1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/aui/dockart.cpp
3 // Purpose: wxaui: wx advanced user interface - docking window manager
4 // Author: Benjamin I. Williams
8 // Copyright: (C) Copyright 2005-2006, Kirix Corporation, All Rights Reserved
9 // Licence: wxWindows Library Licence, Version 3.1
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #include "wx/wxprec.h"
28 #include "wx/aui/framemanager.h"
29 #include "wx/aui/dockart.h"
32 #include "wx/settings.h"
33 #include "wx/dcclient.h"
38 #include "wx/osx/private.h"
39 #include "wx/graphics.h"
40 #include "wx/dcgraph.h"
45 #include "wx/renderer.h"
49 // -- wxAuiDefaultDockArt class implementation --
51 // wxAuiDefaultDockArt is an art provider class which does all of the drawing for
52 // wxAuiManager. This allows the library caller to customize the dock art
53 // (probably by deriving from this class), or to completely replace all drawing
54 // with custom dock art (probably by writing a new stand-alone class derived
55 // from the wxAuiDockArt base class). The active dock art class can be set via
56 // wxAuiManager::SetDockArt()
57 wxColor
wxAuiLightContrastColour(const wxColour
& c
)
61 // if the color is especially dark, then
62 // make the contrast even lighter
63 if (c
.Red() < 128 && c
.Green() < 128 && c
.Blue() < 128)
66 return c
.ChangeLightness(amount
);
69 // wxAuiBitmapFromBits() is a utility function that creates a
70 // masked bitmap from raw bits (XBM format)
71 wxBitmap
wxAuiBitmapFromBits(const unsigned char bits
[], int w
, int h
,
72 const wxColour
& color
)
74 wxImage img
= wxBitmap((const char*)bits
, w
, h
).ConvertToImage();
75 img
.Replace(0,0,0,123,123,123);
76 img
.Replace(255,255,255,color
.Red(),color
.Green(),color
.Blue());
77 img
.SetMaskColour(123,123,123);
82 static void DrawGradientRectangle(wxDC
& dc
,
84 const wxColour
& start_color
,
85 const wxColour
& end_color
,
88 int rd
, gd
, bd
, high
= 0;
89 rd
= end_color
.Red() - start_color
.Red();
90 gd
= end_color
.Green() - start_color
.Green();
91 bd
= end_color
.Blue() - start_color
.Blue();
93 if (direction
== wxAUI_GRADIENT_VERTICAL
)
94 high
= rect
.GetHeight()-1;
96 high
= rect
.GetWidth()-1;
98 for (int i
= 0; i
<= high
; ++i
)
103 r
= start_color
.Red() + (high
<= 0 ?
0 : (((i
*rd
*100)/high
)/100));
104 g
= start_color
.Green() + (high
<= 0 ?
0 : (((i
*gd
*100)/high
)/100));
105 b
= start_color
.Blue() + (high
<= 0 ?
0 : (((i
*bd
*100)/high
)/100));
107 wxPen
p(wxColor((unsigned char)r
,
112 if (direction
== wxAUI_GRADIENT_VERTICAL
)
113 dc
.DrawLine(rect
.x
, rect
.y
+i
, rect
.x
+rect
.width
, rect
.y
+i
);
115 dc
.DrawLine(rect
.x
+i
, rect
.y
, rect
.x
+i
, rect
.y
+rect
.height
);
119 wxString
wxAuiChopText(wxDC
& dc
, const wxString
& text
, int max_size
)
123 // first check if the text fits with no problems
124 dc
.GetTextExtent(text
, &x
, &y
);
128 size_t i
, len
= text
.Length();
129 size_t last_good_length
= 0;
130 for (i
= 0; i
< len
; ++i
)
132 wxString s
= text
.Left(i
);
135 dc
.GetTextExtent(s
, &x
, &y
);
139 last_good_length
= i
;
142 wxString ret
= text
.Left(last_good_length
);
147 wxAuiDefaultDockArt
::wxAuiDefaultDockArt()
149 #if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON
150 wxColor base_colour
= wxColour( wxMacCreateCGColorFromHITheme(kThemeBrushToolbarBackground
));
152 wxColor base_colour
= wxSystemSettings
::GetColour(wxSYS_COLOUR_3DFACE
);
155 // the base_colour is too pale to use as our base colour,
156 // so darken it a bit --
157 if ((255-base_colour
.Red()) +
158 (255-base_colour
.Green()) +
159 (255-base_colour
.Blue()) < 60)
161 base_colour
= base_colour
.ChangeLightness(92);
164 m_base_colour
= base_colour
;
165 wxColor darker1_colour
= base_colour
.ChangeLightness(85);
166 wxColor darker2_colour
= base_colour
.ChangeLightness(75);
167 wxColor darker3_colour
= base_colour
.ChangeLightness(60);
168 //wxColor darker4_colour = base_colour.ChangeLightness(50);
169 wxColor darker5_colour
= base_colour
.ChangeLightness(40);
171 m_active_caption_colour
= wxSystemSettings
::GetColour(wxSYS_COLOUR_HIGHLIGHT
);
172 m_active_caption_gradient_colour
= wxAuiLightContrastColour(wxSystemSettings
::GetColour(wxSYS_COLOUR_HIGHLIGHT
));
173 m_active_caption_text_colour
= wxSystemSettings
::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT
);
174 m_inactive_caption_colour
= darker1_colour
;
175 m_inactive_caption_gradient_colour
= base_colour
.ChangeLightness(97);
176 m_inactive_caption_text_colour
= *wxBLACK
;
178 m_sash_brush
= wxBrush(base_colour
);
179 m_background_brush
= wxBrush(base_colour
);
180 m_gripper_brush
= wxBrush(base_colour
);
182 m_border_pen
= wxPen(darker2_colour
);
183 m_gripper_pen1
= wxPen(darker5_colour
);
184 m_gripper_pen2
= wxPen(darker3_colour
);
185 m_gripper_pen3
= *wxWHITE_PEN
;
188 m_caption_font
= *wxSMALL_FONT
;
190 m_caption_font
= wxFont(8, wxDEFAULT
, wxNORMAL
, wxNORMAL
, FALSE
);
193 // some built in bitmaps
194 #if defined( __WXMAC__ )
195 static const unsigned char close_bits
[]={
196 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFE, 0x03, 0xF8, 0x01, 0xF0, 0x19, 0xF3,
197 0xB8, 0xE3, 0xF0, 0xE1, 0xE0, 0xE0, 0xF0, 0xE1, 0xB8, 0xE3, 0x19, 0xF3,
198 0x01, 0xF0, 0x03, 0xF8, 0x0F, 0xFE, 0xFF, 0xFF };
199 #elif defined(__WXGTK__)
200 static const unsigned char close_bits
[]={
201 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xfb, 0xef, 0xdb, 0xed, 0x8b, 0xe8,
202 0x1b, 0xec, 0x3b, 0xee, 0x1b, 0xec, 0x8b, 0xe8, 0xdb, 0xed, 0xfb, 0xef,
203 0x07, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
205 static const unsigned char close_bits
[]={
206 // reduced height, symmetric
207 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xf3, 0x9f, 0xf9,
208 0x3f, 0xfc, 0x7f, 0xfe, 0x3f, 0xfc, 0x9f, 0xf9, 0xcf, 0xf3, 0xff, 0xff,
209 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
211 // same height as maximize/restore
212 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xe7, 0xcf, 0xf3, 0x9f, 0xf9,
213 0x3f, 0xfc, 0x7f, 0xfe, 0x3f, 0xfc, 0x9f, 0xf9, 0xcf, 0xf3, 0xe7, 0xe7,
214 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
218 static const unsigned char maximize_bits
[] = {
219 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xf7, 0xf7, 0x07, 0xf0,
220 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0x07, 0xf0,
221 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
223 static const unsigned char restore_bits
[]={
224 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf0, 0x1f, 0xf0, 0xdf, 0xf7,
225 0x07, 0xf4, 0x07, 0xf4, 0xf7, 0xf5, 0xf7, 0xf1, 0xf7, 0xfd, 0xf7, 0xfd,
226 0x07, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
228 static const unsigned char pin_bits
[]={
229 0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xfc,0xdf,0xfc,0xdf,0xfc,
230 0xdf,0xfc,0xdf,0xfc,0xdf,0xfc,0x0f,0xf8,0x7f,0xff,0x7f,0xff,
231 0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
234 m_inactive_close_bitmap
= wxAuiBitmapFromBits(close_bits
, 16, 16, *wxWHITE
);
235 m_active_close_bitmap
= wxAuiBitmapFromBits(close_bits
, 16, 16, *wxWHITE
);
237 m_inactive_close_bitmap
= wxAuiBitmapFromBits(close_bits
, 16, 16, m_inactive_caption_text_colour
);
238 m_active_close_bitmap
= wxAuiBitmapFromBits(close_bits
, 16, 16, m_active_caption_text_colour
);
242 m_inactive_maximize_bitmap
= wxAuiBitmapFromBits(maximize_bits
, 16, 16, *wxWHITE
);
243 m_active_maximize_bitmap
= wxAuiBitmapFromBits(maximize_bits
, 16, 16, *wxWHITE
);
245 m_inactive_maximize_bitmap
= wxAuiBitmapFromBits(maximize_bits
, 16, 16, m_inactive_caption_text_colour
);
246 m_active_maximize_bitmap
= wxAuiBitmapFromBits(maximize_bits
, 16, 16, m_active_caption_text_colour
);
250 m_inactive_restore_bitmap
= wxAuiBitmapFromBits(restore_bits
, 16, 16, *wxWHITE
);
251 m_active_restore_bitmap
= wxAuiBitmapFromBits(restore_bits
, 16, 16, *wxWHITE
);
253 m_inactive_restore_bitmap
= wxAuiBitmapFromBits(restore_bits
, 16, 16, m_inactive_caption_text_colour
);
254 m_active_restore_bitmap
= wxAuiBitmapFromBits(restore_bits
, 16, 16, m_active_caption_text_colour
);
257 m_inactive_pin_bitmap
= wxAuiBitmapFromBits(pin_bits
, 16, 16, m_inactive_caption_text_colour
);
258 m_active_pin_bitmap
= wxAuiBitmapFromBits(pin_bits
, 16, 16, m_active_caption_text_colour
);
260 // default metric values
261 #if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON
263 GetThemeMetric( kThemeMetricSmallPaneSplitterHeight
, &height
);
264 m_sash_size
= height
;
265 #elif defined(__WXGTK__)
266 m_sash_size
= wxRendererNative
::Get().GetSplitterParams(NULL
).widthSash
;
274 m_gradient_type
= wxAUI_GRADIENT_VERTICAL
;
277 int wxAuiDefaultDockArt
::GetMetric(int id
)
281 case wxAUI_DOCKART_SASH_SIZE
: return m_sash_size
;
282 case wxAUI_DOCKART_CAPTION_SIZE
: return m_caption_size
;
283 case wxAUI_DOCKART_GRIPPER_SIZE
: return m_gripper_size
;
284 case wxAUI_DOCKART_PANE_BORDER_SIZE
: return m_border_size
;
285 case wxAUI_DOCKART_PANE_BUTTON_SIZE
: return m_button_size
;
286 case wxAUI_DOCKART_GRADIENT_TYPE
: return m_gradient_type
;
287 default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break;
293 void wxAuiDefaultDockArt
::SetMetric(int id
, int new_val
)
297 case wxAUI_DOCKART_SASH_SIZE
: m_sash_size
= new_val
; break;
298 case wxAUI_DOCKART_CAPTION_SIZE
: m_caption_size
= new_val
; break;
299 case wxAUI_DOCKART_GRIPPER_SIZE
: m_gripper_size
= new_val
; break;
300 case wxAUI_DOCKART_PANE_BORDER_SIZE
: m_border_size
= new_val
; break;
301 case wxAUI_DOCKART_PANE_BUTTON_SIZE
: m_button_size
= new_val
; break;
302 case wxAUI_DOCKART_GRADIENT_TYPE
: m_gradient_type
= new_val
; break;
303 default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break;
307 wxColour wxAuiDefaultDockArt
::GetColour(int id
)
311 case wxAUI_DOCKART_BACKGROUND_COLOUR
: return m_background_brush
.GetColour();
312 case wxAUI_DOCKART_SASH_COLOUR
: return m_sash_brush
.GetColour();
313 case wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR
: return m_inactive_caption_colour
;
314 case wxAUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR
: return m_inactive_caption_gradient_colour
;
315 case wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR
: return m_inactive_caption_text_colour
;
316 case wxAUI_DOCKART_ACTIVE_CAPTION_COLOUR
: return m_active_caption_colour
;
317 case wxAUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR
: return m_active_caption_gradient_colour
;
318 case wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR
: return m_active_caption_text_colour
;
319 case wxAUI_DOCKART_BORDER_COLOUR
: return m_border_pen
.GetColour();
320 case wxAUI_DOCKART_GRIPPER_COLOUR
: return m_gripper_brush
.GetColour();
321 default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break;
327 void wxAuiDefaultDockArt
::SetColour(int id
, const wxColor
& colour
)
331 case wxAUI_DOCKART_BACKGROUND_COLOUR
: m_background_brush
.SetColour(colour
); break;
332 case wxAUI_DOCKART_SASH_COLOUR
: m_sash_brush
.SetColour(colour
); break;
333 case wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR
: m_inactive_caption_colour
= colour
; break;
334 case wxAUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR
: m_inactive_caption_gradient_colour
= colour
; break;
335 case wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR
: m_inactive_caption_text_colour
= colour
; break;
336 case wxAUI_DOCKART_ACTIVE_CAPTION_COLOUR
: m_active_caption_colour
= colour
; break;
337 case wxAUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR
: m_active_caption_gradient_colour
= colour
; break;
338 case wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR
: m_active_caption_text_colour
= colour
; break;
339 case wxAUI_DOCKART_BORDER_COLOUR
: m_border_pen
.SetColour(colour
); break;
340 case wxAUI_DOCKART_GRIPPER_COLOUR
:
341 m_gripper_brush
.SetColour(colour
);
342 m_gripper_pen1
.SetColour(colour
.ChangeLightness(40));
343 m_gripper_pen2
.SetColour(colour
.ChangeLightness(60));
345 default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break;
349 void wxAuiDefaultDockArt
::SetFont(int id
, const wxFont
& font
)
351 if (id
== wxAUI_DOCKART_CAPTION_FONT
)
352 m_caption_font
= font
;
355 wxFont wxAuiDefaultDockArt
::GetFont(int id
)
357 if (id
== wxAUI_DOCKART_CAPTION_FONT
)
358 return m_caption_font
;
362 void wxAuiDefaultDockArt
::DrawSash(wxDC
& dc
, wxWindow
*window
, int orientation
, const wxRect
& rect
)
364 #if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON
366 wxUnusedVar(orientation
);
368 HIRect splitterRect
= CGRectMake( rect
.x
, rect
.y
, rect
.width
, rect
.height
);
369 CGContextRef cgContext
;
370 wxGCDCImpl
*impl
= (wxGCDCImpl
*) dc
.GetImpl();
371 cgContext
= (CGContextRef
) impl
->GetGraphicsContext()->GetNativeContext() ;
373 HIThemeSplitterDrawInfo drawInfo
;
374 drawInfo
.version
= 0 ;
375 drawInfo
.state
= kThemeStateActive
;
376 drawInfo
.adornment
= kHIThemeSplitterAdornmentNone
;
377 HIThemeDrawPaneSplitter( &splitterRect
, &drawInfo
, cgContext
, kHIThemeOrientationNormal
) ;
379 #elif defined(__WXGTK__)
380 // clear out the rectangle first
381 dc
.SetPen(*wxTRANSPARENT_PEN
);
382 dc
.SetBrush(m_sash_brush
);
383 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
386 GdkRectangle gdk_rect
;
387 if (orientation
== wxVERTICAL
)
391 gdk_rect
.width
= m_sash_size
;
392 gdk_rect
.height
= rect
.height
;
398 gdk_rect
.width
= rect
.width
;
399 gdk_rect
.height
= m_sash_size
;
404 if (!window
->m_wxwindow
) return;
405 if (!GTK_WIDGET_DRAWABLE(window
->m_wxwindow
)) return;
409 window
->m_wxwindow
->style
,
410 window
->GTKGetDrawingWindow(),
411 // flags & wxCONTROL_CURRENT ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL,
414 NULL
/* no clipping */,
421 (orientation
== wxVERTICAL
) ? GTK_ORIENTATION_VERTICAL
: GTK_ORIENTATION_HORIZONTAL
426 wxUnusedVar(orientation
);
427 dc
.SetPen(*wxTRANSPARENT_PEN
);
428 dc
.SetBrush(m_sash_brush
);
429 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
434 void wxAuiDefaultDockArt
::DrawBackground(wxDC
& dc
, wxWindow
*WXUNUSED(window
), int, const wxRect
& rect
)
436 dc
.SetPen(*wxTRANSPARENT_PEN
);
438 // we have to clear first, otherwise we are drawing a light striped pattern
439 // over an already darker striped background
440 dc
.SetBrush(*wxWHITE_BRUSH
) ;
441 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
443 dc
.SetBrush(m_background_brush
);
444 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
447 void wxAuiDefaultDockArt
::DrawBorder(wxDC
& dc
, wxWindow
*WXUNUSED(window
), const wxRect
& _rect
,
450 dc
.SetPen(m_border_pen
);
451 dc
.SetBrush(*wxTRANSPARENT_BRUSH
);
454 int i
, border_width
= GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE
);
456 if (pane
.IsToolbar())
458 for (i
= 0; i
< border_width
; ++i
)
460 dc
.SetPen(*wxWHITE_PEN
);
461 dc
.DrawLine(rect
.x
, rect
.y
, rect
.x
+rect
.width
, rect
.y
);
462 dc
.DrawLine(rect
.x
, rect
.y
, rect
.x
, rect
.y
+rect
.height
);
463 dc
.SetPen(m_border_pen
);
464 dc
.DrawLine(rect
.x
, rect
.y
+rect
.height
-1,
465 rect
.x
+rect
.width
, rect
.y
+rect
.height
-1);
466 dc
.DrawLine(rect
.x
+rect
.width
-1, rect
.y
,
467 rect
.x
+rect
.width
-1, rect
.y
+rect
.height
);
473 for (i
= 0; i
< border_width
; ++i
)
475 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
482 void wxAuiDefaultDockArt
::DrawCaptionBackground(wxDC
& dc
, const wxRect
& rect
, bool active
)
484 if (m_gradient_type
== wxAUI_GRADIENT_NONE
)
487 dc
.SetBrush(wxBrush(m_active_caption_colour
));
489 dc
.SetBrush(wxBrush(m_inactive_caption_colour
));
491 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
497 // on mac the gradients are expected to become darker from the top
499 DrawGradientRectangle(dc
, rect
,
500 m_active_caption_colour
,
501 m_active_caption_gradient_colour
,
504 // on other platforms, active gradients become lighter at the top
505 DrawGradientRectangle(dc
, rect
,
506 m_active_caption_gradient_colour
,
507 m_active_caption_colour
,
514 // on mac the gradients are expected to become darker from the top
515 DrawGradientRectangle(dc
, rect
,
516 m_inactive_caption_gradient_colour
,
517 m_inactive_caption_colour
,
520 // on other platforms, inactive gradients become lighter at the bottom
521 DrawGradientRectangle(dc
, rect
,
522 m_inactive_caption_colour
,
523 m_inactive_caption_gradient_colour
,
531 void wxAuiDefaultDockArt
::DrawCaption(wxDC
& dc
, wxWindow
*WXUNUSED(window
),
532 const wxString
& text
,
536 dc
.SetPen(*wxTRANSPARENT_PEN
);
537 dc
.SetFont(m_caption_font
);
539 DrawCaptionBackground(dc
, rect
,
540 (pane
.state
& wxAuiPaneInfo
::optionActive
)?
true:false);
542 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
543 dc
.SetTextForeground(m_active_caption_text_colour
);
545 dc
.SetTextForeground(m_inactive_caption_text_colour
);
549 dc
.GetTextExtent(wxT("ABCDEFHXfgkj"), &w
, &h
);
551 wxRect clip_rect
= rect
;
552 clip_rect
.width
-= 3; // text offset
553 clip_rect
.width
-= 2; // button padding
554 if (pane
.HasCloseButton())
555 clip_rect
.width
-= m_button_size
;
556 if (pane
.HasPinButton())
557 clip_rect
.width
-= m_button_size
;
558 if (pane
.HasMaximizeButton())
559 clip_rect
.width
-= m_button_size
;
561 wxString draw_text
= wxAuiChopText(dc
, text
, clip_rect
.width
);
563 dc
.SetClippingRegion(clip_rect
);
564 dc
.DrawText(draw_text
, rect
.x
+3, rect
.y
+(rect
.height
/2)-(h
/2)-1);
565 dc
.DestroyClippingRegion();
568 void wxAuiDefaultDockArt
::DrawGripper(wxDC
& dc
, wxWindow
*WXUNUSED(window
),
572 dc
.SetPen(*wxTRANSPARENT_PEN
);
573 dc
.SetBrush(m_gripper_brush
);
575 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
,rect
.height
);
577 if (!pane
.HasGripperTop())
582 dc
.SetPen(m_gripper_pen1
);
583 dc
.DrawPoint(rect
.x
+3, rect
.y
+y
);
584 dc
.SetPen(m_gripper_pen2
);
585 dc
.DrawPoint(rect
.x
+3, rect
.y
+y
+1);
586 dc
.DrawPoint(rect
.x
+4, rect
.y
+y
);
587 dc
.SetPen(m_gripper_pen3
);
588 dc
.DrawPoint(rect
.x
+5, rect
.y
+y
+1);
589 dc
.DrawPoint(rect
.x
+5, rect
.y
+y
+2);
590 dc
.DrawPoint(rect
.x
+4, rect
.y
+y
+2);
593 if (y
> rect
.GetHeight()-5)
602 dc
.SetPen(m_gripper_pen1
);
603 dc
.DrawPoint(rect
.x
+x
, rect
.y
+3);
604 dc
.SetPen(m_gripper_pen2
);
605 dc
.DrawPoint(rect
.x
+x
+1, rect
.y
+3);
606 dc
.DrawPoint(rect
.x
+x
, rect
.y
+4);
607 dc
.SetPen(m_gripper_pen3
);
608 dc
.DrawPoint(rect
.x
+x
+1, rect
.y
+5);
609 dc
.DrawPoint(rect
.x
+x
+2, rect
.y
+5);
610 dc
.DrawPoint(rect
.x
+x
+2, rect
.y
+4);
613 if (x
> rect
.GetWidth()-5)
619 void wxAuiDefaultDockArt
::DrawPaneButton(wxDC
& dc
, wxWindow
*WXUNUSED(window
),
631 case wxAUI_BUTTON_CLOSE
:
632 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
633 bmp
= m_active_close_bitmap
;
635 bmp
= m_inactive_close_bitmap
;
637 case wxAUI_BUTTON_PIN
:
638 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
639 bmp
= m_active_pin_bitmap
;
641 bmp
= m_inactive_pin_bitmap
;
643 case wxAUI_BUTTON_MAXIMIZE_RESTORE
:
644 if (pane
.IsMaximized())
646 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
647 bmp
= m_active_restore_bitmap
;
649 bmp
= m_inactive_restore_bitmap
;
653 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
654 bmp
= m_active_maximize_bitmap
;
656 bmp
= m_inactive_maximize_bitmap
;
665 rect
.y
= rect
.y
+ (rect
.height
/2) - (bmp
.GetHeight()/2);
666 rect
.height
= old_y
+ rect
.height
- rect
.y
- 1;
669 if (button_state
== wxAUI_BUTTON_STATE_PRESSED
)
675 if (button_state
== wxAUI_BUTTON_STATE_HOVER
||
676 button_state
== wxAUI_BUTTON_STATE_PRESSED
)
678 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
680 dc
.SetBrush(wxBrush(m_active_caption_colour
.ChangeLightness(120)));
681 dc
.SetPen(wxPen(m_active_caption_colour
.ChangeLightness(70)));
685 dc
.SetBrush(wxBrush(m_inactive_caption_colour
.ChangeLightness(120)));
686 dc
.SetPen(wxPen(m_inactive_caption_colour
.ChangeLightness(70)));
689 // draw the background behind the button
690 dc
.DrawRectangle(rect
.x
, rect
.y
, 15, 15);
694 // draw the button itself
695 dc
.DrawBitmap(bmp
, rect
.x
, rect
.y
, true);