ServerParamDlg::ServerParamDlg(wxWindow* pParent) : wxDialog(pParent, wxID_ANY, wxString(wxT("Server param Config")), wxDefaultPosition, wxSize(800, 600), wxDEFAULT_DIALOG_STYLE|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxRESIZE_BORDER) { wxBoxSizer* pSizer2 = ZION_NEW wxBoxSizer(wxHORIZONTAL); pSizer2->AddStretchSpacer(); pSizer2->Add(ZION_NEW wxButton(this, ID_NEW_LINE, wxT("New")), 0, wxALIGN_RIGHT | wxALL, 5); pSizer2->Add(ZION_NEW wxButton(this, ID_DELETE_LINE, wxT("Delete")), 0, wxALIGN_RIGHT | wxALL, 5); pSizer2->Add(ZION_NEW wxButton(this, wxID_OK, wxT("Save")), 0, wxALIGN_RIGHT | wxALL, 5); pSizer2->Add(ZION_NEW wxButton(this, wxID_CANCEL, wxT("Cancel")), 0, wxALIGN_RIGHT | wxALL, 5); wxBoxSizer* pSizer1 = ZION_NEW wxBoxSizer(wxVERTICAL); m_pPropGrid = ZION_NEW wxPropertyGrid(this, ID_PROPERTY_GRID, wxDefaultPosition, wxDefaultSize, wxPG_AUTO_SORT | wxPG_SPLITTER_AUTO_CENTER | wxPG_DEFAULT_STYLE ); Zion::Map<Zion::String, Zion::String> params = Zion::CClientApp::GetDefault()->GetParams(); Zion::Map<Zion::String, Zion::String>::iterator it = params.begin(); for(int i = 0; it != params.end(); ++it, ++i) { wxPGProperty* propGrid = ZION_NEW wxStringProperty(wxString::FromUTF8(it->first.c_str()), wxPG_LABEL, wxString::FromUTF8(it->second.c_str())); m_pPropGrid->Append(propGrid); } pSizer1->Add(m_pPropGrid, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); pSizer1->Add(pSizer2, 0, wxGROW|wxALIGN_BOTTOM); SetSizer(pSizer1); }
CStructEditView::CStructEditView(wxWindow* pParent) : wxPanel(pParent) { wxBoxSizer* m_pSizer; m_pSizer = ZION_NEW wxBoxSizer(wxVERTICAL); m_pPropGrid = ZION_NEW wxPropertyGrid(this, ID_OBJECT_GRID, wxDefaultPosition, wxDefaultSize, wxPG_SPLITTER_AUTO_CENTER | wxPG_DEFAULT_STYLE ); m_pPropGrid->SetExtraStyle( wxPG_EX_HELP_AS_TOOLTIPS ); m_pPropGrid->SetColumnProportion(0, 30); m_pPropGrid->SetColumnProportion(1, 70); m_pSizer->Add(m_pPropGrid, 1, wxGROW|wxALIGN_CENTER_VERTICAL); SetSizer(m_pSizer); m_pInfo = NULL; m_pData = NULL; }