// // File cWSInfoForm.pkg // Author: Wil van Antwerpen // Company: Antwise Solutions // License: LGPL // Date: March 3, 2003 // // Subclass of a form, this subclass allows you to have a displayonly form in which // text can be selected with mouse or keyboard // // // // Created class from Sergey's source // // Use Windows.pkg Define CW_WS_NOTAPPLICABLE For "" Class cWsInfo_pm Is a FormFloatingPopupMenu register_procedure ExploreFolder Procedure Construct_Object Handle hoSelf Forward Send Construct_Object Property Handle phoInvokingObject 0 Move Self To hoSelf Send Add_Item msg_none "" Send Add_Item msg_ExploreFolder "Explore" Set Aux_Value item (item_count(self)-1) to hoSelf End_Procedure // Construct_Object Function FormValue Returns String String sValue Handle hoForm Get phoInvokingObject To hoForm If (hoForm) Begin Get Value Of hoForm To sValue End Function_Return sValue End_Function // FormValue Procedure ExploreFolder String sValue Get FormValue To sValue runprogram background "Explorer" sValue End_Procedure // ExploreFolder Procedure Popup Handle hoFocus Integer iCount String sValue Boolean bShadowExplore Move (true) To bShadowExplore Get Focus To hoFocus If (hoFocus) Begin Set phoInvokingObject To hoFocus Get Value Of hoFocus To sValue Move (pos("\",sValue)=0) To bShadowExplore End Get Item_Count To iCount Set Shadow_State Item (iCount-1) To bShadowExplore Forward Send Popup End_Procedure // Popup End_Class // cWsInfo_pm Object oWsInfo_pm is a cWsInfo_pm End_Object Class cWSInfoForm Is A Form Procedure Construct_Object Forward Send Construct_Object Set Color To clBtnFace Set Floating_Menu_Object to oWsInfo_pm On_Key kCancel Send Close_Panel End_Procedure // Construct_Object Procedure Key Integer iKey If ((iKey=kLeftArrow)Or(iKey=kRightArrow)Or(iKey=295)Or(iKey=294)Or(iKey=5129)Or(iKey=5130)Or(iKey=5128)Or(iKey=5127)) ; Forward Send Key iKey End_Procedure // Key Procedure Set Value Integer iItem String sValue If (sValue="") Move CW_WS_NOTAPPLICABLE To sValue Forward Set Value Item iItem To sValue If (sValue=CW_WS_NOTAPPLICABLE) Set Focus_Mode To nonFocusable Else Set Focus_Mode To Focusable End_Procedure // Set Value Procedure Cut End_Procedure Procedure Delete End_Procedure Procedure Paste End_Procedure End_Class // cWSInfoForm