Re: ATTN Derek: ReBar issues

new topic     » goto parent     » topic index » view thread      » older message » newer message

> Date: 2004 Nov 9 7:32
> From: Greg Haberek <ghaberek at gmail.com>
> Subject: ATTN Derek: ReBar issues
> 
> Derek,
> 
>     I hate to draw you away from the contest (although with all the
> submissions, maybe you need it), but I'm having an issue with ReBars.
> 
>     I can create a ReBar and plenty of ReBarBands no problem. But when
> I add a control to a ReBarBand, it likes to fill the while ReBarBand.
> And when I try to put multiple controls in a ReBarBand, the last one
> fills the ReBarBand, and any caption I may have set for the control is
> set as the caption of the ReBarBand.
> 
>     This is very troubling, as I *know* this worked several versions
> ago, and I liked using ReBarBands. Now that I have a reason to use
> them, I can't! Help!
> 
>     Here's a demo of my problem:
> }}}
<eucode>
> include Win32Lib.ew
> 
> constant
>     Main = create( Window, "Test", 0, Default, Default, 640, 480, 0 ),
> 
>     bar = create( ReBar, "", Main, 0, 0, 0, 34, 0 ),
>     band1 = create( ReBarBand, "band1", bar, 0, 0, 0, 0, 0 ),
>     btn1 = create( PushButton, "btn1", bar, 0, 0, 30, 30, 0 ),
>     btn2 = create( PushButton, "btn2", bar, 0, 0, 30, 30, 0 )
> 
>     addToBand( btn1, band1 )
>     addToBand( btn2, band1 )
> 
>     WinMain( Main, Normal )
> </eucode>
{{{


Ok, I finally worked this one out. Sorry for the delay. 
It appears that the rightmost control in a rebarband is automatically
extended to the right edge of the window.

To get around this behaviour, you need to do this ...

include Win32Lib.ew
without warning

constant 
    Main = create( Window, "Test", 0, Default, Default, 640, 480, 0 ),
    bar = create( ReBar, "", Main, 0, 0, 0, 34, 0 ),
    band1 = create( ReBarBand, "band1", bar, 0, 0, 0, 0, 0 ),
    tb = create(ToolBar, "", bar, 0,0, 0, 34, 0),
    btn1 = create( PushButton, "btn1", tb, 0, 0, 30, 30, 0 ),
    btn2 = create( PushButton, "btn2", tb, 35, 0, 30, 30, 0 )

addToBand( tb, band1)

WinMain( Main, Normal )


So you actually place a toolbar in the rebarband and then put the 
buttons into toolbar.

-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu