CHANGE A BUTTONBAR ON A WINDOW

CHANGE A BUTTONBAR ON A WINDOW

Postby Silvio » Thu Jun 04, 2009 10:31 pm

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 ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: CHANGE A BUTTONBAR ON A WINDOW

Postby FranciscoA » Fri Jun 05, 2009 1:00 am

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.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: CHANGE A BUTTONBAR ON A WINDOW

Postby Silvio » Fri Jun 05, 2009 6:44 am

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...
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: jair, nageswaragunupudi and 84 guests