// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "window.h"
#endif
BEGIN_EVENT_TABLE(wxWindow, wxWindowBase)
EVT_SYS_COLOUR_CHANGED(wxWindow::OnSysColourChanged)
- EVT_IDLE(wxWindow::OnIdle)
END_EVENT_TABLE()
// ============================================================================
DetachWidget(wMain);
}
- if ( m_parent )
- m_parent->RemoveChild( this );
-
// If m_drawingArea, we're a fully-fledged window with drawing area,
// scrollbars etc. (what wxCanvas used to be)
if ( m_drawingArea )
// (2) The widget with the focus may not be in the widget table
// depending on which widgets I put in the table
wxWindow *winFocus = (wxWindow *)NULL;
- for ( wxWindowList::Node *node = wxTopLevelWindows.GetFirst();
+ for ( wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
node;
node = node->GetNext() )
{
wxBrush brush(GetBackgroundColour(), wxSOLID);
dc.SetBrush(brush); // FIXME: needed?
- wxWindowList::Node *cnode = m_children.GetFirst();
+ wxWindowList::compatibility_iterator cnode = m_children.GetFirst();
while (cnode)
{
wxWindow *child = cnode->GetData();
// Now send expose events
- wxList::Node* node = updateRects.GetFirst();
+ wxList::compatibility_iterator node = updateRects.GetFirst();
while (node)
{
wxRect* rect = (wxRect*) node->GetData();
w -= 2 * (thick + margin);
}
+ if( w < 1 ) w = 1;
XtVaSetValues ((Widget) m_scrolledWindow, XmNwidth, w, NULL);
}
h -= 2 * (thick + margin);
}
+ if( h < 1 ) h = 1;
XtVaSetValues ((Widget) m_scrolledWindow, XmNheight, h, NULL);
}
XSendEvent(display, thisWindow, False, ExposureMask, (XEvent *)&dummyEvent);
}
-void wxWindow::Clear()
-{
- wxClientDC dc(this);
- wxBrush brush(GetBackgroundColour(), wxSOLID);
- dc.SetBackground(brush);
- dc.Clear();
-}
-
void wxWindow::DoPaint()
{
//TODO : make a temporary gc so we can do the XCopyArea below
// Responds to colour changes: passes event on to children.
void wxWindow::OnSysColourChanged(wxSysColourChangedEvent& event)
{
- wxWindowList::Node *node = GetChildren().GetFirst();
+ wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
while ( node )
{
// Only propagate to non-top-level windows
}
}
-void wxWindow::OnIdle(wxIdleEvent& WXUNUSED(event))
+void wxWindow::OnInternalIdle()
{
// This calls the UI-update mechanism (querying windows for
// menu/toolbar/control state information)
- if (wxUpdateUIEvent::CanUpdate())
- UpdateWindowUI();
+ if (wxUpdateUIEvent::CanUpdate(this))
+ UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
// ----------------------------------------------------------------------------
// Motif-specific accessors
// ----------------------------------------------------------------------------
+WXWindow wxWindow::GetClientXWindow() const
+{
+ Widget wMain = (Widget)GetClientWidget();
+ if ( wMain )
+ return (WXWindow) XtWindow(wMain);
+ else
+ return (WXWindow) 0;
+}
+
// Get the underlying X window
WXWindow wxWindow::GetXWindow() const
{