]> git.saurik.com Git - wxWidgets.git/blob - src/palmos/button.cpp
Blind fix for bug [ 1106890 ] (undeclared symbols on Solaris).
[wxWidgets.git] / src / palmos / button.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/button.cpp
3 // Purpose: wxButton
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 // ============================================================================
13 // declarations
14 // ============================================================================
15
16 // ----------------------------------------------------------------------------
17 // headers
18 // ----------------------------------------------------------------------------
19
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "button.h"
22 #endif
23
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
26
27 #ifdef __BORLANDC__
28 #pragma hdrstop
29 #endif
30
31 #if wxUSE_BUTTON
32
33 #ifndef WX_PRECOMP
34 #include "wx/app.h"
35 #include "wx/button.h"
36 #include "wx/brush.h"
37 #include "wx/panel.h"
38 #include "wx/bmpbuttn.h"
39 #include "wx/settings.h"
40 #include "wx/dcscreen.h"
41 #endif
42
43 #include "wx/palmos/private.h"
44
45 // ----------------------------------------------------------------------------
46 // macros
47 // ----------------------------------------------------------------------------
48
49 #if wxUSE_EXTENDED_RTTI
50
51 WX_DEFINE_FLAGS( wxButtonStyle )
52
53 wxBEGIN_FLAGS( wxButtonStyle )
54 // new style border flags, we put them first to
55 // use them for streaming out
56 wxFLAGS_MEMBER(wxBORDER_SIMPLE)
57 wxFLAGS_MEMBER(wxBORDER_SUNKEN)
58 wxFLAGS_MEMBER(wxBORDER_DOUBLE)
59 wxFLAGS_MEMBER(wxBORDER_RAISED)
60 wxFLAGS_MEMBER(wxBORDER_STATIC)
61 wxFLAGS_MEMBER(wxBORDER_NONE)
62
63 // old style border flags
64 wxFLAGS_MEMBER(wxSIMPLE_BORDER)
65 wxFLAGS_MEMBER(wxSUNKEN_BORDER)
66 wxFLAGS_MEMBER(wxDOUBLE_BORDER)
67 wxFLAGS_MEMBER(wxRAISED_BORDER)
68 wxFLAGS_MEMBER(wxSTATIC_BORDER)
69 wxFLAGS_MEMBER(wxBORDER)
70
71 // standard window styles
72 wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
73 wxFLAGS_MEMBER(wxCLIP_CHILDREN)
74 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
75 wxFLAGS_MEMBER(wxWANTS_CHARS)
76 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
77 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
78 wxFLAGS_MEMBER(wxVSCROLL)
79 wxFLAGS_MEMBER(wxHSCROLL)
80
81 wxFLAGS_MEMBER(wxBU_LEFT)
82 wxFLAGS_MEMBER(wxBU_RIGHT)
83 wxFLAGS_MEMBER(wxBU_TOP)
84 wxFLAGS_MEMBER(wxBU_BOTTOM)
85 wxFLAGS_MEMBER(wxBU_EXACTFIT)
86 wxEND_FLAGS( wxButtonStyle )
87
88 IMPLEMENT_DYNAMIC_CLASS_XTI(wxButton, wxControl,"wx/button.h")
89
90 wxBEGIN_PROPERTIES_TABLE(wxButton)
91 wxEVENT_PROPERTY( Click , wxEVT_COMMAND_BUTTON_CLICKED , wxCommandEvent)
92
93 wxPROPERTY( Font , wxFont , SetFont , GetFont , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
94 wxPROPERTY( Label, wxString , SetLabel, GetLabel, wxString(), 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
95
96 wxPROPERTY_FLAGS( WindowStyle , wxButtonStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
97
98 wxEND_PROPERTIES_TABLE()
99
100 wxBEGIN_HANDLERS_TABLE(wxButton)
101 wxEND_HANDLERS_TABLE()
102
103 wxCONSTRUCTOR_6( wxButton , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
104
105
106 #else
107 IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
108 #endif
109
110 // this macro tries to adjust the default button height to a reasonable value
111 // using the char height as the base
112 #define BUTTON_HEIGHT_FROM_CHAR_HEIGHT(cy) (11*EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)/10)
113
114 // ============================================================================
115 // implementation
116 // ============================================================================
117
118 // ----------------------------------------------------------------------------
119 // creation/destruction
120 // ----------------------------------------------------------------------------
121
122 bool wxButton::Create(wxWindow *parent,
123 wxWindowID id,
124 const wxString& label,
125 const wxPoint& pos,
126 const wxSize& size,
127 long style,
128 const wxValidator& validator,
129 const wxString& name)
130 {
131 // remember about stock IDs
132 return false;
133 }
134
135 wxButton::~wxButton()
136 {
137 }
138
139 // ----------------------------------------------------------------------------
140 // flags
141 // ----------------------------------------------------------------------------
142
143 WXDWORD wxButton::MSWGetStyle(long style, WXDWORD *exstyle) const
144 {
145 return 0;
146 }
147
148 // ----------------------------------------------------------------------------
149 // size management including autosizing
150 // ----------------------------------------------------------------------------
151
152 wxSize wxButton::DoGetBestSize() const
153 {
154 return wxSize(0,0);
155 }
156
157 /* static */
158 wxSize wxButtonBase::GetDefaultSize()
159 {
160 return wxSize(0,0);
161 }
162
163 void wxButton::SetDefault()
164 {
165 }
166
167 void wxButton::SetTmpDefault()
168 {
169 }
170
171 void wxButton::UnsetTmpDefault()
172 {
173 }
174
175 /* static */
176 void
177 wxButton::SetDefaultStyle(wxButton *btn, bool on)
178 {
179 }
180
181 // ----------------------------------------------------------------------------
182 // helpers
183 // ----------------------------------------------------------------------------
184
185 bool wxButton::SendClickEvent()
186 {
187 return false;
188 }
189
190 void wxButton::Command(wxCommandEvent & event)
191 {
192 }
193
194 // ----------------------------------------------------------------------------
195 // event/message handlers
196 // ----------------------------------------------------------------------------
197
198 bool wxButton::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
199 {
200 return false;
201 }
202
203 #endif // wxUSE_BUTTON
204