diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-10-11 12:18:18 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-10-11 12:18:18 +0200 |
commit | 69db62d8fe099cbb31b366c2429039f5204b39bf (patch) | |
tree | 347bf8235811cec62b1dfea2f9060016464080ff /extras | |
parent | f743e54453be1fbf9b7510b46ace93170ab5eabf (diff) | |
download | fpGUI-69db62d8fe099cbb31b366c2429039f5204b39bf.tar.xz |
minor changes required due to last commits from Jarrod.
Diffstat (limited to 'extras')
-rw-r--r-- | extras/tiopf/gui/tiLogToGUI.pas | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/extras/tiopf/gui/tiLogToGUI.pas b/extras/tiopf/gui/tiLogToGUI.pas index 9acd5ff1..5b2d2a6e 100644 --- a/extras/tiopf/gui/tiLogToGUI.pas +++ b/extras/tiopf/gui/tiLogToGUI.pas @@ -5,9 +5,11 @@ This in normally controlled by the tiLogReg unit. *** NOTE *** - If you application doesn't terminate when you activated LogToGUI, it probably - means a TThread.WaitFor deadlock occured. In that case, call ReleaseLog() - after fpgApplication.Run in you project's *.lpr file. + * If you application doesn't terminate when you activated LogToGUI, it probably + means a TThread.WaitFor deadlock occured. In that case, call ReleaseLog() + after fpgApplication.Run in you project's *.lpr file. + * Alternatively, the LogToGUI form was accidentaly set as Application.MainForm, + because it was the first form created. } unit tiLogToGUI; @@ -46,6 +48,7 @@ type procedure WriteToMemo(const AMessage: string); protected procedure WriteToOutput; override; + procedure WorkingListToOutput; override; procedure SetSevToLog(const AValue: TtiSevToLog); override; public constructor Create; override; @@ -75,12 +78,10 @@ end; destructor TtiLogToGUI.Destroy; begin -// writeln('>> TtiLogToGUI.Destroy'); if Assigned(FForm) then FForm.Free; FForm := nil; inherited Destroy; -// writeln('<< TtiLogToGUI.Destroy'); end; function TtiLogToGUI.CreateForm: TfpgForm; @@ -209,6 +210,12 @@ begin end; procedure TtiLogToGUI.WriteToOutput; +begin + if not ThrdLog.Terminated then + inherited WriteToOutput; +end; + +procedure TtiLogToGUI.WorkingListToOutput; var i: integer; LLogEvent: TtiLogEvent; @@ -217,17 +224,13 @@ var const ciMaxLineCount = 200; begin - if ThrdLog.Terminated then - Exit; //==> - - inherited WriteToOutput; - - if ListWorking.Count > ciMaxLineCount * 2 then + if WorkingList.Count > (ciMaxLineCount * 2) then begin FMemoLog.Lines.Clear; - LPosStart := ListWorking.Count - 1 - ciMaxLineCount; - LPosEnd := ListWorking.Count - 1; - end else + LPosStart := WorkingList.Count - 1 - ciMaxLineCount; + LPosEnd := WorkingList.Count - 1; + end + else begin if FMemoLog.Lines.Count > ciMaxLineCount then begin @@ -236,19 +239,19 @@ begin //{$IFDEF MSWINDOWS} //SendMessage(FMemoLog.handle, WM_VSCROLL, SB_Bottom, 0); //{$ENDIF MSWINDOWS} + { TODO : Keep bottom line of Memo visible by scrolling } end; LPosStart := 0; - LPosEnd := ListWorking.Count - 1; + LPosEnd := WorkingList.Count - 1; end; - for i := LPosStart to LPosEnd do begin + for i := LPosStart to LPosEnd do + begin if ThrdLog.Terminated then Break; //==> - LLogEvent := TtiLogEvent(ListWorking.Items[i]); + LLogEvent := TtiLogEvent(WorkingList.Items[i]); WriteToMemo(LLogEvent.AsLeftPaddedString); end; - - ListWorking.Clear; end; procedure TtiLogToGUI.FormClearMenuItemClick(Sender: TObject); |