]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/msw/bmpbuttn.cpp
Add more checks for Intel compiler.
[wxWidgets.git] / src / msw / bmpbuttn.cpp
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: src/msw/bmpbuttn.cpp
3// Purpose: wxBitmapButton
4// Author: Julian Smart
5// Modified by:
6// Created: 04/01/98
7// Copyright: (c) Julian Smart
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11// For compilers that support precompilation, includes "wx.h".
12#include "wx/wxprec.h"
13
14#ifdef __BORLANDC__
15 #pragma hdrstop
16#endif
17
18#if wxUSE_BMPBUTTON
19
20#include "wx/bmpbuttn.h"
21
22#ifndef WX_PRECOMP
23 #include "wx/log.h"
24 #include "wx/dcmemory.h"
25 #include "wx/image.h"
26#endif
27
28#include "wx/msw/private.h"
29#include "wx/msw/dc.h" // for wxDCTemp
30
31#include "wx/msw/uxtheme.h"
32
33#if wxUSE_UXTHEME
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
51
52// ----------------------------------------------------------------------------
53// macros
54// ----------------------------------------------------------------------------
55
56BEGIN_EVENT_TABLE(wxBitmapButton, wxBitmapButtonBase)
57 EVT_SYS_COLOUR_CHANGED(wxBitmapButton::OnSysColourChanged)
58END_EVENT_TABLE()
59
60/*
61TODO PROPERTIES :
62
63long "style" , wxBU_AUTODRAW
64bool "default" , 0
65bitmap "selected" ,
66bitmap "focus" ,
67bitmap "disabled" ,
68*/
69
70bool wxBitmapButton::Create(wxWindow *parent,
71 wxWindowID id,
72 const wxBitmap& bitmap,
73 const wxPoint& pos,
74 const wxSize& size, long style,
75 const wxValidator& validator,
76 const wxString& name)
77{
78 if ( !wxBitmapButtonBase::Create(parent, id, pos, size, style,
79 validator, name) )
80 return false;
81
82 if ( bitmap.IsOk() )
83 SetBitmapLabel(bitmap);
84
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
92 return true;
93}
94
95#endif // wxUSE_BMPBUTTON