X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/08a092f9f4de6c80a2d43d4072c379ac84e6cc2f..5a224901b8ede55e1db9980f0fcaf7d2cb49285f:/src/common/resource.cpp?ds=sidebyside diff --git a/src/common/resource.cpp b/src/common/resource.cpp index 6a5dcf6401..782e63157c 100644 --- a/src/common/resource.cpp +++ b/src/common/resource.cpp @@ -1484,8 +1484,8 @@ wxFont wxResourceInterpretFontSpec(wxExpr *expr) if (faceNameExpr) faceName = faceNameExpr->StringValue(); - wxFont font(point, family, style, weight, (underline != 0), faceName); - return font; + return *wxTheFontList->FindOrCreateFont(point, family, style, weight, + (underline != 0), faceName); } // Separate file for the remainder of this, for BC++/Win16 @@ -2049,7 +2049,7 @@ wxChar* wxResourceParseWord(wxChar*s, int *i) struct wxResourceBitListStruct { - wxChar *word; + const wxChar *word; long bits; }; @@ -3145,33 +3145,37 @@ bool wxWindowBase::LoadFromResource(wxWindow *parent, const wxString& resourceNa int height = resource->GetHeight(); wxString name = resource->GetName(); - if (IsKindOf(CLASSINFO(wxDialog))) + // this is used for loading wxWizard pages from WXR + if ( parent != this ) { - wxDialog *dialogBox = (wxDialog *)this; - long modalStyle = isModal ? wxDIALOG_MODAL : 0; - if (!dialogBox->Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), theWindowStyle|modalStyle, name)) - return FALSE; + if (IsKindOf(CLASSINFO(wxDialog))) + { + wxDialog *dialogBox = (wxDialog *)this; + long modalStyle = isModal ? wxDIALOG_MODAL : 0; + if (!dialogBox->Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), theWindowStyle|modalStyle, name)) + return FALSE; - // Only reset the client size if we know we're not going to do it again below. - if ((resource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) == 0) - dialogBox->SetClientSize(width, height); - } - else if (IsKindOf(CLASSINFO(wxPanel))) - { - wxPanel* panel = (wxPanel *)this; - if (!panel->Create(parent, -1, wxPoint(x, y), wxSize(width, height), theWindowStyle | wxTAB_TRAVERSAL, name)) - return FALSE; - } - else - { - if (!((wxWindow *)this)->Create(parent, -1, wxPoint(x, y), wxSize(width, height), theWindowStyle, name)) - return FALSE; + // Only reset the client size if we know we're not going to do it again below. + if ((resource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) == 0) + dialogBox->SetClientSize(width, height); + } + else if (IsKindOf(CLASSINFO(wxPanel))) + { + wxPanel* panel = (wxPanel *)this; + if (!panel->Create(parent, -1, wxPoint(x, y), wxSize(width, height), theWindowStyle | wxTAB_TRAVERSAL, name)) + return FALSE; + } + else + { + if (!((wxWindow *)this)->Create(parent, -1, wxPoint(x, y), wxSize(width, height), theWindowStyle, name)) + return FALSE; + } } if ((resource->GetResourceStyle() & wxRESOURCE_USE_DEFAULTS) != 0) { // No need to do this since it's done in wxPanel or wxDialog constructor. - // SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT)); + // SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); } else { @@ -3183,9 +3187,9 @@ bool wxWindowBase::LoadFromResource(wxWindow *parent, const wxString& resourceNa // Should have some kind of font at this point if (!GetFont().Ok()) - SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT)); + SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); if (!GetBackgroundColour().Ok()) - SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE)); + SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); // Only when we've created the window and set the font can we set the correct size, // if based on dialog units.