FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Modificaciones a RBDESIGN.PRG para incluir tooltip
Posts: 1076
Joined: Fri Oct 07, 2005 10:41 PM
Modificaciones a RBDESIGN.PRG para incluir tooltip
Posted: Mon Feb 20, 2012 02:08 PM
Sin mas preambulo,

Code (fw): Select all Collapse
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
Posts: 1076
Joined: Fri Oct 07, 2005 10:41 PM
Re: Modificaciones a RBDESIGN.PRG para incluir tooltip
Posted: Mon Feb 20, 2012 06:13 PM
Se me olvido la modificacion a la clase TRBN,

Code (fw): Select all Collapse
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Modificaciones a RBDESIGN.PRG para incluir tooltip
Posted: Mon Feb 20, 2012 06:24 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1076
Joined: Fri Oct 07, 2005 10:41 PM
Re: Modificaciones a RBDESIGN.PRG para incluir tooltip
Posted: Tue Feb 21, 2012 03: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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Modificaciones a RBDESIGN.PRG para incluir tooltip
Posted: Tue Feb 21, 2012 08:53 AM

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

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion