Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: 280Z28 on December 15, 2005, 06:34:21 am

Title: This is for anyone who makes a new dialog box in C::B
Post by: 280Z28 on December 15, 2005, 06:34:21 am
In the dialog class contructor, after calling LoadDialog() you should call this function. I placed the call right before returning from the constructor where possible for consistency.

Code
PositionUserDialog(this);

This will position the dialog where the user has requested it be placed. PositionUserDialog is declared in <sdk/xtra_classes.h>, or you can just include <sdk/sdk.h>

The full discussion leading to this decision is here:

http://forums.codeblocks.org/index.php?topic=1640.0

I fixed all the existing cases and posted a patch but it is up to you to add this line if you make a new dialog from here on out. :)

 8)

Sam
Title: Re: This is for anyone who makes a new dialog box in C::B
Post by: David Perfors on December 15, 2005, 05:27:49 pm
Why not use this->CenterOnParent()? It is nicer when you don't use C::B maximized... ;)
Title: Re: This is for anyone who makes a new dialog box in C::B
Post by: 280Z28 on December 15, 2005, 05:29:30 pm
Why not use this->CenterOnParent()? It is nicer when you don't use C::B maximized... ;)

They do exactly the same thing with the exception of dialogs that don't have a parent.
Title: Re: This is for anyone who makes a new dialog box in C::B
Post by: 280Z28 on December 16, 2005, 02:00:56 am
Please read the first post again. It has been changed based on the discussion between thomas and I. :)