Author Topic: MacOSX: Proposed patch to compiler_options.xrc  (Read 6719 times)

bnilsson

  • Guest
MacOSX: Proposed patch to compiler_options.xrc
« on: November 04, 2006, 07:32:32 pm »
I have modified src/plugins/compilergcc/resources/compiler_options.xrc to be more suitable for MacOSX.
A wxWidgets bug makes the dialog tabs not fit within the available space, see the images,
I propose to include it in the svn, as I do not think this will make a noticable difference under Windows, however I have not checked Linux.

If there really is a need for a specific __WXMAC__ patch for this, someone would have to modify src/plugins/compilergcc/compileroptionsdlg.cpp.

[attachment deleted by admin]

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: MacOSX: Proposed patch to compiler_options.xrc
« Reply #1 on: November 04, 2006, 09:05:59 pm »
Wait, why are we hard coding the minimum size at all?  The sizers should take care of that automatically as long as the controls contained in the dialog have proper minimum sizes.

bnilsson

  • Guest
Re: MacOSX: Proposed patch to compiler_options.xrc
« Reply #2 on: November 04, 2006, 09:21:33 pm »
What to do when wxWidgets is not doing as it's told?

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 836
Re: MacOSX: Proposed patch to compiler_options.xrc
« Reply #3 on: November 04, 2006, 10:32:43 pm »
Wait, why are we hard coding the minimum size at all?  The sizers should take care of that automatically as long as the controls contained in the dialog have proper minimum sizes.

Sizers won't do this - they may resize window when it's children can not fit inside but are not responsible for situation when tabs in notebook do not fit. Maybe multiline notebook should fix this?

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: MacOSX: Proposed patch to compiler_options.xrc
« Reply #4 on: November 05, 2006, 07:55:45 am »
Well a wxNotebook is just another wxControl/wxWindow both of which should report a proper minimum size.  If the sizer for the main dialog frame is configured correctly it should obey those reported sizes.  So the wxNotebook is not reporting the proper minimum size on wxMac. 

The most flexible solution would be to subclass wxNotebook and have it report the proper minimum size when on the wxMac platform either that or just place a define in the code the manually resizes the dialog for wxMac after its created from the XRC file.  The define is better than changing it for all platform in the XRC.

bnilsson

  • Guest
Re: MacOSX: Proposed patch to compiler_options.xrc
« Reply #5 on: November 05, 2006, 11:34:19 am »
Ok, I agree that proposing a platform-wide change just to fit MacOSX was not a good idea.
The proposition below is maybe not so elegant either, but at least it is mac-specific, in src/plugins/compilergcc/compileroptionsdlg.cpp constructor:
Code
    sizer->Layout();
    Layout();
    GetSizer()->Layout();
    GetSizer()->SetSizeHints(this);
#ifdef __WXMAC__
    int min_width, min_height;
    GetSize(&min_width, &min_height);
    this->SetSizeHints(min_width+140,min_height,-1,-1);
#endif
    this->SetSize(-1, -1, 0, 0);
    this->CentreOnScreen();
} // end of constructor
It will make CB more workable under MacOSX, even if it is not a permanent solution.
I enclose a patch file, just in case if this goes thru the screening.

[attachment deleted by admin]
« Last Edit: November 05, 2006, 11:50:34 am by bnilsson »

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: MacOSX: Proposed patch to compiler_options.xrc
« Reply #6 on: November 05, 2006, 11:52:45 am »
Either patch works for me (.cpp or .xrc).. How does the larger dialog look on Windows/Linux ?

bnilsson

  • Guest
Re: MacOSX: Proposed patch to compiler_options.xrc
« Reply #7 on: November 05, 2006, 12:04:13 pm »
This is for windows.


[attachment deleted by admin]

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: MacOSX: Proposed patch to compiler_options.xrc
« Reply #8 on: November 05, 2006, 12:15:49 pm »
Doesn't look all that bad to me, but we can do the code hack if preferred.

takeshimiya

  • Guest
Re: MacOSX: Proposed patch to compiler_options.xrc
« Reply #9 on: November 06, 2006, 01:50:23 am »
additionally, the "Make" commands tab could hide when not using makefiles build