News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

MacOSX: Proposed patch to compiler_options.xrc

Started by bnilsson, November 04, 2006, 07:32:32 PM

Previous topic - Next topic

bnilsson

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]

Game_Ender

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

What to do when wxWidgets is not doing as it's told?

byo

Quote from: Game_Ender 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.

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?

Game_Ender

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

#5
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:
    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]

afb

Either patch works for me (.cpp or .xrc).. How does the larger dialog look on Windows/Linux ?

bnilsson

This is for windows.


[attachment deleted by admin]

afb

Doesn't look all that bad to me, but we can do the code hack if preferred.

takeshimiya

additionally, the "Make" commands tab could hide when not using makefiles build