]>
Commit | Line | Data |
---|---|---|
78d14f80 | 1 | ///////////////////////////////////////////////////////////////////////////// |
0bca0373 | 2 | // Name: src/xrc/xh_bmp.cpp |
b5d6954b | 3 | // Purpose: XRC resource for wxBitmap and wxIcon |
78d14f80 VS |
4 | // Author: Vaclav Slavik |
5 | // Created: 2000/09/09 | |
6 | // RCS-ID: $Id$ | |
7 | // Copyright: (c) 2000 Vaclav Slavik | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
f80ea77b | 10 | |
78d14f80 VS |
11 | // For compilers that support precompilation, includes "wx.h". |
12 | #include "wx/wxprec.h" | |
13 | ||
14 | #ifdef __BORLANDC__ | |
15 | #pragma hdrstop | |
16 | #endif | |
17 | ||
621be1ec | 18 | #if wxUSE_XRC |
a1e4ec87 | 19 | |
78d14f80 | 20 | #include "wx/xrc/xh_bmp.h" |
0bca0373 WS |
21 | |
22 | #ifndef WX_PRECOMP | |
23 | #include "wx/bitmap.h" | |
24 | #endif | |
78d14f80 | 25 | |
854e189f | 26 | IMPLEMENT_DYNAMIC_CLASS(wxBitmapXmlHandler, wxXmlResourceHandler) |
78d14f80 | 27 | |
f80ea77b | 28 | wxBitmapXmlHandler::wxBitmapXmlHandler() |
0bca0373 | 29 | :wxXmlResourceHandler() |
78d14f80 VS |
30 | { |
31 | } | |
32 | ||
33 | wxObject *wxBitmapXmlHandler::DoCreateResource() | |
f80ea77b | 34 | { |
1e22bc92 VS |
35 | // NB: empty parameter name means "take directly from this node's next |
36 | // instead of from subnode with given name" | |
0966aee3 | 37 | return new wxBitmap(GetBitmap(wxEmptyString)); |
78d14f80 VS |
38 | } |
39 | ||
78d14f80 VS |
40 | bool wxBitmapXmlHandler::CanHandle(wxXmlNode *node) |
41 | { | |
42 | return IsOfClass(node, wxT("wxBitmap")); | |
43 | } | |
44 | ||
854e189f VS |
45 | IMPLEMENT_DYNAMIC_CLASS(wxIconXmlHandler, wxXmlResourceHandler) |
46 | ||
f80ea77b WS |
47 | wxIconXmlHandler::wxIconXmlHandler() |
48 | : wxXmlResourceHandler() | |
78d14f80 VS |
49 | { |
50 | } | |
51 | ||
52 | wxObject *wxIconXmlHandler::DoCreateResource() | |
f80ea77b | 53 | { |
1e22bc92 VS |
54 | // NB: empty parameter name means "take directly from this node's next |
55 | // instead of from subnode with given name" | |
0966aee3 | 56 | return new wxIcon(GetIcon(wxEmptyString)); |
78d14f80 VS |
57 | } |
58 | ||
78d14f80 VS |
59 | bool wxIconXmlHandler::CanHandle(wxXmlNode *node) |
60 | { | |
61 | return IsOfClass(node, wxT("wxIcon")); | |
62 | } | |
a1e4ec87 | 63 | |
621be1ec | 64 | #endif // wxUSE_XRC |