Show dialogue centre screen, not centre parent? 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
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

Show dialogue centre screen, not centre parent?

Post by philjynx »

I have a dialogue which is larger than it's parent, so when it displays, part of it is off screen at the bottom as it appears to be vertically centred on parent, which is shown full screen.
Is there a simple way to display a dialogue screen centred?
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: Show dialogue centre screen, not centre parent?

Post by PB »

CentreOnScreen method does not work as expected? Which platform is it?
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

Re: Show dialogue centre screen, not centre parent?

Post by philjynx »

I haven't found centreofscreen method! Thanks, I'll look for it.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: Show dialogue centre screen, not centre parent?

Post by PB »

You misread my post, it's CentreOnScreen, inherited from wxTopLevelWindow: http://docs.wxwidgets.org/trunk/classwx ... 9e43b03c29
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

Re: Show dialogue centre screen, not centre parent?

Post by philjynx »

PB wrote:You misread my post, it's CentreOnScreen, inherited from wxTopLevelWindow: http://docs.wxwidgets.org/trunk/classwx ... 9e43b03c29
Read it on phone in sunlight with poor eyesight!
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

Re: Show dialogue centre screen, not centre parent?

Post by philjynx »

After a bit of faffing about I found that this->CenterOnScreen() executed last (after Fit()ing and Layout()ing) did the trick. Thank you.
Post Reply