[IF WXDIALOG][ENDIF WXDIALOG][IF WXFRAME]wxSYS_COLOUR_BTNFACE200,200// This code will set a smaller font if Win 3.11 is detected:
int majorVer; int minorVer;
wxGetOsVersion(&majorVer, &minorVer);
if (minorVer == 30 || majorVer == 30 || majorVer == 3)
{
wxFont thisFont(8,wxFONTFAMILY__DEFAULT,wxFONTSTYLE__NORMAL,wxFONTWEIGHT__NORMAL,false,wxEmptyString,wxFONTENCODING__DEFAULT);
SetFont(thisFont);
}0286,334wxVERTICALHow to create a scalable window with working sizers:
A wxBoxSizer (BoxSizer1) is placed as the first element on the wxFrame.
Then, a wxPanel (Panel1) is placed onto the sizer. "Expand" is selected, "Border width" is set to 0. The panel will fill the entire sizer. The panel size can be increased by dragging the corner, or typing "Width" and "Height" parameters. A minimum size can be forced by unchecking "Default Min size" and specifying the size.
BoxSizer2 is placed onto the Panel1. Option wxVERTICAL is selected. Then, a wxNotebook (Notebook1) and Panel2 are placed onto the BoxSizer2. Option "Expand" is selected for both the Panel2 and Notebook1. Now each of these elements will take half of the space in the window and they will be arranged vertically.
BoxSizer3 is added onto the Panel2. Orientation wxHORIZONTAL is selected. Then a wxTextCtrl (TextCtrl1) and wxButton (Button1) is placed onto BoxSizer3. Now the text control and the button will be arranged horizontally and will take half of the panel space. They will not use the entire height of the panel, because "Expand" property is not selected.
Button1 can be made smaller by setting "Proportion" property to 0. Now the button will have the default size and will not be scaled. TextCtrl1 has "Proportion" set to 1 and it will take entire available horizontal space.
"Proportion" is set to 0 for Panel2. Now the panel will be shrunk vertically and will have the same height as the button and the text control.
A new page is added into Notebook1 by clicking right mouse button - Add New Page. Panel3 is created automatically.
BoxSizer4 is added onto Panel3.
TextCtrl2 is added onto BoxSizer4. "Expand" property is checked. Now the text box will fill the entire page of the wxNotebook. Style wxTE__MULTILINE is selected to enable multiline text.
NOTES FOR WIN 3.11 COMPATIBILITY:
===============================
wxBORDER__SIMPLE style needs to be applied to text controls, otherwise there will be no border visible.
Also, Font type: Custom font, Size: 8 may be selected to have smaller fonts under Win 3.11. This can be changed globally, by editing the "Font" property for entire wxFrame.
OR, if you want the proper font to be determined on the runtime, then don't change the "Font" property manually, instead add the following code into "Extra code" property of the wxFrame:
// This code will set a smaller font if Win 3.11 is detected:
int majorVer; int minorVer;
wxGetOsVersion(&majorVer, &minorVer);
if (minorVer == 30 || majorVer == 30 || majorVer == 3)
{
wxFont thisFont(8,wxFONTFAMILY__DEFAULT,wxFONTSTYLE__NORMAL,wxFONTWEIGHT__NORMAL,false,wxEmptyString,wxFONTENCODING__DEFAULT);
SetFont(thisFont);
}
The "Background" of the wxFrame can be also changed to "Face of button" for better color consistency.
Also, wxFULL__REPAINT__ON__RESIZE style has been checked on wxFrame to fix incomplete window refresh after resizing under Win 3.11.wxALL|wxEXPAND5wxALL|wxEXPAND5Click the button to popup this messagewxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL5wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL5wxALL|wxEXPANDwxALL|wxEXPANDAlt-F4Quit the applicationF1Show info about this application1-1wxSB_NORMAL[ENDIF WXFRAME]