]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/icon.h
use a virtual function instead of wxDynamicCast(wxMDIParentFrame) in wxFrame code...
[wxWidgets.git] / include / wx / motif / icon.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/icon.h
3 // Purpose: wxIcon class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 17/09/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_ICON_H_
13 #define _WX_ICON_H_
14
15 #include "wx/bitmap.h"
16
17 // Icon
18 class WXDLLIMPEXP_CORE wxIcon : public wxBitmap
19 {
20 public:
21 wxIcon();
22
23 // Initialize with XBM data
24 wxIcon(const char bits[], int width, int height);
25
26 // Initialize with XPM data
27 wxIcon(const char* const* data);
28 #ifdef wxNEEDS_CHARPP
29 wxIcon(char **data);
30 #endif
31
32 wxIcon(const wxString& name, wxBitmapType type = wxICON_DEFAULT_TYPE,
33 int desiredWidth = -1, int desiredHeight = -1)
34 {
35 LoadFile(name, type, desiredWidth, desiredHeight);
36 }
37
38 wxIcon(const wxIconLocation& loc)
39 {
40 LoadFile(loc.GetFileName(), wxBITMAP_TYPE_ANY);
41 }
42
43 virtual ~wxIcon();
44
45 bool LoadFile(const wxString& name, wxBitmapType type = wxICON_DEFAULT_TYPE,
46 int desiredWidth = -1, int desiredHeight = -1);
47
48 // create from bitmap (which should have a mask unless it's monochrome):
49 // there shouldn't be any implicit bitmap -> icon conversion (i.e. no
50 // ctors, assignment operators...), but it's ok to have such function
51 void CopyFromBitmap(const wxBitmap& bmp);
52
53
54 DECLARE_DYNAMIC_CLASS(wxIcon)
55 };
56
57 #endif // _WX_ICON_H_