#include "wx/intl.h"
#endif
+#include "wx/treebase.h"
+#include "wx/listctrl.h"
+
#if wxUSE_RADIOBTN
#include "wx/radiobut.h"
#endif
{
wxExprDatabase db;
-#if defined(__WXMAC__) && !defined(__UNIX__)
- FILE *fd = fopen(wxUnix2MacFilename(filename.fn_str()), "r");
-#else
FILE *fd = wxFopen(filename, _T("r"));
-#endif
if (!fd)
return FALSE;
bool eof = FALSE;
((wxItemResource*) childResource)->SetBitmap(bitmap);
}
if (!bitmap.Ok())
+#if defined(__WXPM__)
+ //
+ // OS/2 uses integer id's to access resources, not file name strings
+ //
+ bitmap.LoadFile(wxCROSS_BITMAP, wxBITMAP_TYPE_BMP_RESOURCE);
+#else
bitmap.LoadFile("cross_bmp", wxBITMAP_TYPE_BMP_RESOURCE);
+#endif
control = new wxBitmapButton(parent, id, bitmap, pos, size,
childResource->GetStyle() | wxBU_AUTODRAW, wxDefaultValidator, childResource->GetName());
}
if (faceNameExpr)
faceName = faceNameExpr->StringValue();
- wxFont font(point, family, style, weight, (underline != 0), faceName);
- return font;
+ return *wxTheFontList->FindOrCreateFont(point, family, style, weight,
+ (underline != 0), faceName);
}
// Separate file for the remainder of this, for BC++/Win16
struct wxResourceBitListStruct
{
- wxChar *word;
+ const wxChar *word;
long bits;
};
}
case wxBITMAP_TYPE_XPM_DATA:
{
-#if (defined(__WXGTK__)) || (defined(__WXMSW__) && wxUSE_XPM_IN_MSW)
wxItemResource *item = table->FindResource(name);
if (!item)
{
return wxNullBitmap;
}
return wxBitmap((char **)item->GetValue1());
-#else
- wxLogWarning(_("No XPM facility available!"));
- break;
-#endif
}
default:
{
+#if defined(__WXPM__)
+ return wxNullBitmap;
+#else
return wxBitmap(name, (wxBitmapType)bitmapType);
+#endif
}
}
#ifndef __WXGTK__
{
// *** XPM ICON NOT YET IMPLEMENTED IN WXWINDOWS ***
/*
- #if (defined(__WXGTK__)) || (defined(__WXMSW__) && wxUSE_XPM_IN_MSW)
wxItemResource *item = table->FindResource(name);
if (!item)
{
return NULL;
}
return wxIcon((char **)item->GetValue1());
- #else
- wxLogWarning(_("No XPM facility available!"));
- #endif
*/
wxLogWarning(_("No XPM icon facility available!"));
break;
}
}
+#if wxUSE_MENUS
+
wxMenu *wxResourceCreateMenu(wxItemResource *item)
{
wxMenu *menu = new wxMenu;
return (wxMenu *) NULL;
}
+#endif // wxUSE_MENUS
+
// Global equivalents (so don't have to refer to default table explicitly)
bool wxResourceParseData(const wxString& resource, wxResourceTable *table)
{
int height = resource->GetHeight();
wxString name = resource->GetName();
- if (IsKindOf(CLASSINFO(wxDialog)))
+ // this is used for loading wxWizard pages from WXR
+ if ( parent != this )
{
- wxDialog *dialogBox = (wxDialog *)this;
- long modalStyle = isModal ? wxDIALOG_MODAL : 0;
- if (!dialogBox->Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), theWindowStyle|modalStyle, name))
- return FALSE;
+ if (IsKindOf(CLASSINFO(wxDialog)))
+ {
+ wxDialog *dialogBox = (wxDialog *)this;
+ long modalStyle = isModal ? wxDIALOG_MODAL : 0;
+ if (!dialogBox->Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), theWindowStyle|modalStyle, name))
+ return FALSE;
- // Only reset the client size if we know we're not going to do it again below.
- if ((resource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) == 0)
- dialogBox->SetClientSize(width, height);
- }
- else if (IsKindOf(CLASSINFO(wxPanel)))
- {
- wxPanel* panel = (wxPanel *)this;
- if (!panel->Create(parent, -1, wxPoint(x, y), wxSize(width, height), theWindowStyle | wxTAB_TRAVERSAL, name))
- return FALSE;
- }
- else
- {
- if (!((wxWindow *)this)->Create(parent, -1, wxPoint(x, y), wxSize(width, height), theWindowStyle, name))
- return FALSE;
+ // Only reset the client size if we know we're not going to do it again below.
+ if ((resource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) == 0)
+ dialogBox->SetClientSize(width, height);
+ }
+ else if (IsKindOf(CLASSINFO(wxPanel)))
+ {
+ wxPanel* panel = (wxPanel *)this;
+ if (!panel->Create(parent, -1, wxPoint(x, y), wxSize(width, height), theWindowStyle | wxTAB_TRAVERSAL, name))
+ return FALSE;
+ }
+ else
+ {
+ if (!((wxWindow *)this)->Create(parent, -1, wxPoint(x, y), wxSize(width, height), theWindowStyle, name))
+ return FALSE;
+ }
}
if ((resource->GetResourceStyle() & wxRESOURCE_USE_DEFAULTS) != 0)
{
// No need to do this since it's done in wxPanel or wxDialog constructor.
- // SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
+ // SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
}
else
{
// Should have some kind of font at this point
if (!GetFont().Ok())
- SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
+ SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
if (!GetBackgroundColour().Ok())
- SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
+ SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
// Only when we've created the window and set the font can we set the correct size,
// if based on dialog units.