]> git.saurik.com Git - wxWidgets.git/blame - src/msw/bmpbuttn.cpp
Don't use any icon for items inserted without one in wxMSW wxListCtrl.
[wxWidgets.git] / src / msw / bmpbuttn.cpp
CommitLineData
2bda0e17 1/////////////////////////////////////////////////////////////////////////////
1e6feb95 2// Name: src/msw/bmpbuttn.cpp
2bda0e17
KB
3// Purpose: wxBitmapButton
4// Author: Julian Smart
5// Modified by:
6// Created: 04/01/98
6c9a19aa 7// Copyright: (c) Julian Smart
65571936 8// Licence: wxWindows licence
2bda0e17
KB
9/////////////////////////////////////////////////////////////////////////////
10
2bda0e17
KB
11// For compilers that support precompilation, includes "wx.h".
12#include "wx/wxprec.h"
13
14#ifdef __BORLANDC__
1e6feb95 15 #pragma hdrstop
2bda0e17
KB
16#endif
17
1e6feb95
VZ
18#if wxUSE_BMPBUTTON
19
910b0053
WS
20#include "wx/bmpbuttn.h"
21
2bda0e17 22#ifndef WX_PRECOMP
84f19880 23 #include "wx/log.h"
47e92c41 24 #include "wx/dcmemory.h"
155ecd4c 25 #include "wx/image.h"
2bda0e17
KB
26#endif
27
28#include "wx/msw/private.h"
025f7d77 29#include "wx/msw/dc.h" // for wxDCTemp
4e9da8b7 30
37005692 31#include "wx/msw/uxtheme.h"
4e9da8b7 32
37005692 33#if wxUSE_UXTHEME
4e9da8b7
RD
34 // no need to include tmschema.h
35 #ifndef BP_PUSHBUTTON
36 #define BP_PUSHBUTTON 1
37
38 #define PBS_NORMAL 1
39 #define PBS_HOT 2
40 #define PBS_PRESSED 3
41 #define PBS_DISABLED 4
42 #define PBS_DEFAULTED 5
43
44 #define TMT_CONTENTMARGINS 3602
45 #endif
46#endif // wxUSE_UXTHEME
47
48#ifndef ODS_NOFOCUSRECT
49 #define ODS_NOFOCUSRECT 0x0200
50#endif
2bda0e17 51
bc9fb572
JS
52// ----------------------------------------------------------------------------
53// macros
54// ----------------------------------------------------------------------------
55
a6fd0fde
VZ
56BEGIN_EVENT_TABLE(wxBitmapButton, wxBitmapButtonBase)
57 EVT_SYS_COLOUR_CHANGED(wxBitmapButton::OnSysColourChanged)
58END_EVENT_TABLE()
59
066f1b7a
SC
60/*
61TODO PROPERTIES :
62
63long "style" , wxBU_AUTODRAW
64bool "default" , 0
65bitmap "selected" ,
66bitmap "focus" ,
67bitmap "disabled" ,
68*/
69
56c74796
VZ
70bool wxBitmapButton::Create(wxWindow *parent,
71 wxWindowID id,
72 const wxBitmap& bitmap,
73 const wxPoint& pos,
74 const wxSize& size, long style,
b4bde7a7 75 const wxValidator& validator,
56c74796 76 const wxString& name)
2bda0e17 77{
8e4c2912 78 if ( !wxBitmapButtonBase::Create(parent, id, pos, size, style,
a2117591 79 validator, name) )
56c74796 80 return false;
2bda0e17 81
ad94cb2b
VZ
82 if ( bitmap.IsOk() )
83 SetBitmapLabel(bitmap);
2bda0e17 84
e9f935cb
VZ
85 if ( !size.IsFullySpecified() )
86 {
87 // As our bitmap has just changed, our best size has changed as well so
88 // reset the initial size using the new value.
89 SetInitialSize(size);
90 }
91
d50dbf7c
VZ
92 return true;
93}
94
1e6feb95 95#endif // wxUSE_BMPBUTTON