1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-12-24 08:18:52 -05:00

Bug fixes/Little GUI-updates

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@404 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Raymond 2010-01-12 18:07:47 +00:00
parent 2abf01efb2
commit d4a672a4f6
7 changed files with 3047 additions and 2973 deletions

View File

@ -62,14 +62,16 @@ procedure TFunctionListFrame.FrameEndDock(Sender, Target: TObject; X, Y: Integer
); );
begin begin
if Target is TPanel then if Target is TPanel then
FunctionListLabel.Visible := True begin
Form1.SplitterFunctionList.Visible := true;
CloseButton.Visible:= true;
end
else if Target is TCustomDockForm then else if Target is TCustomDockForm then
begin begin
TCustomDockForm(Target).Caption := 'Function List'; TCustomDockForm(Target).Caption := 'Functionlist';
TCustomDockForm(Target).OnClose := @DockFormOnClose; TCustomDockForm(Target).OnClose := @DockFormOnClose;
Form1.SplitterFunctionList.Visible:= false; Form1.SplitterFunctionList.Visible:= false;
FunctionListLabel.Visible := false; CloseButton.Visible:= false;
// TCustomDockForm(frmFunctionList.Parent).BorderStyle:= bsNone;
end; end;
end; end;
@ -164,6 +166,7 @@ begin
tmpNode.Data:= strnew(PChar(Analyzer.Methods[i].CreateMethodStr)); tmpNode.Data:= strnew(PChar(Analyzer.Methods[i].CreateMethodStr));
end; end;
ScriptNode.Expand(true); ScriptNode.Expand(true);
Analyzer.free;
end; end;
function TFunctionListFrame.Find(Next : boolean; backwards : boolean = false) : boolean; function TFunctionListFrame.Find(Next : boolean; backwards : boolean = false) : boolean;

View File

@ -596,6 +596,7 @@ object ScriptFrame: TScriptFrame
OnProcessCommand = SynEditProcessCommand OnProcessCommand = SynEditProcessCommand
OnProcessUserCommand = SynEditProcessUserCommand OnProcessUserCommand = SynEditProcessUserCommand
OnSpecialLineColors = SynEditSpecialLineColors OnSpecialLineColors = SynEditSpecialLineColors
OnStatusChange = SynEditStatusChange
inline TSynGutterPartList inline TSynGutterPartList
object TSynGutterMarks object TSynGutterMarks
Width = 23 Width = 23

View File

@ -1,3 +1,5 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TScriptFrame','FORMDATA',[ LazarusResources.Add('TScriptFrame','FORMDATA',[
'TPF0'#12'TScriptFrame'#11'ScriptFrame'#4'Left'#2#0#6'Height'#3'H'#1#3'Top'#2 'TPF0'#12'TScriptFrame'#11'ScriptFrame'#4'Left'#2#0#6'Height'#3'H'#1#3'Top'#2
+#0#5'Width'#3#141#1#12'ClientHeight'#3'H'#1#11'ClientWidth'#3#141#1#8'TabOrd' +#0#5'Width'#3#141#1#12'ClientHeight'#3'H'#1#11'ClientWidth'#3#141#1#8'TabOrd'
@ -117,36 +119,37 @@ LazarusResources.Add('TScriptFrame','FORMDATA',[
+'nd.'#0#21'BracketHighlightStyle'#7#8'sbhsBoth'#8'OnChange'#7#13'SynEditChan' +'nd.'#0#21'BracketHighlightStyle'#7#8'sbhsBoth'#8'OnChange'#7#13'SynEditChan'
+'ge'#16'OnProcessCommand'#7#21'SynEditProcessCommand'#20'OnProcessUserComman' +'ge'#16'OnProcessCommand'#7#21'SynEditProcessCommand'#20'OnProcessUserComman'
+'d'#7#25'SynEditProcessUserCommand'#19'OnSpecialLineColors'#7#24'SynEditSpec' +'d'#7#25'SynEditProcessUserCommand'#19'OnSpecialLineColors'#7#24'SynEditSpec'
+'ialLineColors'#0#244#18'TSynGutterPartList'#0#0#15'TSynGutterMarks'#0#5'Wid' +'ialLineColors'#14'OnStatusChange'#7#19'SynEditStatusChange'#0#244#18'TSynGu'
+'th'#2#23#0#0#20'TSynGutterLineNumber'#0#5'Width'#2#17#12'MouseActions'#14#0 +'tterPartList'#0#0#15'TSynGutterMarks'#0#5'Width'#2#23#0#0#20'TSynGutterLine'
+#21'MarkupInfo.Background'#7#9'clBtnFace'#21'MarkupInfo.Foreground'#7#6'clNo' +'Number'#0#5'Width'#2#17#12'MouseActions'#14#0#21'MarkupInfo.Background'#7#9
+'ne'#10'DigitCount'#2#2#30'ShowOnlyLineNumbersMultiplesOf'#2#1#9'ZeroStart'#8 +'clBtnFace'#21'MarkupInfo.Foreground'#7#6'clNone'#10'DigitCount'#2#2#30'Show'
+#12'LeadingZeros'#8#0#0#17'TSynGutterChanges'#0#5'Width'#2#4#13'ModifiedColo' +'OnlyLineNumbersMultiplesOf'#2#1#9'ZeroStart'#8#12'LeadingZeros'#8#0#0#17'TS'
+'r'#4#252#233#0#0#10'SavedColor'#7#7'clGreen'#0#0#19'TSynGutterSeparator'#0#5 +'ynGutterChanges'#0#5'Width'#2#4#13'ModifiedColor'#4#252#233#0#0#10'SavedCol'
+'Width'#2#2#0#0#21'TSynGutterCodeFolding'#0#12'MouseActions'#14#1#5'Shift'#11 +'or'#7#7'clGreen'#0#0#19'TSynGutterSeparator'#0#5'Width'#2#2#0#0#21'TSynGutt'
+#0#9'ShiftMask'#11#0#6'Button'#7#7'mbRight'#10'ClickCount'#7#8'ccSingle'#8'C' +'erCodeFolding'#0#12'MouseActions'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Bu'
+'lickDir'#7#4'cdUp'#7'Command'#2#16#9'MoveCaret'#8#6'Option'#2#0#8'Priority' +'tton'#7#7'mbRight'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp'#7'Com'
+#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#7'ssShift'#0#6'Button'#7#8'mbMiddle' +'mand'#2#16#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9
,#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#14#9'MoveCar' ,'ShiftMask'#11#7'ssShift'#0#6'Button'#7#8'mbMiddle'#10'ClickCount'#7#5'ccAny'
+'et'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#7'ssShift'#0#9'ShiftMas' +#8'ClickDir'#7#6'cdDown'#7'Command'#2#14#9'MoveCaret'#8#6'Option'#2#0#8'Prio'
+'k'#11#7'ssShift'#0#6'Button'#7#8'mbMiddle'#10'ClickCount'#7#5'ccAny'#8'Clic' +'rity'#2#0#0#1#5'Shift'#11#7'ssShift'#0#9'ShiftMask'#11#7'ssShift'#0#6'Butto'
+'kDir'#7#6'cdDown'#7'Command'#2#14#9'MoveCaret'#8#6'Option'#2#1#8'Priority'#2 +'n'#7#8'mbMiddle'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Comman'
+#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7 +'d'#2#14#9'MoveCaret'#8#6'Option'#2#1#8'Priority'#2#0#0#1#5'Shift'#11#0#9'Sh'
+#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#0#9'MoveCaret'#8#6'Option'#2#0 +'iftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7
+#8'Priority'#2#0#0#0#21'MarkupInfo.Background'#7#6'clNone'#21'MarkupInfo.For' +#6'cdDown'#7'Command'#2#0#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#21
+'eground'#7#6'clGray'#20'MouseActionsExpanded'#14#1#5'Shift'#11#0#9'ShiftMas' +'MarkupInfo.Background'#7#6'clNone'#21'MarkupInfo.Foreground'#7#6'clGray'#20
+'k'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdD' +'MouseActionsExpanded'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mb'
+'own'#7'Command'#2#14#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#21'Mo' +'Left'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#14#9'M'
+'useActionsCollapsed'#14#1#5'Shift'#11#6'ssCtrl'#0#9'ShiftMask'#11#6'ssCtrl' +'oveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#21'MouseActionsCollapsed'#14#1
+#5'Shift'#11#6'ssCtrl'#0#9'ShiftMask'#11#6'ssCtrl'#0#6'Button'#7#6'mbLeft'#10
+'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#15#9'MoveCaret'
+#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#6'ssCtrl'
+#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7 +#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7
+'Command'#2#15#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0 +'Command'#2#15#9'MoveCaret'#8#6'Option'#2#1#8'Priority'#2#0#0#0#0#0#0#0#17'T'
+#9'ShiftMask'#11#6'ssCtrl'#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny' +'SynFreePascalSyn'#17'SynFreePascalSyn1'#7'Enabled'#8#23'CommentAttri.Foregr'
+#8'ClickDir'#7#6'cdDown'#7'Command'#2#15#9'MoveCaret'#8#6'Option'#2#1#8'Prio' +'ound'#7#6'clBlue'#18'CommentAttri.Style'#11#6'fsBold'#0#26'IdentifierAttri.'
+'rity'#2#0#0#0#0#0#0#0#17'TSynFreePascalSyn'#17'SynFreePascalSyn1'#7'Enabled' +'Foreground'#7#9'clDefault'#22'NumberAttri.Foreground'#7#6'clNavy'#22'String'
+#8#23'CommentAttri.Foreground'#7#6'clBlue'#18'CommentAttri.Style'#11#6'fsBol' +'Attri.Foreground'#7#6'clBlue'#22'SymbolAttri.Foreground'#7#5'clRed'#25'Dire'
+'d'#0#26'IdentifierAttri.Foreground'#7#9'clDefault'#22'NumberAttri.Foregroun' +'ctiveAttri.Foreground'#7#5'clRed'#20'DirectiveAttri.Style'#11#6'fsBold'#0#12
+'d'#7#6'clNavy'#22'StringAttri.Foreground'#7#6'clBlue'#22'SymbolAttri.Foregr' +'CompilerMode'#7#9'pcmObjFPC'#14'NestedComments'#9#4'left'#3'@'#1#3'top'#2#16
+'ound'#7#5'clRed'#25'DirectiveAttri.Foreground'#7#5'clRed'#20'DirectiveAttri' +#0#0#0
+'.Style'#11#6'fsBold'#0#12'CompilerMode'#7#9'pcmObjFPC'#14'NestedComments'#9
+#4'left'#3'@'#1#3'top'#2#16#0#0#0
]); ]);

View File

@ -56,6 +56,7 @@ type
var Command: TSynEditorCommand; var AChar: TUTF8Char; Data: pointer); var Command: TSynEditorCommand; var AChar: TUTF8Char; Data: pointer);
procedure SynEditSpecialLineColors(Sender: TObject; Line: integer; procedure SynEditSpecialLineColors(Sender: TObject; Line: integer;
var Special: boolean; var FG, BG: TColor); var Special: boolean; var FG, BG: TColor);
procedure SynEditStatusChange(Sender: TObject; Changes: TSynStatusChanges);
private private
OwnerPage : TPageControl; OwnerPage : TPageControl;
OwnerSheet : TTabSheet;//The owner TTabsheet -> For title setting OwnerSheet : TTabSheet;//The owner TTabsheet -> For title setting
@ -198,6 +199,17 @@ begin
end; end;
end; end;
procedure TScriptFrame.SynEditStatusChange(Sender: TObject;
Changes: TSynStatusChanges);
begin
if scSelection in changes then
begin;
Form1.TT_Cut.Enabled := SynEdit.SelAvail;
form1.TT_Copy.Enabled:= Form1.TT_Cut.Enabled;
form1.TT_Paste.Enabled:= SynEdit.CanPaste;
end;
end;
procedure TScriptFrame.undo; procedure TScriptFrame.undo;
begin begin

View File

@ -5,7 +5,7 @@ object Form1: TForm1
Width = 734 Width = 734
ActiveControl = ScriptPanel ActiveControl = ScriptPanel
Caption = 'THA FUKING MUFASA' Caption = 'THA FUKING MUFASA'
ClientHeight = 532 ClientHeight = 537
ClientWidth = 734 ClientWidth = 734
KeyPreview = True KeyPreview = True
Menu = MainMenu1 Menu = MainMenu1
@ -27,14 +27,14 @@ object Form1: TForm1
ShowHint = True ShowHint = True
TabOrder = 0 TabOrder = 0
object TB_Run: TToolButton object TB_Run: TToolButton
Left = 96 Left = 168
Hint = 'Run' Hint = 'Run'
Top = 2 Top = 2
Action = ActionRunScript Action = ActionRunScript
ImageIndex = 6 ImageIndex = 6
end end
object TB_Pause: TToolButton object TB_Pause: TToolButton
Left = 119 Left = 191
Hint = 'Pause' Hint = 'Pause'
Top = 2 Top = 2
Action = ActionPauseScript Action = ActionPauseScript
@ -42,7 +42,7 @@ object Form1: TForm1
ImageIndex = 5 ImageIndex = 5
end end
object TB_Stop: TToolButton object TB_Stop: TToolButton
Left = 142 Left = 214
Hint = 'Stop' Hint = 'Stop'
Top = 2 Top = 2
Action = ActionStopScript Action = ActionStopScript
@ -50,39 +50,39 @@ object Form1: TForm1
ImageIndex = 7 ImageIndex = 7
end end
object ToolButton1: TToolButton object ToolButton1: TToolButton
Left = 165 Left = 237
Top = 2 Top = 2
Width = 3 Width = 3
Caption = 'ToolButton1' Caption = 'ToolButton1'
Style = tbsDivider Style = tbsDivider
end end
object TB_NewTab: TToolButton object TB_NewTab: TToolButton
Left = 168 Left = 240
Hint = 'Add tab' Hint = 'Add tab'
Top = 2 Top = 2
Action = ActionNewTab Action = ActionNewTab
end end
object TB_CloseTab: TToolButton object TB_CloseTab: TToolButton
Left = 191 Left = 263
Hint = 'Close tab' Hint = 'Close tab'
Top = 2 Top = 2
Action = ActionCloseTab Action = ActionCloseTab
end end
object ToolButton4: TToolButton object ToolButton4: TToolButton
Left = 214 Left = 286
Top = 2 Top = 2
Width = 3 Width = 3
Caption = 'ToolButton4' Caption = 'ToolButton4'
Style = tbsDivider Style = tbsDivider
end end
object TB_ClearDebug: TToolButton object TB_ClearDebug: TToolButton
Left = 217 Left = 289
Hint = 'Clear debug box' Hint = 'Clear debug box'
Top = 2 Top = 2
Action = ActionClearDebug Action = ActionClearDebug
end end
object TB_PickColour: TToolButton object TB_PickColour: TToolButton
Left = 240 Left = 312
Hint = 'Pick a color' Hint = 'Pick a color'
Top = 2 Top = 2
Caption = 'TB_PickColour' Caption = 'TB_PickColour'
@ -90,7 +90,7 @@ object Form1: TForm1
OnClick = ButtonPickClick OnClick = ButtonPickClick
end end
object TB_SelectClient: TToolButton object TB_SelectClient: TToolButton
Left = 263 Left = 335
Hint = 'Select a client' Hint = 'Select a client'
Top = 2 Top = 2
Caption = 'TB_SelectClient' Caption = 'TB_SelectClient'
@ -98,14 +98,14 @@ object Form1: TForm1
OnMouseDown = ButtonSelectorDown OnMouseDown = ButtonSelectorDown
end end
object ToolButton8: TToolButton object ToolButton8: TToolButton
Left = 286 Left = 358
Top = 2 Top = 2
Width = 3 Width = 3
Caption = 'ToolButton8' Caption = 'ToolButton8'
Style = tbsDivider Style = tbsDivider
end end
object TB_ReloadPlugins: TToolButton object TB_ReloadPlugins: TToolButton
Left = 289 Left = 361
Hint = 'Reload plugins' Hint = 'Reload plugins'
Top = 2 Top = 2
Caption = 'TB_ReloadPlugins' Caption = 'TB_ReloadPlugins'
@ -113,7 +113,7 @@ object Form1: TForm1
ImageIndex = 13 ImageIndex = 13
end end
object TB_Tray: TToolButton object TB_Tray: TToolButton
Left = 312 Left = 384
Hint = 'Minimize to tray' Hint = 'Minimize to tray'
Top = 2 Top = 2
Caption = 'TB_Tray' Caption = 'TB_Tray'
@ -157,26 +157,52 @@ object Form1: TForm1
Enabled = False Enabled = False
end end
object ToolButton3: TToolButton object ToolButton3: TToolButton
Left = 335 Left = 407
Top = 2 Top = 2
Width = 3 Width = 3
Caption = 'ToolButton3' Caption = 'ToolButton3'
Style = tbsDivider Style = tbsDivider
end end
object UpdateButton: TToolButton object TT_Update: TToolButton
Left = 344 Left = 410
Hint = 'A new update is available' Hint = 'A new update is available'
Top = 2 Top = 2
Caption = 'UpdateButton' Caption = 'TT_Update'
ImageIndex = 1 ImageIndex = 1
Visible = False Visible = False
OnClick = UpdateButtonClick OnClick = TT_UpdateClick
end
object TT_Cut: TToolButton
Left = 96
Top = 2
Caption = 'Cu&t'
ImageIndex = 3
OnClick = ActionCutExecute
end
object TT_Copy: TToolButton
Left = 119
Top = 2
Caption = '&Copy'
ImageIndex = 22
OnClick = ActionCopyExecute
end
object TT_Paste: TToolButton
Left = 142
Top = 2
Action = ActionPaste
end
object ToolButton9: TToolButton
Left = 165
Top = 2
Width = 3
Caption = 'ToolButton9'
Style = tbsDivider
end end
end end
object StatusBar: TStatusBar object StatusBar: TStatusBar
Left = 0 Left = 0
Height = 21 Height = 23
Top = 511 Top = 514
Width = 734 Width = 734
Panels = < Panels = <
item item
@ -194,7 +220,7 @@ object Form1: TForm1
object PanelMemo: TPanel object PanelMemo: TPanel
Left = 0 Left = 0
Height = 154 Height = 154
Top = 357 Top = 360
Width = 734 Width = 734
Align = alBottom Align = alBottom
ClientHeight = 154 ClientHeight = 154
@ -214,19 +240,19 @@ object Form1: TForm1
Cursor = crVSplit Cursor = crVSplit
Left = 0 Left = 0
Height = 5 Height = 5
Top = 352 Top = 355
Width = 734 Width = 734
Align = alBottom Align = alBottom
ResizeAnchor = akBottom ResizeAnchor = akBottom
end end
object ScriptPanel: TPanel object ScriptPanel: TPanel
Left = 0 Left = 0
Height = 328 Height = 331
Top = 24 Top = 24
Width = 734 Width = 734
Align = alClient Align = alClient
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 328 ClientHeight = 331
ClientWidth = 734 ClientWidth = 734
DockSite = True DockSite = True
TabOrder = 4 TabOrder = 4
@ -234,7 +260,7 @@ object Form1: TForm1
OnDockOver = ScriptPanelDockOver OnDockOver = ScriptPanelDockOver
object PageControl1: TPageControl object PageControl1: TPageControl
Left = 155 Left = 155
Height = 293 Height = 296
Top = 0 Top = 0
Width = 579 Width = 579
Align = alClient Align = alClient
@ -253,7 +279,7 @@ object Form1: TForm1
object SearchPanel: TPanel object SearchPanel: TPanel
Left = 0 Left = 0
Height = 35 Height = 35
Top = 293 Top = 296
Width = 734 Width = 734
Align = alBottom Align = alBottom
BevelOuter = bvSpace BevelOuter = bvSpace
@ -349,7 +375,7 @@ object Form1: TForm1
end end
object LabeledEditSearch: TLabeledEdit object LabeledEditSearch: TLabeledEdit
Left = 104 Left = 104
Height = 27 Height = 21
Top = 6 Top = 6
Width = 174 Width = 174
EditLabel.AnchorSideLeft.Control = LabeledEditSearch EditLabel.AnchorSideLeft.Control = LabeledEditSearch
@ -357,10 +383,10 @@ object Form1: TForm1
EditLabel.AnchorSideTop.Side = asrCenter EditLabel.AnchorSideTop.Side = asrCenter
EditLabel.AnchorSideRight.Control = LabeledEditSearch EditLabel.AnchorSideRight.Control = LabeledEditSearch
EditLabel.AnchorSideBottom.Control = LabeledEditSearch EditLabel.AnchorSideBottom.Control = LabeledEditSearch
EditLabel.Left = 67 EditLabel.Left = 73
EditLabel.Height = 18 EditLabel.Height = 14
EditLabel.Top = 10 EditLabel.Top = 9
EditLabel.Width = 34 EditLabel.Width = 28
EditLabel.Caption = 'Find: ' EditLabel.Caption = 'Find: '
EditLabel.ParentColor = False EditLabel.ParentColor = False
LabelPosition = lpLeft LabelPosition = lpLeft
@ -373,9 +399,9 @@ object Form1: TForm1
end end
object CheckBoxMatchCase: TCheckBox object CheckBoxMatchCase: TCheckBox
Left = 320 Left = 320
Height = 22 Height = 17
Top = 7 Top = 7
Width = 97 Width = 72
Caption = 'Match case' Caption = 'Match case'
OnClick = CheckBoxMatchCaseClick OnClick = CheckBoxMatchCaseClick
TabOrder = 1 TabOrder = 1
@ -383,39 +409,35 @@ object Form1: TForm1
end end
object SplitterFunctionList: TSplitter object SplitterFunctionList: TSplitter
Left = 150 Left = 150
Height = 293 Height = 296
Top = 0 Top = 0
Width = 5 Width = 5
OnCanResize = SplitterFunctionListCanResize OnCanResize = SplitterFunctionListCanResize
Visible = False Visible = False
end end
inline frmFunctionList: TFunctionListFrame inline frmFunctionList: TFunctionListFrame
Height = 293 Height = 296
Width = 150 Width = 150
ClientHeight = 293 ClientHeight = 296
ClientWidth = 150 ClientWidth = 150
OnEndDock = nil OnEndDock = nil
TabOrder = 3 TabOrder = 3
inherited FunctionList: TTreeView inherited FunctionList: TTreeView
Height = 244 Height = 257
Top = 22
Width = 150 Width = 150
DefaultItemHeight = 19
OnChange = FunctionListChange OnChange = FunctionListChange
OnDeletion = nil OnDeletion = nil
OnEnter = FunctionListEnter OnEnter = FunctionListEnter
OnExit = FunctionListExit OnExit = FunctionListExit
end end
inherited editSearchList: TEdit inherited editSearchList: TEdit
Height = 27 Top = 275
Top = 266
Width = 150 Width = 150
OnExit = editSearchListExit OnExit = editSearchListExit
OnKeyDown = editSearchListKeyDown OnKeyDown = editSearchListKeyDown
OnKeyPress = editSearchListKeyPress OnKeyPress = editSearchListKeyPress
end end
inherited FunctionListLabel: TLabel inherited FunctionListLabel: TLabel
Height = 18
Width = 146 Width = 146
end end
end end
@ -1220,6 +1242,7 @@ object Form1: TForm1
Caption = 'Extra' Caption = 'Extra'
object MenuitemFillFunctionList: TMenuItem object MenuitemFillFunctionList: TMenuItem
Caption = '&Fill Function List' Caption = '&Fill Function List'
ShortCut = 16465
OnClick = MenuitemFillFunctionListClick OnClick = MenuitemFillFunctionListClick
end end
object UpdateMenuButton: TMenuItem object UpdateMenuButton: TMenuItem
@ -2284,6 +2307,7 @@ object Form1: TForm1
end end
object TrayPopup: TPopupMenu object TrayPopup: TPopupMenu
Images = Mufasa_Image_List Images = Mufasa_Image_List
OnPopup = TrayPopupPopup
left = 528 left = 528
top = 144 top = 144
object TrayStop: TMenuItem object TrayStop: TMenuItem

File diff suppressed because it is too large Load Diff

View File

@ -42,7 +42,7 @@ uses
ocr, updateform, simbasettings; ocr, updateform, simbasettings;
const const
SimbaVersion = 399; SimbaVersion = 404;
type type
@ -99,9 +99,13 @@ type
MenuViewSettings: TMenuItem; MenuViewSettings: TMenuItem;
MenuItemExportHTML: TMenuItem; MenuItemExportHTML: TMenuItem;
MenuItemDivider9: TMenuItem; MenuItemDivider9: TMenuItem;
TT_Cut: TToolButton;
TT_Copy: TToolButton;
TT_Paste: TToolButton;
ToolButton9: TToolButton;
UpdateTimer: TTimer; UpdateTimer: TTimer;
ToolButton3: TToolButton; ToolButton3: TToolButton;
UpdateButton: TToolButton; TT_Update: TToolButton;
UpdateMenuButton: TMenuItem; UpdateMenuButton: TMenuItem;
MenuitemFillFunctionList: TMenuItem; MenuitemFillFunctionList: TMenuItem;
MenuItemFunctionList: TMenuItem; MenuItemFunctionList: TMenuItem;
@ -280,7 +284,8 @@ type
procedure SpeedButtonSearchClick(Sender: TObject); procedure SpeedButtonSearchClick(Sender: TObject);
procedure SplitterFunctionListCanResize(Sender: TObject; var NewSize: Integer; procedure SplitterFunctionListCanResize(Sender: TObject; var NewSize: Integer;
var Accept: Boolean); var Accept: Boolean);
procedure UpdateButtonClick(Sender: TObject); procedure TrayPopupPopup(Sender: TObject);
procedure TT_UpdateClick(Sender: TObject);
procedure UpdateMenuButtonClick(Sender: TObject); procedure UpdateMenuButtonClick(Sender: TObject);
procedure UpdateTimerCheck(Sender: TObject); procedure UpdateTimerCheck(Sender: TObject);
private private
@ -290,6 +295,7 @@ type
LastTab : integer; LastTab : integer;
function GetScriptState: TScriptState; function GetScriptState: TScriptState;
procedure SetScriptState(const State: TScriptState); procedure SetScriptState(const State: TScriptState);
function LoadSettingDef(Key : string; Def : string) : string;
public public
DebugStream: String; DebugStream: String;
SearchString : string; SearchString : string;
@ -312,10 +318,9 @@ type
procedure PauseScript; procedure PauseScript;
procedure StopScript; procedure StopScript;
procedure AddTab; procedure AddTab;
function DeleteTab( TabIndex : integer; CloseLast : boolean) : boolean; function DeleteTab( TabIndex : integer; CloseLast : boolean; Silent : boolean = false) : boolean;
procedure ClearTab( TabIndex : integer); procedure ClearTab( TabIndex : integer);
procedure CloseTabs( Exclude : integer);overload;//-1 for none procedure CloseTabs(Exclude: integer = -1; Silent : boolean = false); //-1 for no exclusion
procedure CloseTabs;overload;
procedure SetEditActions; procedure SetEditActions;
procedure DoSearch(Next : boolean; HighlightAll : boolean); procedure DoSearch(Next : boolean; HighlightAll : boolean);
procedure RefreshTab;//Refreshes all the form items that depend on the Script (Panels, title etc.) procedure RefreshTab;//Refreshes all the form items that depend on the Script (Panels, title etc.)
@ -429,10 +434,21 @@ begin
NewSize := ScriptPanel.Width div 2; NewSize := ScriptPanel.Width div 2;
end; end;
procedure TForm1.UpdateButtonClick(Sender: TObject); procedure TForm1.TrayPopupPopup(Sender: TObject);
begin
MenuItemHide.enabled:= Form1.Visible;
{$ifdef MSWindows}
MenuItemShow.Enabled:= not Form1.Visible;
if Form1.Visible then
if Form1.CanFocus then
form1.SetFocus;
{$endif}
end;
procedure TForm1.TT_UpdateClick(Sender: TObject);
begin begin
SimbaUpdateForm.ShowModal; SimbaUpdateForm.ShowModal;
UpdateButton.Visible:=False; TT_Update.Visible:=False;
end; end;
procedure TForm1.UpdateTimerCheck(Sender: TObject); procedure TForm1.UpdateTimerCheck(Sender: TObject);
@ -441,22 +457,18 @@ var
time:integer; time:integer;
begin begin
chk := SettingsForm.Settings.GetSetLoadSaveDefaultKeyValueIfNotExists( chk := LoadSettingDef('Settings/Updater/CheckForUpdates','True');
'Settings/Updater/CheckForUpdates',
'True', SimbaSettingsFile);
if chk <> 'True' then if chk <> 'True' then
Exit; Exit;
if SimbaUpdateForm.CanUpdate then if SimbaUpdateForm.CanUpdate then
begin; begin;
UpdateButton.Visible:=True; TT_Update.Visible:=True;
formWriteln('A new update of Simba is available!'); formWriteln('A new update of Simba is available!');
end; end;
time := StrToIntDef(SettingsForm.Settings.GetSetLoadSaveDefaultKeyValueIfNotExists( time := StrToIntDef(LoadSettingDef('Settings/Updater/CheckEveryXMinutes','30'),30);
'Settings/Updater/CheckEveryXMinutes','30', SimbaSettingsFile)
,30);
UpdateTimer.Interval:= time {mins} * 60 {secs} * 1000 {ms};//Every half hour UpdateTimer.Interval:= time {mins} * 60 {secs} * 1000 {ms};//Every half hour
end; end;
@ -528,20 +540,15 @@ begin
if ScriptFile <> '' then if ScriptFile <> '' then
ScriptPath := ExtractFileDir(ScriptFile); ScriptPath := ExtractFileDir(ScriptFile);
AppPath:= MainDir + DS; AppPath:= MainDir + DS;
includePath:= SettingsForm.Settings.GetSetLoadSaveDefaultKeyValueIfNotExists( includePath:= LoadSettingDef('Settings/Includes/Path',
'Settings/Includes/Path', IncludeTrailingPathDelimiter(ExpandFileName(MainDir+
IncludeTrailingPathDelimiter(ExpandFileName(MainDir+ DS + '..' + DS + '..' + ds)) + 'Includes' + DS);
DS + '..' + DS + '..' + ds)) + 'Includes' + DS, fontPath := LoadSettingDef('Settings/Fonts/Path',
SimbaSettingsFile); IncludeTrailingPathDelimiter(ExpandFileName(MainDir+
fontPath := SettingsForm.Settings.GetSetLoadSaveDefaultKeyValueIfNotExists( DS + '..' + DS + '..' + ds)) + 'Fonts' + DS);
'Settings/Fonts/Path',
IncludeTrailingPathDelimiter(ExpandFileName(MainDir+ PluginsPath := LoadSettingDef('Settings/Plugins/Path',
DS + '..' + DS + '..' + ds)) + 'Fonts' + DS, ExpandFileName(MainDir + DS + '..' + DS + '..'+ DS + 'Plugins'+ DS));
SimbaSettingsFile);
PluginsPath := SettingsForm.Settings.GetSetLoadSaveDefaultKeyValueIfNotExists(
'Settings/Plugins/Path',
ExpandFileName(MainDir + DS + '..' + DS + '..'+ DS + 'Plugins'+ DS),
SimbaSettingsFile);
if not DirectoryExists(PluginsPath) and not assigned(PluginsGlob) then if not DirectoryExists(PluginsPath) and not assigned(PluginsGlob) then
begin begin
if FirstRun then if FirstRun then
@ -564,8 +571,7 @@ begin
ScriptThread.Client.MWindow.SetWindow(Self.Window); ScriptThread.Client.MWindow.SetWindow(Self.Window);
loadFontsOnScriptStart := SettingsForm.Settings.GetSetLoadSaveDefaultKeyValueIfNotExists( loadFontsOnScriptStart := LoadSettingDef('Settings/Fonts/LoadOnStartUp', 'True');
'Settings/Fonts/LoadOnStartUp', 'True', SimbaSettingsFile);
// Copy our current fonts // Copy our current fonts
if not assigned(Self.OCR_Fonts) and (lowercase(loadFontsOnScriptStart) = 'true') and DirectoryExists(fontPath) then if not assigned(Self.OCR_Fonts) and (lowercase(loadFontsOnScriptStart) = 'true') and DirectoryExists(fontPath) then
begin begin
@ -657,15 +663,23 @@ begin;
end; end;
end; end;
function TForm1.DeleteTab(TabIndex: integer; CloseLast : boolean) : boolean; function TForm1.DeleteTab(TabIndex: integer; CloseLast : boolean; Silent : boolean = false) : boolean;
var var
Tab : TMufasaTab; Tab : TMufasaTab;
OldIndex : integer;//So that we can switch back, if needed. OldIndex : integer;//So that we can switch back, if needed.
begin begin
OldIndex := PageControl1.TabIndex; if not Silent then
if TabIndex = OldIndex then //We are closing the 'current' tab, lets go back in history begin;
OldIndex := LastTab; OldIndex := PageControl1.TabIndex;
PageControl1.TabIndex:= TabIndex; if TabIndex = OldIndex then
begin;
if lowercase(LoadSettingDef('Settings/Tabs/OpenNextOnClose','False')) = 'false' then
OldIndex := LastTab //We are closing the 'current' tab, lets go back in history
else
OldIndex := Min(Tabs.Count - 1,OldIndex + 1);
end;
PageControl1.TabIndex:= TabIndex;
end;
//ScriptFrame now is now correct ;-D //ScriptFrame now is now correct ;-D
result := CanExitOrOpen; result := CanExitOrOpen;
if not result then if not result then
@ -677,17 +691,21 @@ begin
begin; begin;
Tab.Free; Tab.Free;
Tabs.Delete(TabIndex); Tabs.Delete(TabIndex);
if OldIndex > TabIndex then if not Silent then
PageControl1.TabIndex := OldIndex - 1 begin;
else if OldIndex < TabIndex then if OldIndex > TabIndex then
PageControl1.TabIndex := OldIndex; PageControl1.TabIndex := OldIndex - 1
else if OldIndex < TabIndex then
PageControl1.TabIndex := OldIndex;
end;
end; end;
if tabs.count <= 1 then if tabs.count <= 1 then
begin; begin;
TB_SaveAll.Enabled:= false; TB_SaveAll.Enabled:= false;
MenuItemSaveAll.Enabled:= false; MenuItemSaveAll.Enabled:= false;
end; end;
RefreshTab; if not silent then
RefreshTab;
end; end;
procedure TForm1.ClearTab(TabIndex: integer); procedure TForm1.ClearTab(TabIndex: integer);
@ -695,21 +713,16 @@ begin
TMufasaTab(Tabs[TabIndex]).Clear; TMufasaTab(Tabs[TabIndex]).Clear;
end; end;
procedure TForm1.CloseTabs(Exclude: integer); procedure TForm1.CloseTabs(Exclude: integer = -1; Silent : boolean = false);
var var
I : integer; I : integer;
begin begin
for i := tabs.count - 1 downto 0 do for i := tabs.count - 1 downto 0 do
if i <> exclude then if i <> exclude then
if not DeleteTab(i,false) then if not DeleteTab(i,false,silent) then
exit; exit;
end; end;
procedure TForm1.CloseTabs;
begin
CloseTabs(-1);
end;
procedure TForm1.SetEditActions; procedure TForm1.SetEditActions;
procedure EditActions(Undo,Redo,Cut,Copy,Paste,Delete : boolean); procedure EditActions(Undo,Redo,Cut,Copy,Paste,Delete : boolean);
begin; begin;
@ -719,6 +732,9 @@ begin;
ActionCopy.Enabled:= Copy; ActionCopy.Enabled:= Copy;
ActionPaste.Enabled:= Paste; ActionPaste.Enabled:= Paste;
ActionDelete.Enabled:= Delete; ActionDelete.Enabled:= Delete;
TT_Cut.Enabled:= Cut;
TT_Paste.Enabled:=Paste;
TT_Copy.enabled := Copy;
end; end;
var var
@ -730,15 +746,17 @@ begin
with CurrScript.SynEdit do with CurrScript.SynEdit do
begin begin
EditActions(CanUndo,CanRedo,SelText <> '',SelText <> '',CanPaste,SelText <> ''); EditActions(CanUndo,CanRedo,SelText <> '',SelText <> '',CanPaste,SelText <> '');
B:= SelText <> ''; // B:= SelText <> '';
B := SelAvail;
PopupItemFind.Enabled:= B; PopupItemFind.Enabled:= B;
PopupItemReplace.Enabled:= B; PopupItemReplace.Enabled:= B;
if(B)then if(B)then
begin begin
if(Length(SelText) > 13)then s := SelText;
S:= Format('"%s"', [Copy(SelText, 1, 10) + '...']) if(Length(S) > 13)then
S:= Format('"%s"', [Copy(S, 1, 10) + '...'])
else else
S:= Format('"%s"', [SelText]); S:= Format('"%s"', [S]);
PopupItemFind.Caption:= 'Find next: ' + S; PopupItemFind.Caption:= 'Find next: ' + S;
PopupItemReplace.Caption:= 'Replace: ' + S; PopupItemReplace.Caption:= 'Replace: ' + S;
end; end;
@ -1420,28 +1438,32 @@ var
Temp2Node : TTreeNode; Temp2Node : TTreeNode;
Tree : TTreeView; Tree : TTreeView;
begin begin
Methods := TMMLPSThread.GetExportedMethods; if frmFunctionList.FunctionList.Items.Count = 0 then
Tree := frmFunctionList.FunctionList;
Tree.Items.Clear;
Sections := TStringList.Create;
LastSection := '';
frmFunctionList.ScriptNode := Tree.Items.Add(nil,'Script');
for i := 0 to high(Methods) do
begin; begin;
if Methods[i].Section <> LastSection then Methods := TMMLPSThread.GetExportedMethods;
Tree := frmFunctionList.FunctionList;
Tree.Items.Clear;
Sections := TStringList.Create;
LastSection := '';
frmFunctionList.ScriptNode := Tree.Items.Add(nil,'Script');
for i := 0 to high(Methods) do
begin; begin;
LastSection := Methods[i].Section; if Methods[i].Section <> LastSection then
Index := Sections.IndexOf(LastSection); begin;
if Index <> -1 then LastSection := Methods[i].Section;
TempNode := Tree.Items.Item[index] Index := Sections.IndexOf(LastSection);
else if Index <> -1 then
begin TempNode := Tree.Items.Item[index]
TempNode := Tree.Items.Add(nil,LastSection); else
Sections.Add(LastSection); begin
TempNode := Tree.Items.Add(nil,LastSection);
Sections.Add(LastSection);
end;
end; end;
Temp2Node := Tree.Items.AddChild(Tempnode,GetMethodName(Methods[i].FuncDecl,false));
Temp2Node.Data:= strnew(PChar(Methods[i].FuncDecl));
end; end;
Temp2Node := Tree.Items.AddChild(Tempnode,GetMethodName(Methods[i].FuncDecl,false)); Sections.free;
Temp2Node.Data:= strnew(PChar(Methods[i].FuncDecl));
end; end;
frmFunctionList.LoadScriptTree(CurrScript.SynEdit.Text); frmFunctionList.LoadScriptTree(CurrScript.SynEdit.Text);
end; end;
@ -1498,9 +1520,7 @@ begin
Picker.Pick(c, x, y); Picker.Pick(c, x, y);
cobj := TColourPickerObject.Create(c, Point(x,y), ''); cobj := TColourPickerObject.Create(c, Point(x,y), '');
if lowercase(SettingsForm.Settings.GetSetLoadSaveDefaultKeyValueIfNotExists( if lowercase(LoadSettingDef('Settings/ColourPicker/ShowHistoryOnPick', 'True')) = 'true' then
'Settings/ColourPicker/ShowHistoryOnPick', 'True', SimbaSettingsFile
)) = 'true' then
begin begin
ColourHistoryForm.AddColObj(cobj, true); ColourHistoryForm.AddColObj(cobj, true);
ColourHistoryForm.Show; ColourHistoryForm.Show;
@ -1635,6 +1655,11 @@ begin
end; end;
end; end;
function TForm1.LoadSettingDef(Key: string; Def: string): string;
begin
result := SettingsForm.Settings.GetSetLoadSaveDefaultKeyValueIfNotExists(Key,def,SimbaSettingsFile);
end;
procedure TForm1.FunctionListShown(ShowIt: boolean); procedure TForm1.FunctionListShown(ShowIt: boolean);
var var
Node : TTreeNode; Node : TTreeNode;