X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4462f911b111ad2462a3e4600892438d42a57c4c..bc9d3d911cfb51f612a699d7fb00f57eb5b2097c:/src/univ/themes/win32.cpp?ds=sidebyside diff --git a/src/univ/themes/win32.cpp b/src/univ/themes/win32.cpp index 37943fb3ef..46da9be08f 100644 --- a/src/univ/themes/win32.cpp +++ b/src/univ/themes/win32.cpp @@ -61,9 +61,7 @@ #include "wx/notebook.h" #include "wx/spinbutt.h" #include "wx/artprov.h" -#ifdef wxUSE_TOGGLEBTN #include "wx/tglbtn.h" -#endif // wxUSE_TOGGLEBTN #include "wx/univ/scrtimer.h" #include "wx/univ/stdrend.h" @@ -1253,7 +1251,7 @@ wxColour wxWin32ColourScheme::GetBackground(wxWindow *win) const col = Get(CONTROL); else { - if ( !col.Ok() ) + if ( !col.IsOk() ) { // doesn't depend on the state col = Get(WINDOW); @@ -1262,7 +1260,7 @@ wxColour wxWin32ColourScheme::GetBackground(wxWindow *win) const } #endif // wxUSE_TEXTCTRL - if (!col.Ok()) + if (!col.IsOk()) col = Get(CONTROL); // Most controls should be this colour, not WINDOW } else @@ -1271,7 +1269,7 @@ wxColour wxWin32ColourScheme::GetBackground(wxWindow *win) const // the colour set by the user should be used for the normal state // and for the states for which we don't have any specific colours - if ( !col.Ok() || (flags & wxCONTROL_PRESSED) != 0 ) + if ( !col.IsOk() || (flags & wxCONTROL_PRESSED) != 0 ) { #if wxUSE_SCROLLBAR if ( wxDynamicCast(win, wxScrollBar) ) @@ -1681,7 +1679,7 @@ void wxWin32Renderer::DrawCheckItemBitmap(wxDC& dc, int flags) { wxBitmap bmp; - if ( bitmap.Ok() ) + if ( bitmap.IsOk() ) { bmp = bitmap; } @@ -1691,7 +1689,7 @@ void wxWin32Renderer::DrawCheckItemBitmap(wxDC& dc, ? IndicatorStatus_Checked : IndicatorStatus_Unchecked; - if ( !m_bmpCheckBitmaps[i].Ok() ) + if ( !m_bmpCheckBitmaps[i].IsOk() ) { m_bmpCheckBitmaps[i] = wxBitmap(ms_xpmChecked[i]); } @@ -1714,7 +1712,7 @@ wxBitmap wxWin32Renderer::GetIndicator(IndicatorType indType, int flags) GetIndicatorsFromFlags(flags, indState, indStatus); wxBitmap& bmp = m_bmpIndicators[indType][indState][indStatus]; - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) { const char **xpm = ms_xpmIndicators[indType][indState][indStatus]; if ( xpm ) @@ -2212,7 +2210,6 @@ void wxWin32Renderer::DrawSliderThumb(wxDC& dc, } rectInt.Deflate(2); -#if !defined(__WXMGL__) static const char *stipple_xpm[] = { /* columns rows colors chars-per-pixel */ "2 2 2 1", @@ -2222,24 +2219,6 @@ void wxWin32Renderer::DrawSliderThumb(wxDC& dc, "w ", " w", }; -#else - // VS: MGL can only do 8x8 stipple brushes - static const char *stipple_xpm[] = { - /* columns rows colors chars-per-pixel */ - "8 8 2 1", - " c None", - "w c white", - /* pixels */ - "w w w w ", - " w w w w", - "w w w w ", - " w w w w", - "w w w w ", - " w w w w", - "w w w w ", - " w w w w", - }; -#endif dc.SetBrush(wxBrush(stipple_xpm)); dc.SetTextForeground(wxSCHEME_COLOUR(m_scheme, SHADOW_HIGHLIGHT)); @@ -2442,12 +2421,12 @@ void wxWin32Renderer::DrawMenuItem(wxDC& dc, // draw the bitmap: use the bitmap provided or the standard checkmark for // the checkable items wxBitmap bmp = bitmap; - if ( !bmp.Ok() && (flags & wxCONTROL_CHECKED) ) + if ( !bmp.IsOk() && (flags & wxCONTROL_CHECKED) ) { bmp = GetIndicator(IndicatorType_Menu, flags); } - if ( bmp.Ok() ) + if ( bmp.IsOk() ) { rect.SetRight(geometryInfo.GetLabelOffset()); wxControlRenderer::DrawBitmap(dc, bmp, rect); @@ -2557,7 +2536,7 @@ wxMenuGeometryInfo *wxWin32Renderer::GetMenuGeometry(wxWindow *win, } const wxBitmap& bmp = item->GetBitmap(); - if ( bmp.Ok() ) + if ( bmp.IsOk() ) { wxCoord widthBmp = bmp.GetWidth(); if ( widthBmp > widthBmpMax ) @@ -3142,14 +3121,12 @@ void wxWin32Renderer::AdjustSize(wxSize *size, const wxWindow *window) #if wxUSE_SCROLLBAR if ( wxDynamicCast(window, wxScrollBar) ) { - // we only set the width of vert scrollbars and height of the - // horizontal ones - if ( window->GetWindowStyle() & wxSB_HORIZONTAL ) - size->y = m_sizeScrollbarArrow.y; - else - size->x = m_sizeScrollbarArrow.x; - - // skip border width adjustments, they don't make sense for us + /* + Don't adjust the size for a scrollbar as its DoGetBestClientSize + already has the correct size set. Any size changes here would get + added to the best size, making the scrollbar larger. + Also skip border width adjustments, they don't make sense for us. + */ return; } #endif // wxUSE_SCROLLBAR @@ -3205,7 +3182,7 @@ void wxWin32Renderer::AdjustSize(wxSize *size, const wxWindow *window) wxBitmap wxWin32Renderer::GetFrameButtonBitmap(FrameButtonType type) { wxBitmap& bmp = m_bmpFrameButtons[type]; - if ( !bmp.Ok() ) + if ( !bmp.IsOk() ) { bmp = wxBitmap(ms_xpmFrameButtons[type]); } @@ -3777,7 +3754,7 @@ void wxWin32FrameInputHandler::PopupSystemMenu(wxTopLevelWindow *window) const if ( window->GetWindowStyle() & wxMAXIMIZE_BOX ) menu.Append(wxID_MAXIMIZE_FRAME , _("Ma&ximize")); menu.AppendSeparator(); - menu.Append(wxID_CLOSE_FRAME, _("Close\tAlt-F4")); + menu.Append(wxID_CLOSE_FRAME, _("&Close") + wxT("\t") + _("Alt+") + wxT("F4")); if ( window->GetWindowStyle() & wxMAXIMIZE_BOX ) {