Modificaciones a RBDESIGN.PRG para incluir tooltip

Modificaciones a RBDESIGN.PRG para incluir tooltip

Postby wmormar » Mon Feb 20, 2012 2:08 pm

Sin mas preambulo,

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

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

 
William, Morales
Saludos

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

Re: Modificaciones a RBDESIGN.PRG para incluir tooltip

Postby wmormar » Mon Feb 20, 2012 6:13 pm

Se me olvido la modificacion a la clase TRBN,

Code: Select all  Expand view
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: 1074
Joined: Fri Oct 07, 2005 10:41 pm
Location: México

Re: Modificaciones a RBDESIGN.PRG para incluir tooltip

Postby Antonio Linares » Mon Feb 20, 2012 6:24 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41898
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Modificaciones a RBDESIGN.PRG para incluir tooltip

Postby wmormar » Tue Feb 21, 2012 3:21 am

Antonio Linares wrote:http://forums.fivetechsupport.com/viewtopic.php?p=126238#p126238


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
wmormar
 
Posts: 1074
Joined: Fri Oct 07, 2005 10:41 pm
Location: México

Re: Modificaciones a RBDESIGN.PRG para incluir tooltip

Postby Antonio Linares » Tue Feb 21, 2012 8:53 am

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41898
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], JoseAlvarez and 86 guests