Better wxFile support, warning fixes and minor source cleaning.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32604 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -675,41 +675,24 @@ return phrase;
|
|||||||
|
|
||||||
|
|
||||||
void rc2wxr::ReadChar(int &ch)
|
void rc2wxr::ReadChar(int &ch)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
wxFileOffset result = m_rc.Tell();
|
||||||
|
|
||||||
int result;
|
if ( result >= m_filesize )
|
||||||
|
|
||||||
result=m_rc.Tell();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if((result>=m_filesize))
|
|
||||||
|
|
||||||
m_done=true;
|
m_done=true;
|
||||||
|
|
||||||
|
result = m_rc.Read(&ch,1);
|
||||||
|
|
||||||
|
if ( result==wxInvalidOffset )
|
||||||
result=m_rc.Read(&ch,1);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if((result==-1))
|
|
||||||
|
|
||||||
m_done=true;
|
m_done=true;
|
||||||
|
|
||||||
|
if(ch==EOF)
|
||||||
|
|
||||||
if(ch==EOF)
|
|
||||||
|
|
||||||
m_done=true;
|
m_done=true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void rc2wxr::ParseComboBox()
|
void rc2wxr::ParseComboBox()
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/* COMBOBOX IDC_SCALECOMBO,10,110,48,52,CBS_DROPDOWNLIST | CBS_SORT |
|
/* COMBOBOX IDC_SCALECOMBO,10,110,48,52,CBS_DROPDOWNLIST | CBS_SORT |
|
||||||
|
@@ -11,37 +11,36 @@
|
|||||||
class rc2wxr : public wxObject
|
class rc2wxr : public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
rc2wxr();
|
rc2wxr();
|
||||||
~rc2wxr();
|
~rc2wxr();
|
||||||
void Convert(wxString wxrfile, wxString rcfile);
|
void Convert(wxString wxrfile, wxString rcfile);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxFile m_rc;
|
wxFile m_rc;
|
||||||
FILE *m_wxr;
|
FILE *m_wxr;
|
||||||
int m_filesize;
|
wxFileOffset m_filesize;
|
||||||
bool m_done;
|
bool m_done;
|
||||||
int m_controlid;
|
int m_controlid;
|
||||||
void ParseDialog(wxString dlgname);
|
void ParseDialog(wxString dlgname);
|
||||||
void ParseControls();
|
void ParseControls();
|
||||||
void ParseStaticText();
|
void ParseStaticText();
|
||||||
void ParseTextCtrl();
|
void ParseTextCtrl();
|
||||||
void ParsePushButton();
|
void ParsePushButton();
|
||||||
bool Seperator(int ch);
|
bool Seperator(int ch);
|
||||||
void ParseGroupBox();
|
void ParseGroupBox();
|
||||||
void ReadRect(int & x, int & y, int & width, int & height);
|
void ReadRect(int & x, int & y, int & width, int & height);
|
||||||
wxString GetToken();
|
wxString GetToken();
|
||||||
wxString GetQuoteField();
|
wxString GetQuoteField();
|
||||||
void ReadChar(int &ch);
|
void ReadChar(int &ch);
|
||||||
void ParseComboBox();
|
void ParseComboBox();
|
||||||
void ParseMenu(wxString name);
|
void ParseMenu(wxString name);
|
||||||
void ParsePopupMenu();
|
void ParsePopupMenu();
|
||||||
wxString PeekToken();
|
wxString PeekToken();
|
||||||
void ParseControlMS();
|
void ParseControlMS();
|
||||||
void ParseSlider(wxString label, wxString varname);
|
void ParseSlider(wxString label, wxString varname);
|
||||||
void ParseProgressBar(wxString label, wxString varname);
|
void ParseProgressBar(wxString label, wxString varname);
|
||||||
bool ReadOrs(wxString & w);
|
bool ReadOrs(wxString & w);
|
||||||
void ParseCtrlButton(wxString label, wxString varname);
|
void ParseCtrlButton(wxString label, wxString varname);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -901,7 +901,8 @@ void rc2xml::FirstPass()
|
|||||||
|
|
||||||
void rc2xml::ParseBitmap(wxString varname)
|
void rc2xml::ParseBitmap(wxString varname)
|
||||||
{
|
{
|
||||||
wxString token,*bitmapfile;
|
wxString token;
|
||||||
|
wxString *bitmapfile;
|
||||||
|
|
||||||
token=PeekToken();
|
token=PeekToken();
|
||||||
//Microsoft notation?
|
//Microsoft notation?
|
||||||
@@ -1138,7 +1139,8 @@ void rc2xml::ParseIconStatic()
|
|||||||
//IDR_MAINFRAME ICON DISCARDABLE "res\\mfcexample.ico"
|
//IDR_MAINFRAME ICON DISCARDABLE "res\\mfcexample.ico"
|
||||||
void rc2xml::ParseIcon(wxString varname)
|
void rc2xml::ParseIcon(wxString varname)
|
||||||
{
|
{
|
||||||
wxString token,*iconfile;
|
wxString token;
|
||||||
|
wxString *iconfile;
|
||||||
iconfile=new wxString;
|
iconfile=new wxString;
|
||||||
token=PeekToken();
|
token=PeekToken();
|
||||||
|
|
||||||
|
@@ -87,7 +87,7 @@ protected:
|
|||||||
wxList * m_resourcelist;
|
wxList * m_resourcelist;
|
||||||
wxFile m_rc;
|
wxFile m_rc;
|
||||||
wxFFile m_xmlfile;
|
wxFFile m_xmlfile;
|
||||||
int m_filesize;
|
wxFileOffset m_filesize;
|
||||||
bool m_done;
|
bool m_done;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@@ -115,9 +115,9 @@ void PropEditCtrlColor::OnDetails()
|
|||||||
|
|
||||||
if (txt.Length() == 7 && txt[0u] == _T('#') &&
|
if (txt.Length() == 7 && txt[0u] == _T('#') &&
|
||||||
wxSscanf(txt.c_str(), _T("#%lX"), &tmp) == 1)
|
wxSscanf(txt.c_str(), _T("#%lX"), &tmp) == 1)
|
||||||
clr = wxColour((tmp & 0xFF0000) >> 16,
|
clr = wxColour((unsigned char)((tmp & 0xFF0000) >> 16),
|
||||||
(tmp & 0x00FF00) >> 8,
|
(unsigned char)((tmp & 0x00FF00) >> 8),
|
||||||
(tmp & 0x0000FF));
|
(unsigned char)((tmp & 0x0000FF)));
|
||||||
|
|
||||||
clr = wxGetColourFromUser(NULL, clr);
|
clr = wxGetColourFromUser(NULL, clr);
|
||||||
if (clr.Ok())
|
if (clr.Ok())
|
||||||
@@ -186,7 +186,7 @@ void PropEditCtrlFlags::OnDetails()
|
|||||||
for (i = 0; i < arr.GetCount(); i++)
|
for (i = 0; i < arr.GetCount(); i++)
|
||||||
if (lbox->IsChecked(i))
|
if (lbox->IsChecked(i))
|
||||||
txt << arr[i] << _T('|');
|
txt << arr[i] << _T('|');
|
||||||
if (!txt.IsEmpty()) txt.RemoveLast();
|
if (!txt.empty()) txt.RemoveLast();
|
||||||
|
|
||||||
m_TextCtrl->SetValue(txt);
|
m_TextCtrl->SetValue(txt);
|
||||||
WriteValue();
|
WriteValue();
|
||||||
|
@@ -60,10 +60,10 @@ class PropsTree: public wxRemotelyScrolledTreeCtrl
|
|||||||
// Reset the device origin since it may have been set
|
// Reset the device origin since it may have been set
|
||||||
dc.SetDeviceOrigin(0, 0);
|
dc.SetDeviceOrigin(0, 0);
|
||||||
|
|
||||||
wxPen pen(wxColour(_T("BLACK")), 1, wxSOLID);
|
wxPen pen(*wxBLACK, 1, wxSOLID);
|
||||||
dc.SetPen(pen);
|
dc.SetPen(pen);
|
||||||
|
|
||||||
dc.SetBrush(* wxTRANSPARENT_BRUSH);
|
dc.SetBrush(*wxTRANSPARENT_BRUSH);
|
||||||
|
|
||||||
wxSize clientSize = GetClientSize();
|
wxSize clientSize = GetClientSize();
|
||||||
wxRect itemRect;
|
wxRect itemRect;
|
||||||
|
Reference in New Issue
Block a user