Skip to content

Commit 457e3cc

Browse files
committed
Update SimbaEvents.Register to take events to register for. Reduces many useless function calls
1 parent 56ba9cd commit 457e3cc

34 files changed

Lines changed: 320 additions & 182 deletions

Source/Simba.lpi

Lines changed: 103 additions & 98 deletions
Large diffs are not rendered by default.

Source/Simba.lpr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@
1616
Classes, SysUtils, Interfaces, Forms,
1717
simba.base,
1818
simba.form_main, simba.form_about, simba.form_imagestring,
19-
simba.form_functionlist, simba.form_output, simba.form_filebrowser,
19+
simba.form_output, simba.form_filebrowser,
2020
simba.form_notes, simba.form_settings, simba.form_openexample, simba.form_shapebox,
2121
simba.form_backups, simba.form_findinfiles, simba.form_downloadsimba, simba.form_package,
2222
simba.form_colorpickhistory,
2323
simba.plugin_dump, simba.script_runner,
2424
simba.initializations, simba.ide_analytics, simba.script,
2525
simba.openssl,
2626
simba.ide_colorpicker, simba.ide_windowselector, simba.ide_areaselector,
27-
simba.ide_mainmenubar, simba.ide_maintoolbar, simba.ide_mainstatusbar;
27+
simba.ide_mainmenubar, simba.ide_maintoolbar, simba.ide_mainstatusbar,
28+
simba.form_functionlist;
2829

2930
begin
3031
{$IF DECLARED(HEAPTRC)}
@@ -130,7 +131,6 @@
130131

131132
Application.ShowMainForm := False;
132133
Application.CreateForm(TSimbaMainForm, SimbaMainForm);
133-
Application.CreateForm(TSimbaFunctionListForm, SimbaFunctionListForm);
134134
Application.CreateForm(TSimbaNotesForm, SimbaNotesForm);
135135
Application.CreateForm(TSimbaOutputForm, SimbaOutputForm);
136136
Application.CreateForm(TSimbaFileBrowserForm, SimbaFileBrowserForm);

Source/ide/simba.form_about.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ procedure TSimbaAboutForm.FormCreate(Sender: TObject);
8686
Width := Scale96ToScreen(550);
8787
Height := Scale96ToScreen(450);
8888

89-
SimbaEvents.Register(Self, @DoSimbaEvent);
89+
SimbaEvents.Register(Self, @DoSimbaEvent, [ESimbaEvent.ACTION_ABOUT]);
9090
end;
9191

9292
procedure TSimbaAboutForm.VersionLabelClick(Sender: TObject);

Source/ide/simba.form_backups.pas

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ procedure TSimbaBackupsForm.DoSimbaEvent(Event: ESimbaEvent; Data: Pointer);
210210
case Event of
211211
ESimbaEvent.FORM_DOCK,
212212
ESimbaEvent.FORM_UNDOCK: DoDockOrUnDock();
213-
214213
ESimbaEvent.ACTION_OPEN_BACKUP,
215214
ESimbaEvent.ACTION_VIEW_BACKUP: DoViewBackups();
216215
end;
@@ -267,7 +266,12 @@ procedure TSimbaBackupsForm.FormCreate(Sender: TObject);
267266
Splitter.OnEnter := @DoSplitterEnterExit;
268267
Splitter.OnExit := @DoSplitterEnterExit;
269268

270-
SimbaEvents.Register(Self, @DoSimbaEvent);
269+
SimbaEvents.Register(Self, @DoSimbaEvent, [
270+
ESimbaEvent.FORM_DOCK,
271+
ESimbaEvent.FORM_UNDOCK,
272+
ESimbaEvent.ACTION_OPEN_BACKUP,
273+
ESimbaEvent.ACTION_VIEW_BACKUP
274+
]);
271275
end;
272276

273277
procedure TSimbaBackupsForm.FormShow(Sender: TObject);

Source/ide/simba.form_colorpickhistory.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ procedure TSimbaColorPickHistoryForm.FormCreate(Sender: TObject);
104104

105105
LoadColors();
106106

107-
SimbaEvents.Register(Self, @DoSimbaEvent);
107+
SimbaEvents.Register(Self, @DoSimbaEvent, [ESimbaEvent.COLOR_PICKED,ESimbaEvent.ACTION_VIEW_COLORHISTORY]);
108108
end;
109109

110110
procedure TSimbaColorPickHistoryForm.FormDestroy(Sender: TObject);

Source/ide/simba.form_downloadsimba.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ procedure TSimbaDownloadSimbaForm.FormCreate(Sender: TObject);
249249

250250
Notebook1.PageIndex := 0;
251251

252-
SimbaEvents.Register(Self, @DoSimbaEvent);
252+
SimbaEvents.Register(Self, @DoSimbaEvent, [ESimbaEvent.ACTION_DOWNLOAD_SIMBA]);
253253
end;
254254

255255
procedure TSimbaDownloadSimbaForm.DoGetNodeColor(Node: TTreeNode; var TheColor: TColor);

Source/ide/simba.form_filebrowser.lfm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ object SimbaFileBrowserForm: TSimbaFileBrowserForm
66
Caption = 'File Browser'
77
DesignTimePPI = 192
88
ShowInTaskBar = stAlways
9+
LCLVersion = '4.0.0.4'
910
object Popup: TPopupMenu
1011
OnPopup = PopupPopup
1112
Left = 176

Source/ide/simba.form_filebrowser.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ constructor TSimbaFileBrowserForm.Create(AOwner: TComponent);
325325
FTreeView.PopupMenu := Popup;
326326
FTreeView.OnCustomFilter := @DoCustomFilter;
327327

328-
SimbaEvents.Register(Self, @DoSimbaEvent);
328+
SimbaEvents.Register(Self, @DoSimbaEvent, [ESimbaEvent.ACTION_VIEW_FILEBROWSER, ESimbaEvent.SPLITTER_DOUBLE_CLICK]);
329329
SimbaSettings.RegisterChangeHandler(Self, SimbaSettings.General.FileBrowserMasks, @DoSimbaSettingChanged, True);
330330

331331
Fill();

Source/ide/simba.form_findinfiles.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ procedure TSimbaFindInFilesForm.FormCreate(Sender: TObject);
447447
Tab.FCheckboxOptions.Checked[1] := SimbaSettings.General.FindInFilesCaseSens.Value;
448448
Tab.FCheckboxOptions.Checked[2] := SimbaSettings.General.FindInFilesWholeWords.Value;
449449

450-
SimbaEvents.Register(Self, @DoSimbaEvent);
450+
SimbaEvents.Register(Self, @DoSimbaEvent, [ESimbaEvent.ACTION_FIND_IN_FILES]);
451451
end;
452452

453453
procedure TSimbaFindInFilesForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);

Source/ide/simba.form_functionlist.lfm

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)