//**************************************************************************** // $Module type: CLASS // $Module name: // $Author : Nils G. Svedmyr // Created : 2001-07-29 @ 10:29 // // Description : // // $Rev History // 2001-07-29 Module header created //**************************************************************************** Use cRdsDbGrid.pkg Use LogDialog.dg Class cDbGridLog is a cRdsDbGrid Procedure Construct_Object Integer iColor Forward Send Construct_Object Property Integer piColw0 24 // 'Recid' // To change a column with, Property Integer piColw1 155 // Statustext // set this property to zero Property Integer piColw2 85 // Tablename // in the object. Property Integer piColw3 72 // Time Property Integer piColw4 50 // Networkuser Property Boolean bUseStdCols True Set Oem_Translate_State To True Set Auto_Label_State To True Set Allow_Bottom_Add_State To False Set Allow_Top_Add_State To False Set Allow_Insert_Add_State To False Set Read_Only_State To True Set Column_Checkbox_State item 0 To True Set Horz_Scroll_Bar_Visible_State To False Set Highlight_Row_state To True Get ReadDWord Of ghoApplication "Preferences" "CurrentRowColor" 0 To iColor If Not iColor Move clAqua To iColor Set CurrentRowColor To iColor Get ReadDWord Of ghoApplication "Preferences" "CurrentCellColor" 0 To iColor If Not iColor Move clYellow To iColor Set CurrentCellColor To iColor On_Key kEnter Send DoPopupLogDialog On_Key Key_Tab Send Switch On_Key kCancel Send msg_None On_Key kFind Send msg_None On_Key kFind_Next Send msg_None On_Key kFind_Previous Send msg_None On_Key kSuper_Find Send msg_None On_Key kSuper_Find_Next Send msg_None On_Key kSuper_Find_Previous Send msg_None End_Procedure // Construct_Object Procedure End_Construct_Object If (bUseStdCols(Self)) Begin If (piColw0(Self) <> 0) Set Form_Width item 0 to (piColw0(Self)) If (piColw1(Self) <> 0) Set Form_Width item 1 to (piColw1(Self)) If (piColw2(Self) <> 0) Set Form_Width item 2 to (piColw2(Self)) If (piColw3(Self) <> 0) Set Form_Width item 3 to (piColw3(Self)) If (piColw4(Self) <> 0) Set Form_Width item 4 to (piColw4(Self)) End Forward Send End_Construct_Object End_Procedure // End_Construct_Object Procedure Entry_Display Integer iFile Integer iType Integer iBase_Item iServer iItem String sValue Forward send Entry_Display iFile iType Get Base_Item to iBase_Item If (iBase_Item < 0) Procedure_Return Get Server to iServer Get Value item (iBase_Item + 1) to sValue If (Uppercase(sValue) contains "ERROR") ; Set Select_State item iBase_Item to True Else ; Set Select_State item iBase_Item to False // The above triggers a change in the DDO. // This will fix it: Set Changed_State of iServer to False For iItem from iBase_Item to (Line_Size(Self) -1) Set Entry_State item iItem to False Loop // For iItem from 0 to (Line_Size(Self) -1) End_Procedure Procedure Mouse_Click Integer iWnd Integer iPos Forward Send Mouse_Click iWnd iPos Send DoPopupLogDialog End_Procedure Procedure DoPopupLogDialog Integer ho Move (oLogDialog(Self)) to ho If ho Send Popup to ho End_Procedure // DoPopupLogDialog // We do not allow user to toggle the checkbox in this grid: Procedure Select_Toggling Integer iItem Integer bState End_Procedure // Set Entry_State for grid items to False. // This doesn't quite work in some cases... Procedure Set Current_Item Integer iCrnt If (iCrnt > -1) Set Entry_State item iCrnt to False Forward Set Current_Item to iCrnt End_Procedure End_Class // cDbGridLog