Toolbar.Horiz="FALSE" seems not to work for Win32

Discuss GUI programming with the RapaGUI plugin here
Post Reply
ntromans
Posts: 54
Joined: Fri Jan 11, 2013 12:06 am

Toolbar.Horiz="FALSE" seems not to work for Win32

Post by ntromans »

I've just been cross-compiling an application from AROS to Win32. I wished for a vertical toolbar, and setting Horiz="FALSE" in the xml file worked fine for AROS but did not display the toolbar under Windows. The toolbar was rendered fine when left to the default horizontal.

Cheers,
Nigel.
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: Toolbar.Horiz="FALSE" seems not to work for Win32

Post by SamuraiCrow »

Why are there quotes around false? I thought False was a constant. If you pass a string instead of a constant, wouldn't that evaluate to True?
I'm on registered MorphOS using FlowStudio.
p-OS
Posts: 167
Joined: Mon Nov 01, 2010 11:56 pm

Re: Toolbar.Horiz="FALSE" seems not to work for Win32

Post by p-OS »

He is not talking about Hollywood Source Code, but the GUI definiton in the XML file... and there its is meant to be a string. Thus sems ok to me.
ntromans
Posts: 54
Joined: Fri Jan 11, 2013 12:06 am

Re: Toolbar.Horiz="FALSE" seems not to work for Win32

Post by ntromans »

p-OS wrote:He is not talking about Hollywood Source Code, but the GUI definiton in the XML file... and there its is meant to be a string. Thus sems ok to me.
Yes, this is from an XML file. So is the vertical mode working for you on Windows? If so, would you mind posting up your XML line so I can see what's not right with mine?

Thanks,
Nigel.
p-OS
Posts: 167
Joined: Mon Nov 01, 2010 11:56 pm

Re: Toolbar.Horiz="FALSE" seems not to work for Win32

Post by p-OS »

didn't user RapaGUI yet, but according to documentation correct Syntax is:

Code: Select all

<toolbar horiz="false">
 .....some buttons....
</toolbar>
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Toolbar.Horiz="FALSE" seems not to work for Win32

Post by airsoftsoftwair »

Works here. Please provide a minimal (!) code sample so that I can see what's wrong there...
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: Toolbar.Horiz="FALSE" seems not to work for Win32

Post by SamuraiCrow »

p-OS wrote:He is not talking about Hollywood Source Code, but the GUI definiton in the XML file... and there its is meant to be a string. Thus sems ok to me.
In that case, is it all lowercase? XML is case sensitive.
I'm on registered MorphOS using FlowStudio.
ntromans
Posts: 54
Joined: Fri Jan 11, 2013 12:06 am

Re: Toolbar.Horiz="FALSE" seems not to work for Win32

Post by ntromans »

airsoftsoftwair wrote:Works here. Please provide a minimal (!) code sample so that I can see what's wrong there...
Sorry for taking a while to get back to you.

The xml code is:

<?xml version="1.0" encoding="iso-8859-1"?>
<application>
<window title="SimpleWhiteboard" notify="closerequest" id="_MAIN" width="60" height="800" StayOnTop="TRUE" left="0" top="0">
<vgroup>
<toolbar id="toolbar" viewmode="Gfx" horiz="FALSE" userdata="draw">
<button id="add_workbench" type = "normal" icon="7" notify="pressed" notifydata="pressed:add_workbench"></button>
<button id="workbench" type="toggle" icon="4" disabled="TRUE" notify="selected" notifydata="selected:toggle_workbench"></button>
<button/>
<button id="add_display" type="normal" icon="5" notify="pressed" notifydata="pressed:add_display"></button>
<button/>
<button id="bin" type="normal" icon="6" notify="pressed" notifydata="pressed:bin" disabled="TRUE"></button>
</toolbar>
</vgroup>
</window>
</application>

Works find on AROS but on Windows 7 & 10 at work it just produces the window top border with a narrow line underneath the border's top bar.

Cheers,
Nigel.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Toolbar.Horiz="FALSE" seems not to work for Win32

Post by airsoftsoftwair »

Ok, so the toolbar on Win32 doesn't seem to impose a minimum size on the window. Thus, it is there, but you won't see it because there's nothing else in your window. To solve this, just add a rectangle to your code, i.e.:

Code: Select all

<?xml version="1.0" encoding="iso-8859-1"?>
<application>
<window title="SimpleWhiteboard" notify="closerequest" id="_MAIN" width="60" height="800" StayOnTop="TRUE" left="0" top="0">
<vgroup>
<toolbar id="toolbar" viewmode="Gfx" horiz="FALSE" userdata="draw">
<button id="add_workbench" type = "normal" icon="7" notify="pressed" notifydata="pressed:add_workbench"></button>
<button id="workbench" type="toggle" icon="4" disabled="TRUE" notify="selected" notifydata="selected:toggle_workbench"></button>
<button/>
<button id="add_display" type="normal" icon="5" notify="pressed" notifydata="pressed:add_display"></button>
<button/>
<button id="bin" type="normal" icon="6" notify="pressed" notifydata="pressed:bin" disabled="TRUE"></button>
</toolbar>
<rectangle/>
</vgroup>
</window>	
</application>
Then it should work.
ntromans
Posts: 54
Joined: Fri Jan 11, 2013 12:06 am

Re: Toolbar.Horiz="FALSE" seems not to work for Win32

Post by ntromans »

Many thanks - I'll give that a try at work tomorrow (if I get a couple of minutes).

Cheers,
Nigel.
Post Reply