]> git.saurik.com Git - wxWidgets.git/blame - src/mgl/window.cpp
Added compatibility file
[wxWidgets.git] / src / mgl / window.cpp
CommitLineData
32b8ec41 1/////////////////////////////////////////////////////////////////////////////
a4bbc9f7
VS
2// Name: src/mgl/window.cpp
3// Purpose: wxWindow
4// Author: Vaclav Slavik
5// (based on GTK & MSW implementations)
6// RCS-ID: $Id$
eea93267 7// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
a4bbc9f7 8// Licence: wxWindows license
32b8ec41
VZ
9/////////////////////////////////////////////////////////////////////////////
10
a4bbc9f7
VS
11// ===========================================================================
12// declarations
13// ===========================================================================
14
15// ---------------------------------------------------------------------------
16// headers
17// ---------------------------------------------------------------------------
32b8ec41
VZ
18
19#ifdef __GNUG__
20 #pragma implementation "window.h"
21#endif
22
a4bbc9f7
VS
23// For compilers that support precompilation, includes "wx.h".
24#include "wx/wxprec.h"
25
26#ifdef __BORLANDC__
27 #pragma hdrstop
28#endif
29
30#ifndef WX_PRECOMP
31 #include "wx/window.h"
d53fc7c9 32 #include "wx/msgdlg.h"
a4bbc9f7
VS
33 #include "wx/accel.h"
34 #include "wx/setup.h"
35 #include "wx/dc.h"
36 #include "wx/dcclient.h"
37 #include "wx/utils.h"
38 #include "wx/app.h"
39 #include "wx/panel.h"
40 #include "wx/caret.h"
41#endif
42
43#if wxUSE_DRAG_AND_DROP
44 #include "wx/dnd.h"
45#endif
46
47#include "wx/log.h"
48#include "wx/sysopt.h"
49#include "wx/mgl/private.h"
50#include "wx/intl.h"
51#include "wx/dcscreen.h"
52
53#include <mgraph.hpp>
54
55#if wxUSE_TOOLTIPS
56 #include "wx/tooltip.h"
57#endif
58
59// ---------------------------------------------------------------------------
60// global variables
61// ---------------------------------------------------------------------------
62
63// MGL window manager and associated DC.
64winmng_t *g_winMng = NULL;
65MGLDevCtx *g_displayDC = NULL;
66
2b260bc3 67// the window that has keyboard focus:
7cdbf02c 68static wxWindowMGL *gs_focusedWindow = NULL;
eea93267
VS
69// the window that is about to be focused after currently focused
70// one looses focus:
71static wxWindow *gs_toBeFocusedWindow = NULL;
7bdc1879 72// the window that is currently under mouse cursor:
7cdbf02c
VS
73static wxWindowMGL *gs_windowUnderMouse = NULL;
74// the window that has mouse capture
75static wxWindowMGL *gs_mouseCapture = NULL;
76// the frame that is currently active (i.e. its child has focus). It is
77// used to generate wxActivateEvents
78static wxWindowMGL *gs_activeFrame = NULL;
a4bbc9f7
VS
79
80// ---------------------------------------------------------------------------
81// constants
82// ---------------------------------------------------------------------------
83
84// Custom identifiers used to distinguish between various event handlers
85// and capture handlers passed to MGL_wm
86enum
87{
88 wxMGL_CAPTURE_MOUSE = 1,
89 wxMGL_CAPTURE_KEYB = 2
90};
91
92
93// ---------------------------------------------------------------------------
94// private functions
95// ---------------------------------------------------------------------------
96
7cdbf02c
VS
97// Returns toplevel grandparent of given window:
98static wxWindowMGL* wxGetTopLevelParent(wxWindowMGL *win)
99{
100 wxWindowMGL *p = win;
101 while (p && !p->IsTopLevel())
102 p = p->GetParent();
103 return p;
104}
105
d53fc7c9
VS
106// An easy way to capture screenshots:
107static void wxCaptureScreenshot()
e6daf008 108{
d53fc7c9
VS
109#ifdef __DOS__
110 #define SCREENSHOT_FILENAME _T("sshot%03i.png")
111#else
112 #define SCREENSHOT_FILENAME _T("screenshot-%03i.png")
113#endif
e6daf008 114 static int screenshot_num = 0;
d53fc7c9
VS
115 wxString screenshot;
116
117 do
118 {
119 screenshot.Printf(SCREENSHOT_FILENAME, screenshot_num++);
120 } while ( wxFileExists(screenshot) && screenshot_num < 1000 );
121
122 g_displayDC->savePNGFromDC(screenshot.mb_str(), 0, 0,
e6daf008
VS
123 g_displayDC->sizex(),
124 g_displayDC->sizey());
d53fc7c9
VS
125
126 wxMessageBox(_("Screenshot captured: ") + wxString(screenshot));
e6daf008 127}
e6daf008 128
7bdc1879
VS
129// ---------------------------------------------------------------------------
130// MGL_WM hooks:
131// ---------------------------------------------------------------------------
132
b43a9886 133static void MGLAPI wxWindowPainter(window_t *wnd, MGLDC *dc)
7bdc1879
VS
134{
135 wxWindowMGL *w = (wxWindow*) wnd->userData;
61bd618f 136
544c782d 137 if ( w && !(w->GetWindowStyle() & wxTRANSPARENT_WINDOW) )
7bdc1879
VS
138 {
139 MGLDevCtx ctx(dc);
140 w->HandlePaint(&ctx);
141 }
ef344ff8
VS
142}
143
b43a9886 144static ibool MGLAPI wxWindowMouseHandler(window_t *wnd, event_t *e)
ef344ff8
VS
145{
146 wxWindowMGL *win = (wxWindowMGL*)MGL_wmGetWindowUserData(wnd);
d76048f5 147 wxPoint orig(win->GetClientAreaOrigin());
985520bc 148 wxPoint where;
ef344ff8 149
985520bc
VS
150 MGL_wmCoordGlobalToLocal(win->GetHandle(),
151 e->where_x, e->where_y, &where.x, &where.y);
152
0a89ac9c
VS
153 for (wxWindowMGL *w = win; w; w = w->GetParent())
154 {
155 if ( !w->IsEnabled() )
156 return FALSE;
157 if ( w->IsTopLevel() )
158 break;
159 }
a200c35e 160
ef344ff8
VS
161 wxEventType type = wxEVT_NULL;
162 wxMouseEvent event;
163 event.SetEventObject(win);
164 event.SetTimestamp(e->when);
d76048f5
VS
165 event.m_x = where.x - orig.x;
166 event.m_y = where.y - orig.y;
ef344ff8
VS
167 event.m_shiftDown = e->modifiers & EVT_SHIFTKEY;
168 event.m_controlDown = e->modifiers & EVT_CTRLSTATE;
169 event.m_altDown = e->modifiers & EVT_LEFTALT;
170 event.m_metaDown = e->modifiers & EVT_RIGHTALT;
171 event.m_leftDown = e->modifiers & EVT_LEFTBUT;
172 event.m_middleDown = e->modifiers & EVT_MIDDLEBUT;
173 event.m_rightDown = e->modifiers & EVT_RIGHTBUT;
8f5e92db 174
ef344ff8
VS
175 switch (e->what)
176 {
177 case EVT_MOUSEDOWN:
8f5e92db
VS
178 // Change focus if the user clicks outside focused window:
179 if ( win->AcceptsFocus() && wxWindow::FindFocus() != win )
180 win->SetFocus();
181
ef344ff8 182 if ( e->message & EVT_LEFTBMASK )
8f5e92db 183 type = wxEVT_LEFT_DOWN;
ef344ff8 184 else if ( e->message & EVT_MIDDLEBMASK )
8f5e92db 185 type = wxEVT_MIDDLE_DOWN;
ef344ff8 186 else if ( e->message & EVT_RIGHTBMASK )
8f5e92db 187 type = wxEVT_RIGHT_DOWN;
a679e129 188
8f5e92db
VS
189 if ( e->message & EVT_DBLCLICK )
190 {
191 // MGL doesn't generate two subsequent single clicks prior
192 // to a double click, but rather only fires one single click
193 // followed by one double click. wxWindows expects two single
194 // clicks, so we have to emulate the second one.
195 event.SetEventType(type);
196 win->GetEventHandler()->ProcessEvent(event);
197
198 // And change event type for the real double click event
199 // that will be generated later in this function:
200 if ( e->message & EVT_LEFTBMASK )
201 type = wxEVT_LEFT_DCLICK;
202 else if ( e->message & EVT_MIDDLEBMASK )
203 type = wxEVT_MIDDLE_DCLICK;
204 else if ( e->message & EVT_RIGHTBMASK )
205 type = wxEVT_RIGHT_DCLICK;
206 }
a679e129 207
ef344ff8
VS
208 break;
209
210 case EVT_MOUSEUP:
211 if ( e->message & EVT_LEFTBMASK )
212 type = wxEVT_LEFT_UP;
213 else if ( e->message & EVT_MIDDLEBMASK )
214 type = wxEVT_MIDDLE_UP;
215 else if ( e->message & EVT_RIGHTBMASK )
216 type = wxEVT_RIGHT_UP;
217 break;
218
219 case EVT_MOUSEMOVE:
7cdbf02c
VS
220 if ( !gs_mouseCapture )
221 {
222 if ( win != gs_windowUnderMouse )
223 {
224 if ( gs_windowUnderMouse )
225 {
226 wxMouseEvent event2(event);
227 MGL_wmCoordGlobalToLocal(gs_windowUnderMouse->GetHandle(),
228 e->where_x, e->where_y,
229 &event2.m_x, &event2.m_y);
230
d76048f5
VS
231 wxPoint orig(gs_windowUnderMouse->GetClientAreaOrigin());
232 event2.m_x -= orig.x;
233 event2.m_y -= orig.y;
234
7cdbf02c
VS
235 event2.SetEventObject(gs_windowUnderMouse);
236 event2.SetEventType(wxEVT_LEAVE_WINDOW);
237 gs_windowUnderMouse->GetEventHandler()->ProcessEvent(event2);
238 }
239
240 wxMouseEvent event3(event);
241 event3.SetEventType(wxEVT_ENTER_WINDOW);
242 win->GetEventHandler()->ProcessEvent(event3);
243
244 gs_windowUnderMouse = win;
245 }
246 }
247 else // gs_mouseCapture
ef344ff8 248 {
7cdbf02c
VS
249 bool inside = (where.x >= 0 &&
250 where.y >= 0 &&
251 where.x < win->GetSize().x &&
252 where.y < win->GetSize().y);
253 if ( (inside && gs_windowUnderMouse != win) ||
254 (!inside && gs_windowUnderMouse == win) )
ef344ff8 255 {
7cdbf02c
VS
256 wxMouseEvent evt(inside ?
257 wxEVT_ENTER_WINDOW : wxEVT_LEAVE_WINDOW);
258 evt.SetEventObject(win);
259 win->GetEventHandler()->ProcessEvent(evt);
260 gs_windowUnderMouse = inside ? win : NULL;
ef344ff8 261 }
ef344ff8
VS
262 }
263
264 type = wxEVT_MOTION;
265 break;
266
267 default:
268 break;
269 }
270
271 if ( type == wxEVT_NULL )
272 {
273 return FALSE;
274 }
275 else
276 {
277 event.SetEventType(type);
278 return win->GetEventHandler()->ProcessEvent(event);
279 }
280}
281
a679e129 282static long wxScanToKeyCode(event_t *event, bool translate)
ef344ff8 283{
84c88a17
VS
284 // VS: make it __WXDEBUG__-only, since we have lots of wxLogTrace calls
285 // here and the arguments would be stored in non-debug executable even
286 // though wxLogTrace would be no-op...
287 #ifdef __WXDEBUG__
288 #define KEY(mgl_key,wx_key) \
289 case mgl_key: \
290 wxLogTrace(_T("keyevents"), \
291 _T("key " #mgl_key ", mapped to " #wx_key)); \
292 key = wx_key; \
293 break;
294 #else
295 #define KEY(mgl_key,wx_key) \
296 case mgl_key: key = wx_key; break;
297 #endif
2b260bc3
VS
298
299 long key = 0;
a679e129
VS
300
301 if ( translate )
2b260bc3 302 {
a679e129
VS
303 switch ( EVT_scanCode(event->message) )
304 {
305 KEY (KB_padMinus, WXK_NUMPAD_SUBTRACT)
306 KEY (KB_padPlus, WXK_NUMPAD_ADD)
307 KEY (KB_padTimes, WXK_NUMPAD_MULTIPLY)
308 KEY (KB_padDivide, WXK_NUMPAD_DIVIDE)
309 KEY (KB_padCenter, WXK_NUMPAD_SEPARATOR) // ?
310 KEY (KB_padLeft, WXK_NUMPAD_LEFT)
311 KEY (KB_padRight, WXK_NUMPAD_RIGHT)
312 KEY (KB_padUp, WXK_NUMPAD_UP)
313 KEY (KB_padDown, WXK_NUMPAD_DOWN)
314 KEY (KB_padInsert, WXK_NUMPAD_INSERT)
315 KEY (KB_padDelete, WXK_NUMPAD_DELETE)
316 KEY (KB_padHome, WXK_NUMPAD_HOME)
317 KEY (KB_padEnd, WXK_NUMPAD_END)
318 KEY (KB_padPageUp, WXK_NUMPAD_PAGEUP)
319 //KEY (KB_padPageUp, WXK_NUMPAD_PRIOR)
320 KEY (KB_padPageDown, WXK_NUMPAD_PAGEDOWN)
321 //KEY (KB_padPageDown, WXK_NUMPAD_NEXT)
322 KEY (KB_1, '1')
323 KEY (KB_2, '2')
324 KEY (KB_3, '3')
325 KEY (KB_4, '4')
326 KEY (KB_5, '5')
327 KEY (KB_6, '6')
328 KEY (KB_7, '7')
329 KEY (KB_8, '8')
330 KEY (KB_9, '9')
331 KEY (KB_0, '0')
332 KEY (KB_minus, WXK_SUBTRACT)
333 KEY (KB_equals, WXK_ADD)
334 KEY (KB_backSlash, '\\')
335 KEY (KB_Q, 'Q')
336 KEY (KB_W, 'W')
337 KEY (KB_E, 'E')
338 KEY (KB_R, 'R')
339 KEY (KB_T, 'T')
340 KEY (KB_Y, 'Y')
341 KEY (KB_U, 'U')
342 KEY (KB_I, 'I')
343 KEY (KB_O, 'O')
344 KEY (KB_P, 'P')
345 KEY (KB_leftSquareBrace,'[')
346 KEY (KB_rightSquareBrace,']')
347 KEY (KB_A, 'A')
348 KEY (KB_S, 'S')
349 KEY (KB_D, 'D')
350 KEY (KB_F, 'F')
351 KEY (KB_G, 'G')
352 KEY (KB_H, 'H')
353 KEY (KB_J, 'J')
354 KEY (KB_K, 'K')
355 KEY (KB_L, 'L')
356 KEY (KB_semicolon, ';')
357 KEY (KB_apostrophe, '\'')
358 KEY (KB_Z, 'Z')
359 KEY (KB_X, 'X')
360 KEY (KB_C, 'C')
361 KEY (KB_V, 'V')
362 KEY (KB_B, 'B')
363 KEY (KB_N, 'N')
364 KEY (KB_M, 'M')
365 KEY (KB_comma, ',')
366 KEY (KB_period, '.')
367 KEY (KB_divide, WXK_DIVIDE)
368 KEY (KB_space, WXK_SPACE)
369 KEY (KB_tilde, '~')
370
371 default: break;
372 }
373 }
374
375 if ( key == 0 )
376 {
377 switch ( EVT_scanCode(event->message) )
378 {
379 KEY (KB_padEnter, WXK_NUMPAD_ENTER)
380 KEY (KB_F1, WXK_F1)
381 KEY (KB_F2, WXK_F2)
382 KEY (KB_F3, WXK_F3)
383 KEY (KB_F4, WXK_F4)
384 KEY (KB_F5, WXK_F5)
385 KEY (KB_F6, WXK_F6)
386 KEY (KB_F7, WXK_F7)
387 KEY (KB_F8, WXK_F8)
388 KEY (KB_F9, WXK_F9)
389 KEY (KB_F10, WXK_F10)
390 KEY (KB_F11, WXK_F11)
391 KEY (KB_F12, WXK_F12)
392 KEY (KB_left, WXK_LEFT)
393 KEY (KB_right, WXK_RIGHT)
394 KEY (KB_up, WXK_UP)
395 KEY (KB_down, WXK_DOWN)
396 KEY (KB_insert, WXK_INSERT)
397 KEY (KB_delete, WXK_DELETE)
398 KEY (KB_home, WXK_HOME)
399 KEY (KB_end, WXK_END)
400 KEY (KB_pageUp, WXK_PAGEUP)
401 KEY (KB_pageDown, WXK_PAGEDOWN)
402 KEY (KB_capsLock, WXK_CAPITAL)
403 KEY (KB_numLock, WXK_NUMLOCK)
404 KEY (KB_scrollLock, WXK_SCROLL)
405 KEY (KB_leftShift, WXK_SHIFT)
406 KEY (KB_rightShift, WXK_SHIFT)
407 KEY (KB_leftCtrl, WXK_CONTROL)
408 KEY (KB_rightCtrl, WXK_CONTROL)
409 KEY (KB_leftAlt, WXK_ALT)
410 KEY (KB_rightAlt, WXK_ALT)
411 KEY (KB_leftWindows, WXK_START)
412 KEY (KB_rightWindows, WXK_START)
413 KEY (KB_menu, WXK_MENU)
414 KEY (KB_sysReq, WXK_SNAPSHOT)
415 KEY (KB_esc, WXK_ESCAPE)
416 KEY (KB_backspace, WXK_BACK)
417 KEY (KB_tab, WXK_TAB)
418 KEY (KB_enter, WXK_RETURN)
419
420 default:
421 key = EVT_asciiCode(event->message);
422 break;
423 }
2b260bc3
VS
424 }
425
544c782d
VS
426 #undef KEY
427
2b260bc3 428 return key;
ef344ff8
VS
429}
430
d53fc7c9
VS
431static bool wxHandleSpecialKeys(wxKeyEvent& event)
432{
433 // Add an easy way to capture screenshots:
434 if ( event.m_keyCode == WXK_SNAPSHOT
435 #ifdef __WXDEBUG__ // FIXME_MGL - remove when KB_sysReq works in MGL!
436 || (event.m_keyCode == WXK_F1 &&
437 event.m_shiftDown && event.m_controlDown)
438 )
439 #endif
440 {
441 wxCaptureScreenshot();
442 return TRUE;
443 }
444
445 if ( event.m_keyCode == WXK_F4 && event.m_altDown &&
446 gs_activeFrame != NULL )
447 {
448 gs_activeFrame->Close();
449 return TRUE;
450 }
451
452 return FALSE;
453}
454
b43a9886 455static ibool MGLAPI wxWindowKeybHandler(window_t *wnd, event_t *e)
2b260bc3 456{
2b260bc3 457 wxWindowMGL *win = (wxWindowMGL*)MGL_wmGetWindowUserData(wnd);
a200c35e
VS
458
459 if ( !win->IsEnabled() ) return FALSE;
460
985520bc
VS
461 wxPoint where;
462 MGL_wmCoordGlobalToLocal(win->GetHandle(),
463 e->where_x, e->where_y, &where.x, &where.y);
2b260bc3
VS
464
465 wxKeyEvent event;
466 event.SetEventObject(win);
467 event.SetTimestamp(e->when);
a679e129 468 event.m_keyCode = wxScanToKeyCode(e, TRUE);
2b260bc3
VS
469 event.m_scanCode = 0; // not used by wx at all
470 event.m_x = where.x;
471 event.m_y = where.y;
2b260bc3
VS
472 event.m_shiftDown = e->modifiers & EVT_SHIFTKEY;
473 event.m_controlDown = e->modifiers & EVT_CTRLSTATE;
474 event.m_altDown = e->modifiers & EVT_LEFTALT;
475 event.m_metaDown = e->modifiers & EVT_RIGHTALT;
476
477 if ( e->what == EVT_KEYUP )
478 {
479 event.SetEventType(wxEVT_KEY_UP);
480 return win->GetEventHandler()->ProcessEvent(event);
481 }
482 else
483 {
484 bool ret;
485 wxKeyEvent event2;
486
487 event.SetEventType(wxEVT_KEY_DOWN);
488 event2 = event;
489
490 ret = win->GetEventHandler()->ProcessEvent(event);
491
84c88a17
VS
492 // wxMSW doesn't send char events with Alt pressed
493 // Only send wxEVT_CHAR event if not processed yet. Thus, ALT-x
d53fc7c9 494 // will only be sent if it is not in an accelerator table:
a679e129 495 event2.m_keyCode = wxScanToKeyCode(e, FALSE);
2b260bc3
VS
496 if ( !ret && event2.m_keyCode != 0 )
497 {
498 event2.SetEventType(wxEVT_CHAR);
499 ret = win->GetEventHandler()->ProcessEvent(event2);
500 }
501
84c88a17 502 // Synthetize navigation key event, but do it only if the TAB key
d53fc7c9 503 // wasn't handled yet:
84c88a17
VS
504 if ( !ret && event.m_keyCode == WXK_TAB &&
505 win->GetParent() && win->GetParent()->HasFlag(wxTAB_TRAVERSAL) )
506 {
507 wxNavigationKeyEvent navEvent;
508 navEvent.SetEventObject(win->GetParent());
509 // Shift-TAB goes in reverse direction:
510 navEvent.SetDirection(!event.m_shiftDown);
511 // Ctrl-TAB changes the (parent) window, i.e. switch notebook page:
512 navEvent.SetWindowChange(event.m_controlDown);
513 navEvent.SetCurrentFocus(wxStaticCast(win, wxWindow));
514 ret = win->GetParent()->GetEventHandler()->ProcessEvent(navEvent);
515 }
516
d53fc7c9
VS
517 // Finally, process special meaning keys that are usually
518 // a responsibility of OS or window manager:
519 if ( !ret )
520 ret = wxHandleSpecialKeys(event);
521
2b260bc3
VS
522 return ret;
523 }
7bdc1879 524}
a4bbc9f7
VS
525
526// ---------------------------------------------------------------------------
527// event tables
528// ---------------------------------------------------------------------------
529
ef344ff8 530// in wxUniv this class is abstract because it doesn't have DoPopupMenu()
a4bbc9f7
VS
531IMPLEMENT_ABSTRACT_CLASS(wxWindowMGL, wxWindowBase)
532
533BEGIN_EVENT_TABLE(wxWindowMGL, wxWindowBase)
d53fc7c9 534 EVT_IDLE(wxWindowMGL::OnIdle)
a4bbc9f7
VS
535END_EVENT_TABLE()
536
537// ===========================================================================
538// implementation
539// ===========================================================================
540
541// ----------------------------------------------------------------------------
542// constructors and such
543// ----------------------------------------------------------------------------
544
a3e76614
VS
545extern wxDisplayModeInfo wxGetDefaultDisplayMode();
546
a4bbc9f7
VS
547void wxWindowMGL::Init()
548{
1f43b5c9
VS
549 // First of all, make sure window manager is up and running. If it is
550 // not the case, initialize it in default display mode
551 if ( !g_winMng )
7b9f73d2
VS
552 {
553 if ( !wxTheApp->SetDisplayMode(wxGetDefaultDisplayMode()) )
554 wxFatalError(_("Cannot initialize display."));
555 }
1f43b5c9 556
a4bbc9f7
VS
557 // generic:
558 InitBase();
559
560 // mgl specific:
a4bbc9f7
VS
561 m_wnd = NULL;
562 m_isShown = TRUE;
563 m_isBeingDeleted = FALSE;
564 m_isEnabled = TRUE;
565 m_frozen = FALSE;
566 m_paintMGLDC = NULL;
2b260bc3 567 m_eraseBackground = -1;
a4bbc9f7
VS
568}
569
570// Destructor
571wxWindowMGL::~wxWindowMGL()
572{
573 m_isBeingDeleted = TRUE;
574
7cdbf02c
VS
575 if ( gs_mouseCapture == this )
576 ReleaseMouse();
d46330c5 577
7cdbf02c 578 if (gs_activeFrame == this)
d46330c5 579 {
31ae546e 580 gs_activeFrame = NULL;
d46330c5
VS
581 // activate next frame in Z-order:
582 if ( m_wnd->prev )
583 {
584 wxWindowMGL *win = (wxWindowMGL*)m_wnd->prev->userData;
585 win->SetFocus();
586 }
d46330c5
VS
587 }
588
7cdbf02c 589 if ( gs_focusedWindow == this )
7bdc1879 590 KillFocus();
d46330c5 591
7cdbf02c
VS
592 if ( gs_windowUnderMouse == this )
593 gs_windowUnderMouse = NULL;
a4bbc9f7
VS
594
595 // VS: destroy children first and _then_ detach *this from its parent.
596 // If we'd do it the other way around, children wouldn't be able
597 // find their parent frame (see above).
598 DestroyChildren();
599
600 if ( m_parent )
601 m_parent->RemoveChild(this);
602
603 if ( m_wnd )
604 MGL_wmDestroyWindow(m_wnd);
605}
606
607// real construction (Init() must have been called before!)
608bool wxWindowMGL::Create(wxWindow *parent,
609 wxWindowID id,
610 const wxPoint& pos,
611 const wxSize& size,
612 long style,
613 const wxString& name)
614{
a4bbc9f7
VS
615 if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
616 return FALSE;
617
544c782d 618 if ( parent )
7bdc1879 619 parent->AddChild(this);
a4bbc9f7 620
ef344ff8
VS
621 int x, y, w, h;
622 x = pos.x, y = pos.y;
623 if ( x == -1 )
624 x = 0; // FIXME_MGL, something better, see GTK+
625 if ( y == -1 )
626 y = 0; // FIXME_MGL, something better, see GTK+
82186005 627 AdjustForParentClientOrigin(x, y, 0);
ef344ff8
VS
628 w = WidthDefault(size.x);
629 h = HeightDefault(size.y);
72fa862b
VS
630
631 long mgl_style = 0;
7cdbf02c 632 window_t *wnd_parent = parent ? parent->GetHandle() : NULL;
544c782d 633
72fa862b 634 if ( !(style & wxNO_FULL_REPAINT_ON_RESIZE) )
544c782d 635 {
72fa862b 636 mgl_style |= MGL_WM_FULL_REPAINT_ON_RESIZE;
544c782d 637 }
72fa862b 638 if ( style & wxSTAY_ON_TOP )
544c782d 639 {
72fa862b 640 mgl_style |= MGL_WM_ALWAYS_ON_TOP;
544c782d
VS
641 }
642 if ( style & wxPOPUP_WINDOW )
643 {
7cdbf02c 644 mgl_style |= MGL_WM_ALWAYS_ON_TOP;
544c782d
VS
645 // it is created hidden as other top level windows
646 m_isShown = FALSE;
7cdbf02c 647 wnd_parent = NULL;
544c782d 648 }
ef344ff8 649
58061670
VS
650 window_t *wnd = MGL_wmCreateWindow(g_winMng, wnd_parent, x, y, w, h);
651
652 MGL_wmSetWindowFlags(wnd, mgl_style);
653 MGL_wmShowWindow(wnd, m_isShown);
654
655 SetMGLwindow_t(wnd);
656
657 return TRUE;
658}
659
660void wxWindowMGL::SetMGLwindow_t(struct window_t *wnd)
661{
662 if ( m_wnd )
663 MGL_wmDestroyWindow(m_wnd);
664
665 m_wnd = wnd;
666 if ( !m_wnd ) return;
667
668 m_isShown = m_wnd->visible;
ef344ff8 669
a4bbc9f7
VS
670 MGL_wmSetWindowUserData(m_wnd, (void*) this);
671 MGL_wmSetWindowPainter(m_wnd, wxWindowPainter);
ef344ff8
VS
672 MGL_wmPushWindowEventHandler(m_wnd, wxWindowMouseHandler, EVT_MOUSEEVT, 0);
673 MGL_wmPushWindowEventHandler(m_wnd, wxWindowKeybHandler, EVT_KEYEVT, 0);
58061670
VS
674
675 if ( m_cursor.Ok() )
676 MGL_wmSetWindowCursor(m_wnd, *m_cursor.GetMGLCursor());
677 else
678 MGL_wmSetWindowCursor(m_wnd, *wxSTANDARD_CURSOR->GetMGLCursor());
a4bbc9f7
VS
679}
680
681// ---------------------------------------------------------------------------
682// basic operations
683// ---------------------------------------------------------------------------
684
685void wxWindowMGL::SetFocus()
686{
a46935cb
VS
687 if ( gs_focusedWindow == this ) return;
688
eea93267
VS
689 wxWindowMGL *oldFocusedWindow = gs_focusedWindow;
690
7cdbf02c 691 if ( gs_focusedWindow )
eea93267
VS
692 {
693 gs_toBeFocusedWindow = (wxWindow*)this;
7cdbf02c 694 gs_focusedWindow->KillFocus();
eea93267
VS
695 gs_toBeFocusedWindow = NULL;
696 }
a4bbc9f7 697
7cdbf02c 698 gs_focusedWindow = this;
a4bbc9f7 699
2b260bc3 700 MGL_wmCaptureEvents(GetHandle(), EVT_KEYEVT, wxMGL_CAPTURE_KEYB);
a4bbc9f7 701
7cdbf02c 702 wxWindowMGL *active = wxGetTopLevelParent(this);
61bd618f 703 if ( !(m_windowStyle & wxPOPUP_WINDOW) && active != gs_activeFrame )
a4bbc9f7 704 {
7cdbf02c
VS
705 if ( gs_activeFrame )
706 {
707 wxActivateEvent event(wxEVT_ACTIVATE, FALSE, gs_activeFrame->GetId());
708 event.SetEventObject(gs_activeFrame);
709 gs_activeFrame->GetEventHandler()->ProcessEvent(event);
710 }
711
712 gs_activeFrame = active;
713 wxActivateEvent event(wxEVT_ACTIVATE, TRUE, gs_activeFrame->GetId());
714 event.SetEventObject(gs_activeFrame);
715 gs_activeFrame->GetEventHandler()->ProcessEvent(event);
a4bbc9f7
VS
716 }
717
718 wxFocusEvent event(wxEVT_SET_FOCUS, GetId());
719 event.SetEventObject(this);
eea93267 720 event.SetWindow((wxWindow*)oldFocusedWindow);
a46935cb 721 GetEventHandler()->ProcessEvent(event);
869dabf8
VS
722
723#if wxUSE_CARET
724 // caret needs to be informed about focus change
725 wxCaret *caret = GetCaret();
726 if ( caret )
727 caret->OnSetFocus();
728#endif // wxUSE_CARET
a4bbc9f7 729}
32b8ec41 730
a4bbc9f7 731void wxWindowMGL::KillFocus()
32b8ec41 732{
7cdbf02c
VS
733 if ( gs_focusedWindow != this ) return;
734 gs_focusedWindow = NULL;
a4bbc9f7 735
7bdc1879
VS
736 if ( m_isBeingDeleted ) return;
737
a4bbc9f7
VS
738 MGL_wmUncaptureEvents(GetHandle(), wxMGL_CAPTURE_KEYB);
739
740#if wxUSE_CARET
741 // caret needs to be informed about focus change
742 wxCaret *caret = GetCaret();
7bdc1879 743 if ( caret )
a4bbc9f7
VS
744 caret->OnKillFocus();
745#endif // wxUSE_CARET
746
a4bbc9f7
VS
747 wxFocusEvent event(wxEVT_KILL_FOCUS, GetId());
748 event.SetEventObject(this);
eea93267 749 event.SetWindow(gs_toBeFocusedWindow);
a46935cb 750 GetEventHandler()->ProcessEvent(event);
32b8ec41
VZ
751}
752
a4bbc9f7
VS
753// ----------------------------------------------------------------------------
754// this wxWindowBase function is implemented here (in platform-specific file)
755// because it is static and so couldn't be made virtual
756// ----------------------------------------------------------------------------
32b8ec41
VZ
757wxWindow *wxWindowBase::FindFocus()
758{
7cdbf02c 759 return (wxWindow*)gs_focusedWindow;
a4bbc9f7
VS
760}
761
762bool wxWindowMGL::Show(bool show)
763{
764 if ( !wxWindowBase::Show(show) )
765 return FALSE;
766
767 MGL_wmShowWindow(m_wnd, show);
ead60ec5
VS
768
769 if (!show && gs_activeFrame == this)
770 {
771 // activate next frame in Z-order:
772 if ( m_wnd->prev )
773 {
774 wxWindowMGL *win = (wxWindowMGL*)m_wnd->prev->userData;
775 win->SetFocus();
776 }
777 }
778
a4bbc9f7
VS
779 return TRUE;
780}
781
782// Raise the window to the top of the Z order
783void wxWindowMGL::Raise()
784{
785 MGL_wmRaiseWindow(m_wnd);
786}
787
788// Lower the window to the bottom of the Z order
789void wxWindowMGL::Lower()
790{
791 MGL_wmLowerWindow(m_wnd);
792}
793
4116c221 794void wxWindowMGL::DoCaptureMouse()
a4bbc9f7 795{
7cdbf02c
VS
796 if ( gs_mouseCapture )
797 MGL_wmUncaptureEvents(gs_mouseCapture->m_wnd, wxMGL_CAPTURE_MOUSE);
798
799 gs_mouseCapture = this;
a4bbc9f7
VS
800 MGL_wmCaptureEvents(m_wnd, EVT_MOUSEEVT, wxMGL_CAPTURE_MOUSE);
801}
802
4116c221 803void wxWindowMGL::DoReleaseMouse()
a4bbc9f7 804{
7cdbf02c
VS
805 wxASSERT_MSG( gs_mouseCapture == this, wxT("attempt to release mouse, but this window hasn't captured it") )
806
a4bbc9f7 807 MGL_wmUncaptureEvents(m_wnd, wxMGL_CAPTURE_MOUSE);
7cdbf02c 808 gs_mouseCapture = NULL;
a4bbc9f7
VS
809}
810
811/* static */ wxWindow *wxWindowBase::GetCapture()
812{
7cdbf02c 813 return (wxWindow*)gs_mouseCapture;
a4bbc9f7
VS
814}
815
816bool wxWindowMGL::SetCursor(const wxCursor& cursor)
817{
818 if ( !wxWindowBase::SetCursor(cursor) )
819 {
820 // no change
821 return FALSE;
822 }
823
824 if ( m_cursor.Ok() )
825 MGL_wmSetWindowCursor(m_wnd, *m_cursor.GetMGLCursor());
ef344ff8
VS
826 else
827 MGL_wmSetWindowCursor(m_wnd, *wxSTANDARD_CURSOR->GetMGLCursor());
a4bbc9f7
VS
828
829 return TRUE;
830}
831
832void wxWindowMGL::WarpPointer(int x, int y)
833{
834 ClientToScreen(&x, &y);
835 EVT_setMousePos(x, y);
836}
837
838#if WXWIN_COMPATIBILITY
839// If nothing defined for this, try the parent.
840// E.g. we may be a button loaded from a resource, with no callback function
841// defined.
842void wxWindowMGL::OnCommand(wxWindow& win, wxCommandEvent& event)
843{
844 if ( GetEventHandler()->ProcessEvent(event) )
845 return;
846 if ( m_parent )
847 m_parent->GetEventHandler()->OnCommand(win, event);
848}
849#endif // WXWIN_COMPATIBILITY_2
850
851#if WXWIN_COMPATIBILITY
852wxObject* wxWindowMGL::GetChild(int number) const
853{
854 // Return a pointer to the Nth object in the Panel
855 wxNode *node = GetChildren().First();
856 int n = number;
857 while (node && n--)
858 node = node->Next();
859 if ( node )
860 {
861 wxObject *obj = (wxObject *)node->Data();
862 return(obj);
863 }
864 else
865 return NULL;
866}
867#endif // WXWIN_COMPATIBILITY
868
869// Set this window to be the child of 'parent'.
870bool wxWindowMGL::Reparent(wxWindowBase *parent)
871{
872 if ( !wxWindowBase::Reparent(parent) )
873 return FALSE;
874
875 MGL_wmReparentWindow(m_wnd, parent->GetHandle());
876
877 return TRUE;
878}
879
880
881// ---------------------------------------------------------------------------
882// drag and drop
883// ---------------------------------------------------------------------------
884
885#if wxUSE_DRAG_AND_DROP
886
887void wxWindowMGL::SetDropTarget(wxDropTarget *pDropTarget)
888{
889 if ( m_dropTarget != 0 ) {
890 m_dropTarget->Revoke(m_hWnd);
891 delete m_dropTarget;
892 }
893
894 m_dropTarget = pDropTarget;
895 if ( m_dropTarget != 0 )
896 m_dropTarget->Register(m_hWnd);
897}
898// FIXME_MGL
899#endif // wxUSE_DRAG_AND_DROP
900
901// old style file-manager drag&drop support: we retain the old-style
902// DragAcceptFiles in parallel with SetDropTarget.
903void wxWindowMGL::DragAcceptFiles(bool accept)
904{
905#if 0 // FIXME_MGL
906 HWND hWnd = GetHwnd();
907 if ( hWnd )
908 ::DragAcceptFiles(hWnd, (BOOL)accept);
909#endif
910}
911
912// ---------------------------------------------------------------------------
913// moving and resizing
914// ---------------------------------------------------------------------------
915
916// Get total size
917void wxWindowMGL::DoGetSize(int *x, int *y) const
918{
e41dcea5
VS
919 wxASSERT_MSG( m_wnd, wxT("invalid window") )
920
a4bbc9f7
VS
921 if (x) *x = m_wnd->width;
922 if (y) *y = m_wnd->height;
923}
924
925void wxWindowMGL::DoGetPosition(int *x, int *y) const
926{
e41dcea5
VS
927 wxASSERT_MSG( m_wnd, wxT("invalid window") )
928
a4bbc9f7
VS
929 if (x) *x = m_wnd->x;
930 if (y) *y = m_wnd->y;
931}
932
933void wxWindowMGL::DoScreenToClient(int *x, int *y) const
934{
935 int ax, ay;
985520bc 936 MGL_wmCoordGlobalToLocal(m_wnd, 0, 0, &ax, &ay);
a4bbc9f7 937 if (x)
985520bc 938 (*x) += ax;
a4bbc9f7 939 if (y)
985520bc 940 (*y) += ay;
a4bbc9f7
VS
941}
942
943void wxWindowMGL::DoClientToScreen(int *x, int *y) const
944{
945 int ax, ay;
985520bc 946 MGL_wmCoordLocalToGlobal(m_wnd, 0, 0, &ax, &ay);
a4bbc9f7 947 if (x)
985520bc 948 (*x) += ax;
a4bbc9f7 949 if (y)
985520bc 950 (*y) += ay;
a4bbc9f7
VS
951}
952
953// Get size *available for subwindows* i.e. excluding menu bar etc.
954void wxWindowMGL::DoGetClientSize(int *x, int *y) const
955{
956 DoGetSize(x, y);
957}
958
959void wxWindowMGL::DoMoveWindow(int x, int y, int width, int height)
960{
961 MGL_wmSetWindowPosition(GetHandle(), x, y, width, height);
962}
963
964// set the size of the window: if the dimensions are positive, just use them,
965// but if any of them is equal to -1, it means that we must find the value for
966// it ourselves (unless sizeFlags contains wxSIZE_ALLOW_MINUS_ONE flag, in
967// which case -1 is a valid value for x and y)
968//
969// If sizeFlags contains wxSIZE_AUTO_WIDTH/HEIGHT flags (default), we calculate
970// the width/height to best suit our contents, otherwise we reuse the current
971// width/height
972void wxWindowMGL::DoSetSize(int x, int y, int width, int height, int sizeFlags)
973{
974 // get the current size and position...
975 int currentX, currentY;
976 GetPosition(&currentX, &currentY);
977 int currentW,currentH;
978 GetSize(&currentW, &currentH);
979
980 // ... and don't do anything (avoiding flicker) if it's already ok
981 if ( x == currentX && y == currentY &&
982 width == currentW && height == currentH )
983 {
984 return;
985 }
986
987 if ( x == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
988 x = currentX;
989 if ( y == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
990 y = currentY;
991
a4bbc9f7 992 AdjustForParentClientOrigin(x, y, sizeFlags);
a4bbc9f7
VS
993
994 wxSize size(-1, -1);
995 if ( width == -1 )
996 {
997 if ( sizeFlags & wxSIZE_AUTO_WIDTH )
998 {
999 size = DoGetBestSize();
1000 width = size.x;
1001 }
1002 else
1003 {
1004 // just take the current one
1005 width = currentW;
1006 }
1007 }
6feddea3 1008
a4bbc9f7
VS
1009 if ( height == -1 )
1010 {
1011 if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
1012 {
1013 if ( size.x == -1 )
1014 {
1015 size = DoGetBestSize();
1016 }
1017 //else: already called DoGetBestSize() above
1018
1019 height = size.y;
1020 }
1021 else
1022 {
1023 // just take the current one
1024 height = currentH;
1025 }
1026 }
6feddea3
VS
1027
1028 int maxWidth = GetMaxWidth(),
1029 minWidth = GetMinWidth(),
1030 maxHeight = GetMaxHeight(),
1031 minHeight = GetMinHeight();
1032
1033 if ( minWidth != -1 && width < minWidth ) width = minWidth;
1034 if ( maxWidth != -1 && width > maxWidth ) width = maxWidth;
1035 if ( minHeight != -1 && height < minHeight ) height = minHeight;
1036 if ( maxHeight != -1 && height > maxHeight ) height = maxHeight;
a4bbc9f7 1037
88f2a771
VS
1038 if ( m_wnd->x != x || m_wnd->y != y ||
1039 (int)m_wnd->width != width || (int)m_wnd->height != height )
1040 {
1041 DoMoveWindow(x, y, width, height);
a4bbc9f7 1042
88f2a771
VS
1043 wxSizeEvent event(wxSize(width, height), GetId());
1044 event.SetEventObject(this);
1045 GetEventHandler()->ProcessEvent(event);
1046 }
a4bbc9f7
VS
1047}
1048
1049void wxWindowMGL::DoSetClientSize(int width, int height)
1050{
1051 SetSize(width, height);
1052}
1053
1054// ---------------------------------------------------------------------------
1055// text metrics
1056// ---------------------------------------------------------------------------
1057
1058int wxWindowMGL::GetCharHeight() const
1059{
1060 wxScreenDC dc;
1061 dc.SetFont(m_font);
1062 return dc.GetCharHeight();
1063}
1064
1065int wxWindowMGL::GetCharWidth() const
1066{
1067 wxScreenDC dc;
1068 dc.SetFont(m_font);
1069 return dc.GetCharWidth();
1070}
1071
1072void wxWindowMGL::GetTextExtent(const wxString& string,
1073 int *x, int *y,
1074 int *descent, int *externalLeading,
1075 const wxFont *theFont) const
1076{
1077 wxScreenDC dc;
1078 if (!theFont)
1079 theFont = &m_font;
1080 dc.GetTextExtent(string, x, y, descent, externalLeading, (wxFont*)theFont);
1081}
1082
1083#if wxUSE_CARET && WXWIN_COMPATIBILITY
1084// ---------------------------------------------------------------------------
1085// Caret manipulation
1086// ---------------------------------------------------------------------------
1087
1088void wxWindowMGL::CreateCaret(int w, int h)
1089{
1090 SetCaret(new wxCaret(this, w, h));
1091}
1092
1093void wxWindowMGL::CreateCaret(const wxBitmap *WXUNUSED(bitmap))
1094{
1095 wxFAIL_MSG("not implemented");
1096}
1097
1098void wxWindowMGL::ShowCaret(bool show)
1099{
1100 wxCHECK_RET( m_caret, "no caret to show" );
1101
1102 m_caret->Show(show);
1103}
1104
1105void wxWindowMGL::DestroyCaret()
1106{
1107 SetCaret(NULL);
1108}
1109
1110void wxWindowMGL::SetCaretPos(int x, int y)
1111{
1112 wxCHECK_RET( m_caret, "no caret to move" );
1113
1114 m_caret->Move(x, y);
1115}
1116
1117void wxWindowMGL::GetCaretPos(int *x, int *y) const
1118{
1119 wxCHECK_RET( m_caret, "no caret to get position of" );
1120
1121 m_caret->GetPosition(x, y);
1122}
1123#endif // wxUSE_CARET
1124
1125
a4bbc9f7
VS
1126// ---------------------------------------------------------------------------
1127// painting
1128// ---------------------------------------------------------------------------
1129
1130void wxWindowMGL::Clear()
1131{
1132 wxClientDC dc((wxWindow *)this);
1133 wxBrush brush(GetBackgroundColour(), wxSOLID);
1134 dc.SetBackground(brush);
1135 dc.Clear();
1136}
1137
61bd618f 1138#include "wx/menu.h"
2b260bc3 1139void wxWindowMGL::Refresh(bool eraseBack, const wxRect *rect)
a4bbc9f7 1140{
2b260bc3
VS
1141 if ( m_eraseBackground == -1 )
1142 m_eraseBackground = eraseBack;
1143 else
1144 m_eraseBackground |= eraseBack;
1145
a4bbc9f7
VS
1146 if ( rect )
1147 {
1148 rect_t r;
1149 r.left = rect->GetLeft(), r.right = rect->GetRight();
1150 r.top = rect->GetTop(), r.bottom = rect->GetBottom();
1151 MGL_wmInvalidateWindowRect(GetHandle(), &r);
1152 }
1153 else
1154 MGL_wmInvalidateWindow(GetHandle());
1155}
1156
1157void wxWindowMGL::Update()
1158{
a4bbc9f7
VS
1159 if ( !m_frozen )
1160 MGL_wmUpdateDC(g_winMng);
1161}
1162
1163void wxWindowMGL::Freeze()
1164{
1165 m_frozen = TRUE;
1166 m_refreshAfterThaw = FALSE;
1167}
1168
1169void wxWindowMGL::Thaw()
1170{
1171 m_frozen = FALSE;
1172 if ( m_refreshAfterThaw )
1173 Refresh();
1174}
1175
a4bbc9f7
VS
1176void wxWindowMGL::HandlePaint(MGLDevCtx *dc)
1177{
1178 if ( m_frozen )
1179 {
1180 // Don't paint anything if the window is frozen.
fd495ab3 1181 m_refreshAfterThaw = TRUE;
a4bbc9f7
VS
1182 return;
1183 }
ef344ff8 1184
82186005
VS
1185#ifdef __WXDEBUG__
1186 // FIXME_MGL -- debugging stuff, to be removed!
1187 static int debugPaintEvents = -1;
1188 if ( debugPaintEvents == -1 )
1189 debugPaintEvents = wxGetEnv(wxT("WXMGL_DEBUG_PAINT_EVENTS"), NULL);
1190 if ( debugPaintEvents )
1191 {
1192 dc->setColorRGB(255,0,255);
1193 dc->fillRect(-1000,-1000,2000,2000);
1194 wxUsleep(50);
1195 }
b8c0528d
VS
1196#endif
1197
fd495ab3
VS
1198 MGLRegion clip;
1199 dc->getClipRegion(clip);
1200 m_updateRegion = wxRegion(clip);
a4bbc9f7
VS
1201 m_paintMGLDC = dc;
1202
a679e129
VS
1203#if wxUSE_CARET
1204 // must hide caret temporarily, otherwise we'd get rendering artifacts
1205 wxCaret *caret = GetCaret();
1206 if ( caret )
1207 caret->Hide();
1208#endif // wxUSE_CARET
1209
2b260bc3 1210 if ( m_eraseBackground != 0 )
7bdc1879 1211 {
2b260bc3
VS
1212 wxWindowDC dc((wxWindow*)this);
1213 wxEraseEvent eventEr(m_windowId, &dc);
1214 eventEr.SetEventObject(this);
1215 GetEventHandler()->ProcessEvent(eventEr);
7bdc1879 1216 }
2b260bc3 1217 m_eraseBackground = -1;
a4bbc9f7
VS
1218
1219 wxNcPaintEvent eventNc(GetId());
1220 eventNc.SetEventObject(this);
1221 GetEventHandler()->ProcessEvent(eventNc);
1222
1223 wxPaintEvent eventPt(GetId());
1224 eventPt.SetEventObject(this);
1225 GetEventHandler()->ProcessEvent(eventPt);
a4bbc9f7 1226
a679e129
VS
1227#if wxUSE_CARET
1228 if ( caret )
1229 caret->Show();
1230#endif // wxUSE_CARET
1231
7bdc1879 1232 m_paintMGLDC = NULL;
fd495ab3 1233 m_updateRegion.Clear();
a4bbc9f7
VS
1234}
1235
1236
1237// Find the wxWindow at the current mouse position, returning the mouse
1238// position.
1239wxWindow* wxFindWindowAtPointer(wxPoint& pt)
1240{
1241 return wxFindWindowAtPoint(pt = wxGetMousePosition());
1242}
1243
1244wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
1245{
1246 window_t *wnd = MGL_wmGetWindowAtPosition(g_winMng, pt.x, pt.y);
1247 return (wxWindow*)wnd->userData;
32b8ec41 1248}
d53fc7c9
VS
1249
1250
1251// ---------------------------------------------------------------------------
1252// idle events processing
1253// ---------------------------------------------------------------------------
1254
1255void wxWindowMGL::OnIdle(wxIdleEvent& WXUNUSED(event))
1256{
1257 UpdateWindowUI();
1258}