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

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger branch: Placement of Windows
« Reply #45 on: April 27, 2012, 05:12:58 am »
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.
I build rev7945, but the debugger setting dialog is still in the wrong place.  :) So, I believe this is not fixed yet.
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 #46 on: April 27, 2012, 03:37:40 pm »
I build rev7945, but the debugger setting dialog is still in the wrong place.  :) So, I believe this is not fixed yet.
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...
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: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger branch: Placement of Windows
« Reply #47 on: April 29, 2012, 04:16:38 pm »
@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);
  //*)
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()

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?



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: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger branch: Placement of Windows
« Reply #48 on: May 09, 2012, 10:05:12 am »
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

So, in these cases,  CentreOnParent is equal to Centre.
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 #49 on: May 09, 2012, 11:40:16 am »
I commit the fix in rev7955.
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.
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: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger branch: Placement of Windows
« Reply #50 on: May 09, 2012, 03:10:38 pm »
I commit the fix in rev7955.
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.
OK, I just updated all the instances of CentreOnParent() to CenterOnParent() in rev7956.
« Last Edit: May 10, 2012, 07:38:33 am by ollydbg »
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 Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Debugger branch: Placement of Windows
« Reply #51 on: May 10, 2012, 01:55:34 am »
Next time, please use British English, so instead CentreOnParent(), use the British equivalent CenterOnParent().
Wait... should not it be the reverse of that?  American and British English spelling differences.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Debugger branch: Placement of Windows
« Reply #52 on: May 10, 2012, 06:53:13 am »
Wait... should not it be the reverse of that?  American and British English spelling differences.
Ouch, dammed - my mistake. The SpellChekcer plugin was set to American English all the time.
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: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger branch: Placement of Windows
« Reply #53 on: May 10, 2012, 08:42:46 am »
Wait... should not it be the reverse of that?  American and British English spelling differences.
Ouch, dammed - my mistake. The SpellChekcer plugin was set to American English all the time.
1, thanks alpha for the info
2, @morten: Do you mean we should use: CentreOnParent() not CenterOnParent()?
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 #54 on: May 10, 2012, 10:00:45 am »
2, @morten: Do you mean we should use: CentreOnParent() not CenterOnParent()?
Yes - you were correct in the first place. I was wondering anyhow why there were so many places. British English is Centre, indeed. :-( I am very sorry for the confusion.

I pimped the SpellChecker plugin in my local copy, that it suggests spelling for CamelCase words and so Centre got underlined, but because SpellChecker used the American English dictionary. I should have thought twice.

BTW: Julian Smart (AFAIK) is British. ;-)
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 #55 on: May 10, 2012, 10:11:20 am »
<facepalm> wx devs should be <spanked> for causing excessive time waste...
(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 #56 on: May 10, 2012, 10:32:39 am »
<facepalm> wx devs should be <spanked> for causing excessive time waste...
Well in that case it was just me. :-[

OT: But it can be worse: I recall the days when I was developing Excel macros in a German Excel, where MS translated the whole macro language to German. That is really some sort of fun. (I wonder if its still like that in recent MS Offices...)
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 daniloz

  • Regular
  • ***
  • Posts: 268
Re: Debugger branch: Placement of Windows
« Reply #57 on: May 10, 2012, 01:45:28 pm »
OT: But it can be worse: I recall the days when I was developing Excel macros in a German Excel, where MS translated the whole macro language to German. That is really some sort of fun. (I wonder if its still like that in recent MS Offices...)

OT: Sorry to stay OT'd here, but it still like this, even in Excel 2010 !!! I understand that they show the localized version of the macro/formulas, but saving them localized in the file and not re-localizing them when opening with another language is just inexcusable !!! I also had lots of fun when I received an Excel file made with an English version and had to convert everything manually to German, so it would work in my German version of Excel 2010 (!!!!!). :o