]> git.saurik.com Git - wxWidgets.git/blame - include/wx/palmos/statbmp.h
Move msw configuration checking to chkconf.h
[wxWidgets.git] / include / wx / palmos / statbmp.h
CommitLineData
ffecfa5a
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/palmos/statbmp.h
3// Purpose: wxStaticBitmap class for Palm OS
e1d63b79 4// Author: William Osborne - minimal working wxPalmOS port
ffecfa5a
JS
5// Modified by:
6// Created: 10/13/04
e1d63b79 7// RCS-ID: $Id$
ffecfa5a
JS
8// Copyright: (c) William Osborne
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_STATBMP_H_
13#define _WX_STATBMP_H_
14
ffecfa5a
JS
15#include "wx/control.h"
16#include "wx/icon.h"
17#include "wx/bitmap.h"
18
53a2db12 19WXDLLIMPEXP_DATA_CORE(extern const wxChar) wxStaticBitmapNameStr[];
ffecfa5a
JS
20
21// a control showing an icon or a bitmap
53a2db12 22class WXDLLIMPEXP_CORE wxStaticBitmap : public wxStaticBitmapBase
ffecfa5a
JS
23{
24public:
25 wxStaticBitmap() { Init(); }
26
27 wxStaticBitmap(wxWindow *parent,
28 wxWindowID id,
29 const wxGDIImage& label,
30 const wxPoint& pos = wxDefaultPosition,
31 const wxSize& size = wxDefaultSize,
32 long style = 0,
33 const wxString& name = wxStaticBitmapNameStr)
34 {
35 Init();
36
37 Create(parent, id, label, pos, size, style, name);
38 }
39
40 bool Create(wxWindow *parent,
41 wxWindowID id,
42 const wxGDIImage& label,
43 const wxPoint& pos = wxDefaultPosition,
44 const wxSize& size = wxDefaultSize,
45 long style = 0,
46 const wxString& name = wxStaticBitmapNameStr);
47
48 virtual ~wxStaticBitmap() { Free(); }
49
50 virtual void SetIcon(const wxIcon& icon) { SetImage(&icon); }
51 virtual void SetBitmap(const wxBitmap& bitmap) { SetImage(&bitmap); }
52
53 // assert failure is provoked by an attempt to get an icon from bitmap or
54 // vice versa
55 wxIcon GetIcon() const
56 {
9a83f860 57 wxASSERT_MSG( m_isIcon, wxT("no icon in this wxStaticBitmap") );
ffecfa5a
JS
58
59 return *(wxIcon *)m_image;
60 }
61
62 wxBitmap GetBitmap() const
63 {
9a83f860 64 wxASSERT_MSG( !m_isIcon, wxT("no bitmap in this wxStaticBitmap") );
ffecfa5a
JS
65
66 return *(wxBitmap *)m_image;
67 }
68
69 // implementation only from now on
70 // -------------------------------
71
72 // implement base class virtuals
73 virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
74
75protected:
76 virtual wxBorder GetDefaultBorder() const;
77 virtual wxSize DoGetBestSize() const;
78 virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
79
80 // ctor/dtor helpers
81 void Init() { m_isIcon = TRUE; m_image = NULL; }
82 void Free();
83
84 // TRUE if icon/bitmap is valid
85 bool ImageIsOk() const;
86
87 void SetImage(const wxGDIImage* image);
88 void SetImageNoCopy( wxGDIImage* image );
89
90 // we can have either an icon or a bitmap
91 bool m_isIcon;
92 wxGDIImage *m_image;
93
94private:
95 DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
c0c133e1 96 wxDECLARE_NO_COPY_CLASS(wxStaticBitmap);
ffecfa5a
JS
97};
98
99#endif
100 // _WX_STATBMP_H_