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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Debugger branch: Placement of Windows
« Reply #30 on: April 16, 2012, 02:23:15 pm »
BTW, notice that the PlaceWindow method uses "pdlBest" as default argument for the method. So unless its really provided/enforced by the caller, the following code:
Code
    if (mode == pdlBest)
        the_mode = cfg->ReadInt(_T("/dialog_placement/dialog_position"), (int) pdlCentre);
    else
        the_mode = (int) mode;
...makes sure that the method does the right thing which is "centre" by default unless the user said different, as you see. So if there is no good reason you should always call PlaceWindow without additional argument.
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger branch: Placement of Windows
« Reply #31 on: April 17, 2012, 08:32:34 am »
So if there is no good reason you should always call PlaceWindow without additional argument.
You mean we should always do like below (call PlaceWindow() with only first parameter)
Code
     CompilerSettingsDlg dlg(this);
     PlaceWindow(&dlg);

In this case, If I would like place dlg in the center of the screen. I need to check on both:
View->Enhance multi-monitor dialog place and Move to "head up" position. Otherwise, the dialog place badly as my original post in this discussion thread.

That's not intuitive, because I work on a Single monitor Laptop.

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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Debugger branch: Placement of Windows
« Reply #32 on: April 17, 2012, 08:50:08 am »
That's not intuitive, because I work on a Single monitor Laptop.
But that's what PlaceWindow is for. If you want to change the default behaviour of of dialogs you should position them in their constructor before calling PlaceWindow. PlaceWindow IMHO is only for multi-monitor placement.
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger branch: Placement of Windows
« Reply #33 on: April 17, 2012, 09:14:08 am »
That's not intuitive, because I work on a Single monitor Laptop.
But that's what PlaceWindow is for. If you want to change the default behaviour of of dialogs you should position them in their constructor before calling PlaceWindow. PlaceWindow IMHO is only for multi-monitor placement.
Ok, I presume that those two options should not be selected.
But if I do not select both, the dialog position is too bad. see the screen shot of my whole screen.

I even can't see the buttons of the dialog. This is the same behavior in both Windows and Ubuntu 10.10.
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Debugger branch: Placement of Windows
« Reply #34 on: April 17, 2012, 09:22:25 am »
I even can't see the buttons of the dialog. This is the same behavior in both Windows and Ubuntu 10.10.
That's why I said its an improper design of the dialog itself then. the constructor should make everything needed/possible to properly position the dialog initially. Then PlaceWindow may adjust it to the users needs in case of multiple monitors.

For the debugger settings pane I see two drawbacks in its contructor:
1.) its wxSmith based, but sets:
Code
	SetMinSize(wxSize(600, 600));
SetSize(wxSize(600, 600));
manually -> no good style.
2.) it does not center itself on the parent (if any).

Both should be adjusted using wxSmith. Than you should be happy.

The same applies to all other dialogs that do not behave / position correctly.
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
Re: Debugger branch: Placement of Windows
« Reply #35 on: April 17, 2012, 10:00:06 am »
Sorry, but these two calls are needed in order to make the dialog large enough and they are there because a bug/missing feature of wxSmith.
The missing feature/bug is that wxSmith adds the setsize/setminsize, right after the creation of the dialog and thus they are useless and doesn't enforce the minimal size.

If you know how to make it work show patches, I do not.
(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
Re: Debugger branch: Placement of Windows
« Reply #36 on: April 17, 2012, 01:27:15 pm »
If you know how to make it work show patches, I do not.
Well surely you should not adjust the min-size flag of the dialog (this is useless most of the time), but the controls on the dialog, that are too small - such as the wxTreeBook.

If I set the min-size of the wxTreeBook (and only that flag, otherwise you screw sizing) to e.g. 500x500 using wxSmith it works just fine.
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
Re: Debugger branch: Placement of Windows
« Reply #37 on: April 17, 2012, 02:19:41 pm »
Can I see a patch?
(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
Re: Debugger branch: Placement of Windows
« Reply #38 on: April 17, 2012, 04:59:28 pm »
Can I see a patch?
Are you serious? OK, here it is at your service - what I did:
- remove the hand-crafted SetSize stuff
- open the dialog in wxSmith
- adjust the min size of the tree control
- hit compile.

Not sure why this was too hard for you, but anyways... ;D ;D
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
Re: Debugger branch: Placement of Windows
« Reply #39 on: April 17, 2012, 10:05:53 pm »
Not sure why this was too hard for you, but anyways... ;D ;D
Because you had the changes already made and to make sure I've understood what you've meant.

Any idea how to force the dialog to auto-resize in order to fit the panel for the debuggergdb options?
Currently using your patch, the disassembly options are clipped.

ollydbg: Does Morten's patch fix your 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
Re: Debugger branch: Placement of Windows
« Reply #40 on: April 18, 2012, 02:02:24 am »
ollydbg: Does Morten's patch fix your problem?
No, I just test this patch, but the problem still exists.  ???
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
Re: Debugger branch: Placement of Windows
« Reply #41 on: April 18, 2012, 08:49:45 am »
2.) it does not center itself on the parent (if any).

Both should be adjusted using wxSmith. Than you should be happy.
How do we set the 2.) in wxSmith? Using the ExtraCode field?
(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
Re: Debugger branch: Placement of Windows
« Reply #42 on: April 18, 2012, 09:33:15 pm »
Any idea how to force the dialog to auto-resize in order to fit the panel for the debuggergdb options?
Currently using your patch, the disassembly options are clipped.
IMHO, the panels are badly design because they do not allow expanding (thats what I recall from the options). Maybe that's the issue. (Cannot look into it ATM.)

2.) it does not center itself on the parent (if any).
Yes, enable the "Centered" flag in the wxSmith options (of the wxScrollingDialog). - I didn't do it in the patch.
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger branch: Placement of Windows
« Reply #43 on: April 25, 2012, 04:36:40 pm »
@morten:
Did you fixed this in the trunk? rev7941? I don't have many time to test it right now. :)
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Debugger branch: Placement of Windows
« Reply #44 on: April 25, 2012, 06:02:20 pm »
Did you fixed this in the trunk? rev7941? I don't have many time to test it right now. :)
The first part, yes. That actually what I sent to oBFusCATed. To be honest: It was actually more an accident because in the revision before, a file of that patch file slipped in. Thus I thought: "What the heck lets try...". ;-)

It works just fine here btw... so I don't expect any issues - its no functional change, just layout.
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