Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » How to center the top most window?
How to center the top most window? [message #30001] Thu, 02 December 2010 15:09 Go to next message
JoseB is currently offline  JoseB
Messages: 37
Registered: March 2009
Member
Is there a method to center de top most window?

Thank you.

JoseB
Re: How to center the top most window? [message #30003 is a reply to message #30001] Thu, 02 December 2010 15:21 Go to previous messageGo to next message
unknown user
The window get centred if x, y parameters of SetRect are 0.

// Example: 
win.SetRect(0, 0, 640, 480); // or in constructor
Re: How to center the top most window? [message #30004 is a reply to message #30003] Thu, 02 December 2010 15:32 Go to previous messageGo to next message
JoseB is currently offline  JoseB
Messages: 37
Registered: March 2009
Member
in constructor I made this:

Rect r=GetRect();
SetRect(0, 0, r.right - r.left, r.bottom - r.top);

and the window is shown in the 0,0 coordinates. I want to center it in the screen

JoseB
Re: How to center the top most window? [message #30005 is a reply to message #30004] Thu, 02 December 2010 15:42 Go to previous messageGo to next message
unknown user
JoseB wrote on Thu, 02 December 2010 15:32

in constructor I made this:

Rect r=GetRect();
SetRect(0, 0, r.right - r.left, r.bottom - r.top);

and the window is shown in the 0,0 coordinates. I want to center it in the screen

JoseB

CenterScreen(); after SetRect(..) would do that.
Re: How to center the top most window? [message #30006 is a reply to message #30005] Thu, 02 December 2010 15:59 Go to previous messageGo to next message
JoseB is currently offline  JoseB
Messages: 37
Registered: March 2009
Member
Ok...
I cant do that in constructor.
I have to create a now method called wjen the windows already exists...


Thank you

Jose B
Re: How to center the top most window? [message #30007 is a reply to message #30006] Thu, 02 December 2010 17:40 Go to previous message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello JoseB

By default TopWindow is centered the first time it is opened, so it is not necessary to re-center it in constructor.

Could you give more details?.


Best regards
IƱaki
Previous Topic: NEW: LogPosCtrl, for editing LogPos of a Ctrl
Next Topic: Push button by keystroke (without ALT)
Goto Forum:
  


Current Time: Fri Mar 29 14:26:22 CET 2024

Total time taken to generate the page: 0.01001 seconds