]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/statbmp.h
column autosizing added
[wxWidgets.git] / include / wx / gtk / statbmp.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: statbmp.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10
11 #ifndef __GTKSTATICBITMAPH__
12 #define __GTKSTATICBITMAPH__
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "wx/defs.h"
19
20 #if wxUSE_STATBMP
21
22 #include "wx/object.h"
23 #include "wx/control.h"
24 #include "wx/bitmap.h"
25 #include "wx/icon.h"
26
27 //-----------------------------------------------------------------------------
28 // classes
29 //-----------------------------------------------------------------------------
30
31 class wxStaticBitmap;
32
33 //-----------------------------------------------------------------------------
34 // global data
35 //-----------------------------------------------------------------------------
36
37 extern const char* wxStaticBitmapNameStr;
38
39 //-----------------------------------------------------------------------------
40 // wxStaticBitmap
41 //-----------------------------------------------------------------------------
42
43 class wxStaticBitmap: public wxControl
44 {
45 DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
46
47 public:
48 wxStaticBitmap();
49 wxStaticBitmap( wxWindow *parent,
50 wxWindowID id,
51 const wxBitmap& label,
52 const wxPoint& pos = wxDefaultPosition,
53 const wxSize& size = wxDefaultSize,
54 long style = 0,
55 const wxString& name = wxStaticBitmapNameStr );
56 bool Create( wxWindow *parent,
57 wxWindowID id,
58 const wxBitmap& label,
59 const wxPoint& pos = wxDefaultPosition,
60 const wxSize& size = wxDefaultSize,
61 long style = 0,
62 const wxString& name = wxStaticBitmapNameStr);
63
64 virtual void SetBitmap( const wxBitmap& bitmap );
65
66 wxBitmap& GetBitmap() { return m_bitmap; }
67 const wxBitmap& GetBitmap() const { return m_bitmap; }
68
69 // for compatibility with wxMSW
70 const wxIcon& GetIcon() const
71 {
72 // don't use wxDynamicCast, icons and bitmaps are really the same thing
73 // in wxGTK
74 return (const wxIcon &)m_bitmap;
75 }
76
77 // for compatibility with wxMSW
78 void SetIcon(const wxIcon& icon)
79 {
80 SetBitmap( icon );
81 }
82
83 protected:
84 virtual wxSize DoGetBestSize() const;
85
86 private:
87 // creates the new pixmap widget
88 void CreatePixmapWidget();
89
90 wxBitmap m_bitmap;
91 };
92
93 #endif
94
95 #endif // __GTKSTATICBITMAPH__