size of elements Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
El_isra
Experienced Solver
Experienced Solver
Posts: 50
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

size of elements

Post 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?
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: size of elements

Post by doublemax »

I think this is a good introduction to understand the basic concept behind sizers:
http://neume.sourceforge.net/sizerdemo/
Use the source, Luke!
El_isra
Experienced Solver
Experienced Solver
Posts: 50
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Re: size of elements

Post by El_isra »

sizers only work for element layout?
some users reported some buttons and text become bigger.
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: size of elements

Post 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.
Use the source, Luke!
El_isra
Experienced Solver
Experienced Solver
Posts: 50
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

Re: size of elements

Post 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.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: size of elements

Post 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.
Post Reply