dockart.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/aui/dockart.h
  3. // Purpose: wxaui: wx advanced user interface - docking window manager
  4. // Author: Benjamin I. Williams
  5. // Modified by:
  6. // Created: 2005-05-17
  7. // Copyright: (C) Copyright 2005, Kirix Corporation, All Rights Reserved.
  8. // Licence: wxWindows Library Licence, Version 3.1
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_DOCKART_H_
  11. #define _WX_DOCKART_H_
  12. // ----------------------------------------------------------------------------
  13. // headers
  14. // ----------------------------------------------------------------------------
  15. #include "wx/defs.h"
  16. #if wxUSE_AUI
  17. #include "wx/pen.h"
  18. #include "wx/brush.h"
  19. #include "wx/bitmap.h"
  20. #include "wx/colour.h"
  21. // dock art provider code - a dock provider provides all drawing
  22. // functionality to the wxAui dock manager. This allows the dock
  23. // manager to have plugable look-and-feels
  24. class WXDLLIMPEXP_AUI wxAuiDockArt
  25. {
  26. public:
  27. wxAuiDockArt() { }
  28. virtual ~wxAuiDockArt() { }
  29. virtual int GetMetric(int id) = 0;
  30. virtual void SetMetric(int id, int newVal) = 0;
  31. virtual void SetFont(int id, const wxFont& font) = 0;
  32. virtual wxFont GetFont(int id) = 0;
  33. virtual wxColour GetColour(int id) = 0;
  34. virtual void SetColour(int id, const wxColor& colour) = 0;
  35. wxColour GetColor(int id) { return GetColour(id); }
  36. void SetColor(int id, const wxColour& color) { SetColour(id, color); }
  37. virtual void DrawSash(wxDC& dc,
  38. wxWindow* window,
  39. int orientation,
  40. const wxRect& rect) = 0;
  41. virtual void DrawBackground(wxDC& dc,
  42. wxWindow* window,
  43. int orientation,
  44. const wxRect& rect) = 0;
  45. virtual void DrawCaption(wxDC& dc,
  46. wxWindow* window,
  47. const wxString& text,
  48. const wxRect& rect,
  49. wxAuiPaneInfo& pane) = 0;
  50. virtual void DrawGripper(wxDC& dc,
  51. wxWindow* window,
  52. const wxRect& rect,
  53. wxAuiPaneInfo& pane) = 0;
  54. virtual void DrawBorder(wxDC& dc,
  55. wxWindow* window,
  56. const wxRect& rect,
  57. wxAuiPaneInfo& pane) = 0;
  58. virtual void DrawPaneButton(wxDC& dc,
  59. wxWindow* window,
  60. int button,
  61. int buttonState,
  62. const wxRect& rect,
  63. wxAuiPaneInfo& pane) = 0;
  64. };
  65. // this is the default art provider for wxAuiManager. Dock art
  66. // can be customized by creating a class derived from this one,
  67. // or replacing this class entirely
  68. class WXDLLIMPEXP_AUI wxAuiDefaultDockArt : public wxAuiDockArt
  69. {
  70. public:
  71. wxAuiDefaultDockArt();
  72. int GetMetric(int metricId);
  73. void SetMetric(int metricId, int newVal);
  74. wxColour GetColour(int id);
  75. void SetColour(int id, const wxColor& colour);
  76. void SetFont(int id, const wxFont& font);
  77. wxFont GetFont(int id);
  78. void DrawSash(wxDC& dc,
  79. wxWindow *window,
  80. int orientation,
  81. const wxRect& rect);
  82. void DrawBackground(wxDC& dc,
  83. wxWindow *window,
  84. int orientation,
  85. const wxRect& rect);
  86. void DrawCaption(wxDC& dc,
  87. wxWindow *window,
  88. const wxString& text,
  89. const wxRect& rect,
  90. wxAuiPaneInfo& pane);
  91. void DrawGripper(wxDC& dc,
  92. wxWindow *window,
  93. const wxRect& rect,
  94. wxAuiPaneInfo& pane);
  95. void DrawBorder(wxDC& dc,
  96. wxWindow *window,
  97. const wxRect& rect,
  98. wxAuiPaneInfo& pane);
  99. void DrawPaneButton(wxDC& dc,
  100. wxWindow *window,
  101. int button,
  102. int buttonState,
  103. const wxRect& rect,
  104. wxAuiPaneInfo& pane);
  105. void DrawIcon(wxDC& dc,
  106. const wxRect& rect,
  107. wxAuiPaneInfo& pane);
  108. protected:
  109. void DrawCaptionBackground(wxDC& dc, const wxRect& rect, bool active);
  110. void InitBitmaps();
  111. protected:
  112. wxPen m_borderPen;
  113. wxBrush m_sashBrush;
  114. wxBrush m_backgroundBrush;
  115. wxBrush m_gripperBrush;
  116. wxFont m_captionFont;
  117. wxBitmap m_inactiveCloseBitmap;
  118. wxBitmap m_inactivePinBitmap;
  119. wxBitmap m_inactiveMaximizeBitmap;
  120. wxBitmap m_inactiveRestoreBitmap;
  121. wxBitmap m_activeCloseBitmap;
  122. wxBitmap m_activePinBitmap;
  123. wxBitmap m_activeMaximizeBitmap;
  124. wxBitmap m_activeRestoreBitmap;
  125. wxPen m_gripperPen1;
  126. wxPen m_gripperPen2;
  127. wxPen m_gripperPen3;
  128. wxColour m_baseColour;
  129. wxColour m_activeCaptionColour;
  130. wxColour m_activeCaptionGradientColour;
  131. wxColour m_activeCaptionTextColour;
  132. wxColour m_inactiveCaptionColour;
  133. wxColour m_inactiveCaptionGradientColour;
  134. wxColour m_inactiveCaptionTextColour;
  135. int m_borderSize;
  136. int m_captionSize;
  137. int m_sashSize;
  138. int m_buttonSize;
  139. int m_gripperSize;
  140. int m_gradientType;
  141. };
  142. #endif // wxUSE_AUI
  143. #endif //_WX_DOCKART_H_