Sign in to follow this  
Followers 0
Kip

Add multiple controls to rebar band?

10 posts in this topic

hey,

I'm exploring the new functions of autoit 3.2.10, but...

How can i add multiple controls to a Rebar band?

I know how to add buttons, but thats it. Thats the only object i can create with the toolbar UDF

Now I wanna create, lets say: 2 Combos, and 1 button in one band.

is it possible?

thnx, chicken in a bucket :P

(I thought something like this, but that creates 3 different bands:)

#include <GUIConstants.au3>
#include <GuiReBar.au3>


$GUI = Guicreate("Rebar Example",800,400)

$Bar = _GUICtrlReBar_Create($GUI,$CCS_TOP)

$Fonts = GUICtrlCreateCombo("Times new Roman",0,0,100,20)
$Size = GUICtrlCreateCombo("",0,0,30,20)
GUICtrlSetData(-1,"6|8|9|10|11|12|14|16|18|20|24|36|48|72","12")
$SetFont = GUICtrlCreateButton("Set",0,0,30,20)

_GUICtrlReBar_AddBand($Bar, $Fonts, 120, 300, "Font")
_GUICtrlReBar_AddBand($Bar, $Size, 120, 300, "Size")
_GUICtrlReBar_AddBand($Bar, $SetFont, 120, 300, "")

GUISetState()


While 1
     if GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
WEnd

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

This contains multiple controls.

Maybe i should ask the question on a different way; How can i add multiple controls to a toolbar

$hReBar = _GUICtrlReBar_Create($hgui, $CCS_TOP)
$hToolbar = _GUICtrlToolBar_Create($hgui)
_GUICtrlToolbar_AddButton($hToolbar, $idNew, $STD_FILENEW)
_GUICtrlToolbar_AddButton($hToolbar, $idOpen, $STD_FILEOPEN)
_GUICtrlToolbar_AddButton($hToolbar, $idSave, $STD_FILESAVE)
_GUICtrlToolbar_AddButtonSep($hToolbar)
_GUICtrlToolbar_AddButton($hToolbar, $idHelp, $STD_HELP)
    
_GUICtrlReBar_AddToolBarBand($hReBar, $hToolbar, "", 0)
Edited by kip

Share this post


Link to post
Share on other sites

This contains multiple controls.

Maybe i should ask the question on a different way; How can i add multiple controls to a toolbar

$hReBar = _GUICtrlReBar_Create($hgui, $CCS_TOP)
$hToolbar = _GUICtrlToolBar_Create($hgui)
_GUICtrlToolbar_AddButton($hToolbar, $idNew, $STD_FILENEW)
_GUICtrlToolbar_AddButton($hToolbar, $idOpen, $STD_FILEOPEN)
_GUICtrlToolbar_AddButton($hToolbar, $idSave, $STD_FILESAVE)
_GUICtrlToolbar_AddButtonSep($hToolbar)
_GUICtrlToolbar_AddButton($hToolbar, $idHelp, $STD_HELP)
    
_GUICtrlReBar_AddToolBarBand($hReBar, $hToolbar, "", 0)
Adding buttons to a toolbar and adding controls to a rebar band are 2 totally different things.

You can create multiple toolbars, and add each one to a seperate band.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Adding buttons to a toolbar and adding controls to a rebar band are 2 totally different things.

not "totally" different things

if you can add multiple controls to a toolbar, then you can add that toolbar to a band (_GUICtrlRebar_AddToolBarBand)

Share this post


Link to post
Share on other sites

not "totally" different things

if you can add multiple controls to a toolbar, then you can add that toolbar to a band (_GUICtrlRebar_AddToolBarBand)

Yes totally different, the reason for a function like _GUICtrlRebar_AddToolBarBand is it does some calculations for you so you don't have to figure out where the band should end.

You can still only add 1 control per band.

From MSDN

About Rebar Controls

Rebar controls act as containers for child windows. An application assigns child windows, which are often other controls, to a rebar control band. Rebar controls contain one or more bands, and each band can have any combination of a gripper bar, a bitmap, a text label, and a child window. However, bands cannot contain more than one child window.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0