]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/utils/wxrcedit/pe_basic.cpp
Removed very out of date files in docs/msw
[wxWidgets.git] / contrib / utils / wxrcedit / pe_basic.cpp
index 8ae8056f4fd46bd5bd3b25a05389aa7285e0039c..d6cb8b6982bf5b32ea5cbc6cd572826ef1ebb0ba 100644 (file)
 
 
 BEGIN_EVENT_TABLE(PropEditCtrlTxt, PropEditCtrl)
 
 
 BEGIN_EVENT_TABLE(PropEditCtrlTxt, PropEditCtrl)
-    EVT_TEXT(-1, PropEditCtrlTxt::OnText)
+    EVT_TEXT(wxID_ANY, PropEditCtrlTxt::OnText)
 END_EVENT_TABLE()
 
 
 wxWindow *PropEditCtrlTxt::CreateEditCtrl()
 {
 END_EVENT_TABLE()
 
 
 wxWindow *PropEditCtrlTxt::CreateEditCtrl()
 {
-    return (m_TextCtrl = new wxTextCtrl(this, -1));
+    return (m_TextCtrl = new wxTextCtrl(this, wxID_ANY));
 }
 
 
 
 }
 
 
 
-void PropEditCtrlTxt::OnText(wxCommandEvent& event)
+void PropEditCtrlTxt::OnText(wxCommandEvent& WXUNUSED(event))
 {
 {
-    if (CanSave()) 
+    if (CanSave())
     {
         WriteValue();
         EditorFrame::Get()->NotifyChanged(CHANGED_PROPS);
     {
         WriteValue();
         EditorFrame::Get()->NotifyChanged(CHANGED_PROPS);
@@ -61,7 +61,7 @@ void PropEditCtrlTxt::WriteValue()
 {
     wxString newv = m_TextCtrl->GetValue();
     XmlWriteValue(GetNode(), m_PropInfo->Name, newv);
 {
     wxString newv = m_TextCtrl->GetValue();
     XmlWriteValue(GetNode(), m_PropInfo->Name, newv);
-    m_TreeCtrl->SetItemBold(m_TreeItem, TRUE);
+    m_TreeCtrl->SetItemBold(m_TreeItem, true);
 }
 
 
 }
 
 
@@ -69,7 +69,9 @@ void PropEditCtrlTxt::WriteValue()
 wxWindow *PropEditCtrlInt::CreateEditCtrl()
 {
     PropEditCtrlTxt::CreateEditCtrl();
 wxWindow *PropEditCtrlInt::CreateEditCtrl()
 {
     PropEditCtrlTxt::CreateEditCtrl();
+#if wxUSE_VALIDATORS
     m_TextCtrl->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
     m_TextCtrl->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
+#endif
     return m_TextCtrl;
 }
 
     return m_TextCtrl;
 }
 
@@ -80,12 +82,12 @@ wxWindow *PropEditCtrlInt::CreateEditCtrl()
 
 
 BEGIN_EVENT_TABLE(PropEditCtrlBool, PropEditCtrl)
 
 
 BEGIN_EVENT_TABLE(PropEditCtrlBool, PropEditCtrl)
-    EVT_CHOICE(-1, PropEditCtrlBool::OnChoice)
+    EVT_CHOICE(wxID_ANY, PropEditCtrlBool::OnChoice)
 END_EVENT_TABLE()
 
 wxWindow *PropEditCtrlBool::CreateEditCtrl()
 {
 END_EVENT_TABLE()
 
 wxWindow *PropEditCtrlBool::CreateEditCtrl()
 {
-    m_Choice = new wxChoice(this, -1);
+    m_Choice = new wxChoice(this, wxID_ANY);
     m_Choice->Append(_T("false"));
     m_Choice->Append(_T("true"));
     return m_Choice;
     m_Choice->Append(_T("false"));
     m_Choice->Append(_T("true"));
     return m_Choice;
@@ -108,7 +110,7 @@ void PropEditCtrlBool::WriteValue()
     wxString newv = m_Choice->GetSelection() == 0 ? _T("0") : _T("1");
 
     XmlWriteValue(GetNode(), m_PropInfo->Name, newv);
     wxString newv = m_Choice->GetSelection() == 0 ? _T("0") : _T("1");
 
     XmlWriteValue(GetNode(), m_PropInfo->Name, newv);
-    m_TreeCtrl->SetItemBold(m_TreeItem, TRUE);
+    m_TreeCtrl->SetItemBold(m_TreeItem, true);
 }
 
 
 }
 
 
@@ -124,9 +126,9 @@ wxString PropEditCtrlBool::GetValueAsText(wxTreeItemId ti)
 
 
 
 
 
 
-void PropEditCtrlBool::OnChoice(wxCommandEvent& event)
+void PropEditCtrlBool::OnChoice(wxCommandEvent& WXUNUSED(event))
 {
 {
-    if (CanSave()) 
+    if (CanSave())
     {
         WriteValue();
         EditorFrame::Get()->NotifyChanged(CHANGED_PROPS);
     {
         WriteValue();
         EditorFrame::Get()->NotifyChanged(CHANGED_PROPS);
@@ -143,7 +145,7 @@ class PropEditCtrlCoordXY : public PropEditCtrlInt
     public:
         PropEditCtrlCoordXY(PropertiesFrame *propFrame, int which)
            : PropEditCtrlInt(propFrame), m_which(which) {}
     public:
         PropEditCtrlCoordXY(PropertiesFrame *propFrame, int which)
            : PropEditCtrlInt(propFrame), m_which(which) {}
-        
+
         virtual void ReadValue()
         {
             wxString s = XmlReadValue(GetNode(), m_PropInfo->Name);
         virtual void ReadValue()
         {
             wxString s = XmlReadValue(GetNode(), m_PropInfo->Name);
@@ -159,7 +161,7 @@ class PropEditCtrlCoordXY : public PropEditCtrlInt
             }
             m_TextCtrl->SetValue(m_c[m_which]);
         }
             }
             m_TextCtrl->SetValue(m_c[m_which]);
         }
-        
+
         virtual void WriteValue()
         {
             m_c[m_which] = m_TextCtrl->GetValue();
         virtual void WriteValue()
         {
             m_c[m_which] = m_TextCtrl->GetValue();
@@ -170,9 +172,9 @@ class PropEditCtrlCoordXY : public PropEditCtrlInt
             wxString prev = XmlReadValue(GetNode(), m_PropInfo->Name);
             if (prev[prev.Len()-1] == _T('d')) s << _T('d');
             XmlWriteValue(GetNode(), m_PropInfo->Name, s);
             wxString prev = XmlReadValue(GetNode(), m_PropInfo->Name);
             if (prev[prev.Len()-1] == _T('d')) s << _T('d');
             XmlWriteValue(GetNode(), m_PropInfo->Name, s);
-            m_TreeCtrl->SetItemBold(m_TreeCtrl->GetParent(m_TreeItem), TRUE);
+            m_TreeCtrl->SetItemBold(m_TreeCtrl->GetItemParent(m_TreeItem), true);
         }
         }
-        
+
         virtual wxString GetValueAsText(wxTreeItemId ti)
         {
             PropertyInfo *pi = &(((PETreeData*)m_TreeCtrl->GetItemData(ti))->PropInfo);
         virtual wxString GetValueAsText(wxTreeItemId ti)
         {
             PropertyInfo *pi = &(((PETreeData*)m_TreeCtrl->GetItemData(ti))->PropInfo);
@@ -189,16 +191,16 @@ class PropEditCtrlCoordXY : public PropEditCtrlInt
             }
             return m_c[m_which];
         }
             }
             return m_c[m_which];
         }
-        
-        virtual wxString GetPropName(const PropertyInfo& pinfo)
+
+        virtual wxString GetPropName(const PropertyInfo& WXUNUSED(pinfo))
         {
             if (m_which == 0) return _T("x"); else return _T("y");
         }
 
         {
             if (m_which == 0) return _T("x"); else return _T("y");
         }
 
-        virtual bool HasClearButton() { return FALSE; }
-        virtual bool IsPresent(const PropertyInfo& pinfo) { return FALSE; } 
+        virtual bool HasClearButton() { return false; }
+        virtual bool IsPresent(const PropertyInfo& WXUNUSED(pinfo)) { return false; }
+
 
 
-    
     protected:
         wxString m_c[2];
         int m_which;
     protected:
         wxString m_c[2];
         int m_which;
@@ -210,7 +212,7 @@ class PropEditCtrlCoordDlg : public PropEditCtrlBool
     public:
         PropEditCtrlCoordDlg(PropertiesFrame *propFrame)
            : PropEditCtrlBool(propFrame) {}
     public:
         PropEditCtrlCoordDlg(PropertiesFrame *propFrame)
            : PropEditCtrlBool(propFrame) {}
-        
+
         virtual void ReadValue()
         {
             wxString s = XmlReadValue(GetNode(), m_PropInfo->Name);
         virtual void ReadValue()
         {
             wxString s = XmlReadValue(GetNode(), m_PropInfo->Name);
@@ -220,15 +222,15 @@ class PropEditCtrlCoordDlg : public PropEditCtrlBool
             else
                 m_Choice->SetSelection(0);
         }
             else
                 m_Choice->SetSelection(0);
         }
-        
+
         virtual void WriteValue()
         {
             wxString s = XmlReadValue(GetNode(), m_PropInfo->Name).BeforeFirst(_T('d'));
             if (m_Choice->GetSelection() == 1) s << _T('d');
             XmlWriteValue(GetNode(), m_PropInfo->Name, s);
         virtual void WriteValue()
         {
             wxString s = XmlReadValue(GetNode(), m_PropInfo->Name).BeforeFirst(_T('d'));
             if (m_Choice->GetSelection() == 1) s << _T('d');
             XmlWriteValue(GetNode(), m_PropInfo->Name, s);
-            m_TreeCtrl->SetItemBold(m_TreeCtrl->GetParent(m_TreeItem), TRUE);
+            m_TreeCtrl->SetItemBold(m_TreeCtrl->GetItemParent(m_TreeItem), true);
         }
         }
-        
+
         virtual wxString GetValueAsText(wxTreeItemId ti)
         {
             PropertyInfo *pi = &(((PETreeData*)m_TreeCtrl->GetItemData(ti))->PropInfo);
         virtual wxString GetValueAsText(wxTreeItemId ti)
         {
             PropertyInfo *pi = &(((PETreeData*)m_TreeCtrl->GetItemData(ti))->PropInfo);
@@ -240,14 +242,14 @@ class PropEditCtrlCoordDlg : public PropEditCtrlBool
             else
                 return _("true");
         }
             else
                 return _("true");
         }
-        
-        virtual wxString GetPropName(const PropertyInfo& pinfo)
+
+        virtual wxString GetPropName(const PropertyInfo& WXUNUSED(pinfo))
         {
             return _T("dlg");
         }
 
         {
             return _T("dlg");
         }
 
-        virtual bool HasClearButton() { return FALSE; }
-        virtual bool IsPresent(const PropertyInfo& pinfo) { return FALSE; } 
+        virtual bool HasClearButton() { return false; }
+        virtual bool IsPresent(const PropertyInfo& WXUNUSED(pinfo)) { return false; }
 };
 
 
 };
 
 
@@ -291,14 +293,14 @@ class PropEditCtrlDimX : public PropEditCtrlInt
     public:
         PropEditCtrlDimX(PropertiesFrame *propFrame)
            : PropEditCtrlInt(propFrame){}
     public:
         PropEditCtrlDimX(PropertiesFrame *propFrame)
            : PropEditCtrlInt(propFrame){}
-        
+
         virtual void ReadValue()
         {
             wxString s = XmlReadValue(GetNode(), m_PropInfo->Name);
             m_c = s.BeforeFirst(_T('d'));
             m_TextCtrl->SetValue(m_c);
         }
         virtual void ReadValue()
         {
             wxString s = XmlReadValue(GetNode(), m_PropInfo->Name);
             m_c = s.BeforeFirst(_T('d'));
             m_TextCtrl->SetValue(m_c);
         }
-        
+
         virtual void WriteValue()
         {
             wxString s = XmlReadValue(GetNode(), m_PropInfo->Name);
         virtual void WriteValue()
         {
             wxString s = XmlReadValue(GetNode(), m_PropInfo->Name);
@@ -307,24 +309,24 @@ class PropEditCtrlDimX : public PropEditCtrlInt
             s = m_c;
             if (dlg) s << _T('d');
             XmlWriteValue(GetNode(), m_PropInfo->Name, s);
             s = m_c;
             if (dlg) s << _T('d');
             XmlWriteValue(GetNode(), m_PropInfo->Name, s);
-            m_TreeCtrl->SetItemBold(m_TreeCtrl->GetParent(m_TreeItem), TRUE);
+            m_TreeCtrl->SetItemBold(m_TreeCtrl->GetItemParent(m_TreeItem), true);
         }
         }
-        
+
         virtual wxString GetValueAsText(wxTreeItemId ti)
         {
             PropertyInfo *pi = &(((PETreeData*)m_TreeCtrl->GetItemData(ti))->PropInfo);
             return XmlReadValue(GetNode(), pi->Name).BeforeFirst(_T('d'));
         }
         virtual wxString GetValueAsText(wxTreeItemId ti)
         {
             PropertyInfo *pi = &(((PETreeData*)m_TreeCtrl->GetItemData(ti))->PropInfo);
             return XmlReadValue(GetNode(), pi->Name).BeforeFirst(_T('d'));
         }
-        
-        virtual wxString GetPropName(const PropertyInfo& pinfo)
+
+        virtual wxString GetPropName(const PropertyInfo& WXUNUSED(pinfo))
         {
             return _T("val");
         }
 
         {
             return _T("val");
         }
 
-        virtual bool HasClearButton() { return FALSE; }
-        virtual bool IsPresent(const PropertyInfo& pinfo) { return FALSE; } 
+        virtual bool HasClearButton() { return false; }
+        virtual bool IsPresent(const PropertyInfo& WXUNUSED(pinfo)) { return false; }
+
 
 
-    
     protected:
         wxString m_c;
 };
     protected:
         wxString m_c;
 };
@@ -357,19 +359,19 @@ wxTreeItemId PropEditCtrlDim::CreateTreeEntry(wxTreeItemId parent, const Propert
 
 
 
 
 
 
-// --------------------- PropEditCtrlXMLID -----------------------------
+// --------------------- PropEditCtrlXRCID -----------------------------
 
 #define REAL_NODE (NodeHandler::Find(GetNode())->GetRealNode(GetNode()))
 
 
 
 #define REAL_NODE (NodeHandler::Find(GetNode())->GetRealNode(GetNode()))
 
 
-void PropEditCtrlXMLID::ReadValue()
+void PropEditCtrlXRCID::ReadValue()
 {
     m_TextCtrl->SetValue(REAL_NODE->GetPropVal(_T("name"), wxEmptyString));
 }
 
 
 
 {
     m_TextCtrl->SetValue(REAL_NODE->GetPropVal(_T("name"), wxEmptyString));
 }
 
 
 
-void PropEditCtrlXMLID::WriteValue()
+void PropEditCtrlXRCID::WriteValue()
 {
     wxString s =m_TextCtrl->GetValue();
     if (s.IsEmpty()) s = _T("-1");
 {
     wxString s =m_TextCtrl->GetValue();
     if (s.IsEmpty()) s = _T("-1");
@@ -377,29 +379,29 @@ void PropEditCtrlXMLID::WriteValue()
     REAL_NODE->DeleteProperty(_T("name"));
     REAL_NODE->AddProperty(_T("name"), s);
 
     REAL_NODE->DeleteProperty(_T("name"));
     REAL_NODE->AddProperty(_T("name"), s);
 
-    m_TreeCtrl->SetItemBold(m_TreeItem, TRUE);
+    m_TreeCtrl->SetItemBold(m_TreeItem, true);
     EditorFrame::Get()->NotifyChanged(CHANGED_TREE_SELECTED);
 }
 
 
 
     EditorFrame::Get()->NotifyChanged(CHANGED_TREE_SELECTED);
 }
 
 
 
-void PropEditCtrlXMLID::Clear()
+void PropEditCtrlXRCID::Clear()
 {
     EndEdit();
     REAL_NODE->DeleteProperty(_T("name"));
 {
     EndEdit();
     REAL_NODE->DeleteProperty(_T("name"));
-    m_TreeCtrl->SetItemBold(m_TreeItem, FALSE);
+    m_TreeCtrl->SetItemBold(m_TreeItem, false);
     EditorFrame::Get()->NotifyChanged(CHANGED_TREE_SELECTED);
 }
 
 
 
     EditorFrame::Get()->NotifyChanged(CHANGED_TREE_SELECTED);
 }
 
 
 
-void PropEditCtrlXMLID::OnDetails()
+void PropEditCtrlXRCID::OnDetails()
 {
     wxString choices[] = {wxString(_T("-1"))
 {
     wxString choices[] = {wxString(_T("-1"))
-      #define stdID(id) , wxString(#id)
+      #define stdID(id) , wxString(_T(#id))
       stdID(wxID_OK) stdID(wxID_CANCEL)
       stdID(wxID_YES) stdID(wxID_NO)
       stdID(wxID_OK) stdID(wxID_CANCEL)
       stdID(wxID_YES) stdID(wxID_NO)
-      stdID(wxID_APPLY) stdID(wxID_HELP) 
+      stdID(wxID_APPLY) stdID(wxID_HELP)
       stdID(wxID_HELP_CONTEXT)
 
       stdID(wxID_OPEN) stdID(wxID_CLOSE) stdID(wxID_NEW)
       stdID(wxID_HELP_CONTEXT)
 
       stdID(wxID_OPEN) stdID(wxID_CLOSE) stdID(wxID_NEW)
@@ -410,32 +412,32 @@ void PropEditCtrlXMLID::OnDetails()
       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_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_SELECTALL)
       stdID(wxID_STATIC) stdID(wxID_FORWARD) stdID(wxID_BACKWARD)
       stdID(wxID_DEFAULT) stdID(wxID_MORE) stdID(wxID_SETUP)
       stdID(wxID_STATIC) stdID(wxID_FORWARD) stdID(wxID_BACKWARD)
       stdID(wxID_DEFAULT) stdID(wxID_MORE) stdID(wxID_SETUP)
-      stdID(wxID_RESET) 
+      stdID(wxID_RESET)
       #undef stdID
       };
 
       #undef stdID
       };
 
-    wxString s = 
-        wxGetSingleChoice(_("Choose from predefined IDs:"), _("XMLID"), 
+    wxString s =
+        wxGetSingleChoice(_("Choose from predefined IDs:"), _("XRCID"),
                           38/*sizeof choices*/, choices);
     if (!s) return;
     m_TextCtrl->SetValue(s);
     WriteValue();
                           38/*sizeof choices*/, choices);
     if (!s) return;
     m_TextCtrl->SetValue(s);
     WriteValue();
-    EditorFrame::Get()->NotifyChanged(CHANGED_PROPS);    
+    EditorFrame::Get()->NotifyChanged(CHANGED_PROPS);
 }
 
 
 
 }
 
 
 
-wxString PropEditCtrlXMLID::GetValueAsText(wxTreeItemId ti)
+wxString PropEditCtrlXRCID::GetValueAsText(wxTreeItemId WXUNUSED(ti))
 {
     return REAL_NODE->GetPropVal(_T("name"), wxEmptyString);
 }
 
 
 
 {
     return REAL_NODE->GetPropVal(_T("name"), wxEmptyString);
 }
 
 
 
-bool PropEditCtrlXMLID::IsPresent(const PropertyInfo& pinfo)
+bool PropEditCtrlXRCID::IsPresent(const PropertyInfo& WXUNUSED(pinfo))
 {
     return REAL_NODE->HasProp(_T("name"));
 }
 {
     return REAL_NODE->HasProp(_T("name"));
 }