Page 1 sur 1

[R] Double barre d'outil

Posté : sam. 20 août 2016 23:19
par Nicoloquinte
Bonjour :mrgreen:

Je travaille sur un programme qui nécessite une interface graphique , et des barres d'outils , je souhaite avoir une barre verticale a gauche :shock: , et une en haut , et la , je n'arrive pas a afficher les deux barres (icônes) , merci d'avance :mrgreen:
ing.png
ing.png (6.58 Kio) Vu 4353 fois
mon code est très très brouillon 8) , c'est juste pour m’entraîner avec ces éléments graphiques , avant de l'integrer a mon interface finale
#include <GUIConstantsEx.au3>
#include <GuiReBar.au3>
#include <GuiToolbar.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>

Local  $btnExit, $hToolbar, $hReBar, $hInput , $hToolbar, $hCombo, $hDTP
Local Enum $idNew = 1000, $idOpen, $idSave , $new , $miou ,  $idHelp2


$hgui = GUICreate("Rebar",400,396 ,-1 ,-1, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_MAXIMIZE,$WS_TABSTOP))

; create the rebar control
$hReBar = _GUICtrlRebar_Create($hgui, BitOR($CCS_TOP, $WS_BORDER, $RBS_VARHEIGHT, $RBS_AUTOSIZE))
; create a toolbar to put in the rebar
$hToolbar = _GUICtrlToolbar_Create($hgui, BitOR($TBSTYLE_FLAT, $CCS_NORESIZE, $CCS_NOPARENTALIGN, $TBSTYLE_WRAPABLE))
_GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_LARGE_COLOR) ; or $IDB_STD_SMALL_COLOR

; Add buttons
_GUICtrlToolbar_AddButton($hToolbar, $idNew, $STD_FILENEW)
_GUICtrlToolbar_AddButton($hToolbar, $idOpen, $STD_FILEOPEN)
_GUICtrlToolbar_AddButton($hToolbar, $idSave, $STD_FILESAVE)
    _GUICtrlToolbar_AddButtonSep($hToolbar)


_GUICtrlRebar_AddToolBarBand($hReBar, $hToolbar, "", -1, $RBBS_NOGRIPPER)

$hReBar2 = _GUICtrlRebar_Create($hgui, BitOR($CCS_TOP, $WS_BORDER, $RBS_VARHEIGHT, $RBS_AUTOSIZE ,$CCS_VERT))
; create a toolbar to put in the rebar
$hToolbar2 = _GUICtrlToolbar_Create($hgui, BitOR($TBSTYLE_FLAT, $CCS_NORESIZE, $CCS_NOPARENTALIGN, $TBSTYLE_WRAPABLE))
_GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_LARGE_COLOR) ; or $IDB_STD_SMALL_COLOR

; Add buttons
_GUICtrlToolbar_AddButton($hToolbar2, $new, $STD_FILENEW)
_GUICtrlToolbar_AddButton($hToolbar2, $miou, $STD_FILEOPEN)
_GUICtrlToolbar_AddButton($hToolbar2, $idSave, $STD_FILESAVE)
    _GUICtrlToolbar_AddButtonSep($hToolbar)
_GUICtrlToolbar_AddButton($hToolbar2, $idHelp2, $STD_HELP)

_GUICtrlRebar_AddToolBarBand($hReBar2, $hToolbar2, "", -1, $RBBS_NOGRIPPER)
GUISetState(@SW_SHOW)
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
Merci d'avance :!:

Re: [...] Double barre d'outil  

Posté : dim. 21 août 2016 10:40
par mimione
Hello
[J'ai regardé ça un peu vite]
Ligne 31: _GUICtrlToolbar_AddBitmap($hToolbar2, 1, -1, $IDB_STD_LARGE_COLOR) ; or $IDB_STD_SMALL_COLOR

(1er paramètre: $hToolbar2)

Re: [...] Double barre d'outil

Posté : dim. 21 août 2016 13:22
par Nicoloquinte
Nickel 8) :mrgreen:

merci beaucoup :D :D