I faced the following: on different systems the default font is different, so texts are often too big for my fix-sized buttons (I absolutely need them to be fixed sized). I tried to set the font (with setFont) of my main frame but it doesnt work, I mean, if I modify font size to 6pt nothing changes. (I thought that cause of parent-children relationship between widgets all of them will have the same text size)
Another problem: how should I use sizers and spacers to achieve the following:
- if there is enough space the spacers reserve the space according to their width/height (and keep the widgets positioned "far" from each other)
- if there is no space (e.g. the screen / resolution is not big enough) the spacers decrease the space allocated to them (e.g. decrease their height/width)
(another question: if there are no spacers / no space between widgets, but the widgets are still too big, what can I do to make my application usable? I cant really decrease the size of my widgets, but I scroll bar appearing on the right/left side of my app would be also a solution).
Sizes of application components
- eranon
- Can't get richer than this
- Posts: 867
- Joined: Sun May 13, 2012 11:42 pm
- Location: France
- Contact:
Re: Sizes of application components
About sizers (and spacers), maybe you should relay on a good (I mean "good for you" ; everyone having his own requirements) UI designer tool which will grandly ease the sizer concept for you. On my side, I'm using wxSmith which is a Code::Blocks's plugin (codeblock being the IDE I use)... This way I just have to understand the wxSmith spirit and adjust settings through its properties grid.
Known GUI builders are listed here : http://wiki.wxwidgets.org/Tools#Rapid_A ... I_Builders.
Known GUI builders are listed here : http://wiki.wxwidgets.org/Tools#Rapid_A ... I_Builders.
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Re: Sizes of application components
That should work, but you must set the font size of the parent before you create the children.I tried to set the font (with setFont) of my main frame but it doesnt work, I mean, if I modify font size to 6pt nothing changes. (I thought that cause of parent-children relationship between widgets all of them will have the same text size)
Use the source, Luke!
Re: Sizes of application components
With wxErlang there is no way to use such a tool like wxSmith, I have to do everything from code. :S
- T-Rex
- Moderator
- Posts: 1204
- Joined: Sat Oct 23, 2004 9:58 am
- Location: Zaporizhzhya, Ukraine
- Contact:
Re: Sizes of application components
You probably could use DialogBlocks, it can generate XRC and then you will just load layout from XRC in your code.