X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bedaf53eaf4e2a860b34d4ff5e0b1928ce8fa5c9..67fade3398f9c35a8e042749ed340c898f7e7bdd:/src/common/resource.cpp diff --git a/src/common/resource.cpp b/src/common/resource.cpp index 8096c9163f..e012fd8929 100644 --- a/src/common/resource.cpp +++ b/src/common/resource.cpp @@ -53,6 +53,9 @@ #include "wx/intl.h" #endif +#include "wx/treebase.h" +#include "wx/listctrl.h" + #if wxUSE_RADIOBTN #include "wx/radiobut.h" #endif @@ -2046,7 +2049,7 @@ wxChar* wxResourceParseWord(wxChar*s, int *i) struct wxResourceBitListStruct { - wxChar *word; + const wxChar *word; long bits; }; @@ -2648,6 +2651,8 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table) } } +#if wxUSE_MENUS + wxMenu *wxResourceCreateMenu(wxItemResource *item) { wxMenu *menu = new wxMenu; @@ -2708,6 +2713,8 @@ wxMenu *wxResourceCreateMenu(const wxString& resource, wxResourceTable *table) return (wxMenu *) NULL; } +#endif // wxUSE_MENUS + // Global equivalents (so don't have to refer to default table explicitly) bool wxResourceParseData(const wxString& resource, wxResourceTable *table) { @@ -3138,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 { @@ -3176,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.