// A workspace-smart version of the List class // // // #REPLACE WM_MOUSEWHEEL |CI$020A Use cWorkspacePanel.pkg Use cSystemStrUtils.pkg Class cWorkspaceList IS A List Procedure Construct_Object // **WvA: 28-02-2003, Tried to add support for mousewheel (VDF7 and below) // After an idea taken from DAW newsgroup mail // by Frygyes Nagy, January 29th, 2003 <-- Doesn't work // Add mousewheel support for VDF7 and lower. // Although the same thing works perfectly well for a dbList (DFformlist) //#IF FMAC_VERSION Le 7 // Set External_Class_Name "Mylistbox" To "DFlistBox" // Set External_Message WM_MOUSEWHEEL To OnMWheel //#ENDIF forward Send Construct_Object Property Integer piCurrentItem Public 0 Property Boolean pbFixFocusNotActive Public True On_Key kCancel Send Close_Panel End_Procedure // Construct_Object //#IF FMAC_VERSION Le 7 // Procedure OnMWheel integer aufab // Move key_up_arrow to termchar // If aufab Lt 0 move key_down_arrow to termchar // Send key to self termchar // End_Procedure // OnMWheel //#ENDIF Function AnsiNametoOemName String sName Returns String Handle hoStr String sResult Move "" To sResult Get Create (RefClass(cSystemStrUtils)) To hoStr If (hoStr) Begin Get AnsiNameToOemName Of hoStr sName To sResult Send Destroy Of hoStr End Function_Return sResult End_Function // // We seem to have a problem at times when the workspace list // is taking the focus for the first time. // For one reason or the other, the current item isn't painted // blue. So we fix it here by sending activate ONE time // Procedure Set Current_Item Integer iItem Forward Set Current_Item To iItem If (pbFixFocusNotActive(Self)) Begin Send Activate Set pbFixFocusNotActive To False End End_Procedure // Set Current_Item End_class // cWorkspaceList