From: Julian Smart Date: Wed, 11 Nov 1998 14:39:42 +0000 (+0000) Subject: Motif bug fixes; dialog OnPaint works now; wxColourDialog tweaking X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/55acd85e7134f8d16d40dc21cd665c5ea18a98f1 Motif bug fixes; dialog OnPaint works now; wxColourDialog tweaking git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@989 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/distrib/msw/generic.rsp b/distrib/msw/generic.rsp index cedfe8b6de..1e57c7435f 100644 --- a/distrib/msw/generic.rsp +++ b/distrib/msw/generic.rsp @@ -302,6 +302,22 @@ samples/wxsocket/*.xpm samples/wxsocket/*.ico samples/wxsocket/*.rc +samples/help/*.cpp +samples/help/*.h +samples/help/*.def +samples/help/makefile* +samples/help/*.xbm +samples/help/*.xpm +samples/help/*.ico +samples/help/*.rc +samples/help/doc/*.html +samples/help/doc/*.htm +samples/help/doc/*.class +samples/help/doc/*.db +samples/help/doc/*.tex +samples/help/doc/*.gif +samples/help/doc/*.map + samples/bombs/*.cpp samples/bombs/*.h samples/bombs/*.def diff --git a/docs/motif/todo.txt b/docs/motif/todo.txt index 4e8ade76ea..0aaab0544d 100644 --- a/docs/motif/todo.txt +++ b/docs/motif/todo.txt @@ -23,6 +23,9 @@ High Priority - Make wxDialog OnPaint work. +- Optimize wxWindow OnPaint, clipping the damaged + region. + - Implementation of OnEraseBackground. How? Call OnEraseBackground just before OnPaint? Will duplicate Xlib's own erase of the background. However, this is usually OK, because the default wxWindow::OnEraseBackground diff --git a/include/wx/help.h b/include/wx/help.h index 7448e58349..b8d5098502 100644 --- a/include/wx/help.h +++ b/include/wx/help.h @@ -3,21 +3,16 @@ #ifdef __WXMSW__ #include "wx/msw/helpwin.h" -#elif defined(__WXGTK__) -#include "wx/generic/helpext.h" #else -#include "wx/generic/helpxlp.h" +#include "wx/generic/helpext.h" #endif #ifdef __WXMSW__ #define wxHelpController wxWinHelpController #define sm_classwxHelpController sm_classwxWinHelpController -#elif defined(__WXGTK__) +#else #define wxHelpController wxExtHelpController #define sm_classwxHelpController sm_classwxExtHelpController -#else -#define wxHelpController wxXLPHelpController -#define sm_classwxHelpController sm_classwxXLPHelpController #endif #endif diff --git a/include/wx/motif/dcclient.h b/include/wx/motif/dcclient.h index 6784cda790..9b75bf2aad 100644 --- a/include/wx/motif/dcclient.h +++ b/include/wx/motif/dcclient.h @@ -131,7 +131,8 @@ class WXDLLEXPORT wxPaintDC: public wxWindowDC DECLARE_DYNAMIC_CLASS(wxPaintDC) public: wxPaintDC() {} - wxPaintDC(wxWindow* win): wxWindowDC(win) {} + wxPaintDC(wxWindow* win); + ~wxPaintDC(); }; class WXDLLEXPORT wxClientDC: public wxWindowDC diff --git a/include/wx/motif/region.h b/include/wx/motif/region.h index 4741405bde..ca68dc140a 100644 --- a/include/wx/motif/region.h +++ b/include/wx/motif/region.h @@ -84,7 +84,8 @@ public: // Is region empty? bool Empty() const; - inline bool IsEmpty() const { return Empty(); } + inline bool IsEmpty() const { return Empty(); } + bool Ok() const { return (m_refData != NULL) ; } //# Tests // Does the region contain the point (x,y)? @@ -100,6 +101,9 @@ public: bool Combine(long x, long y, long width, long height, wxRegionOp op); bool Combine(const wxRegion& region, wxRegionOp op); bool Combine(const wxRect& rect, wxRegionOp op); + + // Get the internal Region handle + WXRegion GetXRegion() ; }; class WXDLLEXPORT wxRegionIterator : public wxObject { diff --git a/include/wx/motif/window.h b/include/wx/motif/window.h index a21bff3a0e..6f72b72742 100644 --- a/include/wx/motif/window.h +++ b/include/wx/motif/window.h @@ -231,7 +231,7 @@ public: virtual void DragAcceptFiles(bool accept); // Update region access - virtual wxRegion GetUpdateRegion() const; + virtual wxRegion& GetUpdateRegion() const; virtual bool IsExposed(int x, int y, int w, int h) const; virtual bool IsExposed(const wxPoint& pt) const; virtual bool IsExposed(const wxRect& rect) const; @@ -486,6 +486,7 @@ public: /// Motif-specific + void ClearUpdateRects(); void CanvasGetSize(int* width, int* height) const; // If have drawing area void CanvasGetClientSize(int *width, int *height) const; void CanvasGetPosition(int *x, int *y) const; // If have drawing area @@ -518,7 +519,6 @@ public: virtual WXPixmap GetBackingPixmap() const { return m_backingPixmap; } inline int GetPixmapWidth() const { return m_pixmapWidth; } inline int GetPixmapHeight() const { return m_pixmapHeight; } - virtual WXRegion GetPaintRegion() const { return m_paintRegion; } // Change properties virtual void ChangeFont(bool keepOriginalSize = TRUE); // Change to the current font (often overridden) @@ -594,7 +594,6 @@ public: int m_lastButton; // last pressed button wxList m_updateRects; // List of wxRectangles representing damaged region bool m_isShown; - WXRegion m_paintRegion; // Clip region generated by expose event protected: WXWidget m_mainWidget; WXWidget m_hScrollBar; diff --git a/samples/help/demo.cpp b/samples/help/demo.cpp index f7118b22d2..01e9b6fbca 100644 --- a/samples/help/demo.cpp +++ b/samples/help/demo.cpp @@ -41,7 +41,7 @@ // ressources // ---------------------------------------------------------------------------- // the application icon -#ifdef __WXGTK__ +#if defined(__WXGTK__) || defined(__WXMOTIF__) #include "mondrian.xpm" #endif diff --git a/src/generic/colrdlgg.cpp b/src/generic/colrdlgg.cpp index 4e011463ab..8444654cca 100644 --- a/src/generic/colrdlgg.cpp +++ b/src/generic/colrdlgg.cpp @@ -232,7 +232,7 @@ void wxGenericColourDialog::CreateWidgets(void) int bw, bh; okButton->GetSize(&bw, &bh); - (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(okButtonX + bw + 10, buttonY)); + (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(okButtonX + bw + 20, buttonY)); (void) new wxButton(this, wxID_ADD_CUSTOM, _("Add to custom colours"), wxPoint(customButtonX, buttonY)); @@ -252,7 +252,7 @@ void wxGenericColourDialog::CreateWidgets(void) blueSlider = new wxSlider(this, wxID_BLUE_SLIDER, 0, 0, 255, wxPoint(sliderX + 2*sliderSpacing, 10), wxSize(-1, sliderHeight), wxVERTICAL|wxSL_LABELS); - SetClientSize(sliderX + 3*sliderSpacing, buttonY + 30); + SetClientSize(sliderX + 3*sliderSpacing, buttonY + 40); okButton->SetDefault(); Centre(wxBOTH); diff --git a/src/generic/fontdlgg.cpp b/src/generic/fontdlgg.cpp index 269f389d52..603d0afad6 100644 --- a/src/generic/fontdlgg.cpp +++ b/src/generic/fontdlgg.cpp @@ -209,8 +209,8 @@ void wxGenericFontDialog::CreateWidgets(void) int x=-1; int y=40; familyChoice = new wxChoice(this, wxID_FONT_FAMILY, wxPoint(10, 10), wxSize(120, -1), 5, families); - styleChoice = new wxChoice(this, wxID_FONT_STYLE, wxPoint(140, 10), wxSize(120, -1), 3, styles); - weightChoice = new wxChoice(this, wxID_FONT_WEIGHT, wxPoint(270, 10), wxSize(120, -1), 3, weights); + styleChoice = new wxChoice(this, wxID_FONT_STYLE, wxPoint(160, 10), wxSize(120, -1), 3, styles); + weightChoice = new wxChoice(this, wxID_FONT_WEIGHT, wxPoint(310, 10), wxSize(120, -1), 3, weights); colourChoice = new wxChoice(this, wxID_FONT_COLOUR, wxPoint(10, 40), wxSize(190, -1), NUM_COLS, wxColourDialogNames); #ifdef __MOTIF__ @@ -228,8 +228,8 @@ void wxGenericFontDialog::CreateWidgets(void) pointSizes[i] = buf; } - pointSizeChoice = new wxChoice(this, wxID_FONT_SIZE, wxPoint(210, y), wxSize(50, -1), 40, pointSizes); - underLineCheckBox = new wxCheckBox(this, wxID_FONT_UNDERLINE, _("Underline"), wxPoint(280, y)); + pointSizeChoice = new wxChoice(this, wxID_FONT_SIZE, wxPoint(230, y), wxSize(50, -1), 40, pointSizes); + underLineCheckBox = new wxCheckBox(this, wxID_FONT_UNDERLINE, _("Underline"), wxPoint(320, y)); int rectY; pointSizeChoice->GetPosition(&x, &rectY); //NL mod @@ -257,7 +257,7 @@ void wxGenericFontDialog::CreateWidgets(void) okButton->SetDefault(); - SetClientSize(400, by + 30); + SetClientSize(450, by + 40); Centre(wxBOTH); diff --git a/src/motif.inc b/src/motif.inc index aedd2d2094..b8668e3742 100644 --- a/src/motif.inc +++ b/src/motif.inc @@ -123,6 +123,7 @@ LIB_CPP_SRC=\ generic/colrdlgg.cpp \ generic/fontdlgg.cpp \ generic/gridg.cpp \ + generic/helpext.cpp \ generic/imaglist.cpp \ generic/listctrl.cpp \ generic/laywin.cpp \ diff --git a/src/motif/choice.cpp b/src/motif/choice.cpp index d8c4b715f0..a70bef64bf 100644 --- a/src/motif/choice.cpp +++ b/src/motif/choice.cpp @@ -416,7 +416,8 @@ void wxChoiceCallback (Widget w, XtPointer clientData, XtPointer WXUNUSED(ptr)) XtVaGetValues (w, XmNuserData, &s, NULL); if (s) { - wxCommandEvent event (wxEVT_COMMAND_CHOICE_SELECTED); + wxCommandEvent event (wxEVT_COMMAND_CHOICE_SELECTED, item->GetId()); + event.SetEventObject(item); event.m_commandInt = item->FindString (s); // event.m_commandString = s; item->ProcessCommand (event); diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp index 6ab2bd156a..fe58804734 100644 --- a/src/motif/dcclient.cpp +++ b/src/motif/dcclient.cpp @@ -1992,17 +1992,17 @@ void wxWindowDC:: SetDCClipping () // clipping imposed on a window by a repaint. // We'll combine it with the user region. But for now, // just use the currently-defined user clipping region. - if (m_userRegion || (m_window && m_window->GetPaintRegion()) ) + if (m_userRegion || (m_window && m_window->GetUpdateRegion().Ok()) ) m_currentRegion = (WXRegion) XCreateRegion (); else m_currentRegion = (WXRegion) NULL; - if ((m_window && m_window->GetPaintRegion()) && m_userRegion) - XIntersectRegion ((Region) m_window->GetPaintRegion(), (Region) m_userRegion, (Region) m_currentRegion); + if ((m_window && m_window->GetUpdateRegion().Ok()) && m_userRegion) + XIntersectRegion ((Region) m_window->GetUpdateRegion().GetXRegion(), (Region) m_userRegion, (Region) m_currentRegion); else if (m_userRegion) XIntersectRegion ((Region) m_userRegion, (Region) m_userRegion, (Region) m_currentRegion); - else if (m_window && m_window->GetPaintRegion()) - XIntersectRegion ((Region) m_window->GetPaintRegion(), (Region) m_window->GetPaintRegion(), + else if (m_window && m_window->GetUpdateRegion().Ok()) + XIntersectRegion ((Region) m_window->GetUpdateRegion().GetXRegion(), (Region) m_window->GetUpdateRegion().GetXRegion(), (Region) m_currentRegion); if (m_currentRegion) @@ -2225,3 +2225,56 @@ void wxWindowDC::DrawSpline( wxList *points ) wx_spline_draw_point_array( this ); }; + +/* + * wxPaintDC + */ + +wxPaintDC::wxPaintDC(wxWindow* win): wxWindowDC(win) +{ + wxRegion* region = NULL; + + // Combine all the update rects into a region + if (win->m_updateRects.Number() > 0) + { + int i = 0; + for (i = 0; i < win->m_updateRects.Number(); i++) + { + wxRect* rect = (wxRect*) win->m_updateRects.Nth(i)->Data(); + /* + cout << "wxPaintDC. wxRect: " << rect->x << ", " << rect->y << ", "; + cout << rect->width << ", " << rect->height << "\n\n"; + */ + + if (!region) + region = new wxRegion(*rect); + else + // TODO: is this correct? In SetDCClipping above, + // XIntersectRegion is used to combine paint and user + // regions. XIntersectRegion appears to work in that case... + region->Union(*rect); + } + } + else + { + int cw, ch; + win->GetClientSize(&cw, &ch); + region = new wxRegion(wxRect(0, 0, cw, ch)); + } + + win->m_updateRegion = *region; + + // Set the clipping region. Any user-defined region will be combined with this + // one in SetDCClipping. + XSetRegion ((Display*) m_display, (GC) m_gc, (Region) region->GetXRegion()); + + delete region; +} + +wxPaintDC::~wxPaintDC() +{ + XSetClipMask ((Display*) m_display, (GC) m_gc, None); + if (m_window) + m_window->m_updateRegion.Clear(); +} + diff --git a/src/motif/dialog.cpp b/src/motif/dialog.cpp index 12f3a7ffad..4afc7bf1c0 100644 --- a/src/motif/dialog.cpp +++ b/src/motif/dialog.cpp @@ -617,86 +617,42 @@ static void wxCloseDialogCallback( Widget WXUNUSED(widget), XtPointer client_dat // TODO: Preferably, we should have a universal repaint proc. // Meanwhile, use a special one for dialogs. static void wxDialogBoxRepaintProc(Widget w, XtPointer WXUNUSED(c_data), XEvent *event, char *) - { +{ Window window; Display *display; -/* - static XRectangle *xrect; - GC gc; - int llp = 0; - static int last_count = 0; - static int draw_count = 0; -*/ wxWindow* win = (wxWindow *)wxWidgetHashTable->Get((long)w); if (!win) return; switch(event -> type) - { + { case Expose : + { window = (Window) win -> GetXWindow(); display = (Display *) win -> GetXDisplay(); - /* TODO - gc = (GC) panel -> GetDC() -> gc; - - llp = event -> xexpose.count; - - if ((last_count == 0) && (llp == 0)) - { - xrect = new XRectangle[1]; - xrect[0].x = event -> xexpose.x; - xrect[0].y = event -> xexpose.y; - xrect[0].width = event -> xexpose.width; - xrect[0].height = event -> xexpose.height; - - XSetClipRectangles(display,gc,0,0,xrect,1,Unsorted); -// panel->DoPaint(xrect, 1); - panel->GetEventHandler()->OnPaint(); - - delete xrect; - } - - if ((last_count == 0) && (llp != 0)) - { - xrect = new XRectangle[llp + 1]; - draw_count = llp + 1; - - xrect[draw_count - llp - 1].x = event -> xexpose.x; - xrect[draw_count - llp - 1].y = event -> xexpose.y; - xrect[draw_count - llp - 1].width = event -> xexpose.width; - xrect[draw_count - llp - 1].height = event -> xexpose.height; - } - - if ((last_count != 0) && (llp != 0)) - { - xrect[draw_count - llp - 1].x = event -> xexpose.x; - xrect[draw_count - llp - 1].y = event -> xexpose.y; - xrect[draw_count - llp - 1].width = event -> xexpose.width; - xrect[draw_count - llp - 1].height = event -> xexpose.height; - } - - if ((last_count != 0) && (llp == 0)) - { - xrect[draw_count - llp - 1].x = event -> xexpose.x; - xrect[draw_count - llp - 1].y = event -> xexpose.y; - xrect[draw_count - llp - 1].width = event -> xexpose.width; - xrect[draw_count - llp - 1].height = event -> xexpose.height; - - XSetClipRectangles(display,gc,0,0,xrect,draw_count,Unsorted); -// panel->DoPaint(xrect,draw_count); - panel->GetEventHandler()->OnPaint(); - - delete xrect; - } - last_count = event -> xexpose.count; - */ + + wxRect* rect = new wxRect(event->xexpose.x, event->xexpose.y, + event->xexpose.width, event->xexpose.height); + win->m_updateRects.Append((wxObject*) rect); + + if (event -> xexpose.count == 0) + { + wxPaintEvent event(win->GetId()); + event.SetEventObject(win); + win->GetEventHandler()->ProcessEvent(event); + + win->ClearUpdateRects(); + } break; - default : + } + default : + { cout << "\n\nNew Event ! is = " << event -> type << "\n"; break; - } - } + } + } +} static void wxDialogBoxEventHandler (Widget wid, XtPointer WXUNUSED(client_data), diff --git a/src/motif/makefile.unx b/src/motif/makefile.unx index f1c5a48a1f..05383b11ed 100644 --- a/src/motif/makefile.unx +++ b/src/motif/makefile.unx @@ -137,6 +137,7 @@ LIB_CPP_SRC=\ ../generic/colrdlgg.cpp \ ../generic/fontdlgg.cpp \ ../generic/gridg.cpp \ + ../generic/helpext.cpp \ ../generic/imaglist.cpp \ ../generic/listctrl.cpp \ ../generic/laywin.cpp \ diff --git a/src/motif/region.cpp b/src/motif/region.cpp index 3a8f5603d0..9149211450 100644 --- a/src/motif/region.cpp +++ b/src/motif/region.cpp @@ -104,6 +104,14 @@ wxRegion::~wxRegion() // m_refData unrefed in ~wxObject } +// Get the internal region handle +WXRegion wxRegion::GetXRegion() +{ + wxASSERT( m_refData !=NULL ); + + return (WXRegion) ((wxRegionRefData*)m_refData)->m_region; +} + //----------------------------------------------------------------------------- //# Modify region //----------------------------------------------------------------------------- @@ -237,7 +245,7 @@ wxRect wxRegion::GetBox() const // Is region empty? bool wxRegion::Empty() const { - return m_refData ? XEmptyRegion(M_REGION) : FALSE; + return m_refData ? XEmptyRegion(M_REGION) : TRUE; } //----------------------------------------------------------------------------- diff --git a/src/motif/slider.cpp b/src/motif/slider.cpp index 0b09dd5e15..34aafd4a61 100644 --- a/src/motif/slider.cpp +++ b/src/motif/slider.cpp @@ -281,6 +281,11 @@ void wxSliderCallback (Widget widget, XtPointer clientData, XmScaleCallbackStruc XtVaGetValues (widget, XmNvalue, &event.m_commandInt, NULL); event.SetEventObject(slider); slider->ProcessCommand(event); + + // Also send a wxCommandEvent for compatibility. + wxCommandEvent event2(wxEVT_COMMAND_SLIDER_UPDATED, slider->GetId()); + event2.SetEventObject(slider); + slider->ProcessCommand(event2); break; } } diff --git a/src/motif/utils.cpp b/src/motif/utils.cpp index 5c2797dc17..63278446f8 100644 --- a/src/motif/utils.cpp +++ b/src/motif/utils.cpp @@ -615,6 +615,13 @@ bool wxIsBusy() return (wxBusyCursorCount > 0); } +const char* wxGetHomeDir( wxString *home ) +{ + *home = wxGetUserHome( wxString() ); + if (home->IsNull()) *home = "/"; + return *home; +}; + char *wxGetUserHome (const wxString& user) { #ifdef VMS diff --git a/src/motif/utilsexc.cpp b/src/motif/utilsexc.cpp index 0f4dc1119f..94ff593d4f 100644 --- a/src/motif/utilsexc.cpp +++ b/src/motif/utilsexc.cpp @@ -10,7 +10,7 @@ ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ -#pragma implementation +// #pragma implementation #endif #include "wx/utils.h" @@ -135,7 +135,7 @@ long wxExecute(char **argv, bool sync, wxProcess *WXUNUSED(handler)) // end VMS } -long wxExecute (const wxString& command, bool sync) +long wxExecute (const wxString& command, bool sync, wxProcess* WXUNUSED(process)) { #ifdef VMS return(0); diff --git a/src/motif/window.cpp b/src/motif/window.cpp index 9fc441729c..dad35a5234 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -135,7 +135,6 @@ wxWindow::wxWindow() m_canAddEventHandler = FALSE; m_scrollPosX = 0; m_scrollPosY = 0; - m_paintRegion = (WXRegion) 0; } // Destructor @@ -143,10 +142,6 @@ wxWindow::~wxWindow() { //// Motif-specific - if (m_paintRegion) - XDestroyRegion ((Region) m_paintRegion); - m_paintRegion = (WXRegion) 0; - if (GetMainWidget()) DetachWidget(GetMainWidget()); // Removes event handlers @@ -243,6 +238,8 @@ wxWindow::~wxWindow() if ( m_windowValidator ) delete m_windowValidator; if (m_clientObject) delete m_clientObject; + + ClearUpdateRects(); } // Destroy the window (delayed, if a managed window) @@ -309,7 +306,6 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id, m_pixmapOffsetY = 0; m_scrollPosX = 0; m_scrollPosY = 0; - m_paintRegion = (WXRegion) 0; if (!parent) return FALSE; @@ -2016,9 +2012,9 @@ bool wxWindow::AcceptsFocus() const } // Update region access -wxRegion wxWindow::GetUpdateRegion() const +wxRegion& wxWindow::GetUpdateRegion() const { - return m_updateRegion; + return (wxRegion&) m_updateRegion; } bool wxWindow::IsExposed(int x, int y, int w, int h) const @@ -2135,75 +2131,41 @@ void wxCanvasRepaintProc (Widget drawingArea, XtPointer clientData, XmDrawingAreaCallbackStruct * cbs) { if (!wxWidgetHashTable->Get ((long) (Widget) drawingArea)) - return; + return; XEvent * event = cbs->event; - wxWindow * canvas = (wxWindow *) clientData; - Display * display = (Display *) canvas->GetXDisplay(); - // GC gc = (GC) canvas->GetDC()->gc; + wxWindow * win = (wxWindow *) clientData; + Display * display = (Display *) win->GetXDisplay(); switch (event->type) { - case Expose: - { - /* TODO - wxCanvasDC* canvasDC = canvas->GetDC(); - if (canvasDC) - { - if (canvasDC->onpaint_reg) - XDestroyRegion(canvasDC->onpaint_reg); - canvasDC->onpaint_reg = XCreateRegion(); - - } - */ - - int n = canvas->m_updateRects.Number(); - XRectangle* xrects = new XRectangle[n]; - int i; - for (i = 0; i < canvas->m_updateRects.Number(); i++) - { - wxRect* rect = (wxRect*) canvas->m_updateRects.Nth(i)->Data(); - xrects[i].x = rect->x; - xrects[i].y = rect->y; - xrects[i].width = rect->width; - xrects[i].height = rect->height; - /* TODO (?) Actually ignore it I think. - if (canvasDC) - XUnionRectWithRegion(&(xrects[i]), canvasDC->onpaint_reg, - canvasDC->onpaint_reg); - */ - } - /* TODO must clip the area being repainted. So we need a gc. - * Alternatively, wxPaintDC must do the clipping - * when it's created. - XSetClipRectangles(display, gc, 0, 0, xrects, n, Unsorted); - */ - - canvas->DoPaint() ; // xrects, n); - delete[] xrects; + case Expose: + { + wxRect* rect = new wxRect(event->xexpose.x, event->xexpose.y, + event->xexpose.width, event->xexpose.height); + /* + cout << "Expose proc. wxRect: " << rect->x << ", " << rect->y << ", "; + cout << rect->width << ", " << rect->height << "\n\n"; + */ - canvas->m_updateRects.Clear(); + win->m_updateRects.Append((wxObject*) rect); - /* - if (canvasDC) - { - XDestroyRegion(canvasDC->onpaint_reg); - canvasDC->onpaint_reg = NULL; - } - - XGCValues gc_val; - gc_val.clip_mask = None; - XChangeGC(display, gc, GCClipMask, &gc_val); - */ + if (event -> xexpose.count == 0) + { + wxPaintEvent event(win->GetId()); + event.SetEventObject(win); + win->GetEventHandler()->ProcessEvent(event); - break; - } - default: - { - cout << "\n\nNew Event ! is = " << event -> type << "\n"; - break; + win->ClearUpdateRects(); + } + break; + } + default: + { + cout << "\n\nNew Event ! is = " << event -> type << "\n"; + break; + } } - } } // Unable to deal with Enter/Leave without a separate EventHandler (Motif 1.1.4) @@ -3138,4 +3100,14 @@ void wxWindow::SetFont(const wxFont& font) ChangeFont(); } - +void wxWindow::ClearUpdateRects() +{ + wxNode* node = m_updateRects.First(); + while (node) + { + wxRect* rect = (wxRect*) node->Data(); + delete rect; + node = node->Next(); + } + m_updateRects.Clear(); +}