2012-03-25 13:55:59 -04:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/aui/tabart.h
|
|
|
|
// Purpose: wxaui: wx advanced user interface - notebook
|
|
|
|
// Author: Benjamin I. Williams
|
|
|
|
// Modified by: Jens Lody (extracted from wx/aui/auibook.h)
|
|
|
|
// Created: 2012-03-21
|
|
|
|
// Copyright: (C) Copyright 2006, Kirix Corporation, All Rights Reserved.
|
|
|
|
// Licence: wxWindows Library Licence, Version 3.1
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _WX_AUI_TABART_H_
|
|
|
|
#define _WX_AUI_TABART_H_
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
|
|
|
#if wxUSE_AUI
|
|
|
|
|
|
|
|
#include "wx/colour.h"
|
|
|
|
#include "wx/gdicmn.h"
|
|
|
|
#include "wx/font.h"
|
|
|
|
#include "wx/pen.h"
|
|
|
|
#include "wx/brush.h"
|
|
|
|
#include "wx/bitmap.h"
|
|
|
|
|
|
|
|
|
|
|
|
class wxAuiNotebookPage;
|
|
|
|
class wxAuiNotebookPageArray;
|
|
|
|
class wxWindow;
|
|
|
|
class wxDC;
|
|
|
|
|
|
|
|
|
|
|
|
// tab art class
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_AUI wxAuiTabArt
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
wxAuiTabArt() { }
|
|
|
|
virtual ~wxAuiTabArt() { }
|
|
|
|
|
|
|
|
virtual wxAuiTabArt* Clone() = 0;
|
|
|
|
virtual void SetFlags(unsigned int flags) = 0;
|
|
|
|
|
|
|
|
virtual void SetSizingInfo(const wxSize& tabCtrlSize,
|
|
|
|
size_t tabCount) = 0;
|
|
|
|
|
|
|
|
virtual void SetNormalFont(const wxFont& font) = 0;
|
|
|
|
virtual void SetSelectedFont(const wxFont& font) = 0;
|
|
|
|
virtual void SetMeasuringFont(const wxFont& font) = 0;
|
|
|
|
virtual void SetColour(const wxColour& colour) = 0;
|
|
|
|
virtual void SetActiveColour(const wxColour& colour) = 0;
|
|
|
|
|
2012-10-08 08:09:13 -04:00
|
|
|
virtual void DrawBorder(
|
|
|
|
wxDC& dc,
|
|
|
|
wxWindow* wnd,
|
|
|
|
const wxRect& rect) = 0;
|
|
|
|
|
2012-03-25 13:55:59 -04:00
|
|
|
virtual void DrawBackground(
|
|
|
|
wxDC& dc,
|
|
|
|
wxWindow* wnd,
|
|
|
|
const wxRect& rect) = 0;
|
|
|
|
|
|
|
|
virtual void DrawTab(wxDC& dc,
|
|
|
|
wxWindow* wnd,
|
|
|
|
const wxAuiNotebookPage& pane,
|
|
|
|
const wxRect& inRect,
|
|
|
|
int closeButtonState,
|
|
|
|
wxRect* outTabRect,
|
|
|
|
wxRect* outButtonRect,
|
|
|
|
int* xExtent) = 0;
|
|
|
|
|
|
|
|
virtual void DrawButton(
|
|
|
|
wxDC& dc,
|
|
|
|
wxWindow* wnd,
|
|
|
|
const wxRect& inRect,
|
|
|
|
int bitmapId,
|
|
|
|
int buttonState,
|
|
|
|
int orientation,
|
|
|
|
wxRect* outRect) = 0;
|
|
|
|
|
|
|
|
virtual wxSize GetTabSize(
|
|
|
|
wxDC& dc,
|
|
|
|
wxWindow* wnd,
|
|
|
|
const wxString& caption,
|
|
|
|
const wxBitmap& bitmap,
|
|
|
|
bool active,
|
|
|
|
int closeButtonState,
|
|
|
|
int* xExtent) = 0;
|
|
|
|
|
|
|
|
virtual int ShowDropDown(
|
|
|
|
wxWindow* wnd,
|
|
|
|
const wxAuiNotebookPageArray& items,
|
|
|
|
int activeIdx) = 0;
|
|
|
|
|
|
|
|
virtual int GetIndentSize() = 0;
|
|
|
|
|
2012-10-08 08:09:13 -04:00
|
|
|
virtual int GetBorderWidth(
|
|
|
|
wxWindow* wnd) = 0;
|
|
|
|
|
2012-10-22 17:46:46 -04:00
|
|
|
virtual int GetAdditionalBorderSpace(
|
|
|
|
wxWindow* wnd) = 0;
|
|
|
|
|
2012-03-25 13:55:59 -04:00
|
|
|
virtual int GetBestTabCtrlSize(
|
|
|
|
wxWindow* wnd,
|
|
|
|
const wxAuiNotebookPageArray& pages,
|
|
|
|
const wxSize& requiredBmpSize) = 0;
|
2018-11-01 11:02:30 -04:00
|
|
|
|
|
|
|
// Provide opportunity for subclasses to recalculate colours
|
|
|
|
virtual void UpdateColoursFromSystem() {}
|
2012-03-25 13:55:59 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_AUI wxAuiGenericTabArt : public wxAuiTabArt
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
wxAuiGenericTabArt();
|
|
|
|
virtual ~wxAuiGenericTabArt();
|
|
|
|
|
2014-03-29 20:02:23 -04:00
|
|
|
wxAuiTabArt* Clone() wxOVERRIDE;
|
|
|
|
void SetFlags(unsigned int flags) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
void SetSizingInfo(const wxSize& tabCtrlSize,
|
2014-03-29 20:02:23 -04:00
|
|
|
size_t tabCount) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
2014-03-29 20:02:23 -04:00
|
|
|
void SetNormalFont(const wxFont& font) wxOVERRIDE;
|
|
|
|
void SetSelectedFont(const wxFont& font) wxOVERRIDE;
|
|
|
|
void SetMeasuringFont(const wxFont& font) wxOVERRIDE;
|
|
|
|
void SetColour(const wxColour& colour) wxOVERRIDE;
|
|
|
|
void SetActiveColour(const wxColour& colour) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
2012-10-08 08:09:13 -04:00
|
|
|
void DrawBorder(
|
|
|
|
wxDC& dc,
|
|
|
|
wxWindow* wnd,
|
2014-03-29 20:02:23 -04:00
|
|
|
const wxRect& rect) wxOVERRIDE;
|
2012-10-08 08:09:13 -04:00
|
|
|
|
2012-03-25 13:55:59 -04:00
|
|
|
void DrawBackground(
|
|
|
|
wxDC& dc,
|
|
|
|
wxWindow* wnd,
|
2014-03-29 20:02:23 -04:00
|
|
|
const wxRect& rect) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
|
|
|
void DrawTab(wxDC& dc,
|
|
|
|
wxWindow* wnd,
|
|
|
|
const wxAuiNotebookPage& pane,
|
|
|
|
const wxRect& inRect,
|
|
|
|
int closeButtonState,
|
|
|
|
wxRect* outTabRect,
|
|
|
|
wxRect* outButtonRect,
|
2014-03-29 20:02:23 -04:00
|
|
|
int* xExtent) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
|
|
|
void DrawButton(
|
|
|
|
wxDC& dc,
|
|
|
|
wxWindow* wnd,
|
|
|
|
const wxRect& inRect,
|
|
|
|
int bitmapId,
|
|
|
|
int buttonState,
|
|
|
|
int orientation,
|
2014-03-29 20:02:23 -04:00
|
|
|
wxRect* outRect) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
2014-03-29 20:02:23 -04:00
|
|
|
int GetIndentSize() wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
2012-10-08 08:09:13 -04:00
|
|
|
int GetBorderWidth(
|
2014-03-29 20:02:23 -04:00
|
|
|
wxWindow* wnd) wxOVERRIDE;
|
2012-10-08 08:09:13 -04:00
|
|
|
|
2012-10-22 17:46:46 -04:00
|
|
|
int GetAdditionalBorderSpace(
|
2014-03-29 20:02:23 -04:00
|
|
|
wxWindow* wnd) wxOVERRIDE;
|
2012-10-22 17:46:46 -04:00
|
|
|
|
2012-03-25 13:55:59 -04:00
|
|
|
wxSize GetTabSize(
|
|
|
|
wxDC& dc,
|
|
|
|
wxWindow* wnd,
|
|
|
|
const wxString& caption,
|
|
|
|
const wxBitmap& bitmap,
|
|
|
|
bool active,
|
|
|
|
int closeButtonState,
|
2014-03-29 20:02:23 -04:00
|
|
|
int* xExtent) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
|
|
|
int ShowDropDown(
|
|
|
|
wxWindow* wnd,
|
|
|
|
const wxAuiNotebookPageArray& items,
|
2014-03-29 20:02:23 -04:00
|
|
|
int activeIdx) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
|
|
|
int GetBestTabCtrlSize(wxWindow* wnd,
|
|
|
|
const wxAuiNotebookPageArray& pages,
|
2014-03-29 20:02:23 -04:00
|
|
|
const wxSize& requiredBmpSize) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
2018-11-01 11:02:30 -04:00
|
|
|
// Provide opportunity for subclasses to recalculate colours
|
|
|
|
virtual void UpdateColoursFromSystem() wxOVERRIDE;
|
|
|
|
|
2012-03-25 13:55:59 -04:00
|
|
|
protected:
|
|
|
|
|
|
|
|
wxFont m_normalFont;
|
|
|
|
wxFont m_selectedFont;
|
|
|
|
wxFont m_measuringFont;
|
|
|
|
wxColour m_baseColour;
|
|
|
|
wxPen m_baseColourPen;
|
|
|
|
wxPen m_borderPen;
|
|
|
|
wxBrush m_baseColourBrush;
|
|
|
|
wxColour m_activeColour;
|
|
|
|
wxBitmap m_activeCloseBmp;
|
|
|
|
wxBitmap m_disabledCloseBmp;
|
|
|
|
wxBitmap m_activeLeftBmp;
|
|
|
|
wxBitmap m_disabledLeftBmp;
|
|
|
|
wxBitmap m_activeRightBmp;
|
|
|
|
wxBitmap m_disabledRightBmp;
|
|
|
|
wxBitmap m_activeWindowListBmp;
|
|
|
|
wxBitmap m_disabledWindowListBmp;
|
|
|
|
|
|
|
|
int m_fixedTabWidth;
|
|
|
|
int m_tabCtrlHeight;
|
|
|
|
unsigned int m_flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_AUI wxAuiSimpleTabArt : public wxAuiTabArt
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
wxAuiSimpleTabArt();
|
|
|
|
virtual ~wxAuiSimpleTabArt();
|
|
|
|
|
2014-03-29 20:02:23 -04:00
|
|
|
wxAuiTabArt* Clone() wxOVERRIDE;
|
|
|
|
void SetFlags(unsigned int flags) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
|
|
|
void SetSizingInfo(const wxSize& tabCtrlSize,
|
2014-03-29 20:02:23 -04:00
|
|
|
size_t tabCount) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
2014-03-29 20:02:23 -04:00
|
|
|
void SetNormalFont(const wxFont& font) wxOVERRIDE;
|
|
|
|
void SetSelectedFont(const wxFont& font) wxOVERRIDE;
|
|
|
|
void SetMeasuringFont(const wxFont& font) wxOVERRIDE;
|
|
|
|
void SetColour(const wxColour& colour) wxOVERRIDE;
|
|
|
|
void SetActiveColour(const wxColour& colour) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
2012-10-08 08:09:13 -04:00
|
|
|
void DrawBorder(
|
|
|
|
wxDC& dc,
|
|
|
|
wxWindow* wnd,
|
2014-03-29 20:02:23 -04:00
|
|
|
const wxRect& rect) wxOVERRIDE;
|
2012-10-08 08:09:13 -04:00
|
|
|
|
2012-03-25 13:55:59 -04:00
|
|
|
void DrawBackground(
|
|
|
|
wxDC& dc,
|
|
|
|
wxWindow* wnd,
|
2014-03-29 20:02:23 -04:00
|
|
|
const wxRect& rect) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
|
|
|
void DrawTab(wxDC& dc,
|
|
|
|
wxWindow* wnd,
|
|
|
|
const wxAuiNotebookPage& pane,
|
|
|
|
const wxRect& inRect,
|
|
|
|
int closeButtonState,
|
|
|
|
wxRect* outTabRect,
|
|
|
|
wxRect* outButtonRect,
|
2014-03-29 20:02:23 -04:00
|
|
|
int* xExtent) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
|
|
|
void DrawButton(
|
|
|
|
wxDC& dc,
|
|
|
|
wxWindow* wnd,
|
|
|
|
const wxRect& inRect,
|
|
|
|
int bitmapId,
|
|
|
|
int buttonState,
|
|
|
|
int orientation,
|
2014-03-29 20:02:23 -04:00
|
|
|
wxRect* outRect) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
2014-03-29 20:02:23 -04:00
|
|
|
int GetIndentSize() wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
2012-10-08 08:09:13 -04:00
|
|
|
int GetBorderWidth(
|
2014-03-29 20:02:23 -04:00
|
|
|
wxWindow* wnd) wxOVERRIDE;
|
2012-10-08 08:09:13 -04:00
|
|
|
|
2012-10-22 17:46:46 -04:00
|
|
|
int GetAdditionalBorderSpace(
|
2014-03-29 20:02:23 -04:00
|
|
|
wxWindow* wnd) wxOVERRIDE;
|
2012-10-22 17:46:46 -04:00
|
|
|
|
2012-03-25 13:55:59 -04:00
|
|
|
wxSize GetTabSize(
|
|
|
|
wxDC& dc,
|
|
|
|
wxWindow* wnd,
|
|
|
|
const wxString& caption,
|
|
|
|
const wxBitmap& bitmap,
|
|
|
|
bool active,
|
|
|
|
int closeButtonState,
|
2014-03-29 20:02:23 -04:00
|
|
|
int* xExtent) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
|
|
|
int ShowDropDown(
|
|
|
|
wxWindow* wnd,
|
|
|
|
const wxAuiNotebookPageArray& items,
|
2014-03-29 20:02:23 -04:00
|
|
|
int activeIdx) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
|
|
|
int GetBestTabCtrlSize(wxWindow* wnd,
|
|
|
|
const wxAuiNotebookPageArray& pages,
|
2014-03-29 20:02:23 -04:00
|
|
|
const wxSize& requiredBmpSize) wxOVERRIDE;
|
2012-03-25 13:55:59 -04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
wxFont m_normalFont;
|
|
|
|
wxFont m_selectedFont;
|
|
|
|
wxFont m_measuringFont;
|
|
|
|
wxPen m_normalBkPen;
|
|
|
|
wxPen m_selectedBkPen;
|
|
|
|
wxBrush m_normalBkBrush;
|
|
|
|
wxBrush m_selectedBkBrush;
|
|
|
|
wxBrush m_bkBrush;
|
|
|
|
wxBitmap m_activeCloseBmp;
|
|
|
|
wxBitmap m_disabledCloseBmp;
|
|
|
|
wxBitmap m_activeLeftBmp;
|
|
|
|
wxBitmap m_disabledLeftBmp;
|
|
|
|
wxBitmap m_activeRightBmp;
|
|
|
|
wxBitmap m_disabledRightBmp;
|
|
|
|
wxBitmap m_activeWindowListBmp;
|
|
|
|
wxBitmap m_disabledWindowListBmp;
|
|
|
|
|
|
|
|
int m_fixedTabWidth;
|
|
|
|
unsigned int m_flags;
|
|
|
|
};
|
|
|
|
|
2012-03-25 13:56:04 -04:00
|
|
|
#ifndef __WXUNIVERSAL__
|
2012-06-30 16:39:06 -04:00
|
|
|
#if defined(__WXGTK20__) && !defined(__WXGTK3__)
|
2012-03-25 13:56:04 -04:00
|
|
|
#define wxHAS_NATIVE_TABART
|
|
|
|
#include "wx/aui/tabartgtk.h"
|
|
|
|
#define wxAuiDefaultTabArt wxAuiGtkTabArt
|
2018-12-08 14:17:57 -05:00
|
|
|
#elif defined(__WXMSW__) && wxUSE_UXTHEME
|
2015-10-03 18:26:14 -04:00
|
|
|
#define wxHAS_NATIVE_TABART
|
|
|
|
#include "wx/aui/tabartmsw.h"
|
|
|
|
#define wxAuiDefaultTabArt wxAuiMSWTabArt
|
2012-03-25 13:56:04 -04:00
|
|
|
#endif
|
|
|
|
#endif // !__WXUNIVERSAL__
|
|
|
|
|
|
|
|
#ifndef wxHAS_NATIVE_TABART
|
|
|
|
#define wxAuiDefaultTabArt wxAuiGenericTabArt
|
|
|
|
#endif
|
2012-03-25 13:55:59 -04:00
|
|
|
|
|
|
|
#endif // wxUSE_AUI
|
|
|
|
|
|
|
|
#endif // _WX_AUI_TABART_H_
|