Position Toolbar

Post Reply
User avatar
ctoas
Posts: 103
Joined: Wed Oct 26, 2005 2:38 pm
Location: São Paulo - Brasil
Contact:

Position Toolbar

Post by ctoas »

Hello friends.

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

Thank you

Image
Christiano Augusto Silveira
christiano.silveira@gmail.com

MaxxTech Soluções em TI
http://www.maxxtech.com.br
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Position Toolbar

Post by Enrico Maria Giordano »

Code: Select all

#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
User avatar
ctoas
Posts: 103
Joined: Wed Oct 26, 2005 2:38 pm
Location: São Paulo - Brasil
Contact:

Re: Position Toolbar

Post by ctoas »

Hello Enrico, is not a ButtonBar, but the Toolbar as PRG below

Code: Select all

********************************************************************************
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()
 
Last edited by ctoas on Mon Aug 04, 2014 1:21 pm, edited 1 time in total.
Christiano Augusto Silveira
christiano.silveira@gmail.com

MaxxTech Soluções em TI
http://www.maxxtech.com.br
User avatar
ctoas
Posts: 103
Joined: Wed Oct 26, 2005 2:38 pm
Location: São Paulo - Brasil
Contact:

Re: Position Toolbar

Post by ctoas »

Enrico Thanks for your attention
Christiano Augusto Silveira
christiano.silveira@gmail.com

MaxxTech Soluções em TI
http://www.maxxtech.com.br
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Position Toolbar

Post by Antonio Linares »

Christiano,

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

Antonio Linares
www.fivetechsoft.com
User avatar
ctoas
Posts: 103
Joined: Wed Oct 26, 2005 2:38 pm
Location: São Paulo - Brasil
Contact:

Re: Position Toolbar

Post by ctoas »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Position Toolbar

Post by Antonio Linares »

Christiano,

I missed that post, thanks

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

Antonio Linares
www.fivetechsoft.com
User avatar
ctoas
Posts: 103
Joined: Wed Oct 26, 2005 2:38 pm
Location: São Paulo - Brasil
Contact:

Re: Position Toolbar

Post by ctoas »

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: Select all

********************************************************************************
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: Select all

// 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Position Toolbar

Post by Antonio Linares »

Chirstiano,

Please try this example:

Code: Select all

#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
User avatar
ctoas
Posts: 103
Joined: Wed Oct 26, 2005 2:38 pm
Location: São Paulo - Brasil
Contact:

Re: Position Toolbar

Post by ctoas »

Antonio, thanks for help me, but the way you showed is just like this already, I want this shown in the image below assembly.


Image

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

MaxxTech Soluções em TI
http://www.maxxtech.com.br
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Position Toolbar

Post by Antonio Linares »

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
User avatar
ctoas
Posts: 103
Joined: Wed Oct 26, 2005 2:38 pm
Location: São Paulo - Brasil
Contact:

Re: Position Toolbar

Post by ctoas »

Tanks Antonio
Christiano Augusto Silveira
christiano.silveira@gmail.com

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