Author Topic: This is for anyone who makes a new dialog box in C::B  (Read 7952 times)

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
This is for anyone who makes a new dialog box in C::B
« 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
« Last Edit: December 16, 2005, 02:01:21 am by 280Z28 »
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: This is for anyone who makes a new dialog box in C::B
« Reply #1 on: December 15, 2005, 05:27:49 pm »
Why not use this->CenterOnParent()? It is nicer when you don't use C::B maximized... ;)
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: This is for anyone who makes a new dialog box in C::B
« Reply #2 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.
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool:

Offline 280Z28

  • Regular
  • ***
  • Posts: 397
  • *insert unicode here*
Re: This is for anyone who makes a new dialog box in C::B
« Reply #3 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. :)
78 280Z, "a few bolt-ons" - 12.71@109.04
99 Trans Am, "Daily Driver" - 525rwhp/475rwtq
 Check out The Sam Zone :cool: