Skip to content

Commit c2d22f9

Browse files
committed
wip
1 parent e6051e4 commit c2d22f9

18 files changed

+561
-477
lines changed

Source/Simba.lpr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
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,
23+
simba.ide_colorpicker, simba.ide_areaselector, simba.ide_windowselector,
2324
simba.plugin_dump, simba.script_runner,
2425
simba.initializations, simba.ide_analytics, simba.script,
2526
simba.openssl;

Source/ide/simba.form_colorpickhistory.lfm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
object SimbaColorPickHistoryForm: TSimbaColorPickHistoryForm
22
Left = -466
3-
Height = 360
3+
Height = 480
44
Top = 796
5-
Width = 480
5+
Width = 640
66
Caption = 'Color Picker History'
7-
DesignTimePPI = 144
7+
DesignTimePPI = 192
88
LCLVersion = '4.0.0.4'
99
OnCreate = FormCreate
1010
OnDestroy = FormDestroy
1111
object ContextMenu: TPopupMenu
1212
OnPopup = ContextMenuPopup
13-
Left = 72
14-
Top = 24
13+
Left = 96
14+
Top = 32
1515
object MenuItemCopy: TMenuItem
1616
Caption = 'Copy'
1717
OnClick = ContextMenuCopyClick

Source/ide/simba.form_colorpickhistory.pas

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ interface
1111

1212
uses
1313
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, ComCtrls, Menus,
14-
simba.base, simba.component_treeview, simba.component_buttonpanel;
14+
simba.base,
15+
simba.ide_events,
16+
simba.component_treeview,
17+
simba.component_buttonpanel;
1518

1619
type
1720
TSimbaColorPickHistoryForm = class(TForm)
@@ -41,7 +44,10 @@ TSimbaColorPickHistoryForm = class(TForm)
4144
procedure DoKeyCopy(Sender: TObject; var Key: Word; Shift: TShiftState);
4245
procedure DoPickColorClick(Sender: TObject);
4346
procedure DoPaintNode(ACanvas: TCanvas; Node: TTreeNode);
47+
procedure DoSimbaEvent(Event: ESimbaEvent; Data: Pointer);
4448
public
49+
constructor Create(TheOwner: TComponent); override;
50+
4551
procedure Add(APoint: TPoint; AColor: TColor; ExpandAndScroll: Boolean = False);
4652
procedure LoadColors;
4753
procedure SaveColors;
@@ -232,6 +238,23 @@ procedure TSimbaColorPickHistoryForm.DoPaintNode(ACanvas: TCanvas; Node: TTreeNo
232238
ACanvas.TextRect(BaseRect, BaseRect.Left, BaseRect.Top, Node.Text, S);
233239
end;
234240

241+
procedure TSimbaColorPickHistoryForm.DoSimbaEvent(Event: ESimbaEvent; Data: Pointer);
242+
begin
243+
if (Event = ESimbaEvent.COLOR_PICKED) then
244+
with TSimbaEventData_ColorPicked(Data^) do
245+
begin
246+
Add(Point, Color, True);
247+
MakeVisible();
248+
end;
249+
end;
250+
251+
constructor TSimbaColorPickHistoryForm.Create(TheOwner: TComponent);
252+
begin
253+
inherited Create(TheOwner);
254+
255+
SimbaEvents.Register(Self, @DoSimbaEvent);
256+
end;
257+
235258
procedure TSimbaColorPickHistoryForm.Add(APoint: TPoint; AColor: TColor; ExpandAndScroll: Boolean);
236259
var
237260
Node: TColorNode;

Source/ide/simba.form_main.pas

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,8 @@ procedure TSimbaMainForm.MenuItemSearchFindInFilesClick(Sender: TObject);
846846

847847
procedure TSimbaMainForm.MenuItemRunLastClick(Sender: TObject);
848848
begin
849-
if Assigned(SimbaTabsForm.PreviousTab) then
850-
SimbaTabsForm.PreviousTab.Run(SimbaMainToolBar.WindowSelection);
849+
//if Assigned(SimbaTabsForm.PreviousTab) then
850+
// SimbaTabsForm.PreviousTab.Run(SimbaMainToolBar.WindowSelection);
851851
end;
852852

853853
procedure TSimbaMainForm.MenuItemSelectLineClick(Sender: TObject);
@@ -951,8 +951,8 @@ procedure TSimbaMainForm.MenuItemDTMEditorClick(Sender: TObject);
951951
Target: TSimbaTarget;
952952
begin
953953
Target := TSimbaTarget.Create();
954-
if (SimbaMainToolBar.WindowSelection <> 0) then
955-
Target.SetWindow(SimbaMainToolBar.WindowSelection);
954+
//if (SimbaMainToolBar.WindowSelection <> 0) then
955+
// Target.SetWindow(SimbaMainToolBar.WindowSelection);
956956

957957
ShowDTMEditor(Target, True);
958958
end;
@@ -1058,7 +1058,7 @@ procedure TSimbaMainForm.DoSimbaEvent(Event: ESimbaEvent; Data: Pointer);
10581058

10591059
function TSimbaMainForm.DoGetWindowForACA: TSimbaImage;
10601060
begin
1061-
Result := TSimbaImage.CreateFromWindow(SimbaMainToolBar.WindowSelectionOrDesktop);
1061+
//Result := TSimbaImage.CreateFromWindow(SimbaMainToolBar.WindowSelectionOrDesktop);
10621062
end;
10631063

10641064
procedure TSimbaMainForm.MenuEditClick(Sender: TObject);

Source/ide/simba.form_output.pas

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,13 @@ function TSimbaOutputForm.CanAnchorDocking(X, Y: Integer): Boolean;
587587

588588
procedure TSimbaOutputForm.DoSimbaEvent(Event: ESimbaEvent; Data: Pointer);
589589
begin
590-
if (Event = ESimbaEvent.TAB_CHANGE) then
591-
TSimbaScriptTab(Data).OutputBox.MakeVisible();
590+
case Event of
591+
ESimbaEvent.TAB_CHANGE:
592+
TSimbaScriptTab(Data).OutputBox.MakeVisible();
593+
594+
ESimbaEvent.TOOLBAR_CLEAROUTPUT:
595+
ActiveOutputBox.Empty();
596+
end;
592597
end;
593598

594599
procedure TSimbaOutputForm.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

Source/ide/simba.form_package.lfm

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
object SimbaPackageForm: TSimbaPackageForm
22
Left = -1860
3-
Height = 962
3+
Height = 1099
44
Top = 325
5-
Width = 1368
5+
Width = 1563
66
Caption = 'Simba Packages'
7-
ClientHeight = 962
8-
ClientWidth = 1368
9-
Constraints.MinHeight = 438
10-
Constraints.MinWidth = 438
11-
DesignTimePPI = 168
7+
ClientHeight = 1099
8+
ClientWidth = 1563
9+
Constraints.MinHeight = 501
10+
Constraints.MinWidth = 501
11+
DesignTimePPI = 192
1212
Position = poMainFormCenter
1313
ShowInTaskBar = stAlways
14+
LCLVersion = '4.0.0.4'
1415
OnShow = FormShow
1516
object Notebook1: TNotebook
1617
Left = 0
@@ -23,7 +24,7 @@ object SimbaPackageForm: TSimbaPackageForm
2324
object MainPage: TPage
2425
object ListPanel: TPanel
2526
Left = 0
26-
Height = 550
27+
Height = 629
2728
Top = 0
2829
Width = 1368
2930
Align = alTop
@@ -66,16 +67,16 @@ object SimbaPackageForm: TSimbaPackageForm
6667
Top = 12
6768
Width = 954
6869
Align = alClient
69-
BorderSpacing.Around = 18
70-
Font.Height = -18
70+
BorderSpacing.Around = 21
71+
Font.Height = -21
7172
Font.Name = 'Courier New'
7273
Font.Pitch = fpFixed
7374
Font.Quality = fqCleartypeNatural
7475
ParentColor = False
7576
ParentFont = False
7677
TabOrder = 0
7778
Gutter.Visible = False
78-
Gutter.Width = 84
79+
Gutter.Width = 103
7980
Gutter.MouseActions = <>
8081
RightGutter.Width = 0
8182
RightGutter.MouseActions = <>
@@ -118,13 +119,13 @@ object SimbaPackageForm: TSimbaPackageForm
118119
LineHighlightColor.Foreground = clNone
119120
inline SynLeftGutterPartList1: TSynGutterPartList
120121
object SynGutterMarks1: TSynGutterMarks
121-
Width = 42
122+
Width = 48
122123
MouseActions = <>
123124
MaxExtraMarksColums = 0
124125
Options = [sgmoDeDuplicateMarksOnOverflow]
125126
end
126127
object SynGutterLineNumber1: TSynGutterLineNumber
127-
Width = 23
128+
Width = 27
128129
MouseActions = <>
129130
MarkupInfo.Background = clBtnFace
130131
MarkupInfo.Foreground = clNone
@@ -134,7 +135,7 @@ object SimbaPackageForm: TSimbaPackageForm
134135
LeadingZeros = False
135136
end
136137
object SynGutterChanges1: TSynGutterChanges
137-
Width = 7
138+
Width = 8
138139
MouseActions = <>
139140
ModifiedColor = 59900
140141
SavedColor = clGreen
@@ -146,7 +147,7 @@ object SimbaPackageForm: TSimbaPackageForm
146147
MarkupInfo.Foreground = clGray
147148
end
148149
object SynGutterCodeFolding1: TSynGutterCodeFolding
149-
Width = 18
150+
Width = 20
150151
MouseActions = <>
151152
MarkupInfo.Background = clNone
152153
MarkupInfo.Foreground = clGray
@@ -162,9 +163,9 @@ object SimbaPackageForm: TSimbaPackageForm
162163
Width = 954
163164
Align = alBottom
164165
AutoSize = True
165-
BorderSpacing.Left = 18
166-
BorderSpacing.Right = 18
167-
BorderSpacing.Bottom = 18
166+
BorderSpacing.Left = 21
167+
BorderSpacing.Right = 21
168+
BorderSpacing.Bottom = 21
168169
Caption = 'Installing...'
169170
TabOrder = 1
170171
OnClick = InstallingButtonClick
@@ -174,7 +175,7 @@ object SimbaPackageForm: TSimbaPackageForm
174175
object Splitter1: TSplitter
175176
Cursor = crVSplit
176177
Left = 0
177-
Height = 9
178+
Height = 10
178179
Top = 550
179180
Width = 1368
180181
Align = alTop
@@ -187,9 +188,9 @@ object SimbaPackageForm: TSimbaPackageForm
187188
AnchorSideLeft.Side = asrCenter
188189
AnchorSideTop.Control = LoadingPage
189190
AnchorSideTop.Side = asrCenter
190-
Left = 448
191+
Left = 512
191192
Height = 25
192-
Top = 411
193+
Top = 470
193194
Width = 339
194195
Caption = 'Downloading package list. Please wait...'
195196
Font.Style = [fsBold]
@@ -212,7 +213,7 @@ object SimbaPackageForm: TSimbaPackageForm
212213
TabOrder = 1
213214
object Bevel3: TBevel
214215
Left = 0
215-
Height = 4
216+
Height = 5
216217
Top = 0
217218
Width = 1368
218219
Align = alTop
@@ -223,9 +224,9 @@ object SimbaPackageForm: TSimbaPackageForm
223224
AnchorSideLeft.Side = asrCenter
224225
AnchorSideTop.Control = Bevel3
225226
AnchorSideTop.Side = asrBottom
226-
Left = 560
227+
Left = 640
227228
Height = 85
228-
Top = 4
229+
Top = 5
229230
Width = 248
230231
AutoSize = True
231232
BevelOuter = bvNone
@@ -239,8 +240,8 @@ object SimbaPackageForm: TSimbaPackageForm
239240
Width = 248
240241
Align = alBottom
241242
AutoSize = True
242-
BorderSpacing.Top = 4
243-
BorderSpacing.Bottom = 4
243+
BorderSpacing.Top = 5
244+
BorderSpacing.Bottom = 5
244245
ButtonHeight = 0
245246
ButtonWidth = 0
246247
EdgeBorders = []
@@ -261,16 +262,16 @@ object SimbaPackageForm: TSimbaPackageForm
261262
OnClick = ButtonRefreshClick
262263
end
263264
object ButtonAddRepository: TToolButton
264-
Left = 95
265+
Left = 109
265266
Top = 0
266267
AutoSize = True
267268
Caption = 'Add Repository'
268269
ImageIndex = 0
269270
OnClick = ButtonAddRepositoryClick
270271
end
271272
object ToolButton1: TToolButton
272-
Left = 81
273-
Height = 0
273+
Left = 93
274+
Height = 9
274275
Top = 0
275276
Caption = 'ToolButton1'
276277
Style = tbsSeparator
@@ -281,8 +282,8 @@ object SimbaPackageForm: TSimbaPackageForm
281282
object ImageList36: TImageList
282283
Height = 36
283284
Width = 36
284-
Left = 56
285-
Top = 123
285+
Left = 64
286+
Top = 141
286287
Bitmap = {
287288
4C7A010000002400000024000000600800000000000078DAED987B70D4D515C7
288289
3710A80F04A90F6CA342AB88D882A88D552A6865C0A90E2D4C41A42204228F52
@@ -357,8 +358,8 @@ object SimbaPackageForm: TSimbaPackageForm
357358
object ImageList: TImageList
358359
Height = 32
359360
Width = 32
360-
Left = 56
361-
Top = 235
361+
Left = 64
362+
Top = 269
362363
Bitmap = {
363364
4C7A020000002000000020000000980900000000000078DAED98095055E715C7
364365
BFF79E3C4529221AC749B489D692E8683560A78D1347DCADD1AA89BBB86F0DAE

Source/ide/simba.form_package.pas

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ interface
1111

1212
uses
1313
Classes, SysUtils, Forms, Controls, Graphics, StdCtrls, ExtCtrls, ComCtrls, SynEdit, Dialogs,
14-
simba.base, simba.ide_package, simba.ide_package_components;
14+
simba.base,
15+
simba.ide_events,
16+
simba.ide_package,
17+
simba.ide_package_components;
1518

1619
type
1720
TSimbaPackageForm = class(TForm)
@@ -54,6 +57,7 @@ TSimbaPackageForm = class(TForm)
5457
procedure DoPackageSelectionChanged(Sender: TObject; User: Boolean);
5558
procedure DoInstallClick(Sender: TObject);
5659
procedure DoAdvancedClick(Sender: TObject);
60+
procedure DoSimbaEvent(Event: ESimbaEvent; Data: Pointer);
5761

5862
// Returns false if need advanced install
5963
function SimpleInstall(Package: TSimbaPackage): Boolean;
@@ -307,6 +311,12 @@ procedure TSimbaPackageForm.DoAdvancedClick(Sender: TObject);
307311
DoPackageSelectionChanged(Self, True); // update new visible info
308312
end;
309313

314+
procedure TSimbaPackageForm.DoSimbaEvent(Event: ESimbaEvent; Data: Pointer);
315+
begin
316+
if (Event = ESimbaEvent.TOOLBAR_PACKAGE) then
317+
ShowOnTop();
318+
end;
319+
310320
constructor TSimbaPackageForm.Create(AOwner: TComponent);
311321
begin
312322
inherited Create(AOwner);
@@ -345,6 +355,8 @@ constructor TSimbaPackageForm.Create(AOwner: TComponent);
345355
{$IFDEF WINDOWS}
346356
OutputSynEdit.Font.Name := 'Consolas';
347357
{$ENDIF}
358+
359+
SimbaEvents.Register(Self, @DoSimbaEvent);
348360
end;
349361

350362
end.

0 commit comments

Comments
 (0)