Use Windows.pkg Use cRichEdit.pkg Use cRDCButtonDPI.pkg Use cRDCModalPanel.pkg Use seq_chnl.pkg Use vWin32fh.pkg Object oLogFileDialog_dg is a cRDCModalPanel Set Size to 214 395 Set Label to "Log File Dialog" Set piMinSize to 89 211 Set Location to 2 2 Set Icon to "OpenLogFile.ico" Property String psLogFileName "" Property Integer piIndent Object oLogFile_edt is a cRichEdit Set Size to 169 373 Set Location to 16 11 Set TextColor to clBlack Set peAnchors to anAll Set Label_Row_Offset to 3 Set Label_TextColor to clGreenGreyLight // Set TextBackColor to clGreenGreyLight Set TextColor to clGreenGreyLight // Set Color to clGreenGreyLight // Set ReadOnlyColor to clGreenGreyLight Set Label_FontItalics to True Set piFontSize to 200 Set psTypeFace to 'Consolas' Delegate Set piIndent to (piParagraphIndent(Self)) Procedure DoSaveDocument String sLogFileName Boolean bOk bOkToSave bChanged Move False to bOkToSave Get pbCanUndo to bChanged If (bChanged = False) Begin Procedure_Return End Get psLogFileName to sLogFileName Send Write sLogFileName // clear undo buffer on save // we want undo buffer to only apply to the new document Send ClearUndoBuffer Send Info_Box "Changes saved." End_Procedure Procedure LoadData String sLogFileName Integer iTwips iIndent Get psLogFileName to sLogFileName Set Label to sLogFileName Move 1440 to iTwips Get piIndent to iIndent Set piParagraphIndent to (iIndent + (iTwips * 0.2)) Send Read sLogFileName End_Procedure On_Key Key_Ctrl+Key_S Send DoSaveDocument On_Key kCancel Send Cancel End_Object Object oCancel_Btn is a cRDCButtonDPI Set Label to "&Close" Set Location to 193 334 Set peAnchors to anBottomRight Procedure OnClick Send Close_Panel End_Procedure End_Object Object oFirstRun_btn is a cRDCButtonDPI Set Location to 193 220 Set Label to "View &first" Set peAnchors to anBottomRight Procedure OnClick Send Beginning_of_Data to oLogFile_edt End_Procedure End_Object Object oLatestRun_btn is a cRDCButtonDPI Set Location to 193 277 Set Label to "View &latest" Set peAnchors to anBottomRight Procedure OnClick Send End_of_Data to oLogFile_edt End_Procedure End_Object // Automatically load data into the grid when activating. Procedure Activating Handle ho Move (oLogFile_edt(Self)) to ho Send LoadData of ho // We need to active before we can send end_of_data. Send Activate of ho Send End_of_Data to ho End_Procedure On_Key Key_Alt+Key_F Send KeyAction of oFirstRun_btn On_Key Key_Ctrl+Key_F Send KeyAction of oFirstRun_btn On_Key Key_Alt+Key_L Send KeyAction of oLatestRun_btn On_Key Key_Ctrl+Key_L Send KeyAction of oLatestRun_btn On_Key Key_Alt+Key_C Send KeyAction of oCancel_Btn End_Object Procedure ActivateLogFileDialog String sLogFile Handle ho Boolean bExists Get vFilePathExists sLogFile to bExists If (bExists = False) Begin Send Info_Box "The logfile doesn't exist." Procedure_Return End Move (oLogFileDialog_dg(Self)) to ho Set psLogFileName of ho to sLogFile Send Popup of ho End_Procedure