extern wxList wxPendingDelete;
extern wxList wxTopLevelWindows;
extern bool g_blockEventsOnDrag;
-wxWindow *g_captureWindow = (wxWindow*)NULL;
+ bool g_capturing = FALSE;
//-----------------------------------------------------------------------------
// "expose_event" (of m_wxwindow, not of m_widget)
{
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
- if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
-
if (g_blockEventsOnDrag) return TRUE;
if (win->m_wxwindow)
// Some control don't have their own X window and thus cannot get
// any events.
- wxNode *node = win->GetChildren()->First();
- while (node)
+ if (!g_capturing)
{
- wxWindow *child = (wxWindow*)node->Data();
- if ((child->m_x <= event.m_x) &&
- (child->m_y <= event.m_y) &&
- (child->m_x+child->m_width >= event.m_x) &&
- (child->m_y+child->m_height >= event.m_y))
+ wxNode *node = win->GetChildren()->First();
+ while (node)
{
- win = child;
- event.m_x -= child->m_x;
- event.m_y -= child->m_y;
- break;
+ wxWindow *child = (wxWindow*)node->Data();
+ if ((child->m_x <= event.m_x) &&
+ (child->m_y <= event.m_y) &&
+ (child->m_x+child->m_width >= event.m_x) &&
+ (child->m_y+child->m_height >= event.m_y))
+ {
+ win = child;
+ event.m_x -= child->m_x;
+ event.m_y -= child->m_y;
+ break;
+ }
+ node = node->Next();
}
- node = node->Next();
}
event.SetEventObject( win );
{
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
- if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
-
if (g_blockEventsOnDrag) return TRUE;
if (!win->HasVMT()) return TRUE;
// Some control don't have their own X window and thus cannot get
// any events.
- wxNode *node = win->GetChildren()->First();
- while (node)
+ if (!g_capturing)
{
- wxWindow *child = (wxWindow*)node->Data();
- if ((child->m_x <= event.m_x) &&
- (child->m_y <= event.m_y) &&
- (child->m_x+child->m_width >= event.m_x) &&
- (child->m_y+child->m_height >= event.m_y))
+ wxNode *node = win->GetChildren()->First();
+ while (node)
{
- win = child;
- event.m_x -= child->m_x;
- event.m_y -= child->m_y;
- break;
+ wxWindow *child = (wxWindow*)node->Data();
+ if ((child->m_x <= event.m_x) &&
+ (child->m_y <= event.m_y) &&
+ (child->m_x+child->m_width >= event.m_x) &&
+ (child->m_y+child->m_height >= event.m_y))
+ {
+ win = child;
+ event.m_x -= child->m_x;
+ event.m_y -= child->m_y;
+ break;
+ }
+ node = node->Next();
}
- node = node->Next();
}
event.SetEventObject( win );
{
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
- if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
-
if (g_blockEventsOnDrag) return TRUE;
if (!win->HasVMT()) return TRUE;
// Some control don't have their own X window and thus cannot get
// any events.
- wxNode *node = win->GetChildren()->First();
- while (node)
+ if (!g_capturing)
{
- wxWindow *child = (wxWindow*)node->Data();
- if ((child->m_x <= event.m_x) &&
- (child->m_y <= event.m_y) &&
- (child->m_x+child->m_width >= event.m_x) &&
- (child->m_y+child->m_height >= event.m_y))
+ wxNode *node = win->GetChildren()->First();
+ while (node)
{
- win = child;
- event.m_x -= child->m_x;
- event.m_y -= child->m_y;
- break;
+ wxWindow *child = (wxWindow*)node->Data();
+ if ((child->m_x <= event.m_x) &&
+ (child->m_y <= event.m_y) &&
+ (child->m_x+child->m_width >= event.m_x) &&
+ (child->m_y+child->m_height >= event.m_y))
+ {
+ win = child;
+ event.m_x -= child->m_x;
+ event.m_y -= child->m_y;
+ break;
+ }
+ node = node->Next();
}
- node = node->Next();
}
event.SetEventObject( win );
{
if (widget->window != gdk_event->window) return TRUE;
- if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
-
if (g_blockEventsOnDrag) return TRUE;
if (!win->HasVMT()) return TRUE;
{
if (widget->window != gdk_event->window) return TRUE;
- if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
-
if (g_blockEventsOnDrag) return TRUE;
if (!win->HasVMT()) return TRUE;
GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK),
(GdkWindow *) NULL, (GdkCursor *) NULL, GDK_CURRENT_TIME );
- g_captureWindow = this;
+ g_capturing = TRUE;
}
void wxWindow::ReleaseMouse(void)
GtkWidget *connect_widget = GetConnectWidget();
gtk_grab_remove( connect_widget );
gdk_pointer_ungrab ( GDK_CURRENT_TIME );
- g_captureWindow = (wxWindow*) NULL;;
+ g_capturing = FALSE;
}
void wxWindow::SetTitle( const wxString &WXUNUSED(title) )
extern wxList wxPendingDelete;
extern wxList wxTopLevelWindows;
extern bool g_blockEventsOnDrag;
-wxWindow *g_captureWindow = (wxWindow*)NULL;
+ bool g_capturing = FALSE;
//-----------------------------------------------------------------------------
// "expose_event" (of m_wxwindow, not of m_widget)
{
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
- if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
-
if (g_blockEventsOnDrag) return TRUE;
if (win->m_wxwindow)
// Some control don't have their own X window and thus cannot get
// any events.
- wxNode *node = win->GetChildren()->First();
- while (node)
+ if (!g_capturing)
{
- wxWindow *child = (wxWindow*)node->Data();
- if ((child->m_x <= event.m_x) &&
- (child->m_y <= event.m_y) &&
- (child->m_x+child->m_width >= event.m_x) &&
- (child->m_y+child->m_height >= event.m_y))
+ wxNode *node = win->GetChildren()->First();
+ while (node)
{
- win = child;
- event.m_x -= child->m_x;
- event.m_y -= child->m_y;
- break;
+ wxWindow *child = (wxWindow*)node->Data();
+ if ((child->m_x <= event.m_x) &&
+ (child->m_y <= event.m_y) &&
+ (child->m_x+child->m_width >= event.m_x) &&
+ (child->m_y+child->m_height >= event.m_y))
+ {
+ win = child;
+ event.m_x -= child->m_x;
+ event.m_y -= child->m_y;
+ break;
+ }
+ node = node->Next();
}
- node = node->Next();
}
event.SetEventObject( win );
{
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
- if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
-
if (g_blockEventsOnDrag) return TRUE;
if (!win->HasVMT()) return TRUE;
// Some control don't have their own X window and thus cannot get
// any events.
- wxNode *node = win->GetChildren()->First();
- while (node)
+ if (!g_capturing)
{
- wxWindow *child = (wxWindow*)node->Data();
- if ((child->m_x <= event.m_x) &&
- (child->m_y <= event.m_y) &&
- (child->m_x+child->m_width >= event.m_x) &&
- (child->m_y+child->m_height >= event.m_y))
+ wxNode *node = win->GetChildren()->First();
+ while (node)
{
- win = child;
- event.m_x -= child->m_x;
- event.m_y -= child->m_y;
- break;
+ wxWindow *child = (wxWindow*)node->Data();
+ if ((child->m_x <= event.m_x) &&
+ (child->m_y <= event.m_y) &&
+ (child->m_x+child->m_width >= event.m_x) &&
+ (child->m_y+child->m_height >= event.m_y))
+ {
+ win = child;
+ event.m_x -= child->m_x;
+ event.m_y -= child->m_y;
+ break;
+ }
+ node = node->Next();
}
- node = node->Next();
}
event.SetEventObject( win );
{
if (!win->IsOwnGtkWindow( gdk_event->window )) return TRUE;
- if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
-
if (g_blockEventsOnDrag) return TRUE;
if (!win->HasVMT()) return TRUE;
// Some control don't have their own X window and thus cannot get
// any events.
- wxNode *node = win->GetChildren()->First();
- while (node)
+ if (!g_capturing)
{
- wxWindow *child = (wxWindow*)node->Data();
- if ((child->m_x <= event.m_x) &&
- (child->m_y <= event.m_y) &&
- (child->m_x+child->m_width >= event.m_x) &&
- (child->m_y+child->m_height >= event.m_y))
+ wxNode *node = win->GetChildren()->First();
+ while (node)
{
- win = child;
- event.m_x -= child->m_x;
- event.m_y -= child->m_y;
- break;
+ wxWindow *child = (wxWindow*)node->Data();
+ if ((child->m_x <= event.m_x) &&
+ (child->m_y <= event.m_y) &&
+ (child->m_x+child->m_width >= event.m_x) &&
+ (child->m_y+child->m_height >= event.m_y))
+ {
+ win = child;
+ event.m_x -= child->m_x;
+ event.m_y -= child->m_y;
+ break;
+ }
+ node = node->Next();
}
- node = node->Next();
}
event.SetEventObject( win );
{
if (widget->window != gdk_event->window) return TRUE;
- if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
-
if (g_blockEventsOnDrag) return TRUE;
if (!win->HasVMT()) return TRUE;
{
if (widget->window != gdk_event->window) return TRUE;
- if ((g_captureWindow) && (win != g_captureWindow)) return TRUE;
-
if (g_blockEventsOnDrag) return TRUE;
if (!win->HasVMT()) return TRUE;
GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK),
(GdkWindow *) NULL, (GdkCursor *) NULL, GDK_CURRENT_TIME );
- g_captureWindow = this;
+ g_capturing = TRUE;
}
void wxWindow::ReleaseMouse(void)
GtkWidget *connect_widget = GetConnectWidget();
gtk_grab_remove( connect_widget );
gdk_pointer_ungrab ( GDK_CURRENT_TIME );
- g_captureWindow = (wxWindow*) NULL;;
+ g_capturing = FALSE;
}
void wxWindow::SetTitle( const wxString &WXUNUSED(title) )
{
wxResourceEditorControlHandler *childHandler = (wxResourceEditorControlHandler *)item->GetEventHandler();
- if (dragItem) childHandler = (wxResourceEditorControlHandler *)dragItem->GetEventHandler();
-
long x, y;
event.Position(&x, &y);
int keys = 0;