Hola amigos del foro. Aqui les dejo este pequeño ejemplo para utilizar barras de botones distintas. Desde un botón de la button-bar principal pueden llamar a otra button-bar, ejecutar una accion y volver a la button-bar principal.
Compilen el ejemplo, y click sobre el botón de la impresora, en cada una de las button-bar.
Espero le sea de utilidad a alguien.
include "FiveWin.ch"
static oWnd
function Main()
local oBar, oPopup, oBtn
SetBalloon( .T. ) // Balloon shape required for tooltips
DEFINE WINDOW oWnd TITLE "FWH - Office 2007 look in your ButtonBars, MsgBar and Menus"
Barra1() //Main button-bar
SET MESSAGE OF oWnd TO "Testing the ButtonBar 2007 Office look" ;
CENTERED CLOCK KEYBOARD 2007
ACTIVATE WINDOW oWnd ;
VALID MsgYesNo( "Do you want to end?" )
return nil
//------------------------------
Function Barra1()
local oBar, oPopup, oBtn
DEFINE BUTTONBAR oBar OF oWnd SIZE 60, 60 2007
DEFINE BUTTON OF oBar ACTION Print() ;
RESOURCE "attach" PROMPT "Attach" TOOLTIP "Attach"
DEFINE BUTTON OF oBar ACTION MsgInfo( "Calendar" ) ;
RESOURCE "calendar" PROMPT "Calendar" WHEN .F. TOOLTIP "Calendar"
MENU oPopup POPUP
MENUITEM "One" ACTION MsgInfo( 1 )
MENUITEM "Two" ACTION MsgInfo( 2 )
ENDMENU
DEFINE BUTTON oBtn OF oBar ACTION oBtn:ShowPopup() ;
RESOURCE "people" PROMPT "Clients" GROUP ;
MENU oPopup TOOLTIP "Clients"
DEFINE BUTTON OF oBar ACTION Barra2(oBar) ; //second button-bar
RESOURCE "print" PROMPT "Print" TOOLTIP "Print"
Return nil
//------------------------------
Function Barra2(oBar1)
local oBar, oPopup, oBtn
oBar1:Hide()
DEFINE BUTTONBAR oBar OF oWnd SIZE 60, 60 2007
DEFINE BUTTON OF oBar ACTION Print() ;
RESOURCE "attach" PROMPT "Attach" TOOLTIP "Attach"
DEFINE BUTTON OF oBar ACTION ( MsgInfo("My Action"), oBar:End(), oBar1:Show() ) ;
RESOURCE "print" PROMPT "Print" TOOLTIP "Hi, Click me"
Return nil
Saludos.
Francisco.
Chinandega, Nicaragua.
Fwxh-MySql-TMySql