Modificaciones a RBDESIGN.PRG para incluir tooltip

Post Reply
User avatar
wmormar
Posts: 1050
Joined: Fri Oct 07, 2005 10:41 pm
Location: México
Contact:

Modificaciones a RBDESIGN.PRG para incluir tooltip

Post by wmormar »

Sin mas preambulo,

Code: Select all

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

//----------------------------------------------------------------------------//

 
William, Morales
Saludos

méxico.sureste
User avatar
wmormar
Posts: 1050
Joined: Fri Oct 07, 2005 10:41 pm
Location: México
Contact:

Re: Modificaciones a RBDESIGN.PRG para incluir tooltip

Post by wmormar »

Se me olvido la modificacion a la clase TRBN,

Code: Select all

METHOD cGenPrg() CLASS TRBtn

   ........
   ........

   if ::oPopup != nil .and. IsWindow( ::oPopup:hMenu )
      cCode += " MENU BuildMenu" + AllTrim( Str( nAt ) ) + "_" + AllTrim( Str( nGroup ) ) + "_" + AllTrim( Str( nTab ) ) + "()" 
   endif

   if ! Empty( ::cTooltip )
      cCode += ' TOOLTIP "' + AllTrim( ::cTooltip ) + '"'
   endif
   
   cCode += CRLF                  
   
return cCode   

//----------------------------------------------------------------------------//
 
William, Morales
Saludos

méxico.sureste
User avatar
wmormar
Posts: 1050
Joined: Fri Oct 07, 2005 10:41 pm
Location: México
Contact:

Re: Modificaciones a RBDESIGN.PRG para incluir tooltip

Post by wmormar »

Mil disculpas por el repost, pero no lo habia visto, para la otra vere el foro antes de reinventar la rueda, jjejjejjejje
William, Morales
Saludos

méxico.sureste
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Modificaciones a RBDESIGN.PRG para incluir tooltip

Post by Antonio Linares »

No hay problema William, era para unificar ambas conversaciones :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply