]> git.saurik.com Git - wxWidgets.git/blob - src/palmos/bmpbuttn.cpp
Use stock labels. Native wxRadioButton. Getting position and size for the controls...
[wxWidgets.git] / src / palmos / bmpbuttn.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/bmpbuttn.cpp
3 // Purpose: wxBitmapButton
4 // Author: William Osborne - minimal working wxPalmOS port
5 // Modified by:
6 // Created: 10/13/04
7 // RCS-ID: $Id$
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
13 #pragma implementation "bmpbuttn.h"
14 #endif
15
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
18
19 #ifdef __BORLANDC__
20 #pragma hdrstop
21 #endif
22
23 #if wxUSE_BMPBUTTON
24
25 #ifndef WX_PRECOMP
26 #include "wx/bmpbuttn.h"
27 #include "wx/log.h"
28 #include "wx/dcmemory.h"
29 #endif
30
31 #include "wx/palmos/private.h"
32
33 // ----------------------------------------------------------------------------
34 // macros
35 // ----------------------------------------------------------------------------
36
37 #if wxUSE_EXTENDED_RTTI
38
39 WX_DEFINE_FLAGS( wxBitmapButtonStyle )
40
41 wxBEGIN_FLAGS( wxBitmapButtonStyle )
42 // new style border flags, we put them first to
43 // use them for streaming out
44 wxFLAGS_MEMBER(wxBORDER_SIMPLE)
45 wxFLAGS_MEMBER(wxBORDER_SUNKEN)
46 wxFLAGS_MEMBER(wxBORDER_DOUBLE)
47 wxFLAGS_MEMBER(wxBORDER_RAISED)
48 wxFLAGS_MEMBER(wxBORDER_STATIC)
49 wxFLAGS_MEMBER(wxBORDER_NONE)
50
51 // old style border flags
52 wxFLAGS_MEMBER(wxSIMPLE_BORDER)
53 wxFLAGS_MEMBER(wxSUNKEN_BORDER)
54 wxFLAGS_MEMBER(wxDOUBLE_BORDER)
55 wxFLAGS_MEMBER(wxRAISED_BORDER)
56 wxFLAGS_MEMBER(wxSTATIC_BORDER)
57 wxFLAGS_MEMBER(wxBORDER)
58
59 // standard window styles
60 wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
61 wxFLAGS_MEMBER(wxCLIP_CHILDREN)
62 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
63 wxFLAGS_MEMBER(wxWANTS_CHARS)
64 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
65 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
66 wxFLAGS_MEMBER(wxVSCROLL)
67 wxFLAGS_MEMBER(wxHSCROLL)
68
69 wxFLAGS_MEMBER(wxBU_AUTODRAW)
70 wxFLAGS_MEMBER(wxBU_LEFT)
71 wxFLAGS_MEMBER(wxBU_RIGHT)
72 wxFLAGS_MEMBER(wxBU_TOP)
73 wxFLAGS_MEMBER(wxBU_BOTTOM)
74 wxEND_FLAGS( wxBitmapButtonStyle )
75
76 IMPLEMENT_DYNAMIC_CLASS_XTI(wxBitmapButton, wxButton,"wx/bmpbuttn.h")
77
78 wxBEGIN_PROPERTIES_TABLE(wxBitmapButton)
79 wxPROPERTY_FLAGS( WindowStyle , wxBitmapButtonStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
80 wxEND_PROPERTIES_TABLE()
81
82 wxBEGIN_HANDLERS_TABLE(wxBitmapButton)
83 wxEND_HANDLERS_TABLE()
84
85 wxCONSTRUCTOR_5( wxBitmapButton , wxWindow* , Parent , wxWindowID , Id , wxBitmap , Bitmap , wxPoint , Position , wxSize , Size )
86
87 #else
88 IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton)
89 #endif
90
91 #define BUTTON_HEIGHT_FACTOR (EDIT_CONTROL_FACTOR * 1.1)
92
93 bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id,
94 const wxBitmap& bitmap,
95 const wxPoint& pos,
96 const wxSize& size, long style,
97 const wxValidator& wxVALIDATOR_PARAM(validator),
98 const wxString& name)
99 {
100 return false;
101 }
102
103 #define FOCUS_MARGIN 3
104
105 void wxBitmapButton::DrawFace( WXHDC dc, int left, int top,
106 int right, int bottom, bool sel )
107 {
108 }
109
110 void wxBitmapButton::DrawButtonFocus( WXHDC dc, int left, int top, int right,
111 int bottom, bool WXUNUSED(sel) )
112 {
113 }
114
115 void wxBitmapButton::DrawButtonDisable( WXHDC dc, int left, int top, int right,
116 int bottom, bool with_marg )
117 {
118 }
119
120 void wxBitmapButton::SetDefault()
121 {
122 }
123
124 wxSize wxBitmapButton::DoGetBestSize() const
125 {
126 wxSize best;
127 best.x = 0;
128 best.y = 0;
129
130 return best;
131 }
132
133 #endif // wxUSE_BMPBUTTON
134