tabart.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. //////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/aui/tabart.h
  3. // Purpose: wxaui: wx advanced user interface - notebook
  4. // Author: Benjamin I. Williams
  5. // Modified by: Jens Lody (extracted from wx/aui/auibook.h)
  6. // Created: 2012-03-21
  7. // Copyright: (C) Copyright 2006, Kirix Corporation, All Rights Reserved.
  8. // Licence: wxWindows Library Licence, Version 3.1
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_AUI_TABART_H_
  11. #define _WX_AUI_TABART_H_
  12. // ----------------------------------------------------------------------------
  13. // headers
  14. // ----------------------------------------------------------------------------
  15. #include "wx/defs.h"
  16. #if wxUSE_AUI
  17. #include "wx/colour.h"
  18. #include "wx/gdicmn.h"
  19. #include "wx/font.h"
  20. #include "wx/pen.h"
  21. #include "wx/brush.h"
  22. #include "wx/bitmap.h"
  23. class wxAuiNotebookPage;
  24. class wxAuiNotebookPageArray;
  25. class wxWindow;
  26. class wxDC;
  27. // tab art class
  28. class WXDLLIMPEXP_AUI wxAuiTabArt
  29. {
  30. public:
  31. wxAuiTabArt() { }
  32. virtual ~wxAuiTabArt() { }
  33. virtual wxAuiTabArt* Clone() = 0;
  34. virtual void SetFlags(unsigned int flags) = 0;
  35. virtual void SetSizingInfo(const wxSize& tabCtrlSize,
  36. size_t tabCount) = 0;
  37. virtual void SetNormalFont(const wxFont& font) = 0;
  38. virtual void SetSelectedFont(const wxFont& font) = 0;
  39. virtual void SetMeasuringFont(const wxFont& font) = 0;
  40. virtual void SetColour(const wxColour& colour) = 0;
  41. virtual void SetActiveColour(const wxColour& colour) = 0;
  42. virtual void DrawBorder(
  43. wxDC& dc,
  44. wxWindow* wnd,
  45. const wxRect& rect) = 0;
  46. virtual void DrawBackground(
  47. wxDC& dc,
  48. wxWindow* wnd,
  49. const wxRect& rect) = 0;
  50. virtual void DrawTab(wxDC& dc,
  51. wxWindow* wnd,
  52. const wxAuiNotebookPage& pane,
  53. const wxRect& inRect,
  54. int closeButtonState,
  55. wxRect* outTabRect,
  56. wxRect* outButtonRect,
  57. int* xExtent) = 0;
  58. virtual void DrawButton(
  59. wxDC& dc,
  60. wxWindow* wnd,
  61. const wxRect& inRect,
  62. int bitmapId,
  63. int buttonState,
  64. int orientation,
  65. wxRect* outRect) = 0;
  66. virtual wxSize GetTabSize(
  67. wxDC& dc,
  68. wxWindow* wnd,
  69. const wxString& caption,
  70. const wxBitmap& bitmap,
  71. bool active,
  72. int closeButtonState,
  73. int* xExtent) = 0;
  74. virtual int ShowDropDown(
  75. wxWindow* wnd,
  76. const wxAuiNotebookPageArray& items,
  77. int activeIdx) = 0;
  78. virtual int GetIndentSize() = 0;
  79. virtual int GetBorderWidth(
  80. wxWindow* wnd) = 0;
  81. virtual int GetAdditionalBorderSpace(
  82. wxWindow* wnd) = 0;
  83. virtual int GetBestTabCtrlSize(
  84. wxWindow* wnd,
  85. const wxAuiNotebookPageArray& pages,
  86. const wxSize& requiredBmpSize) = 0;
  87. };
  88. class WXDLLIMPEXP_AUI wxAuiGenericTabArt : public wxAuiTabArt
  89. {
  90. public:
  91. wxAuiGenericTabArt();
  92. virtual ~wxAuiGenericTabArt();
  93. wxAuiTabArt* Clone();
  94. void SetFlags(unsigned int flags);
  95. void SetSizingInfo(const wxSize& tabCtrlSize,
  96. size_t tabCount);
  97. void SetNormalFont(const wxFont& font);
  98. void SetSelectedFont(const wxFont& font);
  99. void SetMeasuringFont(const wxFont& font);
  100. void SetColour(const wxColour& colour);
  101. void SetActiveColour(const wxColour& colour);
  102. void DrawBorder(
  103. wxDC& dc,
  104. wxWindow* wnd,
  105. const wxRect& rect);
  106. void DrawBackground(
  107. wxDC& dc,
  108. wxWindow* wnd,
  109. const wxRect& rect);
  110. void DrawTab(wxDC& dc,
  111. wxWindow* wnd,
  112. const wxAuiNotebookPage& pane,
  113. const wxRect& inRect,
  114. int closeButtonState,
  115. wxRect* outTabRect,
  116. wxRect* outButtonRect,
  117. int* xExtent);
  118. void DrawButton(
  119. wxDC& dc,
  120. wxWindow* wnd,
  121. const wxRect& inRect,
  122. int bitmapId,
  123. int buttonState,
  124. int orientation,
  125. wxRect* outRect);
  126. int GetIndentSize();
  127. int GetBorderWidth(
  128. wxWindow* wnd);
  129. int GetAdditionalBorderSpace(
  130. wxWindow* wnd);
  131. wxSize GetTabSize(
  132. wxDC& dc,
  133. wxWindow* wnd,
  134. const wxString& caption,
  135. const wxBitmap& bitmap,
  136. bool active,
  137. int closeButtonState,
  138. int* xExtent);
  139. int ShowDropDown(
  140. wxWindow* wnd,
  141. const wxAuiNotebookPageArray& items,
  142. int activeIdx);
  143. int GetBestTabCtrlSize(wxWindow* wnd,
  144. const wxAuiNotebookPageArray& pages,
  145. const wxSize& requiredBmpSize);
  146. protected:
  147. wxFont m_normalFont;
  148. wxFont m_selectedFont;
  149. wxFont m_measuringFont;
  150. wxColour m_baseColour;
  151. wxPen m_baseColourPen;
  152. wxPen m_borderPen;
  153. wxBrush m_baseColourBrush;
  154. wxColour m_activeColour;
  155. wxBitmap m_activeCloseBmp;
  156. wxBitmap m_disabledCloseBmp;
  157. wxBitmap m_activeLeftBmp;
  158. wxBitmap m_disabledLeftBmp;
  159. wxBitmap m_activeRightBmp;
  160. wxBitmap m_disabledRightBmp;
  161. wxBitmap m_activeWindowListBmp;
  162. wxBitmap m_disabledWindowListBmp;
  163. int m_fixedTabWidth;
  164. int m_tabCtrlHeight;
  165. unsigned int m_flags;
  166. };
  167. class WXDLLIMPEXP_AUI wxAuiSimpleTabArt : public wxAuiTabArt
  168. {
  169. public:
  170. wxAuiSimpleTabArt();
  171. virtual ~wxAuiSimpleTabArt();
  172. wxAuiTabArt* Clone();
  173. void SetFlags(unsigned int flags);
  174. void SetSizingInfo(const wxSize& tabCtrlSize,
  175. size_t tabCount);
  176. void SetNormalFont(const wxFont& font);
  177. void SetSelectedFont(const wxFont& font);
  178. void SetMeasuringFont(const wxFont& font);
  179. void SetColour(const wxColour& colour);
  180. void SetActiveColour(const wxColour& colour);
  181. void DrawBorder(
  182. wxDC& dc,
  183. wxWindow* wnd,
  184. const wxRect& rect);
  185. void DrawBackground(
  186. wxDC& dc,
  187. wxWindow* wnd,
  188. const wxRect& rect);
  189. void DrawTab(wxDC& dc,
  190. wxWindow* wnd,
  191. const wxAuiNotebookPage& pane,
  192. const wxRect& inRect,
  193. int closeButtonState,
  194. wxRect* outTabRect,
  195. wxRect* outButtonRect,
  196. int* xExtent);
  197. void DrawButton(
  198. wxDC& dc,
  199. wxWindow* wnd,
  200. const wxRect& inRect,
  201. int bitmapId,
  202. int buttonState,
  203. int orientation,
  204. wxRect* outRect);
  205. int GetIndentSize();
  206. int GetBorderWidth(
  207. wxWindow* wnd);
  208. int GetAdditionalBorderSpace(
  209. wxWindow* wnd);
  210. wxSize GetTabSize(
  211. wxDC& dc,
  212. wxWindow* wnd,
  213. const wxString& caption,
  214. const wxBitmap& bitmap,
  215. bool active,
  216. int closeButtonState,
  217. int* xExtent);
  218. int ShowDropDown(
  219. wxWindow* wnd,
  220. const wxAuiNotebookPageArray& items,
  221. int activeIdx);
  222. int GetBestTabCtrlSize(wxWindow* wnd,
  223. const wxAuiNotebookPageArray& pages,
  224. const wxSize& requiredBmpSize);
  225. protected:
  226. wxFont m_normalFont;
  227. wxFont m_selectedFont;
  228. wxFont m_measuringFont;
  229. wxPen m_normalBkPen;
  230. wxPen m_selectedBkPen;
  231. wxBrush m_normalBkBrush;
  232. wxBrush m_selectedBkBrush;
  233. wxBrush m_bkBrush;
  234. wxBitmap m_activeCloseBmp;
  235. wxBitmap m_disabledCloseBmp;
  236. wxBitmap m_activeLeftBmp;
  237. wxBitmap m_disabledLeftBmp;
  238. wxBitmap m_activeRightBmp;
  239. wxBitmap m_disabledRightBmp;
  240. wxBitmap m_activeWindowListBmp;
  241. wxBitmap m_disabledWindowListBmp;
  242. int m_fixedTabWidth;
  243. unsigned int m_flags;
  244. };
  245. #ifndef __WXUNIVERSAL__
  246. #if defined(__WXGTK20__) && !defined(__WXGTK3__)
  247. #define wxHAS_NATIVE_TABART
  248. #include "wx/aui/tabartgtk.h"
  249. #define wxAuiDefaultTabArt wxAuiGtkTabArt
  250. #endif
  251. #endif // !__WXUNIVERSAL__
  252. #ifndef wxHAS_NATIVE_TABART
  253. #define wxAuiDefaultTabArt wxAuiGenericTabArt
  254. #endif
  255. #endif // wxUSE_AUI
  256. #endif // _WX_AUI_TABART_H_