]>
Commit | Line | Data |
---|---|---|
2bda0e17 KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: window.h | |
3 | // Purpose: wxWindow class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart and Markus Holzem | |
9f3362c4 | 9 | // Licence: wxWindows licence |
2bda0e17 KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
bbcdf8bc JS |
12 | #ifndef _WX_WINDOW_H_ |
13 | #define _WX_WINDOW_H_ | |
2bda0e17 KB |
14 | |
15 | #ifdef __GNUG__ | |
16 | #pragma interface "window.h" | |
17 | #endif | |
18 | ||
19 | #include "wx/gdicmn.h" | |
20 | #include "wx/icon.h" | |
21 | #include "wx/cursor.h" | |
22 | #include "wx/pen.h" | |
23 | #include "wx/font.h" | |
24 | #include "wx/validate.h" | |
25 | #include "wx/event.h" | |
26 | #include "wx/string.h" | |
27 | #include "wx/list.h" | |
81d66cf3 | 28 | #include "wx/region.h" |
14b72bf5 | 29 | #include "wx/msw/accel.h" |
2bda0e17 KB |
30 | |
31 | #define wxKEY_SHIFT 1 | |
32 | #define wxKEY_CTRL 2 | |
33 | ||
34 | /* | |
35 | * Base class for frame, panel, canvas, panel items, dialog box. | |
36 | * | |
37 | */ | |
38 | ||
39 | /* | |
40 | * Event handler: windows have themselves as their event handlers | |
41 | * by default, but their event handlers could be set to another | |
42 | * object entirely. This separation can reduce the amount of | |
43 | * derivation required, and allow alteration of a window's functionality | |
44 | * (e.g. by a resource editor that temporarily switches event handlers). | |
45 | */ | |
46 | ||
47 | class WXDLLEXPORT wxWindow; | |
48 | class WXDLLEXPORT wxEvent; | |
49 | class WXDLLEXPORT wxCommandEvent; | |
50 | class WXDLLEXPORT wxKeyEvent; | |
51 | class WXDLLEXPORT wxControl; | |
52 | class WXDLLEXPORT wxCursor; | |
53 | class WXDLLEXPORT wxColourMap; | |
54 | class WXDLLEXPORT wxFont; | |
55 | class WXDLLEXPORT wxMenu; | |
1b826605 | 56 | class WXDLLEXPORT wxRect; |
2bda0e17 KB |
57 | class WXDLLEXPORT wxBitmap; |
58 | class WXDLLEXPORT wxSizer; | |
59 | class WXDLLEXPORT wxList; | |
60 | class WXDLLEXPORT wxLayoutConstraints; | |
61 | class WXDLLEXPORT wxMouseEvent; | |
62 | class WXDLLEXPORT wxButton; | |
63 | class WXDLLEXPORT wxColour; | |
64 | class WXDLLEXPORT wxBrush; | |
65 | class WXDLLEXPORT wxPen; | |
66 | class WXDLLEXPORT wxIcon; | |
67 | class WXDLLEXPORT wxDC; | |
68 | class WXDLLEXPORT wxValidator; | |
9f3362c4 | 69 | class WXDLLEXPORT wxToolTip; |
2bda0e17 | 70 | |
47d67540 | 71 | #if wxUSE_DRAG_AND_DROP |
b823f5a1 | 72 | class WXDLLEXPORT wxDropTarget; |
2bda0e17 KB |
73 | #endif |
74 | ||
47d67540 | 75 | #if wxUSE_WX_RESOURCES |
2bda0e17 KB |
76 | class WXDLLEXPORT wxResourceTable; |
77 | class WXDLLEXPORT wxItemResource; | |
78 | #endif | |
79 | ||
80 | WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr; | |
81 | ||
82 | WXDLLEXPORT_DATA(extern const wxSize) wxDefaultSize; | |
83 | WXDLLEXPORT_DATA(extern const wxPoint) wxDefaultPosition; | |
84 | ||
1e6d9499 JS |
85 | //----------------------------------------------------------------------------- |
86 | // wxClientData | |
87 | //----------------------------------------------------------------------------- | |
88 | ||
89 | class wxClientData | |
90 | { | |
91 | public: | |
92 | wxClientData() { } | |
93 | virtual ~wxClientData() { } | |
94 | }; | |
95 | ||
96 | //----------------------------------------------------------------------------- | |
97 | // wxStringClientData | |
98 | //----------------------------------------------------------------------------- | |
99 | ||
100 | class wxStringClientData: public wxClientData | |
101 | { | |
102 | public: | |
103 | wxStringClientData() { } | |
104 | wxStringClientData( wxString &data ) { m_data = data; } | |
105 | void SetData( wxString &data ) { m_data = data; } | |
106 | wxString GetData() const { return m_data; } | |
9f3362c4 | 107 | |
1e6d9499 JS |
108 | private: |
109 | wxString m_data; | |
110 | }; | |
111 | ||
3f1af920 JS |
112 | // Clash with Windows headers |
113 | #ifdef GetCharWidth | |
114 | #undef GetCharWidth | |
115 | #endif | |
116 | ||
117 | #ifdef FindWindow | |
118 | #undef FindWindow | |
119 | #endif | |
120 | ||
fd3f686c | 121 | class WXDLLEXPORT wxWindow : public wxEvtHandler |
2bda0e17 KB |
122 | { |
123 | DECLARE_ABSTRACT_CLASS(wxWindow) | |
124 | ||
2bda0e17 KB |
125 | friend class wxDC; |
126 | friend class wxPaintDC; | |
127 | ||
128 | public: | |
fd3f686c VZ |
129 | wxWindow(); |
130 | wxWindow(wxWindow *parent, wxWindowID id, | |
2bda0e17 KB |
131 | const wxPoint& pos = wxDefaultPosition, |
132 | const wxSize& size = wxDefaultSize, | |
debe6624 | 133 | long style = 0, |
2bda0e17 KB |
134 | const wxString& name = wxPanelNameStr) |
135 | { | |
cf65ad8d | 136 | Init(); |
2bda0e17 KB |
137 | Create(parent, id, pos, size, style, name); |
138 | } | |
139 | ||
fd3f686c | 140 | virtual ~wxWindow(); |
2bda0e17 | 141 | |
debe6624 | 142 | bool Create(wxWindow *parent, wxWindowID id, |
2bda0e17 KB |
143 | const wxPoint& pos = wxDefaultPosition, |
144 | const wxSize& size = wxDefaultSize, | |
debe6624 | 145 | long style = 0, |
2bda0e17 KB |
146 | const wxString& name = wxPanelNameStr); |
147 | ||
148 | // Fit the window around the items | |
fd3f686c | 149 | virtual void Fit(); |
2bda0e17 KB |
150 | |
151 | // Show or hide the window | |
debe6624 | 152 | virtual bool Show(bool show); |
2bda0e17 KB |
153 | |
154 | // Is the window shown? | |
fd3f686c | 155 | virtual bool IsShown() const; |
2bda0e17 KB |
156 | |
157 | // Raise the window to the top of the Z order | |
fd3f686c | 158 | virtual void Raise(); |
2bda0e17 KB |
159 | |
160 | // Lower the window to the bottom of the Z order | |
fd3f686c | 161 | virtual void Lower(); |
2bda0e17 KB |
162 | |
163 | // Is the window enabled? | |
fd3f686c | 164 | virtual bool IsEnabled() const; |
2bda0e17 KB |
165 | |
166 | // For compatibility | |
fd3f686c | 167 | inline bool Enabled() const { return IsEnabled(); } |
2bda0e17 KB |
168 | |
169 | // Dialog support: override these and call | |
170 | // base class members to add functionality | |
171 | // that can't be done using validators. | |
172 | ||
173 | // Transfer values to controls. If returns FALSE, | |
174 | // it's an application error (pops up a dialog) | |
fd3f686c | 175 | virtual bool TransferDataToWindow(); |
2bda0e17 KB |
176 | |
177 | // Transfer values from controls. If returns FALSE, | |
178 | // transfer failed: don't quit | |
fd3f686c | 179 | virtual bool TransferDataFromWindow(); |
2bda0e17 KB |
180 | |
181 | // Validate controls. If returns FALSE, | |
182 | // validation failed: don't quit | |
fd3f686c | 183 | virtual bool Validate(); |
2bda0e17 KB |
184 | |
185 | // Return code for dialogs | |
186 | inline void SetReturnCode(int retCode); | |
fd3f686c | 187 | inline int GetReturnCode(); |
2bda0e17 KB |
188 | |
189 | // Set the cursor | |
190 | virtual void SetCursor(const wxCursor& cursor); | |
c0ed460c | 191 | inline virtual wxCursor& GetCursor() const { return (wxCursor& ) m_windowCursor; }; |
2bda0e17 KB |
192 | |
193 | // Get the window with the focus | |
fd3f686c | 194 | static wxWindow *FindFocus(); |
2bda0e17 KB |
195 | |
196 | // Get character size | |
fd3f686c VZ |
197 | virtual int GetCharHeight() const; |
198 | virtual int GetCharWidth() const; | |
2bda0e17 KB |
199 | |
200 | // Get overall window size | |
201 | virtual void GetSize(int *width, int *height) const; | |
7b218dfa | 202 | wxSize GetSize() const { int w, h; GetSize(& w, & h); return wxSize(w, h); } |
2bda0e17 KB |
203 | |
204 | // Get window position, relative to parent (or screen if no parent) | |
205 | virtual void GetPosition(int *x, int *y) const; | |
7b218dfa VZ |
206 | wxPoint GetPosition() const |
207 | { int x, y; GetPosition(&x, &y); return wxPoint(x, y); } | |
208 | ||
209 | // Get size and position | |
210 | wxRect GetRect() const | |
211 | { int x, y, w, h; GetPosition(& x, & y); GetSize(& w, & h); return wxRect(x, y, w, h); } | |
2bda0e17 KB |
212 | |
213 | // Get client (application-useable) size | |
214 | virtual void GetClientSize(int *width, int *height) const; | |
7b218dfa | 215 | wxSize GetClientSize() const { int w, h; GetClientSize(& w, & h); return wxSize(w, h); } |
2bda0e17 KB |
216 | |
217 | // Set overall size and position | |
7b218dfa | 218 | // generic function, may be overriden in derived classes |
debe6624 | 219 | virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); |
7b218dfa VZ |
220 | |
221 | void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) | |
4fabb575 | 222 | { SetSize(rect.x, rect.y, rect.width, rect.height, sizeFlags); } |
4fabb575 | 223 | |
7b218dfa VZ |
224 | // set size only |
225 | void SetSize(int width, int height) | |
226 | { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } | |
227 | void SetSize(const wxSize& size) | |
228 | { SetSize(-1, -1, size.x, size.y, wxSIZE_USE_EXISTING); } | |
229 | ||
230 | // set position only | |
4fabb575 | 231 | virtual void Move(int x, int y) { SetSize(x, y, -1, -1, wxSIZE_USE_EXISTING); } |
7b218dfa | 232 | void Move(const wxPoint& pt) { SetSize(pt.x, pt.y, -1, -1, wxSIZE_USE_EXISTING); } |
2bda0e17 KB |
233 | |
234 | // Set client size | |
4fabb575 | 235 | virtual void SetClientSize(int width, int height); |
7b218dfa | 236 | void SetClientSize(const wxSize& sz) { SetClientSize(sz.x, sz.y); } |
2bda0e17 KB |
237 | |
238 | // Convert client to screen coordinates | |
239 | virtual void ClientToScreen(int *x, int *y) const; | |
7b218dfa | 240 | wxPoint ClientToScreen(const wxPoint& pt) const |
4fabb575 | 241 | { int x = pt.x; int y = pt.y; ClientToScreen(& x, & y); return wxPoint(x, y); } |
2bda0e17 KB |
242 | |
243 | // Convert screen to client coordinates | |
244 | virtual void ScreenToClient(int *x, int *y) const; | |
7b218dfa | 245 | wxPoint ScreenToClient(const wxPoint& pt) const |
4fabb575 | 246 | { int x = pt.x; int y = pt.y; ScreenToClient(& x, & y); return wxPoint(x, y); } |
2bda0e17 KB |
247 | |
248 | // Set the focus to this window | |
fd3f686c | 249 | virtual void SetFocus(); |
2bda0e17 KB |
250 | |
251 | // Capture/release mouse | |
fd3f686c VZ |
252 | virtual void CaptureMouse(); |
253 | virtual void ReleaseMouse(); | |
2bda0e17 KB |
254 | |
255 | // Enable or disable the window | |
debe6624 | 256 | virtual void Enable(bool enable); |
2bda0e17 | 257 | |
47d67540 | 258 | #if wxUSE_DRAG_AND_DROP |
2bda0e17 KB |
259 | // Associate a drop target with this window (if the window already had a drop |
260 | // target, it's deleted!) and return the current drop target (may be NULL). | |
261 | void SetDropTarget(wxDropTarget *pDropTarget); | |
262 | wxDropTarget *GetDropTarget() const { return m_pDropTarget; } | |
263 | #endif | |
264 | ||
cb1a1dc9 | 265 | #if wxUSE_TOOLTIPS |
9f3362c4 VZ |
266 | // tooltips |
267 | // create a tooltip with this text | |
268 | void SetToolTip(const wxString &tip); | |
269 | // pointer may be NULL to remove the tooltip | |
270 | void SetToolTip(wxToolTip *tooltip); | |
271 | // get the current tooltip (may return NULL if none) | |
272 | wxToolTip* GetToolTip() const { return m_tooltip; } | |
cb1a1dc9 | 273 | #endif // wxUSE_TOOLTIPS |
9f3362c4 | 274 | |
2bda0e17 | 275 | // Accept files for dragging |
debe6624 | 276 | virtual void DragAcceptFiles(bool accept); |
2bda0e17 | 277 | |
81d66cf3 JS |
278 | // Update region access |
279 | virtual wxRegion GetUpdateRegion() const; | |
280 | virtual bool IsExposed(int x, int y, int w, int h) const; | |
281 | virtual bool IsExposed(const wxPoint& pt) const; | |
282 | virtual bool IsExposed(const wxRect& rect) const; | |
283 | ||
2bda0e17 KB |
284 | // Set/get the window title |
285 | virtual inline void SetTitle(const wxString& WXUNUSED(title)) {}; | |
fd3f686c | 286 | inline virtual wxString GetTitle() const { return wxString(""); }; |
2bda0e17 KB |
287 | // Most windows have the concept of a label; for frames, this is the |
288 | // title; for items, this is the label or button text. | |
fd3f686c | 289 | inline virtual wxString GetLabel() const { return GetTitle(); } |
2bda0e17 KB |
290 | |
291 | // Set/get the window name (used for resource setting in X) | |
fd3f686c | 292 | inline virtual wxString GetName() const; |
2bda0e17 KB |
293 | inline virtual void SetName(const wxString& name); |
294 | ||
295 | // Centre the window | |
debe6624 JS |
296 | virtual void Centre(int direction) ; |
297 | inline void Center(int direction = wxHORIZONTAL) { Centre(direction); } | |
2bda0e17 KB |
298 | |
299 | // Popup a menu | |
debe6624 | 300 | virtual bool PopupMenu(wxMenu *menu, int x, int y); |
2bda0e17 KB |
301 | |
302 | // Send the window a refresh event | |
1b826605 | 303 | virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL); |
2bda0e17 KB |
304 | |
305 | #if WXWIN_COMPATIBILITY | |
306 | // Set/get scroll attributes | |
debe6624 JS |
307 | virtual void SetScrollRange(int orient, int range, bool refresh = TRUE); |
308 | virtual void SetScrollPage(int orient, int page, bool refresh = TRUE); | |
309 | virtual int OldGetScrollRange(int orient) const; | |
310 | virtual int GetScrollPage(int orient) const; | |
2bda0e17 KB |
311 | #endif |
312 | ||
313 | // New functions that will replace the above. | |
debe6624 JS |
314 | virtual void SetScrollbar(int orient, int pos, int thumbVisible, |
315 | int range, bool refresh = TRUE); | |
2bda0e17 | 316 | |
debe6624 JS |
317 | virtual void SetScrollPos(int orient, int pos, bool refresh = TRUE); |
318 | virtual int GetScrollPos(int orient) const; | |
319 | virtual int GetScrollRange(int orient) const; | |
320 | virtual int GetScrollThumb(int orient) const; | |
2bda0e17 | 321 | |
1b826605 | 322 | virtual void ScrollWindow(int dx, int dy, const wxRect *rect = NULL); |
2bda0e17 KB |
323 | |
324 | // Caret manipulation | |
debe6624 | 325 | virtual void CreateCaret(int w, int h); |
2bda0e17 | 326 | virtual void CreateCaret(const wxBitmap *bitmap); |
fd3f686c | 327 | virtual void DestroyCaret(); |
debe6624 JS |
328 | virtual void ShowCaret(bool show); |
329 | virtual void SetCaretPos(int x, int y); | |
2bda0e17 KB |
330 | virtual void GetCaretPos(int *x, int *y) const; |
331 | ||
332 | // Tell window how much it can be sized | |
debe6624 | 333 | virtual void SetSizeHints(int minW = -1, int minH = -1, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1); |
2bda0e17 KB |
334 | |
335 | // Set/get the window's identifier | |
336 | inline int GetId() const; | |
debe6624 | 337 | inline void SetId(int id); |
2bda0e17 KB |
338 | |
339 | // Make the window modal (all other windows unresponsive) | |
debe6624 | 340 | virtual void MakeModal(bool modal); |
2bda0e17 KB |
341 | |
342 | // Get the private handle (platform-dependent) | |
fd3f686c | 343 | inline void *GetHandle() const; |
2bda0e17 KB |
344 | |
345 | // Set/get the window's relatives | |
fd3f686c | 346 | inline wxWindow *GetParent() const; |
2bda0e17 | 347 | inline void SetParent(wxWindow *p) ; |
fd3f686c | 348 | inline wxWindow *GetGrandParent() const; |
c0ed460c | 349 | inline wxList& GetChildren() const; |
4fabb575 JS |
350 | // Set this window to be the child of 'parent'. |
351 | // Returns FALSE it's not possible (some systems | |
352 | // won't allow it) | |
353 | virtual bool Reparent(wxWindow *parent); | |
2bda0e17 KB |
354 | |
355 | // Set/get the window's font | |
356 | virtual void SetFont(const wxFont& f); | |
c0ed460c | 357 | inline virtual wxFont& GetFont() const; |
2bda0e17 KB |
358 | |
359 | // Set/get the window's validator | |
360 | void SetValidator(const wxValidator& validator); | |
fd3f686c | 361 | inline wxValidator *GetValidator() const; |
2bda0e17 KB |
362 | |
363 | // Set/get the window's style | |
debe6624 | 364 | inline void SetWindowStyleFlag(long flag); |
fd3f686c | 365 | inline long GetWindowStyleFlag() const; |
2bda0e17 KB |
366 | |
367 | // Set/get double-clickability | |
368 | // TODO: we probably wish to get rid of this, and | |
369 | // always allow double clicks. | |
debe6624 | 370 | inline void SetDoubleClick(bool flag); |
fd3f686c | 371 | inline bool GetDoubleClick() const; |
debe6624 | 372 | inline void AllowDoubleClick(bool value) { SetDoubleClick(value); } |
2bda0e17 | 373 | |
02e8b2f9 | 374 | // Handle a control command |
2bda0e17 KB |
375 | virtual void OnCommand(wxWindow& win, wxCommandEvent& event); |
376 | ||
377 | // Set/get event handler | |
378 | inline void SetEventHandler(wxEvtHandler *handler); | |
fd3f686c | 379 | inline wxEvtHandler *GetEventHandler() const; |
2bda0e17 KB |
380 | |
381 | // Push/pop event handler (i.e. allow a chain of event handlers | |
382 | // be searched) | |
383 | void PushEventHandler(wxEvtHandler *handler) ; | |
384 | wxEvtHandler *PopEventHandler(bool deleteHandler = FALSE) ; | |
9f3362c4 | 385 | |
2bda0e17 | 386 | // Close the window by calling OnClose, posting a deletion |
debe6624 | 387 | virtual bool Close(bool force = FALSE); |
2bda0e17 KB |
388 | |
389 | // Destroy the window (delayed, if a managed window) | |
fd3f686c | 390 | virtual bool Destroy() ; |
2bda0e17 KB |
391 | |
392 | // Mode for telling default OnSize members to | |
393 | // call Layout(), if not using Sizers, just top-down constraints | |
debe6624 | 394 | inline void SetAutoLayout(bool a); |
fd3f686c | 395 | inline bool GetAutoLayout() const; |
2bda0e17 KB |
396 | |
397 | // Set/get constraints | |
fd3f686c | 398 | inline wxLayoutConstraints *GetConstraints() const; |
2bda0e17 KB |
399 | void SetConstraints(wxLayoutConstraints *c); |
400 | ||
401 | // Set/get window background colour | |
402 | inline virtual void SetBackgroundColour(const wxColour& col); | |
fd3f686c | 403 | inline virtual wxColour GetBackgroundColour() const; |
2bda0e17 KB |
404 | |
405 | // Set/get window foreground colour | |
406 | inline virtual void SetForegroundColour(const wxColour& col); | |
fd3f686c | 407 | inline virtual wxColour GetForegroundColour() const; |
2bda0e17 | 408 | |
2bda0e17 KB |
409 | // For backward compatibility |
410 | inline virtual void SetButtonFont(const wxFont& font) { SetFont(font); } | |
411 | inline virtual void SetLabelFont(const wxFont& font) { SetFont(font); } | |
c0ed460c JS |
412 | inline virtual wxFont& GetLabelFont() const { return GetFont(); }; |
413 | inline virtual wxFont& GetButtonFont() const { return GetFont(); }; | |
2bda0e17 KB |
414 | |
415 | // Get the default button, if there is one | |
fd3f686c | 416 | inline virtual wxButton *GetDefaultItem() const; |
2bda0e17 KB |
417 | inline virtual void SetDefaultItem(wxButton *but); |
418 | ||
14b72bf5 | 419 | virtual void SetAcceleratorTable(const wxAcceleratorTable& accel); |
46ccb510 | 420 | inline virtual wxAcceleratorTable& GetAcceleratorTable() const { return (wxAcceleratorTable&) m_acceleratorTable; } |
14b72bf5 | 421 | |
2bda0e17 KB |
422 | // Override to define new behaviour for default action (e.g. double clicking |
423 | // on a listbox) | |
424 | virtual void OnDefaultAction(wxControl *initiatingItem); | |
425 | ||
426 | // Resource loading | |
47d67540 | 427 | #if wxUSE_WX_RESOURCES |
2bda0e17 | 428 | virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL); |
fd71308f | 429 | virtual wxControl *CreateItem(const wxItemResource* childResource, const wxItemResource* parentResource, const wxResourceTable *table = NULL); |
2bda0e17 KB |
430 | #endif |
431 | ||
432 | // Native resource loading | |
debe6624 | 433 | virtual bool LoadNativeDialog(wxWindow* parent, wxWindowID& id); |
2bda0e17 | 434 | virtual bool LoadNativeDialog(wxWindow* parent, const wxString& name); |
debe6624 JS |
435 | virtual wxWindow* GetWindowChild1(wxWindowID& id); |
436 | virtual wxWindow* GetWindowChild(wxWindowID& id); | |
2bda0e17 KB |
437 | |
438 | virtual void GetTextExtent(const wxString& string, int *x, int *y, | |
439 | int *descent = NULL, | |
440 | int *externalLeading = NULL, | |
debe6624 | 441 | const wxFont *theFont = NULL, bool use16 = FALSE) const; |
2bda0e17 KB |
442 | |
443 | // Is the window retained? | |
fd3f686c | 444 | inline bool IsRetained() const; |
2bda0e17 | 445 | |
2bda0e17 | 446 | // Warp the pointer the given position |
debe6624 | 447 | virtual void WarpPointer(int x_pos, int y_pos) ; |
2bda0e17 KB |
448 | |
449 | // Clear the window | |
fd3f686c | 450 | virtual void Clear(); |
2bda0e17 KB |
451 | |
452 | // Find a window by id or name | |
debe6624 | 453 | virtual wxWindow *FindWindow(long id); |
2bda0e17 KB |
454 | virtual wxWindow *FindWindow(const wxString& name); |
455 | ||
456 | // Constraint operations | |
fd3f686c | 457 | bool Layout(); |
2bda0e17 | 458 | void SetSizer(wxSizer *sizer); // Adds sizer child to this window |
fd3f686c VZ |
459 | inline wxSizer *GetSizer() const ; |
460 | inline wxWindow *GetSizerParent() const ; | |
2bda0e17 KB |
461 | inline void SetSizerParent(wxWindow *win); |
462 | ||
463 | // Do Update UI processing for controls | |
fd3f686c | 464 | void UpdateWindowUI(); |
2bda0e17 | 465 | |
2bda0e17 KB |
466 | void OnEraseBackground(wxEraseEvent& event); |
467 | void OnChar(wxKeyEvent& event); | |
2bda0e17 KB |
468 | void OnIdle(wxIdleEvent& event); |
469 | ||
52476186 VZ |
470 | // Does this window want to accept keyboard focus? |
471 | virtual bool AcceptsFocus() const; | |
472 | ||
57c208c5 | 473 | virtual void PrepareDC( wxDC& WXUNUSED(dc) ) {}; |
2bda0e17 KB |
474 | public: |
475 | //////////////////////////////////////////////////////////////////////// | |
476 | //// IMPLEMENTATION | |
9f3362c4 | 477 | |
81d66cf3 JS |
478 | // For implementation purposes - sometimes decorations make the client area |
479 | // smaller | |
480 | virtual wxPoint GetClientAreaOrigin() const; | |
481 | ||
482 | // Makes an adjustment to the window position (for example, a frame that has | |
483 | // a toolbar that it manages itself). | |
484 | virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags); | |
485 | ||
2bda0e17 KB |
486 | // Windows subclassing |
487 | void SubclassWin(WXHWND hWnd); | |
fd3f686c VZ |
488 | void UnsubclassWin(); |
489 | virtual long Default(); | |
debe6624 | 490 | virtual bool MSWCommand(WXUINT param, WXWORD id); |
fd3f686c VZ |
491 | |
492 | // returns TRUE if the event was processed | |
493 | virtual bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result); | |
494 | ||
debe6624 JS |
495 | virtual wxWindow *FindItem(int id) const; |
496 | virtual wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const ; | |
497 | virtual void PreDelete(WXHDC dc); // Allows system cleanup | |
2bda0e17 | 498 | // TO DO: how many of these need to be virtual? |
fd3f686c | 499 | virtual WXHWND GetHWND() const ; |
2bda0e17 KB |
500 | virtual void SetHWND(WXHWND hWnd); |
501 | ||
502 | // Make a Windows extended style from the given wxWindows window style | |
503 | virtual WXDWORD MakeExtendedStyle(long style, bool eliminateBorders = TRUE); | |
504 | // Determine whether 3D effects are wanted | |
505 | virtual WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D); | |
506 | ||
507 | virtual void AddChild(wxWindow *child); // Adds reference to the child object | |
508 | virtual void RemoveChild(wxWindow *child); // Removes reference to child | |
509 | // (but doesn't delete the child object) | |
fd3f686c | 510 | virtual void DestroyChildren(); // Removes and destroys all children |
2bda0e17 | 511 | |
fd3f686c | 512 | inline bool IsBeingDeleted(); |
2bda0e17 KB |
513 | |
514 | // MSW only: TRUE if this control is part of the main control | |
515 | virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; }; | |
516 | ||
517 | // Constraint implementation | |
518 | void UnsetConstraints(wxLayoutConstraints *c); | |
fd3f686c | 519 | inline wxList *GetConstraintsInvolvedIn() const ; |
2bda0e17 KB |
520 | // Back-pointer to other windows we're involved with, so if we delete |
521 | // this window, we must delete any constraints we're involved with. | |
522 | void AddConstraintReference(wxWindow *otherWin); | |
523 | void RemoveConstraintReference(wxWindow *otherWin); | |
fd3f686c | 524 | void DeleteRelatedConstraints(); |
2bda0e17 | 525 | |
fd3f686c | 526 | virtual void ResetConstraints(); |
debe6624 | 527 | virtual void SetConstraintSizes(bool recurse = TRUE); |
2bda0e17 KB |
528 | virtual bool LayoutPhase1(int *noChanges); |
529 | virtual bool LayoutPhase2(int *noChanges); | |
debe6624 | 530 | virtual bool DoPhase(int); |
2bda0e17 KB |
531 | // Transforms from sizer coordinate space to actual |
532 | // parent coordinate space | |
533 | virtual void TransformSizerToActual(int *x, int *y) const ; | |
534 | ||
535 | // Set size with transformation to actual coordinates if nec. | |
debe6624 JS |
536 | virtual void SizerSetSize(int x, int y, int w, int h); |
537 | virtual void SizerMove(int x, int y); | |
2bda0e17 KB |
538 | |
539 | // Only set/get the size/position of the constraint (if any) | |
debe6624 JS |
540 | virtual void SetSizeConstraint(int x, int y, int w, int h); |
541 | virtual void MoveConstraint(int x, int y); | |
2bda0e17 KB |
542 | virtual void GetSizeConstraint(int *w, int *h) const ; |
543 | virtual void GetClientSizeConstraint(int *w, int *h) const ; | |
544 | virtual void GetPositionConstraint(int *x, int *y) const ; | |
545 | ||
fd71308f JS |
546 | // Dialog units translations. Implemented in wincmn.cpp. |
547 | wxPoint ConvertPixelsToDialog(const wxPoint& pt) ; | |
548 | wxPoint ConvertDialogToPixels(const wxPoint& pt) ; | |
549 | inline wxSize ConvertPixelsToDialog(const wxSize& sz) | |
550 | { wxPoint pt(ConvertPixelsToDialog(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); } | |
551 | inline wxSize ConvertDialogToPixels(const wxSize& sz) | |
552 | { wxPoint pt(ConvertDialogToPixels(wxPoint(sz.x, sz.y))); return wxSize(pt.x, pt.y); } | |
553 | ||
debe6624 | 554 | wxObject *GetChild(int number) const ; |
2bda0e17 | 555 | |
debe6624 JS |
556 | void MSWCreate(int id, wxWindow *parent, const char *wclass, wxWindow *wx_win, const char *title, |
557 | int x, int y, int width, int height, | |
558 | WXDWORD style, const char *dialog_template = NULL, | |
559 | WXDWORD exendedStyle = 0); | |
2bda0e17 KB |
560 | |
561 | // Actually defined in wx_canvs.cc since requires wxCanvas declaration | |
562 | virtual void MSWDeviceToLogical(float *x, float *y) const ; | |
563 | ||
564 | // Create an appropriate wxWindow from a HWND | |
565 | virtual wxWindow* CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd); | |
566 | ||
567 | // Make sure the window style reflects the HWND style (roughly) | |
fd3f686c | 568 | virtual void AdoptAttributesFromHWND(); |
2bda0e17 KB |
569 | |
570 | // Setup background and foreground colours correctly | |
fd3f686c | 571 | virtual void SetupColours(); |
2bda0e17 | 572 | |
a02eb1d2 VZ |
573 | // Saves the last message information before calling base version |
574 | virtual bool ProcessEvent(wxEvent& event); | |
575 | ||
2bda0e17 KB |
576 | // Handlers |
577 | virtual void MSWOnCreate(WXLPCREATESTRUCT cs); | |
fd3f686c VZ |
578 | virtual bool MSWOnPaint(); |
579 | virtual WXHICON MSWOnQueryDragIcon() { return 0; } | |
debe6624 | 580 | virtual void MSWOnSize(int x, int y, WXUINT flag); |
2bda0e17 | 581 | virtual void MSWOnWindowPosChanging(void *lpPos); |
debe6624 JS |
582 | virtual void MSWOnHScroll(WXWORD nSBCode, WXWORD pos, WXHWND control); |
583 | virtual void MSWOnVScroll(WXWORD nSBCode, WXWORD pos, WXHWND control); | |
584 | virtual bool MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control); | |
2bda0e17 | 585 | virtual long MSWOnSysCommand(WXWPARAM wParam, WXLPARAM lParam); |
fd3f686c | 586 | virtual long MSWOnNotify(WXWPARAM wParam, WXLPARAM lParam); |
debe6624 JS |
587 | virtual WXHBRUSH MSWOnCtlColor(WXHDC dc, WXHWND pWnd, WXUINT nCtlColor, |
588 | WXUINT message, WXWPARAM wParam, WXLPARAM lParam); | |
589 | virtual bool MSWOnColorChange(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam); | |
f7bd2698 JS |
590 | virtual long MSWOnPaletteChanged(WXHWND hWndPalChange); |
591 | virtual long MSWOnQueryNewPalette(); | |
debe6624 JS |
592 | virtual bool MSWOnEraseBkgnd(WXHDC pDC); |
593 | virtual void MSWOnMenuHighlight(WXWORD item, WXWORD flags, WXHMENU sysmenu); | |
594 | virtual void MSWOnInitMenuPopup(WXHMENU menu, int pos, bool isSystem); | |
fd3f686c | 595 | virtual bool MSWOnClose(); |
387a3b02 JS |
596 | // Return TRUE to end session, FALSE to veto end session. |
597 | virtual bool MSWOnQueryEndSession(long logOff); | |
598 | virtual bool MSWOnEndSession(bool endSession, long logOff); | |
fd3f686c | 599 | virtual bool MSWOnDestroy(); |
debe6624 JS |
600 | virtual bool MSWOnSetFocus(WXHWND wnd); |
601 | virtual bool MSWOnKillFocus(WXHWND wnd); | |
602 | virtual void MSWOnDropFiles(WXWPARAM wParam); | |
2bda0e17 KB |
603 | virtual bool MSWOnInitDialog(WXHWND hWndFocus); |
604 | virtual void MSWOnShow(bool show, int status); | |
605 | ||
606 | // TODO: rationalise these functions into 1 or 2 which take the | |
607 | // event type as argument. | |
debe6624 JS |
608 | virtual void MSWOnLButtonDown(int x, int y, WXUINT flags); |
609 | virtual void MSWOnLButtonUp(int x, int y, WXUINT flags); | |
610 | virtual void MSWOnLButtonDClick(int x, int y, WXUINT flags); | |
2bda0e17 | 611 | |
debe6624 JS |
612 | virtual void MSWOnMButtonDown(int x, int y, WXUINT flags); |
613 | virtual void MSWOnMButtonUp(int x, int y, WXUINT flags); | |
614 | virtual void MSWOnMButtonDClick(int x, int y, WXUINT flags); | |
2bda0e17 | 615 | |
debe6624 JS |
616 | virtual void MSWOnRButtonDown(int x, int y, WXUINT flags); |
617 | virtual void MSWOnRButtonUp(int x, int y, WXUINT flags); | |
618 | virtual void MSWOnRButtonDClick(int x, int y, WXUINT flags); | |
2bda0e17 | 619 | |
debe6624 JS |
620 | virtual void MSWOnMouseMove(int x, int y, WXUINT flags); |
621 | virtual void MSWOnMouseEnter(int x, int y, WXUINT flags); | |
622 | virtual void MSWOnMouseLeave(int x, int y, WXUINT flags); | |
2bda0e17 | 623 | |
debe6624 | 624 | virtual void MSWOnChar(WXWORD wParam, WXLPARAM lParam, bool isASCII = FALSE); |
4ce81a75 JS |
625 | virtual void MSWOnKeyDown(WXWORD wParam, WXLPARAM lParam, bool isASCII = FALSE); |
626 | virtual void MSWOnKeyUp(WXWORD wParam, WXLPARAM lParam, bool isASCII = FALSE); | |
2bda0e17 | 627 | |
debe6624 JS |
628 | virtual bool MSWOnActivate(int flag, bool minimized, WXHWND activate); |
629 | virtual long MSWOnMDIActivate(long flag, WXHWND activate, WXHWND deactivate); | |
2bda0e17 | 630 | |
debe6624 JS |
631 | virtual bool MSWOnDrawItem(int id, WXDRAWITEMSTRUCT *item); |
632 | virtual bool MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *item); | |
2bda0e17 | 633 | |
debe6624 JS |
634 | virtual void MSWOnJoyDown(int joystick, int x, int y, WXUINT flags); |
635 | virtual void MSWOnJoyUp(int joystick, int x, int y, WXUINT flags); | |
636 | virtual void MSWOnJoyMove(int joystick, int x, int y, WXUINT flags); | |
637 | virtual void MSWOnJoyZMove(int joystick, int z, WXUINT flags); | |
2bda0e17 | 638 | |
52476186 VZ |
639 | virtual long MSWGetDlgCode(); |
640 | ||
2bda0e17 KB |
641 | // Window procedure |
642 | virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); | |
643 | ||
644 | // Calls an appropriate default window procedure | |
645 | virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); | |
646 | virtual bool MSWProcessMessage(WXMSG* pMsg); | |
57a7b7c1 | 647 | virtual bool MSWTranslateMessage(WXMSG* pMsg); |
fd3f686c | 648 | virtual void MSWDestroyWindow(); |
2bda0e17 KB |
649 | |
650 | // Detach "Window" menu from menu bar so it doesn't get deleted | |
fd3f686c | 651 | void MSWDetachWindowMenu(); |
9f3362c4 | 652 | |
2bda0e17 | 653 | inline WXFARPROC MSWGetOldWndProc() const; |
debe6624 | 654 | inline void MSWSetOldWndProc(WXFARPROC proc); |
2bda0e17 KB |
655 | |
656 | // Define for each class of dialog and control | |
debe6624 | 657 | virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, |
9f3362c4 | 658 | WXUINT message, WXWPARAM wParam, WXLPARAM lParam); |
2bda0e17 | 659 | |
debe6624 | 660 | inline void SetShowing(bool show); |
fd3f686c VZ |
661 | inline bool IsUserEnabled() const; |
662 | inline bool GetUseCtl3D() const ; | |
663 | inline bool GetTransparentBackground() const ; | |
2bda0e17 KB |
664 | |
665 | // Responds to colour changes: passes event on to children. | |
666 | void OnSysColourChanged(wxSysColourChangedEvent& event); | |
667 | ||
668 | // Transfers data to any child controls | |
669 | void OnInitDialog(wxInitDialogEvent& event); | |
670 | ||
671 | // Sends an OnInitDialog event, which in turns transfers data to | |
672 | // to the window via validators. | |
fd3f686c | 673 | virtual void InitDialog(); |
2bda0e17 KB |
674 | |
675 | //////////////////////////////////////////////////////////////////////// | |
676 | //// PROTECTED DATA | |
677 | protected: | |
14b72bf5 | 678 | wxAcceleratorTable m_acceleratorTable; |
2bda0e17 | 679 | int m_windowId; |
9f3362c4 VZ |
680 | long m_windowStyle; // Store the window's style |
681 | wxEvtHandler * m_windowEventHandler; // Usually is 'this' | |
2bda0e17 KB |
682 | wxLayoutConstraints * m_constraints; // Constraints for this window |
683 | wxList * m_constraintsInvolvedIn; // List of constraints we're involved in | |
684 | wxSizer * m_windowSizer; // Window's top-level sizer (if any) | |
685 | wxWindow * m_sizerParent; // Window's parent sizer (if any) | |
686 | bool m_autoLayout; // Whether to call Layout() in OnSize | |
687 | wxWindow * m_windowParent; // Each window always knows its parent | |
688 | wxValidator * m_windowValidator; | |
689 | // Old window proc, for subclassed controls | |
690 | WXFARPROC m_oldWndProc; | |
691 | bool m_useCtl3D; // Using CTL3D for this control | |
692 | ||
9f3362c4 | 693 | bool m_inOnSize; // Protection against OnSize reentry |
bbcdf8bc | 694 | #ifndef _WX_WIN32__ |
2bda0e17 KB |
695 | // Pointer to global memory, for EDIT controls that need |
696 | // special treatment to reduce USER area consumption. | |
697 | WXHGLOBAL m_globalHandle; | |
698 | #endif | |
699 | ||
700 | bool m_winEnabled; | |
701 | int m_minSizeX; | |
702 | int m_minSizeY; | |
703 | int m_maxSizeX; | |
704 | int m_maxSizeY; | |
705 | ||
706 | // Caret data | |
707 | int m_caretWidth; | |
708 | int m_caretHeight; | |
709 | bool m_caretEnabled; | |
710 | bool m_caretShown; | |
2bda0e17 KB |
711 | wxFont m_windowFont; // Window's font |
712 | bool m_isShown; | |
713 | bool m_doubleClickAllowed ; | |
714 | wxCursor m_windowCursor; // Window's cursor | |
715 | bool m_winCaptured; | |
716 | wxString m_windowName; // Window name | |
717 | ||
47d67540 | 718 | #if wxUSE_EXTENDED_STATICS |
2bda0e17 KB |
719 | wxList m_staticItems; |
720 | #endif | |
721 | ||
722 | wxButton * m_defaultItem; | |
2bda0e17 | 723 | wxColour m_backgroundColour ; |
2bda0e17 | 724 | wxColour m_foregroundColour ; |
2bda0e17 KB |
725 | bool m_backgroundTransparent; |
726 | ||
2bda0e17 KB |
727 | int m_xThumbSize; |
728 | int m_yThumbSize; | |
729 | ||
730 | float m_lastXPos; | |
731 | float m_lastYPos; | |
732 | int m_lastEvent; | |
733 | ||
734 | bool m_mouseInWindow; | |
735 | ||
47d67540 | 736 | #if wxUSE_DRAG_AND_DROP |
2bda0e17 KB |
737 | wxDropTarget *m_pDropTarget; // the current drop target or NULL |
738 | #endif //USE_DRAG_AND_DROP | |
739 | ||
740 | public: | |
9f3362c4 | 741 | WXHWND m_hWnd; // MS Windows window handle |
2bda0e17 KB |
742 | WXUINT m_lastMsg; |
743 | WXWPARAM m_lastWParam; | |
744 | WXLPARAM m_lastLParam; | |
81d66cf3 JS |
745 | |
746 | wxRegion m_updateRegion; | |
747 | /* | |
1b826605 | 748 | wxRect m_updateRect; // Bounding box for screen damage area |
2bda0e17 KB |
749 | #ifdef __WIN32__ |
750 | WXHRGN m_updateRgn; // NT allows access to the rectangle list | |
751 | #endif | |
81d66cf3 JS |
752 | */ |
753 | ||
57a7b7c1 | 754 | // WXHANDLE m_acceleratorTable; |
2bda0e17 KB |
755 | WXHMENU m_hMenu; // Menu, if any |
756 | wxList * m_children; // Window's children | |
757 | int m_returnCode; | |
758 | bool m_isBeingDeleted; // Fudge because can't access parent | |
759 | // when being deleted | |
760 | ||
fd3f686c VZ |
761 | private: |
762 | // common part of all ctors | |
763 | void Init(); | |
764 | ||
9f3362c4 | 765 | // the associated tooltip (may be NULL if none) |
cb1a1dc9 | 766 | #if wxUSE_TOOLTIPS |
9f3362c4 | 767 | wxToolTip *m_tooltip; |
cb1a1dc9 | 768 | #endif |
9f3362c4 | 769 | |
fd3f686c | 770 | DECLARE_EVENT_TABLE() |
2bda0e17 KB |
771 | }; |
772 | ||
773 | //////////////////////////////////////////////////////////////////////// | |
774 | //// INLINES | |
775 | ||
fd3f686c | 776 | inline void *wxWindow::GetHandle() const { return (void *)GetHWND(); } |
2bda0e17 | 777 | inline int wxWindow::GetId() const { return m_windowId; } |
debe6624 | 778 | inline void wxWindow::SetId(int id) { m_windowId = id; } |
fd3f686c | 779 | inline wxWindow *wxWindow::GetParent() const { return m_windowParent; } |
2bda0e17 | 780 | inline void wxWindow::SetParent(wxWindow *p) { m_windowParent = p; } |
57c208c5 | 781 | inline wxWindow *wxWindow::GetGrandParent() const { return (m_windowParent ? m_windowParent->m_windowParent : (wxWindow*) NULL); } |
c0ed460c JS |
782 | inline wxList& wxWindow::GetChildren() const { return (wxList&) *m_children; } |
783 | inline wxFont& wxWindow::GetFont() const { return (wxFont&) m_windowFont; } | |
fd3f686c | 784 | inline wxString wxWindow::GetName() const { return m_windowName; } |
2bda0e17 | 785 | inline void wxWindow::SetName(const wxString& name) { m_windowName = name; } |
fd3f686c | 786 | inline long wxWindow::GetWindowStyleFlag() const { return m_windowStyle; } |
debe6624 JS |
787 | inline void wxWindow::SetWindowStyleFlag(long flag) { m_windowStyle = flag; } |
788 | inline void wxWindow::SetDoubleClick(bool flag) { m_doubleClickAllowed = flag; } | |
fd3f686c | 789 | inline bool wxWindow::GetDoubleClick() const { return m_doubleClickAllowed; } |
2bda0e17 | 790 | inline void wxWindow::SetEventHandler(wxEvtHandler *handler) { m_windowEventHandler = handler; } |
fd3f686c | 791 | inline wxEvtHandler *wxWindow::GetEventHandler() const { return m_windowEventHandler; } |
debe6624 | 792 | inline void wxWindow::SetAutoLayout(bool a) { m_autoLayout = a; } |
fd3f686c VZ |
793 | inline bool wxWindow::GetAutoLayout() const { return m_autoLayout; } |
794 | inline wxLayoutConstraints *wxWindow::GetConstraints() const { return m_constraints; } | |
2bda0e17 | 795 | inline void wxWindow::SetBackgroundColour(const wxColour& col) { m_backgroundColour = col; }; |
fd3f686c | 796 | inline wxColour wxWindow::GetBackgroundColour() const { return m_backgroundColour; }; |
2bda0e17 | 797 | inline void wxWindow::SetForegroundColour(const wxColour& col) { m_foregroundColour = col; }; |
fd3f686c | 798 | inline wxColour wxWindow::GetForegroundColour() const { return m_foregroundColour; }; |
2bda0e17 | 799 | |
fd3f686c | 800 | inline wxButton *wxWindow::GetDefaultItem() const { return m_defaultItem; } |
2bda0e17 | 801 | inline void wxWindow::SetDefaultItem(wxButton *but) { m_defaultItem = but; } |
fd3f686c | 802 | inline bool wxWindow::IsRetained() const { return ((m_windowStyle & wxRETAINED) == wxRETAINED); } |
debe6624 | 803 | |
debe6624 | 804 | inline void wxWindow::SetShowing(bool show) { m_isShown = show; } |
fd3f686c VZ |
805 | inline wxList *wxWindow::GetConstraintsInvolvedIn() const { return m_constraintsInvolvedIn; } |
806 | inline wxSizer *wxWindow::GetSizer() const { return m_windowSizer; } | |
807 | inline wxWindow *wxWindow::GetSizerParent() const { return m_sizerParent; } | |
2bda0e17 KB |
808 | inline void wxWindow::SetSizerParent(wxWindow *win) { m_sizerParent = win; } |
809 | inline WXFARPROC wxWindow::MSWGetOldWndProc() const { return m_oldWndProc; } | |
debe6624 | 810 | inline void wxWindow::MSWSetOldWndProc(WXFARPROC proc) { m_oldWndProc = proc; } |
fd3f686c VZ |
811 | inline wxValidator *wxWindow::GetValidator() const { return m_windowValidator; } |
812 | inline bool wxWindow::IsUserEnabled() const { return m_winEnabled; } | |
813 | inline bool wxWindow::GetUseCtl3D() const { return m_useCtl3D; } | |
814 | inline bool wxWindow::GetTransparentBackground() const { return m_backgroundTransparent; } | |
2bda0e17 | 815 | inline void wxWindow::SetReturnCode(int retCode) { m_returnCode = retCode; } |
fd3f686c VZ |
816 | inline int wxWindow::GetReturnCode() { return m_returnCode; } |
817 | inline bool wxWindow::IsBeingDeleted() { return m_isBeingDeleted; } | |
2bda0e17 KB |
818 | |
819 | // Window specific (so far) | |
fd3f686c | 820 | WXDLLEXPORT wxWindow* wxGetActiveWindow(); |
2bda0e17 | 821 | |
2bda0e17 KB |
822 | WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows; |
823 | ||
184b5d99 JS |
824 | WXDLLEXPORT int wxCharCodeMSWToWX(int keySym); |
825 | WXDLLEXPORT int wxCharCodeWXToMSW(int id, bool *IsVirtual); | |
2bda0e17 KB |
826 | |
827 | // Allocates control ids | |
fd3f686c | 828 | WXDLLEXPORT int NewControlId(); |
2bda0e17 KB |
829 | |
830 | #endif | |
bbcdf8bc | 831 | // _WX_WINDOW_H_ |