X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/333a6456b96c38d0d7d1976d94bb2cc255850da1..9c54e4ae1f401a9c337b97b588e5a356d79cbe82:/src/univ/winuniv.cpp diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp index 3d4292e5c3..4de62140fc 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -17,7 +17,7 @@ // headers // --------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "univwindow.h" #endif @@ -121,17 +121,29 @@ bool wxWindow::Create(wxWindow *parent, 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 ); @@ -142,8 +154,25 @@ bool wxWindow::Create(wxWindow *parent, #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(); } @@ -182,7 +211,7 @@ const wxBitmap& wxWindow::GetBackgroundBitmap(int *alignment, // ---------------------------------------------------------------------------- // the event handlers executed when the window must be repainted -void wxWindow::OnNcPaint(wxPaintEvent& event) +void wxWindow::OnNcPaint(wxPaintEvent& WXUNUSED(event)) { if ( m_renderer ) { @@ -340,7 +369,7 @@ void wxWindow::DoDrawBorder(wxDC& dc, const wxRect& rect) } } -void wxWindow::DoDraw(wxControlRenderer *renderer) +void wxWindow::DoDraw(wxControlRenderer * WXUNUSED(renderer)) { } @@ -393,7 +422,7 @@ void wxWindow::Refresh(bool eraseBackground, const wxRect *rectClient) 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(); @@ -504,7 +533,7 @@ void wxWindow::OnSize(wxSizeEvent& event) #if 0 // ndef __WXMSW__ // Refresh the area (strip) previously occupied by the border - if (HasFlag( wxNO_FULL_REPAINT_ON_RESIZE ) && IsShown()) + if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) && IsShown() ) { // This code assumes that wxSizeEvent.GetSize() returns // the area of the entire window, not just the client @@ -891,7 +920,7 @@ void wxWindow::SetScrollbar(int orient, } } -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") ); @@ -954,7 +983,7 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect) // 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();