diff --git a/trunk/Projects/SAMufasaGUI/framescript.lfm b/trunk/Projects/SAMufasaGUI/framescript.lfm index e9a8f73..e287b3b 100644 --- a/trunk/Projects/SAMufasaGUI/framescript.lfm +++ b/trunk/Projects/SAMufasaGUI/framescript.lfm @@ -25,7 +25,7 @@ object ScriptFrame: TScriptFrame OnDragDrop = SynEditDragDrop OnDragOver = SynEditDragOver OnKeyDown = SynEditKeyDown - Gutter.Width = 53 + Gutter.Width = 57 Gutter.MouseActions = < item Shift = [] @@ -225,7 +225,7 @@ object ScriptFrame: TScriptFrame end item Command = ecBlockIndent - ShortCut = 24649 + ShortCut = 16457 end item Command = ecLineBreak @@ -233,7 +233,7 @@ object ScriptFrame: TScriptFrame end item Command = ecBlockUnindent - ShortCut = 24661 + ShortCut = 16469 end item Command = ecPaste @@ -591,6 +591,7 @@ object ScriptFrame: TScriptFrame 'begin' 'end.' ) + Options = [eoAutoIndent, eoGroupUndo, eoScrollPastEol, eoSmartTabs, eoTabIndent, eoTabsToSpaces, eoTrimTrailingSpaces, eoBracketHighlight] BracketHighlightStyle = sbhsBoth OnChange = SynEditChange OnProcessCommand = SynEditProcessCommand @@ -602,7 +603,7 @@ object ScriptFrame: TScriptFrame Width = 23 end object TSynGutterLineNumber - Width = 13 + Width = 17 MouseActions = <> MarkupInfo.Background = clBtnFace MarkupInfo.Foreground = clNone @@ -720,4 +721,4 @@ object ScriptFrame: TScriptFrame left = 320 top = 16 end -end \ No newline at end of file +end diff --git a/trunk/Projects/SAMufasaGUI/framescript.lrs b/trunk/Projects/SAMufasaGUI/framescript.lrs index 9d4bdad..5c11ce6 100644 --- a/trunk/Projects/SAMufasaGUI/framescript.lrs +++ b/trunk/Projects/SAMufasaGUI/framescript.lrs @@ -9,7 +9,7 @@ LazarusResources.Add('TScriptFrame','FORMDATA',[ +'h'#7#7'fpFixed'#12'Font.Quality'#7#16'fqNonAntialiased'#11'ParentColor'#8#10 +'ParentFont'#8#9'PopupMenu'#7#17'Form1.ScriptPopup'#8'TabOrder'#2#0#10'OnDra' +'gDrop'#7#15'SynEditDragDrop'#10'OnDragOver'#7#15'SynEditDragOver'#9'OnKeyDo' - +'wn'#7#14'SynEditKeyDown'#12'Gutter.Width'#2'5'#19'Gutter.MouseActions'#14#1 + +'wn'#7#14'SynEditKeyDown'#12'Gutter.Width'#2'9'#19'Gutter.MouseActions'#14#1 +#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'cc' +'Any'#8'ClickDir'#7#6'cdDown'#7'Command'#2#13#9'MoveCaret'#8#6'Option'#2#0#8 +'Priority'#2#0#0#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#7'mbRight'#10 @@ -44,8 +44,8 @@ LazarusResources.Add('TScriptFrame','FORMDATA',[ +#128#0#0#0#1#7'Command'#7#6'ecRedo'#8'ShortCut'#4#8#160#0#0#0#1#7'Command'#7 +#11'ecLineBreak'#8'ShortCut'#2#13#0#1#7'Command'#7#11'ecSelectAll'#8'ShortCu' +'t'#3'A@'#0#1#7'Command'#7#6'ecCopy'#8'ShortCut'#3'C@'#0#1#7'Command'#7#13'e' - +'cBlockIndent'#8'ShortCut'#3'I`'#0#1#7'Command'#7#11'ecLineBreak'#8'ShortCut' - +#3'M@'#0#1#7'Command'#7#15'ecBlockUnindent'#8'ShortCut'#3'U`'#0#1#7'Command' + +'cBlockIndent'#8'ShortCut'#3'I@'#0#1#7'Command'#7#11'ecLineBreak'#8'ShortCut' + +#3'M@'#0#1#7'Command'#7#15'ecBlockUnindent'#8'ShortCut'#3'U@'#0#1#7'Command' +#7#7'ecPaste'#8'ShortCut'#3'V@'#0#1#7'Command'#7#5'ecCut'#8'ShortCut'#3'X@'#0 +#1#7'Command'#7#12'ecDeleteLine'#8'ShortCut'#3'Y@'#0#1#7'Command'#7#11'ecDel' +'eteEOL'#8'ShortCut'#3'Y`'#0#1#7'Command'#7#6'ecUndo'#8'ShortCut'#3'Z@'#0#1#7 @@ -116,40 +116,42 @@ LazarusResources.Add('TScriptFrame','FORMDATA',[ +#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#8'cc' +'Single'#8'ClickDir'#7#6'cdDown'#7'Command'#2#9#9'MoveCaret'#8#6'Option'#2#0 +#8'Priority'#2#0#0#0#13'Lines.Strings'#1#6#12'program new;'#6#5'begin'#6#4'e' - +'nd.'#0#21'BracketHighlightStyle'#7#8'sbhsBoth'#8'OnChange'#7#13'SynEditChan' - +'ge'#16'OnProcessCommand'#7#21'SynEditProcessCommand'#20'OnProcessUserComman' - +'d'#7#25'SynEditProcessUserCommand'#19'OnSpecialLineColors'#7#24'SynEditSpec' - +'ialLineColors'#14'OnStatusChange'#7#19'SynEditStatusChange'#0#244#18'TSynGu' - +'tterPartList'#0#0#15'TSynGutterMarks'#0#5'Width'#2#23#0#0#20'TSynGutterLine' - +'Number'#0#5'Width'#2#13#12'MouseActions'#14#0#21'MarkupInfo.Background'#7#9 - +'clBtnFace'#21'MarkupInfo.Foreground'#7#6'clNone'#10'DigitCount'#2#2#30'Show' - +'OnlyLineNumbersMultiplesOf'#2#1#9'ZeroStart'#8#12'LeadingZeros'#8#0#0#17'TS' - +'ynGutterChanges'#0#5'Width'#2#4#13'ModifiedColor'#4#252#233#0#0#10'SavedCol' - +'or'#7#7'clGreen'#0#0#19'TSynGutterSeparator'#0#5'Width'#2#2#0#0#21'TSynGutt' - +'erCodeFolding'#0#12'MouseActions'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Bu' - +'tton'#7#7'mbRight'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cdUp'#7'Com' - +'mand'#2#16#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shift'#11#0#9 - ,'ShiftMask'#11#7'ssShift'#0#6'Button'#7#8'mbMiddle'#10'ClickCount'#7#5'ccAny' - +#8'ClickDir'#7#6'cdDown'#7'Command'#2#14#9'MoveCaret'#8#6'Option'#2#0#8'Prio' - +'rity'#2#0#0#1#5'Shift'#11#7'ssShift'#0#9'ShiftMask'#11#7'ssShift'#0#6'Butto' - +'n'#7#8'mbMiddle'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Comman' - +'d'#2#14#9'MoveCaret'#8#6'Option'#2#1#8'Priority'#2#0#0#1#5'Shift'#11#0#9'Sh' - +'iftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7 - +#6'cdDown'#7'Command'#2#0#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#21 - +'MarkupInfo.Background'#7#6'clNone'#21'MarkupInfo.Foreground'#7#6'clGray'#20 - +'MouseActionsExpanded'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button'#7#6'mb' - +'Left'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#14#9'M' - +'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 - +'Command'#2#15#9'MoveCaret'#8#6'Option'#2#1#8'Priority'#2#0#0#0#0#0#0#0#17'T' - +'SynFreePascalSyn'#17'SynFreePascalSyn1'#7'Enabled'#8#23'CommentAttri.Foregr' - +'ound'#7#6'clBlue'#18'CommentAttri.Style'#11#6'fsBold'#0#26'IdentifierAttri.' - +'Foreground'#7#9'clDefault'#22'NumberAttri.Foreground'#7#6'clNavy'#22'String' - +'Attri.Foreground'#7#6'clBlue'#22'SymbolAttri.Foreground'#7#5'clRed'#25'Dire' - +'ctiveAttri.Foreground'#7#5'clRed'#20'DirectiveAttri.Style'#11#6'fsBold'#0#12 - +'CompilerMode'#7#9'pcmObjFPC'#14'NestedComments'#9#4'left'#3'@'#1#3'top'#2#16 - +#0#0#0 + +'nd.'#0#7'Options'#11#12'eoAutoIndent'#11'eoGroupUndo'#15'eoScrollPastEol'#11 + +'eoSmartTabs'#11'eoTabIndent'#14'eoTabsToSpaces'#20'eoTrimTrailingSpaces'#18 + +'eoBracketHighlight'#0#21'BracketHighlightStyle'#7#8'sbhsBoth'#8'OnChange'#7 + +#13'SynEditChange'#16'OnProcessCommand'#7#21'SynEditProcessCommand'#20'OnPro' + +'cessUserCommand'#7#25'SynEditProcessUserCommand'#19'OnSpecialLineColors'#7 + +#24'SynEditSpecialLineColors'#14'OnStatusChange'#7#19'SynEditStatusChange'#0 + +#244#18'TSynGutterPartList'#0#0#15'TSynGutterMarks'#0#5'Width'#2#23#0#0#20'T' + +'SynGutterLineNumber'#0#5'Width'#2#17#12'MouseActions'#14#0#21'MarkupInfo.Ba' + +'ckground'#7#9'clBtnFace'#21'MarkupInfo.Foreground'#7#6'clNone'#10'DigitCoun' + +'t'#2#2#30'ShowOnlyLineNumbersMultiplesOf'#2#1#9'ZeroStart'#8#12'LeadingZero' + +'s'#8#0#0#17'TSynGutterChanges'#0#5'Width'#2#4#13'ModifiedColor'#4#252#233#0 + +#0#10'SavedColor'#7#7'clGreen'#0#0#19'TSynGutterSeparator'#0#5'Width'#2#2#0#0 + +#21'TSynGutterCodeFolding'#0#12'MouseActions'#14#1#5'Shift'#11#0#9'ShiftMask' + ,#11#0#6'Button'#7#7'mbRight'#10'ClickCount'#7#8'ccSingle'#8'ClickDir'#7#4'cd' + +'Up'#7'Command'#2#16#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#1#5'Shif' + +'t'#11#0#9'ShiftMask'#11#7'ssShift'#0#6'Button'#7#8'mbMiddle'#10'ClickCount' + +#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2#14#9'MoveCaret'#8#6'Option' + +#2#0#8'Priority'#2#0#0#1#5'Shift'#11#7'ssShift'#0#9'ShiftMask'#11#7'ssShift' + +#0#6'Button'#7#8'mbMiddle'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown' + +#7'Command'#2#14#9'MoveCaret'#8#6'Option'#2#1#8'Priority'#2#0#0#1#5'Shift'#11 + +#0#9'ShiftMask'#11#0#6'Button'#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8'Click' + +'Dir'#7#6'cdDown'#7'Command'#2#0#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0 + +#0#0#21'MarkupInfo.Background'#7#6'clNone'#21'MarkupInfo.Foreground'#7#6'clG' + +'ray'#20'MouseActionsExpanded'#14#1#5'Shift'#11#0#9'ShiftMask'#11#0#6'Button' + +#7#6'mbLeft'#10'ClickCount'#7#5'ccAny'#8'ClickDir'#7#6'cdDown'#7'Command'#2 + +#14#9'MoveCaret'#8#6'Option'#2#0#8'Priority'#2#0#0#0#21'MouseActionsCollapse' + +'d'#14#1#5'Shift'#11#6'ssCtrl'#0#9'ShiftMask'#11#6'ssCtrl'#0#6'Button'#7#6'm' + +'bLeft'#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'Command'#2#15#9'MoveCaret'#8#6'Option'#2#1#8'Priority'#2#0#0#0#0#0 + +#0#0#17'TSynFreePascalSyn'#17'SynFreePascalSyn1'#7'Enabled'#8#23'CommentAttr' + +'i.Foreground'#7#6'clBlue'#18'CommentAttri.Style'#11#6'fsBold'#0#26'Identifi' + +'erAttri.Foreground'#7#9'clDefault'#22'NumberAttri.Foreground'#7#6'clNavy'#22 + +'StringAttri.Foreground'#7#6'clBlue'#22'SymbolAttri.Foreground'#7#5'clRed'#25 + +'DirectiveAttri.Foreground'#7#5'clRed'#20'DirectiveAttri.Style'#11#6'fsBold' + +#0#12'CompilerMode'#7#9'pcmObjFPC'#14'NestedComments'#9#4'left'#3'@'#1#3'top' + +#2#16#0#0#0 ]); diff --git a/trunk/Projects/SAMufasaGUI/framescript.pas b/trunk/Projects/SAMufasaGUI/framescript.pas index 6bb2efa..222a00a 100644 --- a/trunk/Projects/SAMufasaGUI/framescript.pas +++ b/trunk/Projects/SAMufasaGUI/framescript.pas @@ -130,15 +130,15 @@ end; procedure TScriptFrame.SynEditProcessCommand(Sender: TObject; var Command: TSynEditorCommand; var AChar: TUTF8Char; Data: pointer); begin - if Command = ecUndo then - begin; - Command:= ecNone; - Self.Undo; - end else - if Command = ecRedo then - begin; - Command := ecNone; - Self.Redo; + case Command of + ecUndo : begin + Command:= ecNone; + Self.Undo; + end; + ecRedo : begin + Command := ecNone; + self.Redo; + end; end; end; diff --git a/trunk/Projects/SAMufasaGUI/testunit.pas b/trunk/Projects/SAMufasaGUI/testunit.pas index cbd6753..d6a7b80 100644 --- a/trunk/Projects/SAMufasaGUI/testunit.pas +++ b/trunk/Projects/SAMufasaGUI/testunit.pas @@ -44,7 +44,7 @@ uses about, framefunctionlist, ocr, updateform, simbasettings; const - SimbaVersion = 578; + SimbaVersion = 579; type @@ -359,6 +359,7 @@ type procedure HandleParameters; end; + procedure ClearDebug; procedure formWriteln( S : String); function GetMethodName( Decl : string; PlusNextChar : boolean) : string; @@ -526,22 +527,29 @@ begin SimbaUpdateForm.ShowModal; end; +procedure ClearDebug; +begin + {$IFNDEF MSWINDOWS} + Form1.ProcessDebugStream(nil); + {$ENDIF} + TThread.Synchronize(nil,@Form1.Memo1.Clear); +end; + procedure formWriteln( S : String); begin writeln('formWriteln: ' + s); + {$ifdef MSWindows} + //Ha, we cán acces the debugmemo + Form1.Memo1.Lines.Add(s); + {$else} DebugCriticalSection.Enter; try - {$ifdef MSWindows} - //Ha, we cán acces the debugmemo - Form1.Memo1.Lines.Add(s); - {$else} s := s + MEOL; Form1.DebugStream:= Form1.DebugStream + s; - {$endif} finally DebugCriticalSection.Leave; end; - //Form1.Memo1.Lines.Add(s); + {$endif} end; //{$ENDIF} @@ -1037,7 +1045,7 @@ begin end; {$IFNDEF TERMINALWRITELN} Thread.SetDebug(@formWriteln); - Thread.DebugMemo := Self.Memo1; + Thread.SetDebugClear(@ClearDebug); {$ENDIF} Thread.SetScript(CurrScript.SynEdit.Lines.Text); DbgImgInfo.DispSize := @DebugImgForm.DispSize; @@ -2272,4 +2280,3 @@ initialization end. - diff --git a/trunk/Projects/SAMufasaGUI/updateform.pas b/trunk/Projects/SAMufasaGUI/updateform.pas index b6b8906..fe2d195 100644 --- a/trunk/Projects/SAMufasaGUI/updateform.pas +++ b/trunk/Projects/SAMufasaGUI/updateform.pas @@ -225,6 +225,11 @@ begin Self.UpdateLog.Lines.Add('Download stopped at '+inttostr(DownloadProgress.Position)+'%... Simba did not succesfully update.'); // more detailed info writeln('EXCEPTION IN UPDATEFORM: We either hit Cancel, or something went wrong with files'); + if FileExists(Updater.BasePath + Updater.ReplacementFile + '_') then + begin + Writeln(Format('Deleting the ghost file (%s)',[Updater.BasePath + Updater.ReplacementFile + '_'])); + DeleteFile(Updater.BasePath + Updater.ReplacementFile + '_'); + end; end; FDone := True; Self.UpdateButton.Caption := 'Update!'; diff --git a/trunk/Units/MMLAddon/PSInc/Wrappers/other.inc b/trunk/Units/MMLAddon/PSInc/Wrappers/other.inc index 540b5ce..54ee392 100644 --- a/trunk/Units/MMLAddon/PSInc/Wrappers/other.inc +++ b/trunk/Units/MMLAddon/PSInc/Wrappers/other.inc @@ -62,8 +62,8 @@ end; procedure ClearDebug; extdecl; begin - if Assigned(CurrThread.DebugMemo) then - CurrThread.Synchronize(@CurrThread.DebugMemo.Clear); + if Assigned(CurrThread.DebugClear) then + CurrThread.DebugClear(); end; procedure SaveScreenshot(FileName: string); extdecl; diff --git a/trunk/Units/MMLAddon/mmlpsthread.pas b/trunk/Units/MMLAddon/mmlpsthread.pas index e48f4fa..9305fc9 100644 --- a/trunk/Units/MMLAddon/mmlpsthread.pas +++ b/trunk/Units/MMLAddon/mmlpsthread.pas @@ -46,6 +46,7 @@ type end; TWritelnProc = procedure(s: string); + TClearDebugProc = procedure; TDbgImgInfo = record DispSize : ^TPoint; ShowForm : procedure of object; @@ -72,10 +73,13 @@ type end; TExpMethodArr = array of TExpMethod; + { TMThread } + TMThread = class(TThread) protected ScriptPath, AppPath, IncludePath, PluginPath, FontPath: string; DebugTo: TWritelnProc; + DebugClear : TClearDebugProc; DebugImg : TDbgImgInfo; ExportedMethods : TExpMethodArr; Includes : TStringList; @@ -85,7 +89,6 @@ type Client : TClient; MInternet : TMInternet; StartTime : LongWord; - DebugMemo : TMemo; SyncInfo : PSyncInfo; //We need this for callthreadsafe ErrorData : PErrorData; //We need this for thread-safety etc @@ -97,8 +100,8 @@ type function LoadFile(ParentFile : string; var filename, contents: string): boolean; procedure AddMethod(meth: TExpMethod); virtual; - procedure SetScript(Script : string); procedure SetDebug( writelnProc : TWritelnProc ); + procedure SetDebugClear( clearProc : TClearDebugProc ); procedure SetDbgImg( DebugImageInfo : TDbgImgInfo); procedure SetPaths(ScriptP,AppP,IncludeP,PluginP,FontP : string); procedure OnThreadTerminate(Sender: TObject); @@ -396,6 +399,11 @@ begin DebugTo := writelnProc; end; +procedure TMThread.SetDebugClear(clearProc: TClearDebugProc); +begin + DebugClear:= clearProc; +end; + procedure TMThread.SetDbgImg(DebugImageInfo: TDbgImgInfo); begin DebugImg := DebugImageInfo; @@ -875,4 +883,3 @@ finalization //PluginsGlob.Free; //Its a nice idea, but it will segfault... the program is closing anyway. end. -