X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..cfcc39321282c5877cbb45248bb8004ced24516b:/src/motif/window.cpp?ds=sidebyside diff --git a/src/motif/window.cpp b/src/motif/window.cpp index 15a5f5240f..e77149f3a9 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -172,17 +172,24 @@ void wxWindow::UnmanageAndDestroy(WXWidget widget) } } -bool wxWindow::MapOrUnmap(WXWidget widget, bool map) +bool wxWindow::MapOrUnmap(WXWidget widget, bool domap) { Widget w = (Widget)widget; if ( !w ) return FALSE; - if ( map ) + if ( domap ) XtMapWidget(w); else XtUnmapWidget(w); + // Rationale: a lot of common operations (including but not + // limited to moving, resizing and appending items to a listbox) + // unmamange the widget, do their work, then manage it again. + // This means that, for example adding an item to a listbox will show it, + // or that most controls are shown every time they are moved or resized! + XtSetMappedWhenManaged( w, domap ); + return TRUE; } @@ -954,16 +961,16 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect) GetClientSize(& w, & h); } - wxNode *cnode = m_children.First(); + wxWindowList::Node *cnode = m_children.GetFirst(); while (cnode) { - wxWindow *child = (wxWindow*) cnode->Data(); + wxWindow *child = cnode->GetData(); int sx = 0; int sy = 0; child->GetSize( &sx, &sy ); wxPoint pos( child->GetPosition() ); child->SetSize( pos.x + dx, pos.y + dy, sx, sy, wxSIZE_ALLOW_MINUS_ONE ); - cnode = cnode->Next(); + cnode = cnode->GetNext(); } int x1 = (dx >= 0) ? x : x - dx; @@ -1072,10 +1079,10 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect) // Now send expose events - wxNode* node = updateRects.First(); + wxList::Node* node = updateRects.GetFirst(); while (node) { - wxRect* rect = (wxRect*) node->Data(); + wxRect* rect = (wxRect*) node->GetData(); XExposeEvent event; event.type = Expose; @@ -1092,17 +1099,17 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect) XSendEvent(display, window, False, ExposureMask, (XEvent *)&event); - node = node->Next(); + node = node->GetNext(); } // Delete the update rects - node = updateRects.First(); + node = updateRects.GetFirst(); while (node) { - wxRect* rect = (wxRect*) node->Data(); + wxRect* rect = (wxRect*) node->GetData(); delete rect; - node = node->Next(); + node = node->GetNext(); } XmUpdateDisplay((Widget) GetMainWidget()); @@ -1806,8 +1813,8 @@ bool wxAddWindowToTable(Widget w, wxWindow *win) wxWidgetHashTable->Put((long) w, win); - wxLogTrace("widget", "Widget 0x%08x <-> window %p (%s)", - w, win, win->GetClassInfo()->GetClassName()); + wxLogTrace("widget", "Widget 0x%p <-> window %p (%s)", + (WXWidget)w, win, win->GetClassInfo()->GetClassName()); return TRUE; } @@ -2986,8 +2993,9 @@ void wxWindow::ChangeFont(bool keepOriginalSize) int width, height, width1, height1; GetSize(& width, & height); - // lesstif 0.87 hangs here -#ifndef LESSTIF_VERSION + // lesstif 0.87 hangs here, but 0.93 does not +#if !defined(LESSTIF_VERSION) \ + || (defined(LesstifVersion) && LesstifVersion >= 93) XtVaSetValues (w, XmNfontList, (XmFontList) m_font.GetFontList(1.0, XtDisplay(w)), NULL);