X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4758baf5eb87bd1f1251a21e3fa8e5d658b9a3b6..931d6a47c32a5b4c283243cb553ce71ee2b535d5:/src/aui/tabart.cpp?ds=sidebyside diff --git a/src/aui/tabart.cpp b/src/aui/tabart.cpp index 068070dff2..f736f0b6e5 100644 --- a/src/aui/tabart.cpp +++ b/src/aui/tabart.cpp @@ -4,7 +4,6 @@ // Author: Benjamin I. Williams // Modified by: Jens Lody (moved from auibook.cpp in extra file) // Created: 2012-03-21 -// RCS-ID: $Id:$ // Copyright: (C) Copyright 2006, Kirix Corporation, All Rights Reserved // Licence: wxWindows Library Licence, Version 3.1 /////////////////////////////////////////////////////////////////////////////// @@ -31,6 +30,8 @@ #include "wx/renderer.h" #include "wx/aui/auibook.h" +#include "wx/aui/framemanager.h" +#include "wx/aui/dockart.h" #ifdef __WXMAC__ #include "wx/osx/private.h" @@ -48,7 +49,7 @@ public: bool ProcessEvent(wxEvent& evt) { - if (evt.GetEventType() == wxEVT_COMMAND_MENU_SELECTED) + if (evt.GetEventType() == wxEVT_MENU) { m_lastId = evt.GetId(); return true; @@ -244,6 +245,18 @@ void wxAuiGenericTabArt::SetSizingInfo(const wxSize& tab_ctrl_size, } +void wxAuiGenericTabArt::DrawBorder(wxDC& dc, wxWindow* wnd, const wxRect& rect) +{ + int i, border_width = GetBorderWidth(wnd); + + wxRect theRect(rect); + for (i = 0; i < border_width; ++i) + { + dc.DrawRectangle(theRect.x, theRect.y, theRect.width, theRect.height); + theRect.Deflate(1); + } +} + void wxAuiGenericTabArt::DrawBackground(wxDC& dc, wxWindow* WXUNUSED(wnd), const wxRect& rect) @@ -584,6 +597,23 @@ int wxAuiGenericTabArt::GetIndentSize() return 5; } +int wxAuiGenericTabArt::GetBorderWidth(wxWindow* wnd) +{ + wxAuiManager* mgr = wxAuiManager::GetManager(wnd); + if (mgr) + { + wxAuiDockArt* art = mgr->GetArtProvider(); + if (art) + return art->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE); + } + return 1; +} + +int wxAuiGenericTabArt::GetAdditionalBorderSpace(wxWindow* WXUNUSED(wnd)) +{ + return 0; +} + wxSize wxAuiGenericTabArt::GetTabSize(wxDC& dc, wxWindow* WXUNUSED(wnd), const wxString& caption, @@ -908,6 +938,18 @@ void wxAuiSimpleTabArt::SetActiveColour(const wxColour& colour) m_selectedBkPen = wxPen(colour); } +void wxAuiSimpleTabArt::DrawBorder(wxDC& dc, wxWindow* wnd, const wxRect& rect) +{ + int i, border_width = GetBorderWidth(wnd); + + wxRect theRect(rect); + for (i = 0; i < border_width; ++i) + { + dc.DrawRectangle(theRect.x, theRect.y, theRect.width, theRect.height); + theRect.Deflate(1); + } +} + void wxAuiSimpleTabArt::DrawBackground(wxDC& dc, wxWindow* WXUNUSED(wnd), const wxRect& rect) @@ -1087,6 +1129,23 @@ int wxAuiSimpleTabArt::GetIndentSize() return 0; } +int wxAuiSimpleTabArt::GetBorderWidth(wxWindow* wnd) +{ + wxAuiManager* mgr = wxAuiManager::GetManager(wnd); + if (mgr) + { + wxAuiDockArt* art = mgr->GetArtProvider(); + if (art) + return art->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE); + } + return 1; +} + +int wxAuiSimpleTabArt::GetAdditionalBorderSpace(wxWindow* WXUNUSED(wnd)) +{ + return 0; +} + wxSize wxAuiSimpleTabArt::GetTabSize(wxDC& dc, wxWindow* WXUNUSED(wnd), const wxString& caption,