wxObject *wxDialogXmlHandler::DoCreateResource() { XRC_MAKE_INSTANCE(dlg, wxDialog); dlg->Create(m_parentAsWindow, GetID(), GetText(wxT("title")), wxDefaultPosition, wxDefaultSize, GetStyle(wxT("style"), wxDEFAULT_DIALOG_STYLE), GetName()); if (HasParam(wxT("size"))) dlg->SetClientSize(GetSize(wxT("size"), dlg)); if (HasParam(wxT("pos"))) dlg->Move(GetPosition()); if (HasParam(wxT("icon"))) dlg->SetIcons(GetIconBundle(wxT("icon"), wxART_FRAME_ICON)); SetupWindow(dlg); CreateChildren(dlg); if (GetBool(wxT("centered"), false)) dlg->Centre(); return dlg; }
wxObject *wxMdiXmlHandler::DoCreateResource() { wxWindow *frame = CreateFrame(); if (HasParam(wxT("size"))) frame->SetClientSize(GetSize()); if (HasParam(wxT("pos"))) frame->Move(GetPosition()); if (HasParam(wxT("icon"))) { wxFrame* f = wxDynamicCast(frame, wxFrame); if (f) f->SetIcons(GetIconBundle(wxT("icon"), wxART_FRAME_ICON)); } SetupWindow(frame); CreateChildren(frame); if (GetBool(wxT("centered"), false)) frame->Centre(); return frame; }
wxObject *wxPropertySheetDialogXmlHandler::DoCreateResource() { if (m_class == wxT("propertysheetpage")) { wxXmlNode *n = GetParamNode(wxT("object")); if (!n) n = GetParamNode(wxT("object_ref")); if (n) { wxBookCtrlBase *bookctrl = m_dialog->GetBookCtrl(); bool old_ins = m_isInside; m_isInside = false; wxObject *item = CreateResFromNode(n, bookctrl, NULL); m_isInside = old_ins; wxWindow *wnd = wxDynamicCast(item, wxWindow); if (wnd) { bookctrl->AddPage(wnd, GetText(wxT("label")), GetBool(wxT("selected"))); if (HasParam(wxT("bitmap"))) { wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER); wxImageList *imgList = bookctrl->GetImageList(); if (imgList == NULL) { imgList = new wxImageList(bmp.GetWidth(), bmp.GetHeight()); bookctrl->AssignImageList(imgList); } int imgIndex = imgList->Add(bmp); bookctrl->SetPageImage(bookctrl->GetPageCount()-1, imgIndex); } } else { ReportError(n, "propertysheetpage child must be a window"); } return wnd; } else { ReportError("propertysheetpage must have a window child"); return NULL; } } else { XRC_MAKE_INSTANCE(dlg, wxPropertySheetDialog) dlg->Create(m_parentAsWindow, GetID(), GetText(wxT("title")), GetPosition(), GetSize(), GetStyle(), GetName()); if (HasParam(wxT("icon"))) dlg->SetIcons(GetIconBundle(wxT("icon"), wxART_FRAME_ICON)); SetupWindow(dlg); wxPropertySheetDialog *old_par = m_dialog; m_dialog = dlg; bool old_ins = m_isInside; m_isInside = true; CreateChildren(m_dialog, true/*only this handler*/); m_isInside = old_ins; m_dialog = old_par; if (GetBool(wxT("centered"), false)) dlg->Centre(); wxString buttons = GetText(wxT("buttons")); if (!buttons.IsEmpty()) { int flags = 0; if (buttons.Find(wxT("wxOK")) != wxNOT_FOUND) flags |= wxOK; if (buttons.Find(wxT("wxCANCEL")) != wxNOT_FOUND) flags |= wxCANCEL; if (buttons.Find(wxT("wxYES")) != wxNOT_FOUND) flags |= wxYES; if (buttons.Find(wxT("wxNO")) != wxNOT_FOUND) flags |= wxNO; if (buttons.Find(wxT("wxHELP")) != wxNOT_FOUND) flags |= wxHELP; if (buttons.Find(wxT("wxNO_DEFAULT")) != wxNOT_FOUND) flags |= wxNO_DEFAULT; dlg->CreateButtons(flags); } return dlg; } }