Home » Community » Newbie corner » Switch Control
Re: Switch Control, always displayed horizontaly [message #30107 is a reply to message #30105] |
Thu, 09 December 2010 13:08   |
|
ratah wrote on Thu, 09 December 2010 12:32 | Hi everybody,
I want to arrange swich items in my manner. How to do I can't!!
Thank you
|
Hi Ratah,
The switch widget chooses between vertical and horizontal layout based on its size. If you make it tall and narrow it will be vertical, if you make it short and wide it will became horizontal. Changing the size of the widget at runtime (e.g. when the layout is resized), will recompute the best layout as well.
In case you are looking for way how to manage this manually, or for some more complex layouts like columns, then I'm afraid there is no such thing in Switch. You could of course derive your own widget based on Switch - the only thing you would have to override is the Paint() method. It should be quite easy, have a look at CtrlLib/Switch.cpp, line 152. It is only ~50 lines of code, most of which could be reused.
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Mon Jun 09 08:35:25 CEST 2025
Total time taken to generate the page: 0.03371 seconds
|