Hello to all,
I have written a simple TOOLBAR to provide the most basic editing functions (Cut/Copy/Paste).It works as expected, nonetheless...
How can these buttons on the toolbar automatically DISABLE or ENABLE according to applicability? How do I make them respond as SYS(1500) _MEDIT menu?
I have no problem enabling/disabling toolbar options for application-specific functions... What am I missing?
Sample code:
I have written a simple TOOLBAR to provide the most basic editing functions (Cut/Copy/Paste).It works as expected, nonetheless...
How can these buttons on the toolbar automatically DISABLE or ENABLE according to applicability? How do I make them respond as SYS(1500) _MEDIT menu?
I have no problem enabling/disabling toolbar options for application-specific functions... What am I missing?
Sample code:
Code:
PUBLIC oTbr
oTbr = CreateObject("MyToolBar")
oTbr.Visible = .t.
DEFINE CLASS MyToolBar as ToolBar
CAPTION = "My ToolBar"
ADD OBJECT cmdEditCut AS CommandButton WITH ;
CAPTION = "Cut"
ADD OBJECT cmdEditCopy AS CommandButton WITH ;
CAPTION = "Copy"
ADD OBJECT cmdEditPaste AS CommandButton WITH ;
CAPTION = "Paste"
***********************
PROCEDURE cmdEditCut.CLICK
SYS(1500, '_MED_CUT', '_MEDIT')
PROCEDURE cmdEditCopy.CLICK
SYS(1500, '_MED_COPY', '_MEDIT')
PROCEDURE cmdEditPaste.CLICK
SYS(1500, '_MED_PASTE', '_MEDIT')
* KEYBOARD '{CTRL+V}' && This also works!
ENDDEFINE