- Code: Select all Expand view
- function RibbonButtonOptions( nRow, nCol, oButton )
....
MENU oMenu POPUP
MENUITEM "Edit prompt..." ACTION EditButtonLabel( oButton )
MENUITEM "Edit tooltip..." ACTION EditButtonTooltip( oButton )
MENUITEM "Select bitmap..." ACTION ( oButton:LoadBitmaps( cGetFile( "*.bmp" ) ), oButton:Refresh() )
...
return nil
......
function EditButtonTooltip( oButton )
local oDlg, oGet, cTooltip := PadR( oButton:cTooltip, 100 ), cOldTooltip := oButton:cTooltip
if empty(cTooltip)
cTooltip := ""
endif
DEFINE DIALOG oDlg TITLE "Edit Button Tooltip"
@ 1.8, 4 GET oGet VAR cTooltip MEMO SIZE 100, 24 ;
ON CHANGE ( oButton:cTooltip := AllTrim( oGet:GetText() ), oButton:Refresh() )
@ 3, 6 BUTTON "&Ok" OF oDlg ACTION ( oButton:cTooltip := AllTrim( oGet:GetText() ), oButton:Refresh(), oDlg:End() )
@ 3, 14 BUTTON "&Cancel" OF oDlg ACTION ( oButton:cTooltip := cOldTooltip, oButton:Refresh(), oDlg:End() )
oGet:bGotFocus := {|o| o:SelectAll()}
ACTIVATE DIALOG oDlg CENTERED
return nil
//----------------------------------------------------------------------------//