static void wxWindowPainter(window_t *wnd, MGLDC *dc)
{
wxWindowMGL *w = (wxWindow*) wnd->userData;
+
if ( w && !(w->GetWindowStyle() & wxTRANSPARENT_WINDOW) )
{
MGLDevCtx ctx(dc);
MGL_wmCoordGlobalToLocal(win->GetHandle(),
e->where_x, e->where_y, &where.x, &where.y);
- if ( !win->IsEnabled() ) return FALSE;
+ for (wxWindowMGL *w = win; w; w = w->GetParent())
+ {
+ if ( !w->IsEnabled() )
+ return FALSE;
+ if ( w->IsTopLevel() )
+ break;
+ }
wxEventType type = wxEVT_NULL;
wxMouseEvent event;
void wxWindowMGL::SetFocus()
{
+ if ( gs_focusedWindow == this ) return;
+
if ( gs_focusedWindow )
gs_focusedWindow->KillFocus();
#endif // wxUSE_CARET
wxWindowMGL *active = wxGetTopLevelParent(this);
- if ( active != gs_activeFrame )
+ if ( !(m_windowStyle & wxPOPUP_WINDOW) && active != gs_activeFrame )
{
if ( gs_activeFrame )
{
caret->OnKillFocus();
#endif // wxUSE_CARET
- if ( IsTopLevel() )
- {
- // FIXME_MGL - this is wrong, see wxGTK!
- wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId());
- event.SetEventObject(this);
- GetEventHandler()->ProcessEvent(event);
- }
-
wxFocusEvent event(wxEVT_KILL_FOCUS, GetId());
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
dc.Clear();
}
+#include "wx/menu.h"
void wxWindowMGL::Refresh(bool eraseBack, const wxRect *rect)
{
if ( m_eraseBackground == -1 )
return;
}
+#if 0 // FIXME_MGL -- debugging stuff!
+ dc->setColorRGB(255,0,255);
+ dc->fillRect(-1000,-1000,2000,2000);
+ wxUsleep(100);
+#endif
+
MGLRegion clip;
dc->getClipRegion(clip);
m_updateRegion = wxRegion(clip);