]>
git.saurik.com Git - wxWidgets.git/blob - src/palmos/bmpbuttn.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/bmpbuttn.cpp
3 // Purpose: wxBitmapButton
4 // Author: William Osborne - minimal working wxPalmOS port
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
21 #include "wx/bmpbuttn.h"
25 #include "wx/dcmemory.h"
28 #include "wx/palmos/private.h"
30 // ----------------------------------------------------------------------------
32 // ----------------------------------------------------------------------------
34 #if wxUSE_EXTENDED_RTTI
36 WX_DEFINE_FLAGS( wxBitmapButtonStyle
)
38 wxBEGIN_FLAGS( wxBitmapButtonStyle
)
39 // new style border flags, we put them first to
40 // use them for streaming out
41 wxFLAGS_MEMBER(wxBORDER_SIMPLE
)
42 wxFLAGS_MEMBER(wxBORDER_SUNKEN
)
43 wxFLAGS_MEMBER(wxBORDER_DOUBLE
)
44 wxFLAGS_MEMBER(wxBORDER_RAISED
)
45 wxFLAGS_MEMBER(wxBORDER_STATIC
)
46 wxFLAGS_MEMBER(wxBORDER_NONE
)
48 // old style border flags
49 wxFLAGS_MEMBER(wxSIMPLE_BORDER
)
50 wxFLAGS_MEMBER(wxSUNKEN_BORDER
)
51 wxFLAGS_MEMBER(wxDOUBLE_BORDER
)
52 wxFLAGS_MEMBER(wxRAISED_BORDER
)
53 wxFLAGS_MEMBER(wxSTATIC_BORDER
)
54 wxFLAGS_MEMBER(wxBORDER
)
56 // standard window styles
57 wxFLAGS_MEMBER(wxTAB_TRAVERSAL
)
58 wxFLAGS_MEMBER(wxCLIP_CHILDREN
)
59 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW
)
60 wxFLAGS_MEMBER(wxWANTS_CHARS
)
61 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE
)
62 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB
)
63 wxFLAGS_MEMBER(wxVSCROLL
)
64 wxFLAGS_MEMBER(wxHSCROLL
)
66 wxFLAGS_MEMBER(wxBU_AUTODRAW
)
67 wxFLAGS_MEMBER(wxBU_LEFT
)
68 wxFLAGS_MEMBER(wxBU_RIGHT
)
69 wxFLAGS_MEMBER(wxBU_TOP
)
70 wxFLAGS_MEMBER(wxBU_BOTTOM
)
71 wxEND_FLAGS( wxBitmapButtonStyle
)
73 IMPLEMENT_DYNAMIC_CLASS_XTI(wxBitmapButton
, wxButton
,"wx/bmpbuttn.h")
75 wxBEGIN_PROPERTIES_TABLE(wxBitmapButton
)
76 wxPROPERTY_FLAGS( WindowStyle
, wxBitmapButtonStyle
, long , SetWindowStyleFlag
, GetWindowStyleFlag
, EMPTY_MACROVALUE
, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
77 wxEND_PROPERTIES_TABLE()
79 wxBEGIN_HANDLERS_TABLE(wxBitmapButton
)
80 wxEND_HANDLERS_TABLE()
82 wxCONSTRUCTOR_5( wxBitmapButton
, wxWindow
* , Parent
, wxWindowID
, Id
, wxBitmap
, Bitmap
, wxPoint
, Position
, wxSize
, Size
)
85 IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton
, wxButton
)
88 #define BUTTON_HEIGHT_FACTOR (EDIT_CONTROL_FACTOR * 1.1)
90 bool wxBitmapButton::Create(wxWindow
*parent
, wxWindowID id
,
91 const wxBitmap
& bitmap
,
93 const wxSize
& size
, long style
,
94 const wxValidator
& wxVALIDATOR_PARAM(validator
),
100 #define FOCUS_MARGIN 3
102 void wxBitmapButton::DrawFace( WXHDC dc
, int left
, int top
,
103 int right
, int bottom
, bool sel
)
107 void wxBitmapButton::DrawButtonFocus( WXHDC dc
, int left
, int top
, int right
,
108 int bottom
, bool WXUNUSED(sel
) )
112 void wxBitmapButton::DrawButtonDisable( WXHDC dc
, int left
, int top
, int right
,
113 int bottom
, bool with_marg
)
117 void wxBitmapButton::SetDefault()
121 wxSize
wxBitmapButton::DoGetBestSize() const
130 #endif // wxUSE_BMPBUTTON