For th emain window I have a button bar with many buttons
when I open a module I want change the main buttonbar and insert a new buttonbar with 4 buttons
when I close this module I want erase the buttonbar of this module and recall the buttonbar of the main window
Can I make it and How ?
CHANGE A BUTTONBAR ON A WINDOW
- FranciscoA
- Posts: 2163
- Joined: Fri Jul 18, 2008 1:24 am
- Location: Chinandega, Nicaragua, C.A.
Re: CHANGE A BUTTONBAR ON A WINDOW
Silvio:
Here's an example of what you're looking for. I hope you find it useful. Please click on the printer-button on both bars.
#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
Regards
Francisco.
Here's an example of what you're looking for. I hope you find it useful. Please click on the printer-button on both bars.
#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
Regards
Francisco.
Francisco J. Alegría P.
Chinandega, Nicaragua.
Fwxh-MySql-TMySql
Chinandega, Nicaragua.
Fwxh-MySql-TMySql
Re: CHANGE A BUTTONBAR ON A WINDOW
thanks...
but there is a small problem
when U change the size of the main window when U return at barra1 the buttonbar is changed the size
perhaps it want a resize of this buttonbar...
but there is a small problem
when U change the size of the main window when U return at barra1 the buttonbar is changed the size
perhaps it want a resize of this buttonbar...
Best Regards, Saludos
Falconi Silvio
Falconi Silvio