Page 1 of 1

size of elements

Posted: Mon Apr 19, 2021 8:00 pm
by El_isra
my GUI looses it's proportion on other machines.
I already know i Have to use Sizers, but i dont know wich one's to use, or how to use them ( i haven't found any tutorial yet)
i'm using codeblocks to manage the project.
could you point me into a tutorial or guide on how to use them properly?

Re: size of elements

Posted: Mon Apr 19, 2021 8:03 pm
by doublemax
I think this is a good introduction to understand the basic concept behind sizers:
http://neume.sourceforge.net/sizerdemo/

Re: size of elements

Posted: Tue Apr 20, 2021 12:33 pm
by El_isra
sizers only work for element layout?
some users reported some buttons and text become bigger.

Re: size of elements

Posted: Tue Apr 20, 2021 1:56 pm
by doublemax
El_isra wrote:
Tue Apr 20, 2021 12:33 pm
sizers only work for element layout?
Yes.
El_isra wrote:
Tue Apr 20, 2021 12:33 pm
some users reported some buttons and text become bigger.
No, sizers don't do that.

Re: size of elements

Posted: Wed Apr 21, 2021 1:38 pm
by El_isra
i got the answer!
it seems that the default Font configuration used by Code::Blocks Wizard for wxWidgets projects caused the issue.
setting a custom font & size for every frame & dialog solved the bug.

Re: size of elements

Posted: Wed Apr 21, 2021 5:41 pm
by ONEEYEMAN
Hi,
You definitely should be using sizers and not trying to tweak the font/size unless absolutely necessary.

As doublemax said - sizers are doing layout for you.

In the beginning it is better to have some RAD tool to create GUI (if you don't use C::B/CodeLite, you can use wxGlade), then look at the generated code.

You will thank people in the long run for creating a layouts that will be working independently of resolution, OS, theme and any defaults there is.

Thank you.