// headers
// ---------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "univwindow.h"
#endif
long style,
const wxString& name)
{
+ long actualStyle = style;
+
+ // FIXME: may need this on other platforms
+#ifdef __WXMSW__
+ actualStyle &= ~wxVSCROLL;
+ actualStyle &= ~wxHSCROLL;
+#endif
+
// we add wxCLIP_CHILDREN to get the same ("natural") behaviour under MSW
// as under the other platforms
if ( !wxWindowNative::Create(parent, id, pos, size,
- style | wxCLIP_CHILDREN,
+ actualStyle | wxCLIP_CHILDREN,
name) )
{
return FALSE;
}
- // if we should always have the scrollbar, do show it
- if ( GetWindowStyle() & wxALWAYS_SHOW_SB )
+ // Set full style again, including those we didn't want present
+ // when calling the base window Create().
+ wxWindowBase::SetWindowStyleFlag(style);
+
+ // if we should always have a vertical scrollbar, do show it
+ if ( style & wxALWAYS_SHOW_SB )
{
#if wxUSE_TWO_WINDOWS
SetInsertIntoMain( TRUE );
#if wxUSE_TWO_WINDOWS
SetInsertIntoMain( FALSE );
#endif
+ }
- // and position it
+ // if we should always have a horizontal scrollbar, do show it
+ if ( style & wxHSCROLL )
+ {
+#if wxUSE_TWO_WINDOWS
+ SetInsertIntoMain( TRUE );
+#endif
+ m_scrollbarHorz = new wxScrollBar(this, -1,
+ wxDefaultPosition, wxDefaultSize,
+ wxSB_HORIZONTAL);
+#if wxUSE_TWO_WINDOWS
+ SetInsertIntoMain( FALSE );
+#endif
+ }
+
+ if (m_scrollbarHorz || m_scrollbarVert)
+ {
+ // position it/them
PositionScrollbars();
}
// ----------------------------------------------------------------------------
// the event handlers executed when the window must be repainted
-void wxWindow::OnNcPaint(wxPaintEvent& event)
+void wxWindow::OnNcPaint(wxPaintEvent& WXUNUSED(event))
{
if ( m_renderer )
{
}
}
-void wxWindow::DoDraw(wxControlRenderer *renderer)
+void wxWindow::DoDraw(wxControlRenderer * WXUNUSED(renderer))
{
}
wxWindowNative::Refresh(eraseBackground, &rectWin);
// Refresh all sub controls if any.
- wxWindowList::Node *node = GetChildren().GetFirst();
+ wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
while ( node )
{
wxWindow *win = node->GetData();
// Only refresh sub controls when it is visible
// and when it is in the update region.
- if(win->IsShown() && wxRegion(rectWin).Contains(win->GetRect()) != wxOutRegion)
+ if(!win->IsKindOf(CLASSINFO(wxTopLevelWindow)) && win->IsShown() && wxRegion(rectWin).Contains(win->GetRect()) != wxOutRegion)
win->Refresh(eraseBackground, &rectWin);
node = node->GetNext();
}
}
-void wxWindow::SetScrollPos(int orient, int pos, bool refresh)
+void wxWindow::SetScrollPos(int orient, int pos, bool WXUNUSED(refresh))
{
wxScrollBar *scrollbar = GetScrollbar(orient);
wxCHECK_RET( scrollbar, _T("no scrollbar to set position for") );
// scroll children accordingly:
wxPoint offset(dx, dy);
- for (wxWindowList::Node *node = GetChildren().GetFirst();
+ for (wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
node; node = node->GetNext())
{
wxWindow *child = node->GetData();