long numArg = 0,
const wxString& strArg = wxEmptyString);
+ // The scrollbars around a normal window should not
+ // receive the focus.
+ virtual bool AcceptsFocus() const;
+
// wxScrollBar sub elements state (combination of wxCONTROL_XXX)
void SetState(Element which, int flags);
int GetState(Element which) const;
{
wxPaintDC dc(this);
PrepareDC( dc );
-
+
+#if 0
wxRegionIterator upd( GetUpdateRegion() );
while (upd)
{
wxLogDebug( "Paint: %d %d %d %d", upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() );
upd ++;
}
+#endif
+
+#if 0
+ wxSize size = GetSize();
+ wxSize client_size = GetClientSize();
+ wxLogDebug( "size %d %d client_size %d %d", size.x, size.y, client_size.x, client_size.y );
+#endif
dc.SetPen( *wxWHITE_PEN );
for (int i = 0; i < 20; i += 2)
dc.DrawLine( i,i, i+100,i );
+ dc.SetPen( *wxWHITE_PEN );
+ for (int i = 200; i < 220; i += 2)
+ dc.DrawLine( i-200,i, i-100,i );
+
wxRegion region( 110, 110, 80, 80 );
wxRegion hole( 130, 130, 40, 1 );
region.Intersect( hole );
win = win->GetParent();
}
+ printf( "Dismiss now.\n" );
+
m_popup->DismissAndNotify();
}
{
}
+bool wxScrollBar::AcceptsFocus() const
+{
+ if (!wxWindow::AcceptsFocus()) return FALSE;
+
+ wxWindow *parent = (wxWindow*) GetParent();
+
+ if (parent)
+ {
+ if ((parent->GetScrollbar( wxHORIZONTAL ) == this) ||
+ (parent->GetScrollbar( wxVERTICAL ) == this))
+ {
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
// ----------------------------------------------------------------------------
// scrollbar API
// ----------------------------------------------------------------------------
return rt;
}
+//-----------------------------------------------------------------------
+// X11 predicate function for exposure compression
+//-----------------------------------------------------------------------
+
+struct wxExposeInfo
+{
+ Window window;
+ Bool found_non_matching;
+};
+
+static Bool expose_predicate (Display *display, XEvent *xevent, XPointer arg)
+{
+ wxExposeInfo *info = (wxExposeInfo*) arg;
+
+ if (info->found_non_matching)
+ return FALSE;
+
+ if (xevent->xany.type != Expose)
+ {
+ info->found_non_matching = TRUE;
+ return FALSE;
+ }
+
+ if (xevent->xexpose.window != info->window)
+ {
+ info->found_non_matching = TRUE;
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+//-----------------------------------------------------------------------
// Processes an X event.
+//-----------------------------------------------------------------------
+
void wxApp::ProcessXEvent(WXEvent* _event)
{
XEvent* event = (XEvent*) _event;
win->GetClearRegion().Union( XExposeEventGetX(event), XExposeEventGetY(event),
XExposeEventGetWidth(event), XExposeEventGetHeight(event));
+
#if !wxUSE_NANOX
- if (event->xexpose.count == 0)
-#endif
+ XEvent tmp_event;
+ wxExposeInfo info;
+ info.window = event->xexpose.window;
+ info.found_non_matching = FALSE;
+ while (XCheckIfEvent( wxGlobalDisplay(), &tmp_event, expose_predicate, (XPointer) &info ))
{
- // Only erase background, paint in idle time.
- win->SendEraseEvents();
+ win->GetUpdateRegion().Union( tmp_event.xexpose.x, tmp_event.xexpose.y,
+ tmp_event.xexpose.width, tmp_event.xexpose.height );
+
+ win->GetClearRegion().Union( tmp_event.xexpose.x, tmp_event.xexpose.y,
+ tmp_event.xexpose.width, tmp_event.xexpose.height );
}
+#endif
+
+ win->SendEraseEvents();
return;
}
focusEvent.SetEventObject(win);
focusEvent.SetWindow( g_prevFocus );
g_prevFocus = NULL;
+
win->GetEventHandler()->ProcessEvent(focusEvent);
}
break;
void wxTopLevelWindowX11::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
- wxLogDebug( "Setting pos: %d, %d", x, y );
+ // wxLogDebug( "Setting pos: %d, %d", x, y );
wxWindowX11::DoSetSize(x, y, width, height, sizeFlags);
wxPoint pt = GetPosition();
- wxLogDebug( "After, pos: %d, %d", pt.x, pt.y );
+ // wxLogDebug( "After, pos: %d, %d", pt.x, pt.y );
#if 0
XSync(wxGlobalDisplay(), False);
int w, h;
if (x != -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
{
- int yy = 0;
+ int yy = 0;
AdjustForParentClientOrigin( x, yy, sizeFlags);
windowChanges.x = x;
valueMask |= CWX;
}
if (y != -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
{
- int xx = 0;
+ int xx = 0;
AdjustForParentClientOrigin( xx, y, sizeFlags);
windowChanges.y = y;
valueMask |= CWY;
int offsetY = 0;
#if !wxUSE_NANOX
- wxLogDebug("Translating...");
+ // wxLogDebug("Translating...");
Window childWindow;
XTranslateCoordinates(wxGlobalDisplay(), window, XDefaultRootWindow(wxGlobalDisplay()),
0, 0, & offsetX, & offsetY, & childWindow);
- wxLogDebug("Offset: %d, %d", offsetX, offsetY);
+ // wxLogDebug("Offset: %d, %d", offsetX, offsetY);
#endif
XWindowAttributes attr;
else
{
wxRect rect;
- if (dx < 0) rect.x = cw+dx; else rect.x = s_x;
- if (dy < 0) rect.y = ch+dy; else rect.y = s_y;
+ if (dx < 0) rect.x = cw+dx + offset.x; else rect.x = s_x;
+ if (dy < 0) rect.y = ch+dy + offset.y; else rect.y = s_y;
if (dy != 0) rect.width = cw; else rect.width = abs(dx);
if (dx != 0) rect.height = ch; else rect.height = abs(dy);