Author Topic: Debugger branch: Placement of Windows  (Read 34433 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Debugger branch: Placement of Windows
« on: January 17, 2012, 04:30:39 pm »
There is another issue, see the screen shot:

Is it possible to show at least the "OK" button. (move the dialog a little UP)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Debugger branch: Placement of Windows
« Reply #1 on: January 18, 2012, 02:51:28 am »
ollydbg: I don't get what is your problem? As far as I know the newly shown windows are not placed by C::B, but by your Explorer.exe.
I mean that when the debugger setting dialog is shown, can you make it centered on the screen?
I just test the compiler setting dialog, it shows centered which looks fine to me.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Debugger branch: Placement of Windows
« Reply #2 on: January 18, 2012, 08:40:56 am »
ollydbg: you'll have to debug it yourself, because here it works as intended, but I'm running bigger screens than yours (1600x1200 and 1920x1080). The code for compiler settings and debugger settings is pretty much the same. The only difference is that the Compiler settings are created from xrc resource, but debugger settings are created with wxSmith.

Morten: I wouldn't be surprised if the wx guys have messed the API, once again. But I'll be happy if you take some time and try to find the real cause for the problem.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Debugger branch: Placement of Windows
« Reply #3 on: January 18, 2012, 01:50:52 pm »
ollydbg: you'll have to debug it yourself, because here it works as intended, but I'm running bigger screens than yours (1600x1200 and 1920x1080). The code for compiler settings and debugger settings is pretty much the same. The only difference is that the Compiler settings are created from xrc resource, but debugger settings are created with wxSmith.
I just debug it myself, and please add one line statement to fix this issue.

Code
Center();

In the end of function body, in file: src\debuggersettingsdlg.cpp around line 108.
Code
DebuggerSettingsDlg::DebuggerSettingsDlg(wxWindow* parent) 
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Debugger branch: Placement of Windows
« Reply #4 on: January 18, 2012, 02:17:57 pm »
In fact looking at the code of Compiler settings the correct function should be CenterOnParent(). I will add it...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Debugger branch: Placement of Windows
« Reply #5 on: January 18, 2012, 02:56:04 pm »
In fact looking at the code of Compiler settings the correct function should be CenterOnParent(). I will add it...
I believe there is a C::B API (PlaceWindow, IIRC) that should do this gracefully, also on Multi-Monitor systems...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Debugger branch: Placement of Windows
« Reply #6 on: January 18, 2012, 03:09:43 pm »
Yes, I know and I use it, but it seems that it doesn't work.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Debugger branch: Placement of Windows
« Reply #7 on: January 18, 2012, 03:48:38 pm »
It seems to work here (debian 64bit) with wx 2.8.12 .

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Debugger branch: Placement of Windows
« Reply #8 on: January 18, 2012, 09:09:13 pm »
PlaceWindow might be broken on Windows, because it uses some win32 api stuff.
Someone should debug it to see what is going on.


@admins: Can you extract the related posts in a separate topic, because they are not related to the debugger:)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger branch: Placement of Windows
« Reply #9 on: January 18, 2012, 10:31:35 pm »
ollydbg: Can you try in a trunk version to remove the CenterToParent call in the Compiler dialog and to see if it places the dialog at the center of the screen?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger branch: Placement of Windows
« Reply #10 on: January 19, 2012, 02:01:28 am »
ollydbg: Can you try in a trunk version to remove the CenterToParent call in the Compiler dialog and to see if it places the dialog at the center of the screen?
I just test it by removing "CentreOnParent();" in the line 104 of cb_trunk\src\src\compilersettingsdlg.cpp.
The result is: dialog does NOT show on the center of the parent window.

PS: CentreOnParent() function works OK on my WinXP without any problem. (wx2.8.12)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Debugger branch: Placement of Windows
« Reply #11 on: January 19, 2012, 06:33:57 am »
ollydbg: Can you try in a trunk version to remove the CenterToParent call in the Compiler dialog and to see if it places the dialog at the center of the screen?
I just test it by removing "CentreOnParent();" in the line 104 of cb_trunk\src\src\compilersettingsdlg.cpp.
The result is: dialog does NOT show on the center of the parent window.

PS: CentreOnParent() function works OK on my WinXP without any problem. (wx2.8.12)
What are your settings in "Settings -> View" for Multimonitor placement ?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger branch: Placement of Windows
« Reply #12 on: January 19, 2012, 07:01:54 am »
ollydbg: Can you try in a trunk version to remove the CenterToParent call in the Compiler dialog and to see if it places the dialog at the center of the screen?
I just test it by removing "CentreOnParent();" in the line 104 of cb_trunk\src\src\compilersettingsdlg.cpp.
The result is: dialog does NOT show on the center of the parent window.

PS: CentreOnParent() function works OK on my WinXP without any problem. (wx2.8.12)
What are your settings in "Settings -> View" for Multimonitor placement ?
Unchecked. (I do not have multi monitors, I have never changed this option, so it is by default)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Debugger branch: Placement of Windows
« Reply #13 on: January 19, 2012, 07:50:10 am »
ollydbg: Can you try in a trunk version to remove the CenterToParent call in the Compiler dialog and to see if it places the dialog at the center of the screen?
I just test it by removing "CentreOnParent();" in the line 104 of cb_trunk\src\src\compilersettingsdlg.cpp.
The result is: dialog does NOT show on the center of the parent window.

PS: CentreOnParent() function works OK on my WinXP without any problem. (wx2.8.12)
What are your settings in "Settings -> View" for Multimonitor placement ?
Unchecked. (I do not have multi monitors, I have never changed this option, so it is by default)
If the Multimonitor placement checkbox  is unchecked and PlaceWindow() is not called with the third parameter set to true (defaults to false), it does nothing.
See sdk/globals.cpp:1017 .

That is obviously not the best way to implement it (or more exactly) the name is misleading).

You can call PlaceWindow with pdlCentre as second and true as third parameter to enforce placing the window (more or less) regardless the settings in "Settings -> View" .

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger branch: Placement of Windows
« Reply #14 on: January 19, 2012, 08:48:36 am »
So, what should we/I do to fix this problem? Use both functions?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]