- RefreshProps(node);
-}
-
-
-
-void EditorFrame::OnXMLIDEdit(wxCommandEvent& event)
-{
- if (!m_SelectedNode) return;
- wxXmlNode *node = FindHandler(m_SelectedNode)->GetRealNode(m_SelectedNode);
-
- node->DeleteProperty("name");
- wxString s = m_XMLIDCtrl->GetValue();
- if (!(s == "-1")) node->AddProperty("name", s);
- NotifyChanged(CHANGED_TREE_SELECTED);
-}
-
-
-
-void EditorFrame::OnXMLIDPick(wxCommandEvent& event)
-{
- if (!m_SelectedNode) return;
- wxXmlNode *node = FindHandler(m_SelectedNode)->GetRealNode(m_SelectedNode);
-
- wxString choices[] = {wxString("-1")
- #define stdID(id) , wxString(#id)
- stdID(wxID_OK) stdID(wxID_CANCEL)
- stdID(wxID_YES) stdID(wxID_NO)
- stdID(wxID_APPLY) stdID(wxID_HELP)
- stdID(wxID_HELP_CONTEXT)
-
- stdID(wxID_OPEN) stdID(wxID_CLOSE) stdID(wxID_NEW)
- stdID(wxID_SAVE) stdID(wxID_SAVEAS) stdID(wxID_REVERT)
- stdID(wxID_EXIT) stdID(wxID_UNDO) stdID(wxID_REDO)
- stdID(wxID_PRINT) stdID(wxID_PRINT_SETUP)
- stdID(wxID_PREVIEW) stdID(wxID_ABOUT) stdID(wxID_HELP_CONTENTS)
- stdID(wxID_HELP_COMMANDS) stdID(wxID_HELP_PROCEDURES)
- stdID(wxID_CUT) stdID(wxID_COPY) stdID(wxID_PASTE)
- stdID(wxID_CLEAR) stdID(wxID_FIND) stdID(wxID_DUPLICATE)
- stdID(wxID_SELECTALL)
- stdID(wxID_STATIC) stdID(wxID_FORWARD) stdID(wxID_BACKWARD)
- stdID(wxID_DEFAULT) stdID(wxID_MORE) stdID(wxID_SETUP)
- stdID(wxID_RESET)
- #undef stdID
- };
-
- wxString s =
- wxGetSingleChoice(_("Choose from predefined IDs:"), _("XMLID"),
- 38/*sizeof choices*/, choices);
- if (!s) return;
-
- m_XMLIDCtrl->SetValue(s);
- node->DeleteProperty("name");
- if (!(s == "-1")) node->AddProperty("name", s);
- NotifyChanged(CHANGED_TREE_SELECTED);
-}
-
-
-
-void EditorFrame::OnEditCode(wxCommandEvent& event)
-{
- if (!m_SelectedNode) return;
-
- wxBusyCursor bcur;
- wxDialog dlg(this, -1, _("XML code editor"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER);
- wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
- wxTextCtrl *tc = new wxTextCtrl(&dlg, -1, "", wxDefaultPosition,
- wxDefaultSize, wxTE_MULTILINE);
- sizer->Add(tc, 1, wxEXPAND | wxALL, 10);
-
- wxSizer *sz2 = new wxBoxSizer(wxHORIZONTAL);
-
- sz2->Add(new wxButton(&dlg, wxID_OK, _("Save")), 0);
- sz2->Add(new wxButton(&dlg, wxID_CANCEL, _("Cancel")), 0, wxLEFT, 10);
-
- sizer->Add(sz2, 0, wxALIGN_RIGHT | wxRIGHT|wxBOTTOM, 10);
-
- dlg.SetAutoLayout(TRUE);
- dlg.SetSizer(sizer);
-
- wxConfigBase *cfg = wxConfigBase::Get();
-
- dlg.SetSize(wxRect(wxPoint(cfg->Read("xmleditor_x", -1), cfg->Read("xmleditor_y", -1)),
- wxSize(cfg->Read("xmleditor_w", 400), cfg->Read("xmleditor_h", 400))));
-
- wxString tempfile;
- wxGetTempFileName("xmleditor", tempfile);