Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Oct 29, 2024
1 parent 0250d64 commit 0a38464
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 21 deletions.
8 changes: 5 additions & 3 deletions Source/ide/codetools/simba.ide_codetools_parser.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1305,15 +1305,17 @@ function TDeclaration_Method.GetParamCount: Integer;
function TDeclaration_Method.GetParams: TDeclarationArray;
var
Decl: TDeclaration;
Decls: TDeclarationArray;
begin
if FParams.IsNull then
begin
FParams := [];

Decls := [];
Decl := Items.GetByClassFirst(TDeclaration_ParamList);
if (Decl <> nil) then
for Decl in Decl.Items.GetByClass(TDeclaration_ParamGroup) do
FParams.Value.Add(Decl.Items.GetByClass(TDeclaration_Parameter));
Decls.Add(Decl.Items.GetByClass(TDeclaration_Parameter));

FParams := Decls;
end;

Result := FParams;
Expand Down
4 changes: 2 additions & 2 deletions Source/ide/simba.form_main.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object SimbaMainForm: TSimbaMainForm
OnDestroy = FormDestroy
OnWindowStateChange = FormWindowStateChange
Position = poScreenCenter
LCLVersion = '3.4.0.0'
LCLVersion = '3.6.0.0'
object DockPanel: TAnchorDockPanel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Side = asrBottom
Expand Down Expand Up @@ -320,7 +320,7 @@ object SimbaMainForm: TSimbaMainForm
end
object MenuItemRunLast: TMenuItem
Caption = 'Run Last Script'
ShortCut = 41042
ShortCut = 32849
Visible = False
OnClick = MenuItemRunLastClick
end
Expand Down
8 changes: 6 additions & 2 deletions Source/ide/simba.form_tabs.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object SimbaTabsForm: TSimbaTabsForm
OnMouseMove = FormMouseMove
OnMouseUp = FormMouseUp
ShowInTaskBar = stAlways
LCLVersion = '3.0.0.3'
LCLVersion = '3.6.0.0'
object FindPanel: TPanel
Left = 0
Height = 0
Expand Down Expand Up @@ -76,7 +76,11 @@ object SimbaTabsForm: TSimbaTabsForm
OnClick = DoTabPopupClick
end
object MenuItemCloseOtherTabs: TMenuItem
Caption = 'Close All Other Tabs'
Caption = 'Close All Other'
OnClick = DoTabPopupClick
end
object MenuItemCloseTabsOnRight: TMenuItem
Caption = 'Close All On Right'
OnClick = DoTabPopupClick
end
end
Expand Down
26 changes: 24 additions & 2 deletions Source/ide/simba.form_tabs.pas
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface

type
TSimbaTabsForm = class(TForm)
MenuItemCloseTabsOnRight: TMenuItem;
OpenDialog: TOpenDialog;
MenuItemNewTab: TMenuItem;
MenuItemCloseTab: TMenuItem;
Expand Down Expand Up @@ -93,6 +94,7 @@ TSimbaTabsForm = class(TForm)

function CloseTab(Tab: TSimbaScriptTab; KeepOne: Boolean): Boolean;
function CloseOtherTabs(Tab: TSimbaScriptTab): Boolean;
function CloseTabsOnRight(Tab: TSimbaScriptTab): Boolean;
function CloseAllTabs: Boolean;

function Open(FileName: String; CheckOtherTabs: Boolean = True): Boolean; overload;
Expand Down Expand Up @@ -147,8 +149,9 @@ procedure TSimbaTabsForm.DoTabPopupClick(Sender: TObject);

if Assigned(Tab) then
begin
if (Sender = MenuItemCloseTab) then CloseTab(Tab, True);
if (Sender = MenuItemCloseOtherTabs) then CloseOtherTabs(Tab);
if (Sender = MenuItemCloseTab) then CloseTab(Tab, True);
if (Sender = MenuItemCloseOtherTabs) then CloseOtherTabs(Tab);
if (Sender = MenuItemCloseTabsOnRight) then CloseTabsOnRight(Tab);
end;
end;
end;
Expand Down Expand Up @@ -536,6 +539,25 @@ function TSimbaTabsForm.CloseOtherTabs(Tab: TSimbaScriptTab): Boolean;
end;
end;

function TSimbaTabsForm.CloseTabsOnRight(Tab: TSimbaScriptTab): Boolean;
var
I: Integer;
begin
Result := True;

for I := TabCount - 1 downto 0 do
begin
if (Tabs[I] = Tab) then
Exit;

if (not CloseTab(Tabs[I], True)) then
begin
Result := False;
Exit;
end;
end;
end;

function TSimbaTabsForm.CloseAllTabs: Boolean;
var
I: Integer;
Expand Down
15 changes: 3 additions & 12 deletions Source/ide/simba.ide_editor_autocomplete.pas
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ TSimbaAutoComplete_Hint = class(TSynCompletionHint)
function UseFGThemes: Boolean; override;
procedure Paint; override;
public
constructor Create(AOwner: TComponent); override;

function CalcHintRect: TRect; override;
end;

Expand Down Expand Up @@ -124,15 +122,6 @@ procedure TSimbaAutoComplete_Hint.Paint;
end;
end;

constructor TSimbaAutoComplete_Hint.Create(AOwner: TComponent);
begin
inherited Create(AOwner);

{$IFDEF WINDOWS}
SetClassLong(Handle); // Clear CS_DROPSHADOW
{$ENDIF}
end;

function TSimbaAutoComplete_Hint.UseBGThemes: Boolean;
begin
Result := False;
Expand Down Expand Up @@ -764,8 +753,10 @@ constructor TSimbaAutoComplete.Create(AOwner: TComponent);
begin
inherited Create(AOwner);

// On Windows remove shadows CS_DROPSHADOW
{$IFDEF WINDOWS}
SetClassLong(Form.Handle); // Clear CS_DROPSHADOW
SetClassLong(Form.Handle);
SetClassLong(Form.Hint.Handle);
{$ENDIF}

Form.SizeDrag.OnPaint := @DoPaintSizeDrag;
Expand Down

0 comments on commit 0a38464

Please sign in to comment.