]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/statbmp.h
radiobox now sends notification messages when the selection is changed from
[wxWidgets.git] / include / wx / msw / statbmp.h
CommitLineData
2bda0e17
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: statbmp.h
3// Purpose: wxStaticBitmap class
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
bbcdf8bc 8// Copyright: (c) Julian Smart
9e3e0821 9// Licence: wxWindows licence
2bda0e17
KB
10/////////////////////////////////////////////////////////////////////////////
11
bbcdf8bc
JS
12#ifndef _WX_STATBMP_H_
13#define _WX_STATBMP_H_
2bda0e17
KB
14
15#ifdef __GNUG__
06b57134 16 #pragma interface "statbmp.h"
2bda0e17
KB
17#endif
18
19#include "wx/control.h"
20
21WXDLLEXPORT_DATA(extern const char*) wxStaticBitmapNameStr;
22
9e3e0821 23// a control showing an icon or a bitmap
06b57134 24class WXDLLEXPORT wxStaticBitmap : public wxControl
2bda0e17 25{
bfc6fde4 26 DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
2bda0e17 27
06b57134 28public:
9e3e0821
VZ
29 wxStaticBitmap() { Init(); }
30
31 wxStaticBitmap(wxWindow *parent,
32 wxWindowID id,
33 const wxBitmap& label,
34 const wxPoint& pos = wxDefaultPosition,
35 const wxSize& size = wxDefaultSize,
36 long style = 0,
37 const wxString& name = wxStaticBitmapNameStr)
06b57134
VZ
38 {
39 Create(parent, id, label, pos, size, style, name);
40 }
9e3e0821
VZ
41
42 bool Create(wxWindow *parent,
43 wxWindowID id,
44 const wxBitmap& label,
45 const wxPoint& pos = wxDefaultPosition,
46 const wxSize& size = wxDefaultSize,
47 long style = 0,
48 const wxString& name = wxStaticBitmapNameStr);
49
50 virtual ~wxStaticBitmap() { Free(); }
51
52 virtual void SetIcon(const wxIcon& icon) { SetBitmap(icon); }
06b57134 53 virtual void SetBitmap(const wxBitmap& bitmap);
9e3e0821
VZ
54
55 // assert failure is provoked by an attempt to get an icon from bitmap or
56 // vice versa
57 const wxIcon& GetIcon() const
58 { wxASSERT( m_isIcon ); return *m_image.icon; }
59 const wxBitmap& GetBitmap() const
60 { wxASSERT( !m_isIcon ); return *m_image.bitmap; }
61
06b57134
VZ
62 // overriden base class virtuals
63 virtual bool AcceptsFocus() const { return FALSE; }
9e3e0821
VZ
64
65 // IMPLEMENTATION
66 virtual void Command(wxCommandEvent& WXUNUSED(event)) { }
67 virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) { }
68
69#ifdef __WIN16__
06b57134
VZ
70 virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
71 virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
9e3e0821 72#endif // __WIN16__
2bda0e17 73
06b57134 74protected:
9e3e0821
VZ
75 void Init() { m_isIcon = TRUE; m_image.icon = NULL; }
76 void Free();
77
78 // TRUE if icon/bitmap is valid
79 bool ImageIsOk() const;
80
81 // we can have either an icon or a bitmap
82 bool m_isIcon;
83 union
84 {
85 wxIcon *icon;
86 wxBitmap *bitmap;
87 } m_image;
88
bfc6fde4
VZ
89 virtual void DoSetSize(int x, int y,
90 int width, int height,
91 int sizeFlags = wxSIZE_AUTO);
2bda0e17
KB
92};
93
94#endif
bbcdf8bc 95 // _WX_STATBMP_H_