Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Debugger branch: Placement of Windows
ollydbg:
--- Quote from: MortenMacFly on April 25, 2012, 06:02:20 pm ---
--- Quote from: ollydbg on April 25, 2012, 04:36:40 pm ---Did you fixed this in the trunk? rev7941? I don't have many time to test it right now. :)
--- End quote ---
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.
--- End quote ---
I build rev7945, but the debugger setting dialog is still in the wrong place. :) So, I believe this is not fixed yet.
MortenMacFly:
--- Quote from: ollydbg on April 27, 2012, 05:12:58 am ---I build rev7945, but the debugger setting dialog is still in the wrong place. :) So, I believe this is not fixed yet.
--- End quote ---
This revision does not position the dialog differently, it just has changed the layout in terms of size. For the other stuff what still applies is that "centering" is missing in the constructor. I see if I can give it a shot...
ollydbg:
@morten:
I see you change in rev7950
--- Code: ---===================================================================
--- trunk/src/src/debuggersettingsdlg.cpp (revision 7949)
+++ trunk/src/src/debuggersettingsdlg.cpp (revision 7950)
@@ -60,15 +60,16 @@
m_treebook->SetMinSize(wxSize(600,440));
mainSizer->Add(m_treebook, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
staticLine = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxSize(10,-1), wxLI_HORIZONTAL, _T("wxID_ANY"));
- mainSizer->Add(staticLine, 0, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_BOTTOM, 5);
+ mainSizer->Add(staticLine, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
stdDialogButtons = new wxStdDialogButtonSizer();
stdDialogButtons->AddButton(new wxButton(this, wxID_OK, wxEmptyString));
stdDialogButtons->AddButton(new wxButton(this, wxID_CANCEL, wxEmptyString));
stdDialogButtons->Realize();
- mainSizer->Add(stdDialogButtons, 0, wxALL|wxALIGN_BOTTOM|wxALIGN_CENTER_HORIZONTAL, 5);
+ mainSizer->Add(stdDialogButtons, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
SetSizer(mainSizer);
mainSizer->Fit(this);
mainSizer->SetSizeHints(this);
+ Center();
Connect(ID_TREEBOOK,wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED,(wxObjectEventFunction)&DebuggerSettingsDlg::OnPageChanged);
//*)
--- End code ---
But this does not solve the problem, because there are many code snippets after Center() call in the constructor of DebuggerSettingsDlg::DebuggerSettingsDlg. And the size of the dialog is changed by those code snippets.
Please put the Center command in the end of the constructor like:
--- Code: ---Index: E:/code/cb/cb_trunk/src/src/debuggersettingsdlg.cpp
===================================================================
--- E:/code/cb/cb_trunk/src/src/debuggersettingsdlg.cpp (revision 7950)
+++ E:/code/cb/cb_trunk/src/src/debuggersettingsdlg.cpp (working copy)
@@ -100,6 +100,8 @@
for (size_t ii = 0; ii < m_treebook->GetPageCount(); ++ii)
m_treebook->ExpandNode(ii);
+
+ Center();
}
DebuggerSettingsDlg::~DebuggerSettingsDlg()
--- End code ---
This works OK.
The another issue is: If you search the word "CentreOnParent", you will see many dialog's constructor will call this in the end. As we discussed before, We should be consistent. Either all Center() or all CentreOnParent().
What do you think? (As jens said here: Re: Debugger branch: Placement of Windows)
I think Center() is preferred. Right?
ollydbg:
FYI:
I commit the fix in rev7955.
BTW: I have read the wx's manual, and I see that
--- Quote ---void wxWindow::CentreOnParent ( int direction = wxBOTH )
Centres the window on its parent.
This is a more readable synonym for Centre().
Parameters:
direction Specifies the direction for the centring. May be wxHORIZONTAL, wxVERTICAL or wxBOTH.
Remarks:
This methods provides for a way to centre top level windows over their parents instead of the entire screen. If there is no parent or if the window is not a top level window, then behaviour is the same as Centre().
See also:
wxTopLevelWindow::CentreOnScreen
--- End quote ---
So, in these cases, CentreOnParent is equal to Centre.
MortenMacFly:
--- Quote from: ollydbg on May 09, 2012, 10:05:12 am ---I commit the fix in rev7955.
--- End quote ---
Next time, please use British English, so instead CentreOnParent(), use the British equivalent CenterOnParent(). wxWidgets supports both language styles (a bit strange, but true). We committed ourselves to use British English ages ago... you could not know that.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version