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
How to change the position of the toolbar as shown in picture?
Thank you
www.FiveTechSoft.com
https://fivetechsoft.com/forums/
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
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()
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()
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
{
}
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.