X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/370eda07c101d665fa9676f0c9e0cf450c1e3124..bb93b4a819810a4c8d2cba1ab1d0618dcaca68ab:/src/ribbon/art_msw.cpp?ds=sidebyside diff --git a/src/ribbon/art_msw.cpp b/src/ribbon/art_msw.cpp index 5ed271fe2a..3d42946d52 100644 --- a/src/ribbon/art_msw.cpp +++ b/src/ribbon/art_msw.cpp @@ -15,11 +15,9 @@ #pragma hdrstop #endif -#include "wx/dcmemory.h" -#include "wx/ribbon/art.h" - #if wxUSE_RIBBON +#include "wx/ribbon/art.h" #include "wx/ribbon/art_internal.h" #include "wx/ribbon/bar.h" #include "wx/ribbon/buttonbar.h" @@ -27,6 +25,7 @@ #include "wx/ribbon/toolbar.h" #ifndef WX_PRECOMP +#include "wx/dcmemory.h" #endif #ifdef __WXMSW__ @@ -86,7 +85,7 @@ static const char* const gallery_extension_xpm[] = { wxRibbonMSWArtProvider::wxRibbonMSWArtProvider(bool set_colour_scheme) { m_flags = 0; - m_tab_label_font = wxFont(8, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE); + m_tab_label_font = *wxNORMAL_FONT; m_button_bar_label_font = m_tab_label_font; m_panel_label_font = m_tab_label_font; @@ -1932,10 +1931,9 @@ void wxRibbonMSWArtProvider::DrawPartialPageBackground( wxPoint offset(wnd->GetPosition()); wxRibbonPage* page = NULL; wxWindow* parent = wnd->GetParent(); - wxRibbonPanel* panel = NULL; + wxRibbonPanel* panel = wxDynamicCast(wnd, wxRibbonPanel); bool hovered = false; - panel = wxDynamicCast(wnd, wxRibbonPanel); if(panel != NULL) { hovered = allow_hovered && panel->IsHovered(); @@ -2447,6 +2445,8 @@ wxSize wxRibbonMSWArtProvider::GetPanelClientSize( else *client_offset = wxPoint(3, 2); } + if (size.x < 0) size.x = 0; + if (size.y < 0) size.y = 0; return size; } @@ -2638,12 +2638,10 @@ bool wxRibbonMSWArtProvider::GetButtonBarButtonSize( wxCoord label_height; wxCoord best_width; dc.GetTextExtent(label, &best_width, &label_height); - int best_num_lines = 1; int last_line_extra_width = 0; if(kind != wxRIBBON_BUTTON_NORMAL) { last_line_extra_width += 8; - best_num_lines = 2; // label on top line, button below } size_t i; for(i = 0; i < label.Len(); ++i) @@ -2656,7 +2654,6 @@ bool wxRibbonMSWArtProvider::GetButtonBarButtonSize( if(width < best_width) { best_width = width; - best_num_lines = 2; } } }