Any way to arrange Radio Buttons horizontal?

10 posts / 0 new
Last post
ktadd
ktadd's picture
Offline
Last seen: 8 months 2 weeks ago
Joined: 2010-12-01 01:20
Any way to arrange Radio Buttons horizontal?

Is there any way to arrange Radio Buttons in a horizontal configuration?
I couldn't find a tag for it.

If not guess I'll have to resort to checkboxes and handle the interaction manually.

jabirulo
jabirulo's picture
Offline
Last seen: 2 weeks 4 days ago
Joined: 2013-05-30 00:53
Re: Any way to arrange Radio Buttons horizontal?

AFAIK no, radiobutton.gadget is vertical.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

hypex
hypex's picture
Offline
Last seen: 2 months 1 week ago
Joined: 2011-09-09 16:20
Re: Any way to arrange Radio Buttons horizontal?

So, in the layout group, does the default LAYOUT_ORIENT_HORIZ not lay them across?

trixie
trixie's picture
Offline
Last seen: 5 months 3 weeks ago
Joined: 2011-02-03 13:58
Re: Any way to arrange Radio Buttons horizontal?

@hypex

So, in the layout group, does the default LAYOUT_ORIENT_HORIZ not lay them across?

No. LAYOUT_ORIENT_HORIZ will order objects within the given layout group horizontally, but the radiobuttons will stay vertical. The gadget is programmed that way. Horizontal buttons are not supported.

AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2

hypex
hypex's picture
Offline
Last seen: 2 months 1 week ago
Joined: 2011-09-09 16:20
Re: Any way to arrange Radio Buttons horizontal?

@trixie

No. LAYOUT_ORIENT_HORIZ will order objects within the given layout group horizontally, but the radiobuttons will stay vertical. The gadget is programmed that way. Horizontal buttons are not supported.

Actually, I thought that was what the question was about. Laying out the radio gadgets across. Looking at AmigaInput, GUI and Notifications, they all layout radio gadgets across.

So, the question was really about the radio list opening up across the window horizontally? I've never head of it! That would take up more space across the screen and need the mouse to be dragged more! :-D

Also, I'm still getting my head around this layout gadget. So all I read says the window needs one before all other gadgets, making it look like a Gadtool context gadget. Makes me wonder why it isn't added by the class then. But, I wonder what happens then if you want to layout gadgets in a group in different directions? It makes sense that each layout group has its own layout gadget, but I also read somewhere that one layout gadget controls the whole window and there aren't separate gadgets like in Intuition. So this all still looks confusing. :-)

OldFart
OldFart's picture
Offline
Last seen: 2 weeks 5 min ago
Joined: 2010-11-30 14:09
Re: Any way to arrange Radio Buttons horizontal?

@hypex

Also, I'm still getting my head around this layout gadget. So all I read says the window needs one before all other gadgets, making it look like a Gadtool context gadget. Makes me wonder why it isn't added by the class then. But, I wonder what happens then if you want to layout gadgets in a group in different directions? It makes sense that each layout group has its own layout gadget, but I also read somewhere that one layout gadget controls the whole window and there aren't separate gadgets like in Intuition. So this all still looks confusing. :-)

One sure way to mitigate this matter is to write your own macro to do just that and Bob's your uncle.

OldFart

trixie
trixie's picture
Offline
Last seen: 5 months 3 weeks ago
Joined: 2011-02-03 13:58
Re: Any way to arrange Radio Buttons horizontal?

@hypex

So, the question was really about the radio list opening up across the window horizontally? I've never heard of it! That would take up more space across the screen and need the mouse to be dragged more!

Horizontally laid-out radiobuttons are common in GUI toolkits but they of course come with a limitation: the button strings must be short so that the gadget doesn't grow too wide.

Also, I'm still getting my head around this layout gadget. So all I read says the window needs one before all other gadgets, making it look like a Gadtool context gadget.

A "ReAction window" (i.e. a window created via ReAction's window.class) usually has a "parent layout" gadget, which is added via the WINDOW_Layout tag (previously named WINDOW_ParentGroup, but that name is now deprecated). If this is the case, all GUI objects in the window will be positioned (laid out) and sized by ReAction.

Makes me wonder why it isn't added by the class then.

The window.class doesn't create the parent layout gadget automatically for you because you don't have to have a parent layout: you can easily get the window created by the window.class, and then you can add and control your gadgets yourself as if you're working with a standard Intuition window. But of course you lose all the advantages such as automatic (re)positioning, (re)scaling, and font-sensitivity.

I wonder what happens then if you want to layout gadgets in a group in different directions?

You can have as many (sub)layouts in a ReAction window as you want, each with a different orientation (vertical or horizontal). The fact that the parent layout is, say, vertical doesn't mean that all objects within the window have to be arranged vertically. You can mix and match vertical and horizontal object groups at will. Like this, for example:

Parent layout (vertical)
--- Sub-layout 1 (horizontal)
------- Object 1 Object 2 Object 3
--- Sub-layout 2 (vertical)
------- Object 1
------- Object 2
------- Object 3

I'm sure you get the idea.

I also read somewhere that one layout gadget controls the whole window and there aren't separate gadgets like in Intuition.

The parent layout gadget does control the whole window (as I said above), but of course there are separate gadgets: only they are added as child objects to the respective layout object (gadget).

AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2

hypex
hypex's picture
Offline
Last seen: 2 months 1 week ago
Joined: 2011-09-09 16:20
Re: Any way to arrange Radio Buttons horizontal?

@trixie

Horizontally laid-out radiobuttons are common in GUI toolkits but they of course come with a limitation: the button strings must be short so that the gadget doesn't grow too wide.

That would make sense. I suppose I haven't noticed any. Or didn't take any notice.

The window.class doesn't create the parent layout gadget automatically for you because you don't have to have a parent layout: you can easily get the window created by the window.class, and then you can add and control your gadgets yourself as if you're working with a standard Intuition window. But of course you lose all the advantages such as automatic (re)positioning, (re)scaling, and font-sensitivity.

I'd say it might be harder as well using window.class to manage a basic window. Like a library needing an interface you need to open window.class before you can open the window. But I can see why the layout is needed as it's implemented as a gadget and allows to customise it which would be limited if a default layout was included.

You can have as many (sub)layouts in a ReAction window as you want, each with a different orientation (vertical or horizontal). The fact that the parent layout is, say, vertical doesn't mean that all objects within the window have to be arranged vertically. You can mix and match vertical and horizontal object groups at will. Like this, for example:

I can see the layout acts as a container and is the bridge to arranging all the gadget layouts. Including placement of those to the right as well as to the bottom so it's all organised in layouts that place objects across or down. Also, a layout group, with a label and box is the easiest way to visualise it I find. But the hidden ones control overall gadget placement that isn't always obvious to the naked eye.

I'm sure you get the idea.

Yes it does explain how it all stacks up. :-)

The parent layout gadget does control the whole window (as I said above), but of course there are separate gadgets: only they are added as child objects to the respective layout object (gadget).

And all with different options to configure. But that's another subject as well. Thanks for the information.

trixie
trixie's picture
Offline
Last seen: 5 months 3 weeks ago
Joined: 2011-02-03 13:58
Re: Any way to arrange Radio Buttons horizontal?

@hypex

I'd say it might be harder as well using window.class to manage a basic window.

It would definitely be overkill to use window.class to create a basic Intuition window in which you don't plan to use ReAction layouting. I'm just saying it's possible :-)

To give you an example of real-life use: if I were developing a music sequencer, I'd implement the main sequencer window (containing the timeline with events) as a basic Intuition window because it would contain a lot of custom imagery I can't easily draw from BOOPSI gadgets: the drawing and redrawing of the window would be unnecessarily slow because BOOPSI comes with an overhead that stems from constant message passing. On the other hand, I would implement all other windows in the sequencer (such as program settings and various auxiliary windows) using the window.class because of the undisputable benefits ReAction brings for window creation and layouting.

AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2

hypex
hypex's picture
Offline
Last seen: 2 months 1 week ago
Joined: 2011-09-09 16:20
Re: Any way to arrange Radio Buttons horizontal?

@trixie.

I can see what you mean by your example. It would be handy to have the best of both worlds and have full control when needed. While using a consistent API.

Log in or register to post comments