X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..1a19e369fbce12ce4d8097fc08609a436748a6ed:/src/common/resource.cpp diff --git a/src/common/resource.cpp b/src/common/resource.cpp index de02d6a71f..92785ac35a 100644 --- a/src/common/resource.cpp +++ b/src/common/resource.cpp @@ -5,8 +5,8 @@ // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Copyright: (c) Julian Smart +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -119,23 +119,25 @@ void wxCleanUpResourceSystem() delete[] wxResourceBuffer; } +#if 0 void wxLogWarning(char *msg) { wxMessageBox(msg, _("Warning"), wxOK); } +#endif IMPLEMENT_DYNAMIC_CLASS(wxItemResource, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxResourceTable, wxHashTable) wxItemResource::wxItemResource() { - m_itemType = ""; - m_title = ""; - m_name = ""; + m_itemType = wxT(""); + m_title = wxT(""); + m_name = wxT(""); m_windowStyle = 0; m_x = m_y = m_width = m_height = 0; m_value1 = m_value2 = m_value3 = m_value5 = 0; - m_value4 = ""; + m_value4 = wxT(""); m_windowId = 0; m_exStyle = 0; } @@ -230,7 +232,7 @@ bool wxResourceTable::ParseResourceFile(const wxString& filename) { wxExprDatabase db; - FILE *fd = wxFopen(filename, _T("r")); + FILE *fd = wxFopen(filename, wxT("r")); if (!fd) return FALSE; bool eof = FALSE; @@ -341,7 +343,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c // bitmap.LoadFile(wxCROSS_BITMAP, wxBITMAP_TYPE_BMP_RESOURCE); #else - bitmap.LoadFile("cross_bmp", wxBITMAP_TYPE_BMP_RESOURCE); + bitmap.LoadFile(wxT("cross_bmp"), wxBITMAP_TYPE_BMP_RESOURCE); #endif control = new wxBitmapButton(parent, id, bitmap, pos, size, childResource->GetStyle() | wxBU_AUTODRAW, wxDefaultValidator, childResource->GetName()); @@ -367,7 +369,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c #ifdef __WXMSW__ // Use a default bitmap if (!bitmap.Ok()) - bitmap.LoadFile("cross_bmp", wxBITMAP_TYPE_BMP_RESOURCE); + bitmap.LoadFile(wxT("cross_bmp"), wxBITMAP_TYPE_BMP_RESOURCE); #endif if (bitmap.Ok()) @@ -2645,7 +2647,7 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table) } default: { -#ifdef __WXGTK__ +#if defined( __WXGTK__ ) || defined( __WXMOTIF__ ) wxLogWarning(_("Icon resource specification %s not found."), (const wxChar*) resource); break; #else @@ -2735,6 +2737,15 @@ bool wxResourceParseData(const wxString& resource, wxResourceTable *table) return table->ParseResourceData(resource); } +bool wxResourceParseData(const char* resource, wxResourceTable *table) +{ + wxString str(resource, wxConvLibc); + if (!table) + table = wxDefaultResourceTable; + + return table->ParseResourceData(str); +} + bool wxResourceParseFile(const wxString& filename, wxResourceTable *table) { if (!table) @@ -2798,7 +2809,7 @@ bool wxResourceParseIncludeFile(const wxString& f, wxResourceTable *table) if (!table) table = wxDefaultResourceTable; - FILE *fd = wxFopen(f, _T("r")); + FILE *fd = wxFopen(f, wxT("r")); if (!fd) { return FALSE; @@ -3100,6 +3111,15 @@ bool wxResourceReadOneResourceString(char *s, wxExprDatabase& db, bool *eof, wxR return TRUE; } +bool wxResourceParseString(const wxString& s, wxResourceTable *table) +{ +#if wxUSE_UNICODE + return wxResourceParseString( (char*)s.mb_str().data() ); +#else + return wxResourceParseString( (char*)s.c_str() ); +#endif +} + bool wxResourceParseString(char *s, wxResourceTable *table) { if (!table)