]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/statbmp.h
fix comparison of BYTE variable with -1 after last commit
[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
f36e602b 19extern WXDLLEXPORT_DATA(const char) 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:
9d17ee60 61 virtual wxSize DoGetBestSize() const;
6d167489 62
46a5e01e 63 // ctor/dtor helpers
3dece6c4 64 void Init() { m_isIcon = true; m_image = NULL; m_currentHandle = 0; }
9e3e0821
VZ
65 void Free();
66
57f4f925 67 // true if icon/bitmap is valid
9e3e0821
VZ
68 bool ImageIsOk() const;
69
4004f41e 70 void SetImage(const wxGDIImage* image);
d8bffc13 71 void SetImageNoCopy( wxGDIImage* image );
6d167489 72
9e3e0821
VZ
73 // we can have either an icon or a bitmap
74 bool m_isIcon;
6d167489 75 wxGDIImage *m_image;
4fe41ce6 76
3dece6c4 77 // handle used in last call to STM_SETIMAGE
4fe41ce6 78 WXHANDLE m_currentHandle;
1e6feb95
VZ
79
80private:
81 DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
22f3361e 82 DECLARE_NO_COPY_CLASS(wxStaticBitmap)
2bda0e17
KB
83};
84
85#endif
bbcdf8bc 86 // _WX_STATBMP_H_