Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Debugger branch: Placement of Windows

<< < (7/12) > >>

MortenMacFly:
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;
--- End code ---
...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.

ollydbg:

--- Quote from: MortenMacFly on April 16, 2012, 02:23:15 pm ---So if there is no good reason you should always call PlaceWindow without additional argument.

--- End quote ---
You mean we should always do like below (call PlaceWindow() with only first parameter)

--- Code: ---     CompilerSettingsDlg dlg(this);
     PlaceWindow(&dlg);

--- End code ---

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.

MortenMacFly:

--- Quote from: ollydbg on April 17, 2012, 08:32:34 am ---That's not intuitive, because I work on a Single monitor Laptop.

--- End quote ---
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.

ollydbg:

--- Quote from: MortenMacFly on April 17, 2012, 08:50:08 am ---
--- Quote from: ollydbg on April 17, 2012, 08:32:34 am ---That's not intuitive, because I work on a Single monitor Laptop.

--- End quote ---
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.

--- End quote ---
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.

MortenMacFly:

--- Quote from: ollydbg on April 17, 2012, 09:14:08 am ---I even can't see the buttons of the dialog. This is the same behavior in both Windows and Ubuntu 10.10.

--- End quote ---
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));

--- End code ---
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.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version