// subclass property of object nodes will be ignored
// (useful for previews in XRC editors)
wxXmlResource(const wxString& filemask, int flags = wxXRC_USE_LOCALE);
- %name(EmptyXmlResource) wxXmlResource(int flags = wxXRC_USE_LOCALE);
+ %RenameCtor(EmptyXmlResource, wxXmlResource(int flags = wxXRC_USE_LOCALE));
~wxXmlResource();
}
}
+ // Unload resource from the given XML file (wildcards not allowed)
+ bool Unload(const wxString& filename);
+
// Initialize handlers for all supported controls/windows.
void InitAllHandlers();
// Loads menubar from resource. Returns NULL on failure.
wxMenuBar *LoadMenuBar(const wxString& name);
- %name(LoadMenuBarOnFrame) wxMenuBar *LoadMenuBar(wxWindow *parent, const wxString& name);
+ %Rename(LoadMenuBarOnFrame, wxMenuBar* , LoadMenuBar(wxWindow *parent, const wxString& name));
// Loads toolbar
// wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog");
// dlg->ShowModal();
wxDialog *LoadDialog(wxWindow *parent, const wxString& name);
- %name(LoadOnDialog)bool LoadDialog(wxDialog *dlg, wxWindow *parent, const wxString& name);
+ %Rename(LoadOnDialog, bool, LoadDialog(wxDialog *dlg, wxWindow *parent, const wxString& name));
// Loads panel. panel points to parent window (if any). Second form
// is used to finish creation of already existing instance.
wxPanel *LoadPanel(wxWindow *parent, const wxString& name);
- %name(LoadOnPanel)bool LoadPanel(wxPanel *panel, wxWindow *parent, const wxString& name);
+ %Rename(LoadOnPanel, bool, LoadPanel(wxPanel *panel, wxWindow *parent, const wxString& name));
// Load a frame's contents from a resource
wxFrame *LoadFrame(wxWindow* parent, const wxString& name);
- %name(LoadOnFrame)bool LoadFrame(wxFrame* frame, wxWindow *parent, const wxString& name);
+ %Rename(LoadOnFrame, bool, LoadFrame(wxFrame* frame, wxWindow *parent, const wxString& name));
// Load an object from the resource specifying both the resource name and
// the classname. This lets you load nonstandard container windows.
// Load an object from the resource specifying both the resource name and
// the classname. This form lets you finish the creation of an existing
// instance.
- %name(LoadOnObject)bool LoadObject(wxObject *instance, wxWindow *parent, const wxString& name,
- const wxString& classname);
+ %Rename(LoadOnObject, bool, LoadObject(wxObject *instance, wxWindow *parent, const wxString& name,
+ const wxString& classname));
// Loads a bitmap resource from a file.
wxBitmap LoadBitmap(const wxString& name);
bool AttachUnknownControl(const wxString& name, wxWindow *control,
wxWindow *parent = NULL);
- // Returns numeric ID that is equivalent to string id used in XML
- // resource. To be used in event tables
- // Macro XMLID is provided for convenience
- static int GetXRCID(const wxString& str_id);
+ // Returns a numeric ID that is equivalent to the string ID used in an XML
+ // resource. If an unknown str_id is requested (i.e. other than wxID_XXX
+ // or integer), a new record is created which associates the given string
+ // with a number. If value_if_not_found == wxID_NONE, the number is obtained via
+ // wxNewId(). Otherwise value_if_not_found is used.
+ // Macro XRCID(name) is provided for convenient use in event tables.
+ static int GetXRCID(const wxString& str_id, int value_if_not_found = wxID_NONE);
// Returns version info (a.b.c.d = d+ 256*c + 256^2*b + 256^3*a)
long GetVersion() const;
//----------------------------------------------------------------------
%pythoncode {
-def XRCID(str_id):
- return XmlResource_GetXRCID(str_id)
+def XRCID(str_id, value_if_not_found = wx.ID_NONE):
+ return XmlResource_GetXRCID(str_id, value_if_not_found)
def XRCCTRL(window, str_id, *ignoreargs):
return window.FindWindowById(XRCID(str_id))