]> git.saurik.com Git - wxWidgets.git/commitdiff
Better wxFile support, warning fixes and minor source cleaning.
authorWłodzimierz Skiba <abx@abx.art.pl>
Fri, 4 Mar 2005 19:32:40 +0000 (19:32 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Fri, 4 Mar 2005 19:32:40 +0000 (19:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32604 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

contrib/utils/convertrc/rc2wxr.cpp
contrib/utils/convertrc/rc2wxr.h
contrib/utils/convertrc/rc2xml.cpp
contrib/utils/convertrc/rc2xml.h
contrib/utils/wxrcedit/pe_adv.cpp
contrib/utils/wxrcedit/propframe.cpp

index 11eb941376c9844a1ab7e8f08f426a143d3c277f..2a923d54459a204bb51992e563b010efdba2bac2 100644 (file)
@@ -675,41 +675,24 @@ return phrase;
 
 
 void rc2wxr::ReadChar(int &ch)
-
 {
+    wxFileOffset result = m_rc.Tell();
 
-    int result;
-
-result=m_rc.Tell();
-
-
-
-if((result>=m_filesize))
-
-    m_done=true;
-
-
-
-result=m_rc.Read(&ch,1);
+    if ( result >= m_filesize )
+        m_done=true;
 
+    result = m_rc.Read(&ch,1);
 
+    if ( result==wxInvalidOffset )
+        m_done=true;
 
-if((result==-1))
-
-   m_done=true;
-
-
-
-if(ch==EOF)
-
-   m_done=true;
-
+    if(ch==EOF)
+        m_done=true;
 }
 
 
 
 void rc2wxr::ParseComboBox()
-
 {
 
 /* COMBOBOX        IDC_SCALECOMBO,10,110,48,52,CBS_DROPDOWNLIST | CBS_SORT |
index 3250092d7e2f1a45a1532dcea0096be926826f44..d01f76591ffb28e3e0bf62b07d9cae7d8ffab9ef 100644 (file)
 class rc2wxr : public wxObject
 {
 public:
-rc2wxr();
-~rc2wxr();
-void Convert(wxString wxrfile, wxString rcfile);
+    rc2wxr();
+    ~rc2wxr();
+    void Convert(wxString wxrfile, wxString rcfile);
 
 private:
-wxFile m_rc;
-FILE *m_wxr;
-int m_filesize;
-bool m_done;
-int m_controlid;
-void ParseDialog(wxString dlgname);
-void ParseControls();
-void ParseStaticText();
-void ParseTextCtrl();
-void ParsePushButton();
-bool Seperator(int ch);
-void ParseGroupBox();
-void ReadRect(int & x, int & y, int & width, int & height);
-wxString GetToken();
-wxString GetQuoteField();
-void ReadChar(int &ch);
-void ParseComboBox();
-void ParseMenu(wxString name);
-void ParsePopupMenu();
-wxString PeekToken();
-void ParseControlMS();
-void ParseSlider(wxString label, wxString varname);
-void ParseProgressBar(wxString label, wxString varname);
-bool ReadOrs(wxString & w);
-void ParseCtrlButton(wxString label, wxString varname);
-
+    wxFile m_rc;
+    FILE *m_wxr;
+    wxFileOffset m_filesize;
+    bool m_done;
+    int m_controlid;
+    void ParseDialog(wxString dlgname);
+    void ParseControls();
+    void ParseStaticText();
+    void ParseTextCtrl();
+    void ParsePushButton();
+    bool Seperator(int ch);
+    void ParseGroupBox();
+    void ReadRect(int & x, int & y, int & width, int & height);
+    wxString GetToken();
+    wxString GetQuoteField();
+    void ReadChar(int &ch);
+    void ParseComboBox();
+    void ParseMenu(wxString name);
+    void ParsePopupMenu();
+    wxString PeekToken();
+    void ParseControlMS();
+    void ParseSlider(wxString label, wxString varname);
+    void ParseProgressBar(wxString label, wxString varname);
+    bool ReadOrs(wxString & w);
+    void ParseCtrlButton(wxString label, wxString varname);
 };
 
 
index 4279eaef82fe48a761c34afc94a5d9ac9b947657..386d02a27b48874fc646d762e52a659f7b82a88b 100644 (file)
@@ -901,7 +901,8 @@ void rc2xml::FirstPass()
 
 void rc2xml::ParseBitmap(wxString varname)
 {
-    wxString token,*bitmapfile;
+    wxString token;
+    wxString *bitmapfile;
 
     token=PeekToken();
     //Microsoft notation?
@@ -1138,7 +1139,8 @@ void rc2xml::ParseIconStatic()
 //IDR_MAINFRAME           ICON    DISCARDABLE     "res\\mfcexample.ico"
 void rc2xml::ParseIcon(wxString varname)
 {
-    wxString token,*iconfile;
+    wxString token;
+    wxString *iconfile;
     iconfile=new wxString;
     token=PeekToken();
 
index 0481665f4bb3f3ccf5232326fdeedc838105896f..edf6ba95517efd5f0713381abb3c3b9513cfc969 100644 (file)
@@ -87,7 +87,7 @@ protected:
     wxList * m_resourcelist;
     wxFile m_rc;
     wxFFile m_xmlfile;
-    int m_filesize;
+    wxFileOffset m_filesize;
     bool m_done;
 
 };
index 7698cf680462944e8ab972385f1a81c9f567fcfb..e89206d328f1fd009ce801f5b0fbf65ca60a9db2 100644 (file)
@@ -115,9 +115,9 @@ void PropEditCtrlColor::OnDetails()
 
     if (txt.Length() == 7 && txt[0u] == _T('#') &&
         wxSscanf(txt.c_str(), _T("#%lX"), &tmp) == 1)
-        clr = wxColour((tmp & 0xFF0000) >> 16,
-                       (tmp & 0x00FF00) >> 8,
-                       (tmp & 0x0000FF));
+        clr = wxColour((unsigned char)((tmp & 0xFF0000) >> 16),
+                       (unsigned char)((tmp & 0x00FF00) >> 8),
+                       (unsigned char)((tmp & 0x0000FF)));
 
     clr = wxGetColourFromUser(NULL, clr);
     if (clr.Ok())
@@ -186,7 +186,7 @@ void PropEditCtrlFlags::OnDetails()
     for (i = 0; i < arr.GetCount(); i++)
         if (lbox->IsChecked(i))
             txt << arr[i] << _T('|');
-    if (!txt.IsEmpty()) txt.RemoveLast();
+    if (!txt.empty()) txt.RemoveLast();
 
     m_TextCtrl->SetValue(txt);
     WriteValue();
index ee124f4048c1fb448cef446e3134282c797c2bad..b31b83425c47df98ade70d8ccb882514a02920c7 100644 (file)
@@ -60,10 +60,10 @@ class PropsTree: public wxRemotelyScrolledTreeCtrl
             // Reset the device origin since it may have been set
             dc.SetDeviceOrigin(0, 0);
 
-            wxPen pen(wxColour(_T("BLACK")), 1, wxSOLID);
+            wxPen pen(*wxBLACK, 1, wxSOLID);
             dc.SetPen(pen);
 
-            dc.SetBrush(* wxTRANSPARENT_BRUSH);
+            dc.SetBrush(*wxTRANSPARENT_BRUSH);
 
             wxSize clientSize = GetClientSize();
             wxRect itemRect;