From c1552aacd631a4f718922991cfb748ae56e05df3 Mon Sep 17 00:00:00 2001 From: Christian Hammacher Date: Thu, 19 May 2005 11:03:42 +0000 Subject: [PATCH] * May 18th, 2005: Starting to develop AMXX-Edit v2 as a kind of open source * May 19th, 2005: Added debug dialog (only for developing) --- editor/editor2/AMXX_Edit_v2.dpr | 6 +++++- editor/editor2/UnitfrmAbout.dfm | Bin 226163 -> 226172 bytes editor/editor2/UnitfrmMain.dfm | 4 ++-- editor/editor2/UnitfrmMain.pas | 18 ++++++++++++------ 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/editor/editor2/AMXX_Edit_v2.dpr b/editor/editor2/AMXX_Edit_v2.dpr index 63d16655..7129cba4 100755 --- a/editor/editor2/AMXX_Edit_v2.dpr +++ b/editor/editor2/AMXX_Edit_v2.dpr @@ -13,12 +13,15 @@ program AMXX_Edit_v2; GlyFX Icons: www.glyfx.com (using GlyFX Icon Pack of Delphi 2005 PE) Modified CorelButton (see CorelButton.pas, original by ConquerWare) Indy 9 Socket Components: www.indyproject.org + [JEDI component library, only necersarry for Exception Dialog (jvcl.sourceforge.net)] AMXX-Edit v2 is published under GNU General Public License and comes with ABSOLUTELY NO WARRANTY (see GPL.txt for more information) } +//{$DEFINE EXCEPTION_DEBUG} // Remove comments only when you want to trace exceptions + uses Forms, Windows, @@ -38,7 +41,8 @@ uses UnitHowToMakePlayerMenu in 'UnitHowToMakePlayerMenu.pas' {frmHowToMakePlayerMenu}, UnitfrmSockets in 'UnitfrmSockets.pas' {frmSocketTerminal}, UnitReadThread in 'UnitReadThread.pas', - UnitfrmLoopGenerator in 'UnitfrmLoopGenerator.pas' {frmLoopGenerator}; + UnitfrmLoopGenerator in 'UnitfrmLoopGenerator.pas' {frmLoopGenerator}, + UnitfrmExceptionHandler in 'UnitfrmExceptionHandler.pas' {ExceptionDialog}; {$R *.res} diff --git a/editor/editor2/UnitfrmAbout.dfm b/editor/editor2/UnitfrmAbout.dfm index 7b1856a48564c0c00257b6065f2c00f27e77400a..6aacc7f3aba845fb8f55dc25355cd162d5a62de5 100755 GIT binary patch delta 208 zcmezTjQ7toUV;By3?XhozK%}*p&<+g0+|y9G8u19top^cXL2cHGvnIkpN#E489|t7 z`%gyZw*~b~HLT&8DJ2=q=NQ;LQZv&tN|@Byof8X6GV}A;vK)OQB6M9-GD{T7j1)?X zQ;QXXlQZ*5GIMeg6>>6@iV}+|6*MwRN(!v>^~=l4^@?G#ddc~@nhJ?|DGHe-#R}y` xi3J6zMG6`zsW}B1nLt%~#rdU0$*F1L`9fOnjGQzMJeGxg`5mP003HHN(%r0 delta 153 zcmezKjQ8_1UV;By3?XhozK%}*p&<+g0tpiZG8r#Vtop^cWpXKFGvm_cpN#E489|t7 z`%gyZw*@}T4GgT|nJFb1%zqfzJW?~$GfJ4G*qsv#N;32F*b*FlBO-KNQ!+~w%8V2; zixpB*%Tjal3sO@Qk}4IP5{omFb$t_yOHzvz67y1~3luX;auz3N=9OgT 0 then begin // if we are on line 0 we would access line -1 otherwise - if (Trim(sciEditor.Lines[sciEditor.GetCurrentLineNumber]) <> '') and (Trim(sciEditor.Lines[sciEditor.GetCurrentLineNumber -1]) = '') and (frmSettings.chkAutoIndent.Checked) then // if the prevorious line isn't empty, the line contains only spaces and the auto-identer is enabled then... - sciEditor.Lines[sciEditor.GetCurrentLineNumber] := Copy(sciEditor.Lines[sciEditor.GetCurrentLineNumber -1], 1, Length(sciEditor.Lines[sciEditor.GetCurrentLineNumber -1]) -2); // remove the last char + sciEditor.SelText := ' ' + else if (Trim(sciEditor.Lines[sciEditor.GetCurrentLineNumber -1]) = '') and (frmSettings.chkAutoIndent.Checked) then begin // if the prevorious line isn't empty, the line contains only spaces and the auto-identer is enabled then... + sciEditor.Lines[sciEditor.GetCurrentLineNumber] := Copy(sciEditor.Lines[sciEditor.GetCurrentLineNumber], 1, Length(sciEditor.Lines[sciEditor.GetCurrentLineNumber]) -1); // remove last indent.. + sciEditor.SelStart := sciEditor.SelStart + Length(sciEditor.Lines[sciEditor.GetCurrentLineNumber]); // and jump to last position end; end; end; @@ -650,7 +649,14 @@ begin else if (Key = 9) and (not (ssCtrl in Shift)) then // Tab SetModified else if (Key >= 65) and (Key <= 90) and (not (ssCtrl in Shift)) then // a..z - SetModified; + SetModified + else if Chr(Key) = '}' then begin + if sciEditor.GetCurrentLineNumber <> 0 then begin // if we are on line 0 we would access line -1 otherwise + if (Trim(sciEditor.Lines[sciEditor.GetCurrentLineNumber]) = '') and (frmSettings.chkAutoIndent.Checked) then // if the prevorious line isn't empty, the line contains only spaces and the auto-identer is enabled then... + sciEditor.Lines[sciEditor.GetCurrentLineNumber] := Copy(sciEditor.Lines[sciEditor.GetCurrentLineNumber], 1, Length(sciEditor.Lines[sciEditor.GetCurrentLineNumber]) -1); // remove the last char + end; + end; + if (sciEditor.GetCurrentLineNumber <> eCurrentLine) or (RemoveSpaces(sciEditor.Lines[sciEditor.GetCurrentLineNumber]) = '') then begin UpdateList(sciEditor.Lines.Text);