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

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

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

Post by ntromans » Mon Apr 24, 2017 9:32 pm

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: 154
Joined: Fri May 15, 2015 5:15 pm
Location: Ft. Collins, Colorado USA

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

Post by SamuraiCrow » Tue Apr 25, 2017 3:01 pm

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?

p-OS
Posts: 89
Joined: Tue Nov 02, 2010 12:56 am

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

Post by p-OS » Tue Apr 25, 2017 5:34 pm

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: 30
Joined: Fri Jan 11, 2013 1:06 am

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

Post by ntromans » Tue Apr 25, 2017 10:50 pm

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: 89
Joined: Tue Nov 02, 2010 12:56 am

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

Post by p-OS » Wed Apr 26, 2017 12:41 am

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: 2531
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

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

Post by airsoftsoftwair » Wed Apr 26, 2017 8:34 pm

Works here. Please provide a minimal (!) code sample so that I can see what's wrong there...

SamuraiCrow
Posts: 154
Joined: Fri May 15, 2015 5:15 pm
Location: Ft. Collins, Colorado USA

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

Post by SamuraiCrow » Thu Apr 27, 2017 6:30 pm

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.

ntromans
Posts: 30
Joined: Fri Jan 11, 2013 1:06 am

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

Post by ntromans » Tue May 16, 2017 7:29 pm

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: 2531
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

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

Post by airsoftsoftwair » Thu May 18, 2017 10:55 pm

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: 30
Joined: Fri Jan 11, 2013 1:06 am

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

Post by ntromans » Tue May 23, 2017 11:12 pm

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

Cheers,
Nigel.

Post Reply