//*************************************************************************** //* //* Class: cRDSDbGrid //* Package Name: cRDSDbGrid.pkg //* //*************************************************************************** Use DFAllEnt.pkg //Use cTooltip.pkg Use cRDSWinToolTip.pkg Register_Object oToolbar Register_Procedure Set phoCopy Handle ho Register_Procedure Set phoPaste Handle ho Register_Procedure Set phoCut Handle ho Class cRDSDbGrid is a dbGrid Import_Class_Protocol cRDSWinToolTip Procedure Construct_Object Integer iColor Forward Send Construct_Object Send Define_cRDSWinToolTip Set pbClassEnabledHandleType To False // True=Default Set pbClassDisabledHandleType To True // True=Default Set pbClassEntryStateHandleType To True // True=Default Get ReadDWord Of ghoApplication "Preferences" "CurrentRowColor" clWindow To iColor Set CurrentRowColor To iColor Get ReadDWord Of ghoApplication "Preferences" "CurrentCellColor" clWindow To iColor Set CurrentCellColor To iColor Get ReadDWord Of ghoApplication "Preferences" "peGridLineColor" clBtnFace To iColor Set peGridLineColor To iColor // Property Handle Private.phoToolTip 0 // Object oTooltip Is A cTooltip // Set Private.phoToolTip To (Self) // End_Object // oTooltip Set Auto_Label_State To True End_Procedure // Construct_Object // Procedure End_Construct_Object // Handle ho // String sHelp // Boolean bVisible bPopup // Forward Send End_Construct_Object // Get Private.phoToolTip To ho // Get Visible_State To bVisible // If (ho > 0 And bVisible = True) Begin // Delegate Get Popup_State To bPopup // //If (bPopup = False) Send Activate Of ho // Send Activate Of ho // End // If (ho > 0 And bVisible = True) Begin // End_Procedure // End_Construct_Object // Pagedown and pageup are sent when the user clicks in the open scrollbar area // If they are forward sent, the grid has several painting issues. Instead, // I just send scroll in their place. Procedure SetVScrollBox Integer iType Integer iData If ((iType <> SB_PAGEDOWN) And (iType <> SB_PAGEUP)) ; Forward Send SetVScrollBox iType iData If (iType = SB_PAGEDOWN) Send Scroll 1 0 Else If (iType = SB_PAGEUP) Send Scroll 0 0 End_Procedure // SetVScrollBox Procedure Set pbHidden Boolean bMode Handle ho Get Label_Object To ho Set Visible_State To (Not(bMode)) If ho Set Visible_State Of ho To (Not(bMode)) Set Enabled_State To (Not(bMode)) If ho Send Enable_Window Of ho (Not(bMode)) Set Focus_Mode To (If(bMode = True, NonFocusable, Focusable)) End_Procedure // Set pbHidden Function pbHidden Returns Boolean Function_Return (Visible_State(Self)) End_Function // pbHidden // Procedure Set pbToolTips Boolean bState // Handle ho // Get Private.phoToolTip To ho // If ho Begin // If (bState = False) Send DeActivate Of ho // Else Send Activate Of ho // End // If ho Begin // End_Procedure // Set pbToolTips // Procedure Page Integer iFlag // Handle ho hWnd // String sHelp // Boolean bVisible bPopup // Integer iField iServer // Forward Send Page iFlag // Get Data_Field To iField // Get Server To iServer // Get Private.phoToolTip To ho // Get Visible_State To bVisible // If (ho And bVisible) Begin // Get Status_Help Item 0 To sHelp // //If (Length(sHelp) = 0) Get Status_Help Of iServer iField To sHelp // Set psTooltip Of ho To (ToAnsi(sHelp)) // //If (Enabled_State(Self)) Get Window_Handle To hWnd // //Else Get Form_Window_Handle To hWnd // Get Window_Handle To hWnd // If (iFlag And ho > 0 And hWnd > 0) Send AddTool Of ho hWnd // End // If (ho And bVisible) Begin // End_Procedure // Page // Procedure Destroy // Send DestroyToolTip // Forward Send Destroy // End_Procedure // Destroy // Procedure DestroyToolTip // Handle ho // Get Private.phoToolTip To ho // If ho Begin // Send Destroy Of ho // Set Private.phoToolTip To 0 // End // If ho Begin // End_Procedure // DestroyToolTip End_Class // cRDSDbGrid