]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/statbmp.h
Toolbars shouldn't have themed borders
[wxWidgets.git] / include / wx / msw / statbmp.h
CommitLineData
2bda0e17 1/////////////////////////////////////////////////////////////////////////////
1e6feb95
VZ
2// Name: wx/msw/statbmp.h
3// Purpose: wxStaticBitmap class for wxMSW
2bda0e17
KB
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
bbcdf8bc 8// Copyright: (c) Julian Smart
65571936 9// Licence: wxWindows licence
2bda0e17
KB
10/////////////////////////////////////////////////////////////////////////////
11
bbcdf8bc
JS
12#ifndef _WX_STATBMP_H_
13#define _WX_STATBMP_H_
2bda0e17 14
2bda0e17 15#include "wx/control.h"
916d0b61 16#include "wx/icon.h"
4304b42f 17#include "wx/bitmap.h"
2bda0e17 18
63ec432b 19extern WXDLLEXPORT_DATA(const wxChar) wxStaticBitmapNameStr[];
2bda0e17 20
9e3e0821 21// a control showing an icon or a bitmap
1e6feb95 22class WXDLLEXPORT wxStaticBitmap : public wxStaticBitmapBase
2bda0e17 23{
06b57134 24public:
9e3e0821
VZ
25 wxStaticBitmap() { Init(); }
26
27 wxStaticBitmap(wxWindow *parent,
28 wxWindowID id,
6d167489 29 const wxGDIImage& label,
9e3e0821
VZ
30 const wxPoint& pos = wxDefaultPosition,
31 const wxSize& size = wxDefaultSize,
32 long style = 0,
33 const wxString& name = wxStaticBitmapNameStr)
06b57134 34 {
46a5e01e
VZ
35 Init();
36
06b57134
VZ
37 Create(parent, id, label, pos, size, style, name);
38 }
9e3e0821
VZ
39
40 bool Create(wxWindow *parent,
41 wxWindowID id,
6d167489 42 const wxGDIImage& label,
9e3e0821
VZ
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
1e6feb95
VZ
50 virtual void SetIcon(const wxIcon& icon) { SetImage(&icon); }
51 virtual void SetBitmap(const wxBitmap& bitmap) { SetImage(&bitmap); }
a44fb285
VZ
52 virtual wxBitmap GetBitmap() const;
53 virtual wxIcon GetIcon() const;
46a5e01e 54
6f02a879 55 virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
9e3e0821 56
a047aff2
JS
57 // returns true if the platform should explicitly apply a theme border
58 virtual bool CanApplyThemeBorder() const { return false; }
59
06b57134 60protected:
65bc172c 61 virtual wxBorder GetDefaultBorder() const;
9d17ee60 62 virtual wxSize DoGetBestSize() const;
6d167489 63
46a5e01e 64 // ctor/dtor helpers
3dece6c4 65 void Init() { m_isIcon = true; m_image = NULL; m_currentHandle = 0; }
9e3e0821
VZ
66 void Free();
67
57f4f925 68 // true if icon/bitmap is valid
9e3e0821
VZ
69 bool ImageIsOk() const;
70
4004f41e 71 void SetImage(const wxGDIImage* image);
d8bffc13 72 void SetImageNoCopy( wxGDIImage* image );
6d167489 73
9e3e0821
VZ
74 // we can have either an icon or a bitmap
75 bool m_isIcon;
6d167489 76 wxGDIImage *m_image;
4fe41ce6 77
3dece6c4 78 // handle used in last call to STM_SETIMAGE
4fe41ce6 79 WXHANDLE m_currentHandle;
1e6feb95
VZ
80
81private:
82 DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
22f3361e 83 DECLARE_NO_COPY_CLASS(wxStaticBitmap)
2bda0e17
KB
84};
85
86#endif
bbcdf8bc 87 // _WX_STATBMP_H_