FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Position Toolbar
Posts: 115
Joined: Wed Oct 26, 2005 02:38 PM
Position Toolbar
Posted: Mon Aug 04, 2014 11:08 AM
Hello friends.

How to change the position of the toolbar as shown in picture?

Thank you

Christiano Augusto Silveira
christiano.silveira@gmail.com

MaxxTech Soluções em TI
http://www.maxxtech.com.br
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Position Toolbar
Posted: Mon Aug 04, 2014 12:41 PM
Code (fw): Select all Collapse
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd

    LOCAL oBar

    SETBALLOON( .T. )

    DEFINE WINDOW oWnd

    DEFINE BUTTONBAR OF oWnd 2007;
           SIZE 33, 33

    DEFINE BUTTON OF oWnd:oBar;
           FILE "E:\FWHARBOUR\BITMAPS\OPEN.BMP";
           ACTION MSGINFO( "First bar Ok!" );
           TOOLTIP "This is a test"

    @ 33, -1 BUTTONBAR oBar OF oWnd;
             SIZE 1602, 36;
             BUTTONSIZE 60, 33

    oBar:l2007 = .T.

    DEFINE BUTTON OF oBar;
           FILE "E:\FWHARBOUR\BITMAPS\SAVE.BMP";
           ACTION MSGINFO( "Second bar Ok!" )

    ACTIVATE WINDOW oWnd

    RETURN NIL


EMG
Posts: 115
Joined: Wed Oct 26, 2005 02:38 PM
Re: Position Toolbar
Posted: Mon Aug 04, 2014 01:04 PM
Hello Enrico, is not a ButtonBar, but the Toolbar as PRG below

Code (fw): Select all Collapse
********************************************************************************
FUNCTION TESTE()
********************************************************************************

    DEFINE DIALOG oDlg RESOURCE "TESTE" TITLE "TESTE" FONT wfonte_FixedSys 
    
    ACTIVATE DIALOG oDlgAGENDA CENTERED ON INIT (BARRABOTOESAGENDA())
        
RETURN NIL    

********************************************************************************
FUNCTION BARRABOTOESAGENDA()
********************************************************************************

    **** TOOLBAR - TAMANHOS DOS BOTÕES               
    oImageList = TImageList():New(48,48)      
    oImageList2 = TImageList():New(48,48)      
                                                           
    **** TOOLBAR - IMAGENS DOS BOTÕES   
    oImageList :AddMasked(TBitmap():Define("DIAG_BAR_NOVO"      ,,oDlgAGENDA),nRGB(255,255,255))   
    oImageList :AddMasked(TBitmap():Define("DIAG_BAR_NOVO_MULT" ,,oDlgAGENDA),nRGB(255,255,255))   
    oImageList :AddMasked(TBitmap():Define("DIAG_BAR_VISUALIZAR",,oDlgAGENDA),nRGB(255,255,255))   
    oImageList :AddMasked(TBitmap():Define("DIAG_BAR_ALTERAR"   ,,oDlgAGENDA),nRGB(255,255,255))   
    oImageList :AddMasked(TBitmap():Define("DIAG_BAR_EXCLUIR"   ,,oDlgAGENDA),nRGB(255,255,255))   
    oImageList :AddMasked(TBitmap():Define("DIAG_BAR_IMPRESSAO" ,,oDlgAGENDA),nRGB(255,255,255))   
    oImageList2:AddMasked(TBitmap():Define("DIAG_BAR_SAIR"      ,,oDlgAGENDA),nRGB(255,255,255))   
                                           
    DEFINE REBAR oReBar OF oDlgAGENDA
    
    **** TOOLBAR - DEFINE   
    DEFINE TOOLBAR oToolBarAGENDA  OF oReBar SIZE 52,52 IMAGELIST oImageList  BALLOON 
    DEFINE TOOLBAR oToolBarAGENDA2 OF oReBar SIZE 52,52 IMAGELIST oImageList2 BALLOON

    oToolBarAGENDA:nWidth  = 335
    oToolBarAGENDA2:nWidth = 58
   
   oReBar:InsertBand( oToolBarAGENDA )
   oReBar:InsertBand( oToolBarAGENDA2 )
   
RETURN NIL

oImageList:END()
oImageList2:END()
Christiano Augusto Silveira
christiano.silveira@gmail.com

MaxxTech Soluções em TI
http://www.maxxtech.com.br
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Position Toolbar
Posted: Mon Aug 04, 2014 01:16 PM

Christiano,

uh, sorry, I never used a REBAR. :-(

EMG

Posts: 115
Joined: Wed Oct 26, 2005 02:38 PM
Re: Position Toolbar
Posted: Mon Aug 04, 2014 01:40 PM

Enrico Thanks for your attention

Christiano Augusto Silveira
christiano.silveira@gmail.com

MaxxTech Soluções em TI
http://www.maxxtech.com.br
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Position Toolbar
Posted: Mon Aug 04, 2014 02:33 PM

Christiano,

Could you post the source code that you are using to build it ? thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 115
Joined: Wed Oct 26, 2005 02:38 PM
Re: Position Toolbar
Posted: Mon Aug 04, 2014 02:50 PM

Hello Antonio, Thanks for responding.

The source code is exactly what I posted above.

Christiano Augusto Silveira
christiano.silveira@gmail.com

MaxxTech Soluções em TI
http://www.maxxtech.com.br
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Position Toolbar
Posted: Mon Aug 04, 2014 03:06 PM

Christiano,

I missed that post, thanks

Pease provide the source code for the RC "TESTE" dialog, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 115
Joined: Wed Oct 26, 2005 02:38 PM
Re: Position Toolbar
Posted: Mon Aug 04, 2014 03:16 PM
Antonio, I do not include the ToolBar RES / RC as you can see in the source code below. This way I do this wrong?

Code (fw): Select all Collapse
********************************************************************************
FUNCTION TESTE()
********************************************************************************

    DEFINE DIALOG oDlg RESOURCE "TESTE" TITLE APPNAME + "TESTE" FONT wfonte_FixedSys 
    
   ACTIVATE DIALOG oDlgAGENDA CENTERED ON INIT (BARRABOTOESAGENDA())
        
RETURN NIL    

********************************************************************************
FUNCTION BARRABOTOESAGENDA()
********************************************************************************

    **** TOOLBAR - TAMANHOS DOS BOTÕES               
    oImageList = TImageList():New(48,48)      
    oImageList2 = TImageList():New(48,48)      
                                                           
    **** TOOLBAR - IMAGENS DOS BOTÕES   
    oImageList :AddMasked(TBitmap():Define("DIAG_BAR_NOVO"      ,,oDlgAGENDA),nRGB(255,255,255))   
    oImageList :AddMasked(TBitmap():Define("DIAG_BAR_NOVO_MULT" ,,oDlgAGENDA),nRGB(255,255,255))   
    oImageList :AddMasked(TBitmap():Define("DIAG_BAR_VISUALIZAR",,oDlgAGENDA),nRGB(255,255,255))   
    oImageList :AddMasked(TBitmap():Define("DIAG_BAR_ALTERAR"   ,,oDlgAGENDA),nRGB(255,255,255))   
    oImageList :AddMasked(TBitmap():Define("DIAG_BAR_EXCLUIR"   ,,oDlgAGENDA),nRGB(255,255,255))   
    oImageList :AddMasked(TBitmap():Define("DIAG_BAR_IMPRESSAO" ,,oDlgAGENDA),nRGB(255,255,255))   
    oImageList2:AddMasked(TBitmap():Define("DIAG_BAR_SAIR"      ,,oDlgAGENDA),nRGB(255,255,255))   
                                           
    DEFINE REBAR oReBar OF oDlgAGENDA
    
    **** TOOLBAR - DEFINE   
    DEFINE TOOLBAR oToolBarAGENDA  OF oReBar SIZE 52,52 IMAGELIST oImageList  BALLOON 
    DEFINE TOOLBAR oToolBarAGENDA2 OF oReBar SIZE 52,52 IMAGELIST oImageList2 BALLOON

    oToolBarAGENDA:nWidth  = 335
   oToolBarAGENDA2:nWidth = 58
   
   oReBar:InsertBand( oToolBarAGENDA )
   oReBar:InsertBand( oToolBarAGENDA2 )
   
RETURN NIL

oImageList:END()
oImageList2:END()


TESTE.RC
Code (fw): Select all Collapse
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 7.00".

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>

LANGUAGE LANG_PORTUGUESE,SUBLANG_PORTUGUESE_BRAZILIAN

TESTE DIALOGEX DISCARDABLE 6, 18, 284, 329
STYLE WS_POPUP|DS_MODALFRAME|DS_3DLOOK|WS_CAPTION|WS_VISIBLE
FONT 9, "Fixedsys", 0, 0, 1
{
}
Christiano Augusto Silveira
christiano.silveira@gmail.com

MaxxTech Soluções em TI
http://www.maxxtech.com.br
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Position Toolbar
Posted: Mon Aug 04, 2014 05:18 PM
Chirstiano,

Please try this example:

Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oWnd, oReBar, oToolBar1, oImageList1

   DEFINE DIALOG oWnd NAME "DIALOG" TITLE "FWH - Testing Win32 ReBars & Toolbars"

   ACTIVATE DIALOG oWnd CENTERED ;
      ON INIT CREABARRA( @oImageList1, oWnd )

   oImageList1:End()

return nil

FUNCTION CREABARRA( oImageList1, oWnd )

   LOCAL oReBar, oToolBar1

   // First we build the imagelists with all the bitmaps
   oImageList1 = TImageList():New( 32, 32 ) // width and height of bitmaps

   oImageList1:AddMasked( TBitmap():Define( "new",,    oWnd ), nRGB( 255, 0, 255 ) )
   oImageList1:AddMasked( TBitmap():Define( "open",,   oWnd ), nRGB( 255, 0, 255 ) )
   oImageList1:AddMasked( TBitmap():Define( "search",, oWnd ), nRGB( 255, 0, 255 ) )
   oImageList1:AddMasked( TBitmap():Define( "print",,  oWnd ), nRGB( 255, 0, 255 ) )

   // Now we create the rebar
   oReBar = TReBar():New( oWnd )

   // Now we create the toolbars and add the buttons
   oToolBar1 = TToolBar():New( oReBar, 52, 52, oImageList1 )
   oToolBar1:AddButton( { || MsgInfo( "New" ) }, "New", "New project" )
   oToolBar1:AddButton( { || MsgInfo( "Open" ) }, "Open", "Open project" )
   oToolBar1:AddSeparator()
   oToolBar1:AddButton( { || MsgInfo( "Search" ) }, "Search", "Search" )
   oToolBar1:AddButton( { || MsgInfo( "Print" ) }, "Print a report", "Print" )

   // We set the widths for each toolbar
   oToolBar1:nWidth = 290

   // Now we insert the toolbars into the rebar
   oReBar:InsertBand( oToolBar1 )

RETURN .T.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 115
Joined: Wed Oct 26, 2005 02:38 PM
Re: Position Toolbar
Posted: Mon Aug 04, 2014 07:34 PM
Antonio, thanks for help me, but the way you showed is just like this already, I want this shown in the image below assembly.




I want be like this.
Christiano Augusto Silveira
christiano.silveira@gmail.com

MaxxTech Soluções em TI
http://www.maxxtech.com.br
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Position Toolbar
Posted: Mon Aug 04, 2014 11:39 PM

Christiano,

En mi ejemplo solo tienes que añadir esta línea:

// Now we create the rebar
oReBar = TReBar():New( oWnd )

oRebar:nTop = 60 // esta !!!

Puedes ponerla en la posición que desees :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 115
Joined: Wed Oct 26, 2005 02:38 PM
Re: Position Toolbar
Posted: Tue Aug 05, 2014 11:55 AM

Tanks Antonio

Christiano Augusto Silveira
christiano.silveira@gmail.com

MaxxTech Soluções em TI
http://www.maxxtech.com.br

Continue the discussion