Skip to content

Commit

Permalink
make datetime methods type methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Jul 5, 2024
1 parent 8d79b10 commit 0a22266
Show file tree
Hide file tree
Showing 17 changed files with 2,543 additions and 1,866 deletions.
2 changes: 1 addition & 1 deletion DocGen/docgen.simba
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ begin
APIFiles += ['Source\script\imports\simba.import_web.pas', 'Web' ];
APIFiles += ['Source\script\imports\simba.import_file.pas', 'File' ];
APIFiles += ['Source\script\imports\simba.import_encoding.pas', 'Encoding' ];
APIFiles += ['Source\script\imports\simba.import_timing.pas', 'Timing' ];
APIFiles += ['Source\script\imports\simba.import_datetime.pas', 'Date & Time' ];
APIFiles += ['Source\script\imports\simba.import_string.pas', 'String' ];
APIFiles += ['Source\script\imports\simba.import_process.pas', 'Process' ];
APIFiles += ['Source\script\imports\simba.import_math.pas', 'Math' ];
Expand Down
Binary file modified Images/property.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/property_150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/property_200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/variable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/variable_150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/variable_200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 28 additions & 14 deletions Source/ide/simba.form_functionlist.pas
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ implementation

uses
simba.form_main, simba.ide_events, simba.threading, simba.settings,
simba.form_tabs, simba.ide_tab, simba.ide_showdeclaration, simba.nativeinterface;
simba.form_tabs, simba.ide_tab, simba.ide_showdeclaration, simba.nativeinterface,
simba.vartype_string;

function GetImage(const Decl: TDeclaration): Integer;
begin
Expand Down Expand Up @@ -150,7 +151,7 @@ function GetURL(const Section: String): String;
'TQuad': Result := ROOT + 'TQuad.html';
'Random': Result := ROOT + 'Random.html';
'T2DPointArray': Result := ROOT + 'T2DPointArray.html';
'Debug Image': Result := ROOT + 'Debug Image.html';
'Date & Time': Result := ROOT + 'Date %26 Time';
'TWindowHandle': Result := ROOT + 'TWindowHandle.html';
'Image': Result := ROOT + 'Image.html';
'Finder': Result := ROOT + 'Finder.html';
Expand Down Expand Up @@ -801,8 +802,7 @@ procedure TSimbaFunctionListForm.ArrangeSimbaNodes;
MoveToTop('File');
MoveToTop('String');
MoveToTop('Random');
MoveToTop('Timing');
MoveToTop('DateTime');
MoveToTop('Date & Time');
MoveToTop('TBox');
MoveToTop('TBoxArray');
MoveToTop('TPoint');
Expand All @@ -829,21 +829,35 @@ function TSimbaFunctionListForm.CompareNodes(A, B: TTreeNode): Integer;
begin
Result := NaturalCompareText(A.Text, B.Text);

if ((A.ImageIndex = IMG_FUNC) or (A.ImageIndex = IMG_PROC) or (A.ImageIndex = IMG_PROPERTY)) and
((B.ImageIndex = IMG_FUNC) or (B.ImageIndex = IMG_PROC) or (B.ImageIndex = IMG_PROPERTY)) then
begin
if ('.' in A.Text) then Dec(Result, 100);
if ('.' in B.Text) then Inc(Result, 100);
end;

case A.ImageIndex of
IMG_TYPE: Dec(Result, 2000);
IMG_CONST: Dec(Result, 1500);
IMG_VAR: Dec(Result, 1000);
IMG_PROC: Dec(Result, 500);
IMG_FUNC: Dec(Result, 500);
IMG_TYPE: Dec(Result, 500);
IMG_CONST: Dec(Result, 400);
IMG_VAR: Dec(Result, 300);
IMG_PROC: Dec(Result, 200);
IMG_FUNC: Dec(Result, 200);
IMG_PROPERTY: Dec(Result, 200);
end;

case B.ImageIndex of
IMG_TYPE: Inc(Result, 2000);
IMG_CONST: Inc(Result, 1500);
IMG_VAR: Inc(Result, 1000);
IMG_PROC: Inc(Result, 500);
IMG_FUNC: Inc(Result, 500);
IMG_TYPE: Inc(Result, 500);
IMG_CONST: Inc(Result, 400);
IMG_VAR: Inc(Result, 300);
IMG_PROC: Inc(Result, 200);
IMG_FUNC: Inc(Result, 200);
IMG_PROPERTY: Inc(Result, 200);
end;

if (A.ImageIndex = IMG_PROPERTY) and (A.Text.Before('.') = B.Text.Before('.')) then
Inc(Result, 100);
if (B.ImageIndex = IMG_PROPERTY) and (A.Text.Before('.') = B.Text.Before('.')) then
Dec(Result, 100);
end;

procedure TSimbaFunctionListForm.DoIdleBegin(Sender: TObject);
Expand Down
3,164 changes: 1,582 additions & 1,582 deletions Source/ide/simba.form_main.lfm

Large diffs are not rendered by default.

Loading

0 comments on commit 0a22266

Please sign in to comment.