]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 807366 ] fixes for wxrcedit contrib util
authorJulian Smart <julian@anthemion.co.uk>
Thu, 18 Sep 2003 13:47:05 +0000 (13:47 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 18 Sep 2003 13:47:05 +0000 (13:47 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23671 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/utils/wxrcedit/edapp.cpp
contrib/utils/wxrcedit/editor.cpp
contrib/utils/wxrcedit/nodehnd.cpp
contrib/utils/wxrcedit/nodesdb.cpp
contrib/utils/wxrcedit/pe_adv.cpp
contrib/utils/wxrcedit/pe_basic.cpp
contrib/utils/wxrcedit/preview.cpp
contrib/utils/wxrcedit/propedit.cpp
contrib/utils/wxrcedit/splittree.cpp
contrib/utils/wxrcedit/wxrcedit.rc

index 9c3602ffaad75f7107cbb9f98654f0a451a6cad0..ffce6a4fe512a0b8fd70124864d3e4782c44f11d 100644 (file)
@@ -49,7 +49,7 @@ bool MyApp::OnInit()
 {
     SetVendorName(wxT("wxWindows"));
     SetAppName(wxT("wxrcedit"));
-    wxString arg = (argc >= 1) ? argv[1] : "";
+    wxString arg = (argc >= 1) ? argv[1] : _T("");
     wxInitAllImageHandlers();
     wxFrame *frame = new EditorFrame(NULL, arg);
     SetTopWindow(frame);
index a77da8d858e5f8c8f797319c32c609d31c424c83..7afb2b2377341a1c133351f7e967c9c6af38c092 100644 (file)
@@ -192,35 +192,35 @@ EditorFrame::EditorFrame(wxFrame *parent, const wxString& filename)
     
     wxConfigBase *cfg = wxConfigBase::Get();
     
-    SetSize(wxRect(wxPoint(cfg->Read("editor_x", -1), cfg->Read("editor_y", -1)),
-            wxSize(cfg->Read("editor_w", 400), cfg->Read("editor_h", 400))));
+    SetSize(wxRect(wxPoint(cfg->Read(_T("editor_x"), -1), cfg->Read(_T("editor_y"), -1)),
+            wxSize(cfg->Read(_T("editor_w"), 400), cfg->Read(_T("editor_h"), 400))));
 
     m_SelectedNode = NULL;
     m_Resource = NULL;
     m_FileName = wxEmptyString;
 
     wxMenu *menuFile = new wxMenu;
-    menuFile->Append(ID_NEW, "&New");
-    menuFile->Append(ID_OPEN, "&Open\tCtrl-O");
-    menuFile->Append(ID_SAVE, "&Save\tCtrl-S");
-    menuFile->Append(ID_SAVEAS, "Save &as...");
+    menuFile->Append(ID_NEW, _T("&New"));
+    menuFile->Append(ID_OPEN, _T("&Open\tCtrl-O"));
+    menuFile->Append(ID_SAVE, _T("&Save\tCtrl-S"));
+    menuFile->Append(ID_SAVEAS, _T("Save &as..."));
     menuFile->AppendSeparator();
-    menuFile->Append(ID_EXIT, "E&xit\tAlt-X");
+    menuFile->Append(ID_EXIT, _T("E&xit\tAlt-X"));
 
     wxMenu *menuEdit = new wxMenu;
-    menuEdit->Append(ID_CUT, "Cut\tCtrl-X");
-    menuEdit->Append(ID_COPY, "Copy\tCtrl-C");
-    menuEdit->Append(ID_PASTE_SYBLING, "Paste as sybling\tCtrl-V");
-    menuEdit->Append(ID_PASTE_CHILD, "Paste as child");
+    menuEdit->Append(ID_CUT, _T("Cut\tCtrl-X"));
+    menuEdit->Append(ID_COPY, _T("Copy\tCtrl-C"));
+    menuEdit->Append(ID_PASTE_SYBLING, _T("Paste as sybling\tCtrl-V"));
+    menuEdit->Append(ID_PASTE_CHILD, _T("Paste as child"));
     menuEdit->AppendSeparator();
-    menuEdit->Append(ID_DELETE_NODE,  "Delete");
+    menuEdit->Append(ID_DELETE_NODE,  _T("Delete"));
 
     menuEdit->Enable(ID_PASTE_SYBLING, FALSE);
     menuEdit->Enable(ID_PASTE_CHILD, FALSE);
     
     wxMenuBar *menuBar = new wxMenuBar();
-    menuBar->Append(menuFile, "&File");
-    menuBar->Append(menuEdit, "&Edit");
+    menuBar->Append(menuFile, _T("&File"));
+    menuBar->Append(menuEdit, _T("&Edit"));
     SetMenuBar(menuBar);
   
     // Create toolbar:
@@ -294,7 +294,7 @@ void EditorFrame::LoadFile(const wxString& filename)
      // create new resource in order to handle version differences properly
     PreviewFrame::Get()->ResetResource();
     
-    m_FileName = "";
+    m_FileName = wxEmptyString;
     m_Resource = new wxXmlRcEditDocument;
     m_Modified = FALSE;
     
@@ -303,7 +303,7 @@ void EditorFrame::LoadFile(const wxString& filename)
         delete m_Resource;
         m_Resource = NULL;
         NewFile();
-        wxLogError("Error parsing " + filename);
+        wxLogError(_T("Error parsing ") + filename);
     }
     else
     {
@@ -339,11 +339,11 @@ void EditorFrame::NewFile()
 
     delete m_Resource;
     
-    m_FileName = "";
+    m_FileName = wxEmptyString;
     m_Resource = new wxXmlRcEditDocument;
     m_Resource->SetRoot(new wxXmlNode(wxXML_ELEMENT_NODE, _("resource")));
        
-       m_Resource->SetFileEncoding("utf-8");
+       m_Resource->SetFileEncoding(_T("utf-8"));
 #if !wxUSE_UNICODE
     m_Resource->SetEncoding(wxLocale::GetSystemEncodingName());
 #endif
@@ -363,7 +363,7 @@ void EditorFrame::RefreshTitle()
     wxString s;
     if (m_Modified) s << _T("* ");
     s << _("wxrcedit");
-    if (m_FileName != "")
+    if (m_FileName != wxEmptyString)
         s << _T(" - ") << wxFileNameFromPath(m_FileName);
     SetTitle(s);
 }
@@ -376,7 +376,7 @@ void EditorFrame::RefreshTree()
     
     m_TreeCtrl->DeleteAllItems(); 
 
-    wxTreeItemId root = m_TreeCtrl->AddRoot("Resource: " + wxFileNameFromPath(m_FileName), 5, 5);
+    wxTreeItemId root = m_TreeCtrl->AddRoot(_T("Resource: ") + wxFileNameFromPath(m_FileName), 5, 5);
 
     wxXmlNode *n = m_Resource->GetRoot()->GetChildren();  
     while (n)
@@ -541,7 +541,7 @@ void EditorFrame::OnToolbar(wxCommandEvent& event)
             }
 
         case ID_SAVE :
-            if (m_FileName != "") { SaveFile(m_FileName); break;}
+            if (m_FileName != wxEmptyString) { SaveFile(m_FileName); break;}
             // else go to SAVEAS
 
         case ID_SAVEAS :
index e8a9abc39bb8a1f1563176aaed6bbb13ef1ab505..ff5c07cd66355ba43229f9631a56700f74bb2485 100644 (file)
@@ -100,7 +100,7 @@ bool NodeHandler::CanHandle(wxXmlNode *node)
 
 
 
-PropertyInfoArray& NodeHandler::GetPropsList(wxXmlNode *node)
+PropertyInfoArray& NodeHandler::GetPropsList(wxXmlNode *WXUNUSED(node))
 {
     return m_NodeInfo->Props;
 }
@@ -159,7 +159,7 @@ wxArrayString& NodeHandler::GetChildTypes()
 
 
 
-void NodeHandler::InsertNode(wxXmlNode *parent, wxXmlNode *node, wxXmlNode *insert_before)
+void NodeHandler::InsertNode(wxXmlNode *WXUNUSED(parent), wxXmlNode *node, wxXmlNode *WXUNUSED(insert_before))
 {
     delete node;
     wxLogError(_("Cannot insert child into this type of node!"));
@@ -178,7 +178,7 @@ wxTreeItemId NodeHandlerPanel::CreateTreeNode(wxTreeCtrl *treectrl,
 {
     wxTreeItemId root = NodeHandler::CreateTreeNode(treectrl, parent, node);
     
-    wxXmlNode *n = XmlFindNode(node, "object");
+    wxXmlNode *n = XmlFindNode(node, _T("object"));
 
     while (n)
     {
index 53a9a9595cd1e62e68121f5ad35e43d5a65faac2..1fe48b08afc2f5387002224b456f28c884882e39 100644 (file)
@@ -159,7 +159,7 @@ void NodesDb::LoadDir(const wxString& path)
     wxString filename;
     bool cont;
 
-    cont = dir.GetFirst(&filename, "*.df");
+    cont = dir.GetFirst(&filename, _T("*.df"));
     while (cont)
     {
         LoadFile(filename);
index 88b447b8d005859f051e64aa26a7070369c7fb3e..80abc878e57fdc3cd690ab95199d455c0606e031 100644 (file)
@@ -94,7 +94,7 @@ void PropEditCtrlChoice::WriteValue()
 
 
 
-void PropEditCtrlChoice::OnChoice(wxCommandEvent& event)
+void PropEditCtrlChoice::OnChoice(wxCommandEvent& WXUNUSED(event))
 {
     if (CanSave()) 
     {
index b55b81f9ebde0f81a56f24f834dc078d5cabd534..ab467eb4537186a324fc3f46b036b951e200c9e7 100644 (file)
@@ -39,7 +39,7 @@ wxWindow *PropEditCtrlTxt::CreateEditCtrl()
 
 
 
-void PropEditCtrlTxt::OnText(wxCommandEvent& event)
+void PropEditCtrlTxt::OnText(wxCommandEvent& WXUNUSED(event))
 {
     if (CanSave()) 
     {
@@ -126,7 +126,7 @@ wxString PropEditCtrlBool::GetValueAsText(wxTreeItemId ti)
 
 
 
-void PropEditCtrlBool::OnChoice(wxCommandEvent& event)
+void PropEditCtrlBool::OnChoice(wxCommandEvent& WXUNUSED(event))
 {
     if (CanSave()) 
     {
@@ -398,7 +398,7 @@ void PropEditCtrlXRCID::Clear()
 void PropEditCtrlXRCID::OnDetails()
 {
     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_APPLY) stdID(wxID_HELP) 
@@ -430,14 +430,14 @@ void PropEditCtrlXRCID::OnDetails()
 
 
 
-wxString PropEditCtrlXRCID::GetValueAsText(wxTreeItemId ti)
+wxString PropEditCtrlXRCID::GetValueAsText(wxTreeItemId WXUNUSED(ti))
 {
     return REAL_NODE->GetPropVal(_T("name"), wxEmptyString);
 }
 
 
 
-bool PropEditCtrlXRCID::IsPresent(const PropertyInfo& pinfo)
+bool PropEditCtrlXRCID::IsPresent(const PropertyInfo& WXUNUSED(pinfo))
 {
     return REAL_NODE->HasProp(_T("name"));
 }
index 22d9ceeaab0cb237c1c06ab50e4d4580400de54a..29a11c77bdb96edd158571737710e8a59da756eb 100644 (file)
@@ -202,7 +202,7 @@ void PreviewFrame::Preview(wxXmlNode *node, wxXmlDocument *orig_doc)
 
 void PreviewFrame::PreviewMenu()
 {
-    wxMenuBar *mbar;
+    wxMenuBar *mbar = NULL;
 
     if (XmlGetClass(m_Node) == _T("wxMenuBar"))
         mbar = m_RC->LoadMenuBar(m_Node->GetPropVal(_T("name"), _T("-1")));
@@ -274,7 +274,7 @@ BEGIN_EVENT_TABLE(PreviewFrame, wxFrame)
     EVT_ENTER_WINDOW(PreviewFrame::OnMouseEnter)
 END_EVENT_TABLE()
 
-void PreviewFrame::OnMouseEnter(wxMouseEvent& event)
+void PreviewFrame::OnMouseEnter(wxMouseEvent& WXUNUSED(event))
 {
     if (m_Dirty) Preview(m_Node,m_Doc);
 }
index a2021b83d0c77a5140037832071be3921d338b86..288dd3ee6c10f6fa2dd5ebfaf82e74f3db163d74 100644 (file)
@@ -37,12 +37,12 @@ BEGIN_EVENT_TABLE(PropEditCtrl, wxPanel)
     EVT_BUTTON(ID_DETAILS, PropEditCtrl::OnButtonDetails)
 END_EVENT_TABLE()
 
-void PropEditCtrl::OnButtonDetails(wxCommandEvent& event)
+void PropEditCtrl::OnButtonDetails(wxCommandEvent& WXUNUSED(event))
 {
     OnDetails();
 }
 
-void PropEditCtrl::OnButtonClear(wxCommandEvent& event)
+void PropEditCtrl::OnButtonClear(wxCommandEvent& WXUNUSED(event))
 {
     Clear();
     EditorFrame::Get()->NotifyChanged(CHANGED_PROPS);        
index 5955bc135f3c5616b862acea7bcf35c5dfdfa6f0..263d9df88beb6ebc2faeafbda956df6bb1f8b27f 100644 (file)
@@ -92,12 +92,12 @@ void wxRemotelyScrolledTreeCtrl::HideVScrollbar()
 // Number of pixels per user unit (0 or -1 for no scrollbar)
 // Length of virtual canvas in user units
 // Length of page in user units
+#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
 void wxRemotelyScrolledTreeCtrl::SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
                              int noUnitsX, int noUnitsY,
                              int xPos, int yPos,
                              bool noRefresh)
 {
-#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     {
         wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
@@ -109,15 +109,21 @@ void wxRemotelyScrolledTreeCtrl::SetScrollbars(int pixelsPerUnitX, int pixelsPer
             scrolledWindow->SetScrollbars(0, pixelsPerUnitY, 0, noUnitsY, 0, yPos, noRefresh);
         }
     }
+#else
+void wxRemotelyScrolledTreeCtrl::SetScrollbars(int WXUNUSED(pixelsPerUnitX), int WXUNUSED(pixelsPerUnitY),
+                             int WXUNUSED(noUnitsX), int WXUNUSED(noUnitsY),
+                             int WXUNUSED(xPos), int WXUNUSED(yPos),
+                             bool WXUNUSED(noRefresh))
+{
 #endif
 }
 
 // In case we're using the generic tree control.
+#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
 int wxRemotelyScrolledTreeCtrl::GetScrollPos(int orient) const
 {
     wxScrolledWindow* scrolledWindow = GetScrolledWindow();
 
-#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     {
         wxGenericTreeCtrl* win = (wxGenericTreeCtrl*) this;
@@ -129,6 +135,9 @@ int wxRemotelyScrolledTreeCtrl::GetScrollPos(int orient) const
             return scrolledWindow->GetScrollPos(orient);
         }
     }
+#else
+int wxRemotelyScrolledTreeCtrl::GetScrollPos(int WXUNUSED(orient)) const
+{
 #endif
     return 0;
 }
@@ -164,9 +173,9 @@ void wxRemotelyScrolledTreeCtrl::GetViewStart(int *x, int *y) const
 }
 
 // In case we're using the generic tree control.
+#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
 void wxRemotelyScrolledTreeCtrl::PrepareDC(wxDC& dc)
 {
-#if USE_GENERIC_TREECTRL || !defined(__WXMSW__)
     if (IsKindOf(CLASSINFO(wxGenericTreeCtrl)))
     {
            wxScrolledWindow* scrolledWindow = GetScrolledWindow();
@@ -183,12 +192,15 @@ void wxRemotelyScrolledTreeCtrl::PrepareDC(wxDC& dc)
         dc.SetDeviceOrigin( -startX * xppu1, -startY * yppu2 );
         // dc.SetUserScale( win->GetScaleX(), win->GetScaleY() );
     }
+#else
+void wxRemotelyScrolledTreeCtrl::PrepareDC(wxDC& WXUNUSED(dc))
+{
 #endif
 }
 
 // Scroll to the given line (in scroll units where each unit is
 // the height of an item)
-void wxRemotelyScrolledTreeCtrl::ScrollToLine(int posHoriz, int posVert)
+void wxRemotelyScrolledTreeCtrl::ScrollToLine(int WXUNUSED(posHoriz), int posVert)
 {
 #ifdef __WXMSW__
 #if USE_GENERIC_TREECTRL
@@ -417,7 +429,7 @@ void wxTreeCompanionWindow::DrawItem(wxDC& dc, wxTreeItemId id, const wxRect& re
 #endif
 }
 
-void wxTreeCompanionWindow::OnPaint(wxPaintEvent& event)
+void wxTreeCompanionWindow::OnPaint(wxPaintEvent& WXUNUSED(event))
 {
        wxPaintDC dc(this);
 
@@ -470,7 +482,7 @@ void wxTreeCompanionWindow::OnScroll(wxScrollWinEvent& event)
        Refresh(TRUE);
 }
 
-void wxTreeCompanionWindow::OnExpand(wxTreeEvent& event)
+void wxTreeCompanionWindow::OnExpand(wxTreeEvent& WXUNUSED(event))
 {
        // TODO: something more optimized than simply refresh the whole
        // window when the tree is expanded/collapsed. Tricky.
@@ -509,7 +521,7 @@ void wxThinSplitterWindow::SizeWindows()
 }
 
 // Tests for x, y over sash
-bool wxThinSplitterWindow::SashHitTest(int x, int y, int tolerance)
+bool wxThinSplitterWindow::SashHitTest(int x, int y, int WXUNUSED(tolerance))
 {
        return wxSplitterWindow::SashHitTest(x, y, 4);
 }
@@ -581,12 +593,12 @@ wxSplitterScrolledWindow::wxSplitterScrolledWindow(wxWindow* parent, wxWindowID
 {
 }
 
-void wxSplitterScrolledWindow::OnSize(wxSizeEvent& event)
+void wxSplitterScrolledWindow::OnSize(wxSizeEvent& WXUNUSED(event))
 {
        wxSize sz = GetClientSize();
-       if (GetChildren().First())
+       if (GetChildren().GetFirst())
        {
-               ((wxWindow*) GetChildren().First()->Data())->SetSize(0, 0, sz.x, sz.y);
+               ((wxWindow*) GetChildren().GetFirst()->GetData())->SetSize(0, 0, sz.x, sz.y);
        }
 }
 
@@ -637,10 +649,10 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event)
     }
 
     // Find targets in splitter window and send the event to them
-    wxNode* node = GetChildren().First();
+    wxNode* node = (wxNode *)GetChildren().GetFirst();
     while (node)
     {
-        wxWindow* child = (wxWindow*) node->Data();
+        wxWindow* child = (wxWindow*) node->GetData();
         if (child->IsKindOf(CLASSINFO(wxSplitterWindow)))
         {
             wxSplitterWindow* splitter = (wxSplitterWindow*) child;
@@ -650,7 +662,7 @@ void wxSplitterScrolledWindow::OnScroll(wxScrollWinEvent& event)
                 splitter->GetWindow2()->ProcessEvent(event);
             break;
         }
-        node = node->Next();
+        node = node->GetNext();
     }
 
 #ifdef __WXMAC__
index cf5a5202c08f8eb703a254de8b46def0881b758b..f61f0e588555817dc66611a74d3956b20fd52915 100644 (file)
@@ -1,17 +1,17 @@
 #include "wx/msw/wx.rc"
 
-aaa      ICON   mondrian.ico
+aaa      ICON   "mondrian.ico"
 
-close    BITMAP bitmaps/close.bmp
-open     BITMAP bitmaps/open.bmp
-preview  BITMAP bitmaps/preview.bmp
-save     BITMAP bitmaps/save.bmp
+close    BITMAP "bitmaps/close.bmp"
+open     BITMAP "bitmaps/open.bmp"
+preview  BITMAP "bitmaps/preview.bmp"
+save     BITMAP "bitmaps/save.bmp"
 
-control  ICON   bitmaps/control.ico
-hsizer   ICON   bitmaps/hsizer.ico
-vsizer   ICON   bitmaps/vsizer.ico
-panel    ICON   bitmaps/panel.ico
-unused   ICON   bitmaps/unused.ico
-used     ICON   bitmaps/used.ico
-resicon  ICON   bitmaps/resicon.ico
-gsizer   ICON   bitmaps/gsizer.ico
+control  ICON   "bitmaps/control.ico"
+hsizer   ICON   "bitmaps/hsizer.ico"
+vsizer   ICON   "bitmaps/vsizer.ico"
+panel    ICON   "bitmaps/panel.ico"
+unused   ICON   "bitmaps/unused.ico"
+used     ICON   "bitmaps/used.ico"
+resicon  ICON   "bitmaps/resicon.ico"
+gsizer   ICON   "bitmaps/gsizer.ico"