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/mac/private.h"
39 #include "wx/graphics.h"
44 #include "wx/gtk/win_gtk.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()
59 wxColor
wxAuiStepColour(const wxColor
& c
, int percent
)
61 int r
= c
.Red(), g
= c
.Green(), b
= c
.Blue();
62 return wxColour((unsigned char)wxMin((r
*percent
)/100,255),
63 (unsigned char)wxMin((g
*percent
)/100,255),
64 (unsigned char)wxMin((b
*percent
)/100,255));
67 wxColor
wxAuiLightContrastColour(const wxColour
& c
)
71 // if the color is especially dark, then
72 // make the contrast even lighter
73 if (c
.Red() < 128 && c
.Green() < 128 && c
.Blue() < 128)
76 return wxAuiStepColour(c
, amount
);
79 // wxAuiBitmapFromBits() is a utility function that creates a
80 // masked bitmap from raw bits (XBM format)
81 wxBitmap
wxAuiBitmapFromBits(const unsigned char bits
[], int w
, int h
,
82 const wxColour
& color
)
84 wxImage img
= wxBitmap((const char*)bits
, w
, h
).ConvertToImage();
85 img
.Replace(0,0,0,123,123,123);
86 img
.Replace(255,255,255,color
.Red(),color
.Green(),color
.Blue());
87 img
.SetMaskColour(123,123,123);
92 static void DrawGradientRectangle(wxDC
& dc
,
94 const wxColour
& start_color
,
95 const wxColour
& end_color
,
98 int rd
, gd
, bd
, high
= 0;
99 rd
= end_color
.Red() - start_color
.Red();
100 gd
= end_color
.Green() - start_color
.Green();
101 bd
= end_color
.Blue() - start_color
.Blue();
103 if (direction
== wxAUI_GRADIENT_VERTICAL
)
104 high
= rect
.GetHeight()-1;
106 high
= rect
.GetWidth()-1;
108 for (int i
= 0; i
<= high
; ++i
)
113 r
= start_color
.Red() + ((i
*rd
*100)/high
)/100;
114 g
= start_color
.Green() + ((i
*gd
*100)/high
)/100;
115 b
= start_color
.Blue() + ((i
*bd
*100)/high
)/100;
117 wxPen
p(wxColor((unsigned char)r
,
122 if (direction
== wxAUI_GRADIENT_VERTICAL
)
123 dc
.DrawLine(rect
.x
, rect
.y
+i
, rect
.x
+rect
.width
, rect
.y
+i
);
125 dc
.DrawLine(rect
.x
+i
, rect
.y
, rect
.x
+i
, rect
.y
+rect
.height
);
129 wxString
wxAuiChopText(wxDC
& dc
, const wxString
& text
, int max_size
)
133 // first check if the text fits with no problems
134 dc
.GetTextExtent(text
, &x
, &y
);
138 size_t i
, len
= text
.Length();
139 size_t last_good_length
= 0;
140 for (i
= 0; i
< len
; ++i
)
142 wxString s
= text
.Left(i
);
145 dc
.GetTextExtent(s
, &x
, &y
);
149 last_good_length
= i
;
152 wxString ret
= text
.Left(last_good_length
);
157 wxAuiDefaultDockArt
::wxAuiDefaultDockArt()
160 wxBrush toolbarbrush
;
161 toolbarbrush
.MacSetTheme( kThemeBrushToolbarBackground
);
162 wxColor base_colour
= toolbarbrush
.GetColour();
164 wxColor base_colour
= wxSystemSettings
::GetColour(wxSYS_COLOUR_3DFACE
);
167 m_base_colour
= base_colour
;
168 wxColor darker1_colour
= wxAuiStepColour(base_colour
, 85);
169 wxColor darker2_colour
= wxAuiStepColour(base_colour
, 70);
170 wxColor darker3_colour
= wxAuiStepColour(base_colour
, 60);
171 wxColor darker4_colour
= wxAuiStepColour(base_colour
, 50);
172 wxColor darker5_colour
= wxAuiStepColour(base_colour
, 40);
174 m_active_caption_colour
= wxSystemSettings
::GetColour(wxSYS_COLOUR_HIGHLIGHT
);
175 m_active_caption_gradient_colour
= wxAuiLightContrastColour(wxSystemSettings
::GetColour(wxSYS_COLOUR_HIGHLIGHT
));
176 m_active_caption_text_colour
= wxSystemSettings
::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT
);
177 m_inactive_caption_colour
= darker1_colour
;
178 m_inactive_caption_gradient_colour
= wxAuiStepColour(base_colour
, 97);
179 m_inactive_caption_text_colour
= *wxBLACK
;
182 m_sash_brush
= toolbarbrush
;
183 m_background_brush
= toolbarbrush
;
184 m_gripper_brush
= toolbarbrush
;
186 m_sash_brush
= wxBrush(base_colour
);
187 m_background_brush
= wxBrush(base_colour
);
188 m_gripper_brush
= wxBrush(base_colour
);
190 m_border_pen
= wxPen(darker2_colour
);
191 m_gripper_pen1
= wxPen(darker5_colour
);
192 m_gripper_pen2
= wxPen(darker3_colour
);
193 m_gripper_pen3
= *wxWHITE_PEN
;
196 m_caption_font
= *wxSMALL_FONT
;
198 m_caption_font
= wxFont(8, wxDEFAULT
, wxNORMAL
, wxNORMAL
, FALSE
);
201 // some built in bitmaps
202 #if defined( __WXMAC__ )
203 static unsigned char close_bits
[]={
204 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFE, 0x03, 0xF8, 0x01, 0xF0, 0x19, 0xF3,
205 0xB8, 0xE3, 0xF0, 0xE1, 0xE0, 0xE0, 0xF0, 0xE1, 0xB8, 0xE3, 0x19, 0xF3,
206 0x01, 0xF0, 0x03, 0xF8, 0x0F, 0xFE, 0xFF, 0xFF };
207 #elif defined( __WXGTK__)
208 static unsigned char close_bits
[]={
209 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xfb, 0xef, 0xdb, 0xed, 0x8b, 0xe8,
210 0x1b, 0xec, 0x3b, 0xee, 0x1b, 0xec, 0x8b, 0xe8, 0xdb, 0xed, 0xfb, 0xef,
211 0x07, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
213 static unsigned char close_bits
[]={
214 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xf3, 0xcf, 0xf9,
215 0x9f, 0xfc, 0x3f, 0xfe, 0x3f, 0xfe, 0x9f, 0xfc, 0xcf, 0xf9, 0xe7, 0xf3,
216 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
219 static unsigned char maximize_bits
[] = {
220 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xf7, 0xf7, 0x07, 0xf0,
221 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0x07, 0xf0,
222 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
224 static unsigned char restore_bits
[]={
225 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf0, 0x1f, 0xf0, 0xdf, 0xf7,
226 0x07, 0xf4, 0x07, 0xf4, 0xf7, 0xf5, 0xf7, 0xf1, 0xf7, 0xfd, 0xf7, 0xfd,
227 0x07, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
229 static unsigned char pin_bits
[]={
230 0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xfc,0xdf,0xfc,0xdf,0xfc,
231 0xdf,0xfc,0xdf,0xfc,0xdf,0xfc,0x0f,0xf8,0x7f,0xff,0x7f,0xff,
232 0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
235 m_inactive_close_bitmap
= wxAuiBitmapFromBits(close_bits
, 16, 16, *wxWHITE
);
236 m_active_close_bitmap
= wxAuiBitmapFromBits(close_bits
, 16, 16, *wxWHITE
);
238 m_inactive_close_bitmap
= wxAuiBitmapFromBits(close_bits
, 16, 16, m_inactive_caption_text_colour
);
239 m_active_close_bitmap
= wxAuiBitmapFromBits(close_bits
, 16, 16, m_active_caption_text_colour
);
243 m_inactive_maximize_bitmap
= wxAuiBitmapFromBits(maximize_bits
, 16, 16, *wxWHITE
);
244 m_active_maximize_bitmap
= wxAuiBitmapFromBits(maximize_bits
, 16, 16, *wxWHITE
);
246 m_inactive_maximize_bitmap
= wxAuiBitmapFromBits(maximize_bits
, 16, 16, m_inactive_caption_text_colour
);
247 m_active_maximize_bitmap
= wxAuiBitmapFromBits(maximize_bits
, 16, 16, m_active_caption_text_colour
);
251 m_inactive_restore_bitmap
= wxAuiBitmapFromBits(restore_bits
, 16, 16, *wxWHITE
);
252 m_active_restore_bitmap
= wxAuiBitmapFromBits(restore_bits
, 16, 16, *wxWHITE
);
254 m_inactive_restore_bitmap
= wxAuiBitmapFromBits(restore_bits
, 16, 16, m_inactive_caption_text_colour
);
255 m_active_restore_bitmap
= wxAuiBitmapFromBits(restore_bits
, 16, 16, m_active_caption_text_colour
);
258 m_inactive_pin_bitmap
= wxAuiBitmapFromBits(pin_bits
, 16, 16, m_inactive_caption_text_colour
);
259 m_active_pin_bitmap
= wxAuiBitmapFromBits(pin_bits
, 16, 16, m_active_caption_text_colour
);
261 // default metric values
262 #if defined(__WXMAC__)
264 GetThemeMetric( kThemeMetricSmallPaneSplitterHeight
, &height
);
265 m_sash_size
= height
;
266 #elif defined(__WXGTK__)
267 m_sash_size
= wxRendererNative
::Get().GetSplitterParams(NULL
).widthSash
;
275 m_gradient_type
= wxAUI_GRADIENT_VERTICAL
;
278 int wxAuiDefaultDockArt
::GetMetric(int id
)
282 case wxAUI_ART_SASH_SIZE
: return m_sash_size
;
283 case wxAUI_ART_CAPTION_SIZE
: return m_caption_size
;
284 case wxAUI_ART_GRIPPER_SIZE
: return m_gripper_size
;
285 case wxAUI_ART_PANE_BORDER_SIZE
: return m_border_size
;
286 case wxAUI_ART_PANE_BUTTON_SIZE
: return m_button_size
;
287 case wxAUI_ART_GRADIENT_TYPE
: return m_gradient_type
;
288 default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break;
294 void wxAuiDefaultDockArt
::SetMetric(int id
, int new_val
)
298 case wxAUI_ART_SASH_SIZE
: m_sash_size
= new_val
; break;
299 case wxAUI_ART_CAPTION_SIZE
: m_caption_size
= new_val
; break;
300 case wxAUI_ART_GRIPPER_SIZE
: m_gripper_size
= new_val
; break;
301 case wxAUI_ART_PANE_BORDER_SIZE
: m_border_size
= new_val
; break;
302 case wxAUI_ART_PANE_BUTTON_SIZE
: m_button_size
= new_val
; break;
303 case wxAUI_ART_GRADIENT_TYPE
: m_gradient_type
= new_val
; break;
304 default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break;
308 wxColour wxAuiDefaultDockArt
::GetColour(int id
)
312 case wxAUI_ART_BACKGROUND_COLOUR
: return m_background_brush
.GetColour();
313 case wxAUI_ART_SASH_COLOUR
: return m_sash_brush
.GetColour();
314 case wxAUI_ART_INACTIVE_CAPTION_COLOUR
: return m_inactive_caption_colour
;
315 case wxAUI_ART_INACTIVE_CAPTION_GRADIENT_COLOUR
: return m_inactive_caption_gradient_colour
;
316 case wxAUI_ART_INACTIVE_CAPTION_TEXT_COLOUR
: return m_inactive_caption_text_colour
;
317 case wxAUI_ART_ACTIVE_CAPTION_COLOUR
: return m_active_caption_colour
;
318 case wxAUI_ART_ACTIVE_CAPTION_GRADIENT_COLOUR
: return m_active_caption_gradient_colour
;
319 case wxAUI_ART_ACTIVE_CAPTION_TEXT_COLOUR
: return m_active_caption_text_colour
;
320 case wxAUI_ART_BORDER_COLOUR
: return m_border_pen
.GetColour();
321 case wxAUI_ART_GRIPPER_COLOUR
: return m_gripper_brush
.GetColour();
322 default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break;
328 void wxAuiDefaultDockArt
::SetColour(int id
, const wxColor
& colour
)
332 case wxAUI_ART_BACKGROUND_COLOUR
: m_background_brush
.SetColour(colour
); break;
333 case wxAUI_ART_SASH_COLOUR
: m_sash_brush
.SetColour(colour
); break;
334 case wxAUI_ART_INACTIVE_CAPTION_COLOUR
: m_inactive_caption_colour
= colour
; break;
335 case wxAUI_ART_INACTIVE_CAPTION_GRADIENT_COLOUR
: m_inactive_caption_gradient_colour
= colour
; break;
336 case wxAUI_ART_INACTIVE_CAPTION_TEXT_COLOUR
: m_inactive_caption_text_colour
= colour
; break;
337 case wxAUI_ART_ACTIVE_CAPTION_COLOUR
: m_active_caption_colour
= colour
; break;
338 case wxAUI_ART_ACTIVE_CAPTION_GRADIENT_COLOUR
: m_active_caption_gradient_colour
= colour
; break;
339 case wxAUI_ART_ACTIVE_CAPTION_TEXT_COLOUR
: m_active_caption_text_colour
= colour
; break;
340 case wxAUI_ART_BORDER_COLOUR
: m_border_pen
.SetColour(colour
); break;
341 case wxAUI_ART_GRIPPER_COLOUR
:
342 m_gripper_brush
.SetColour(colour
);
343 m_gripper_pen1
.SetColour(wxAuiStepColour(colour
, 40));
344 m_gripper_pen2
.SetColour(wxAuiStepColour(colour
, 60));
346 default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break;
350 void wxAuiDefaultDockArt
::SetFont(int id
, const wxFont
& font
)
352 if (id
== wxAUI_ART_CAPTION_FONT
)
353 m_caption_font
= font
;
356 wxFont wxAuiDefaultDockArt
::GetFont(int id
)
358 if (id
== wxAUI_ART_CAPTION_FONT
)
359 return m_caption_font
;
363 void wxAuiDefaultDockArt
::DrawSash(wxDC
& dc
, wxWindow
*window
, int orientation
, const wxRect
& rect
)
365 #if defined(__WXMAC__)
366 HIRect splitterRect
= CGRectMake( rect
.x
, rect
.y
, rect
.width
, rect
.height
);
367 CGContextRef cgContext
;
368 #if wxMAC_USE_CORE_GRAPHICS
369 cgContext
= (CGContextRef
) dc
.GetGraphicsContext()->GetNativeContext() ;
372 GetPortBounds( (CGrafPtr
) dc
.m_macPort
, &bounds
) ;
373 QDBeginCGContext( (CGrafPtr
) dc
.m_macPort
, &cgContext
) ;
374 CGContextTranslateCTM( cgContext
, 0 , bounds
.bottom
- bounds
.top
) ;
375 CGContextScaleCTM( cgContext
, 1 , -1 ) ;
378 HIThemeSplitterDrawInfo drawInfo
;
379 drawInfo
.version
= 0 ;
380 drawInfo
.state
= kThemeStateActive
;
381 drawInfo
.adornment
= kHIThemeSplitterAdornmentNone
;
382 HIThemeDrawPaneSplitter( &splitterRect
, &drawInfo
, cgContext
, kHIThemeOrientationNormal
) ;
384 #if wxMAC_USE_CORE_GRAPHICS
386 QDEndCGContext( (CGrafPtr
) dc
.m_macPort
, &cgContext
) ;
389 #elif defined(__WXGTK__)
390 // clear out the rectangle first
391 dc
.SetPen(*wxTRANSPARENT_PEN
);
392 dc
.SetBrush(m_sash_brush
);
393 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
395 GdkRectangle gdk_rect
;
396 if (orientation
== wxVERTICAL
)
400 gdk_rect
.width
= m_sash_size
;
401 gdk_rect
.height
= rect
.height
;
407 gdk_rect
.width
= rect
.width
;
408 gdk_rect
.height
= m_sash_size
;
412 if (!window
->m_wxwindow
) return;
413 if (!GTK_PIZZA(window
->m_wxwindow
)->bin_window
) return;
417 window
->m_wxwindow
->style
,
418 GTK_PIZZA(window
->m_wxwindow
)->bin_window
,
419 // flags & wxCONTROL_CURRENT ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL,
422 NULL
/* no clipping */,
429 (orientation
== wxVERTICAL
) ? GTK_ORIENTATION_VERTICAL
: GTK_ORIENTATION_HORIZONTAL
434 wxUnusedVar(orientation
);
435 dc
.SetPen(*wxTRANSPARENT_PEN
);
436 dc
.SetBrush(m_sash_brush
);
437 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
442 void wxAuiDefaultDockArt
::DrawBackground(wxDC
& dc
, wxWindow
*WXUNUSED(window
), int, const wxRect
& rect
)
444 dc
.SetPen(*wxTRANSPARENT_PEN
);
446 // we have to clear first, otherwise we are drawing a light striped pattern
447 // over an already darker striped background
448 dc
.SetBrush(*wxWHITE_BRUSH
) ;
449 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
451 dc
.SetBrush(m_background_brush
);
452 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
455 void wxAuiDefaultDockArt
::DrawBorder(wxDC
& dc
, wxWindow
*WXUNUSED(window
), const wxRect
& _rect
,
458 dc
.SetPen(m_border_pen
);
459 dc
.SetBrush(*wxTRANSPARENT_BRUSH
);
462 int i
, border_width
= GetMetric(wxAUI_ART_PANE_BORDER_SIZE
);
464 if (pane
.IsToolbar())
466 for (i
= 0; i
< border_width
; ++i
)
468 dc
.SetPen(*wxWHITE_PEN
);
469 dc
.DrawLine(rect
.x
, rect
.y
, rect
.x
+rect
.width
, rect
.y
);
470 dc
.DrawLine(rect
.x
, rect
.y
, rect
.x
, rect
.y
+rect
.height
);
471 dc
.SetPen(m_border_pen
);
472 dc
.DrawLine(rect
.x
, rect
.y
+rect
.height
-1,
473 rect
.x
+rect
.width
, rect
.y
+rect
.height
-1);
474 dc
.DrawLine(rect
.x
+rect
.width
-1, rect
.y
,
475 rect
.x
+rect
.width
-1, rect
.y
+rect
.height
);
481 for (i
= 0; i
< border_width
; ++i
)
483 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
490 void wxAuiDefaultDockArt
::DrawCaptionBackground(wxDC
& dc
, const wxRect
& rect
, bool active
)
492 if (m_gradient_type
== wxAUI_GRADIENT_NONE
)
495 dc
.SetBrush(wxBrush(m_active_caption_colour
));
497 dc
.SetBrush(wxBrush(m_inactive_caption_colour
));
499 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
505 // on mac the gradients are expected to become darker from the top
507 DrawGradientRectangle(dc
, rect
,
508 m_active_caption_colour
,
509 m_active_caption_gradient_colour
,
512 // on other platforms, active gradients become lighter at the top
513 DrawGradientRectangle(dc
, rect
,
514 m_active_caption_gradient_colour
,
515 m_active_caption_colour
,
522 // on mac the gradients are expected to become darker from the top
523 DrawGradientRectangle(dc
, rect
,
524 m_inactive_caption_gradient_colour
,
525 m_inactive_caption_colour
,
528 // on other platforms, inactive gradients become lighter at the bottom
529 DrawGradientRectangle(dc
, rect
,
530 m_inactive_caption_colour
,
531 m_inactive_caption_gradient_colour
,
539 void wxAuiDefaultDockArt
::DrawCaption(wxDC
& dc
, wxWindow
*WXUNUSED(window
),
540 const wxString
& text
,
544 dc
.SetPen(*wxTRANSPARENT_PEN
);
545 dc
.SetFont(m_caption_font
);
547 DrawCaptionBackground(dc
, rect
,
548 (pane
.state
& wxAuiPaneInfo
::optionActive
)?
true:false);
550 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
551 dc
.SetTextForeground(m_active_caption_text_colour
);
553 dc
.SetTextForeground(m_inactive_caption_text_colour
);
557 dc
.GetTextExtent(wxT("ABCDEFHXfgkj"), &w
, &h
);
559 wxRect clip_rect
= rect
;
560 clip_rect
.width
-= 3; // text offset
561 clip_rect
.width
-= 2; // button padding
562 if (pane
.HasCloseButton())
563 clip_rect
.width
-= m_button_size
;
564 if (pane
.HasPinButton())
565 clip_rect
.width
-= m_button_size
;
566 if (pane
.HasMaximizeButton())
567 clip_rect
.width
-= m_button_size
;
569 wxString draw_text
= wxAuiChopText(dc
, text
, clip_rect
.width
);
571 dc
.SetClippingRegion(clip_rect
);
572 dc
.DrawText(draw_text
, rect
.x
+3, rect
.y
+(rect
.height
/2)-(h
/2)-1);
573 dc
.DestroyClippingRegion();
576 void wxAuiDefaultDockArt
::DrawGripper(wxDC
& dc
, wxWindow
*WXUNUSED(window
),
580 dc
.SetPen(*wxTRANSPARENT_PEN
);
581 dc
.SetBrush(m_gripper_brush
);
583 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
,rect
.height
);
585 if (!pane
.HasGripperTop())
590 dc
.SetPen(m_gripper_pen1
);
591 dc
.DrawPoint(rect
.x
+3, rect
.y
+y
);
592 dc
.SetPen(m_gripper_pen2
);
593 dc
.DrawPoint(rect
.x
+3, rect
.y
+y
+1);
594 dc
.DrawPoint(rect
.x
+4, rect
.y
+y
);
595 dc
.SetPen(m_gripper_pen3
);
596 dc
.DrawPoint(rect
.x
+5, rect
.y
+y
+1);
597 dc
.DrawPoint(rect
.x
+5, rect
.y
+y
+2);
598 dc
.DrawPoint(rect
.x
+4, rect
.y
+y
+2);
601 if (y
> rect
.GetHeight()-5)
610 dc
.SetPen(m_gripper_pen1
);
611 dc
.DrawPoint(rect
.x
+x
, rect
.y
+3);
612 dc
.SetPen(m_gripper_pen2
);
613 dc
.DrawPoint(rect
.x
+x
+1, rect
.y
+3);
614 dc
.DrawPoint(rect
.x
+x
, rect
.y
+4);
615 dc
.SetPen(m_gripper_pen3
);
616 dc
.DrawPoint(rect
.x
+x
+1, rect
.y
+5);
617 dc
.DrawPoint(rect
.x
+x
+2, rect
.y
+5);
618 dc
.DrawPoint(rect
.x
+x
+2, rect
.y
+4);
621 if (x
> rect
.GetWidth()-5)
627 void wxAuiDefaultDockArt
::DrawPaneButton(wxDC
& dc
, wxWindow
*WXUNUSED(window
),
635 if (button_state
== wxAUI_BUTTON_STATE_PRESSED
)
641 if (button_state
== wxAUI_BUTTON_STATE_HOVER
||
642 button_state
== wxAUI_BUTTON_STATE_PRESSED
)
644 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
646 dc
.SetBrush(wxBrush(wxAuiStepColour(m_active_caption_colour
, 120)));
647 dc
.SetPen(wxPen(wxAuiStepColour(m_active_caption_colour
, 70)));
651 dc
.SetBrush(wxBrush(wxAuiStepColour(m_inactive_caption_colour
, 120)));
652 dc
.SetPen(wxPen(wxAuiStepColour(m_inactive_caption_colour
, 70)));
655 // draw the background behind the button
656 dc
.DrawRectangle(rect
.x
, rect
.y
, 15, 15);
663 case wxAUI_BUTTON_MAXIMIZE_RESTORE
:
664 if (pane
.IsMaximized()) {
665 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
666 bmp
= m_active_restore_bitmap
;
668 bmp
= m_inactive_restore_bitmap
;
670 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
671 bmp
= m_active_maximize_bitmap
;
673 bmp
= m_inactive_maximize_bitmap
;
676 case wxAUI_BUTTON_CLOSE
:
677 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
678 bmp
= m_active_close_bitmap
;
680 bmp
= m_inactive_close_bitmap
;
682 case wxAUI_BUTTON_PIN
:
683 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
684 bmp
= m_active_pin_bitmap
;
686 bmp
= m_inactive_pin_bitmap
;
690 // draw the button itself
691 dc
.DrawBitmap(bmp
, rect
.x
, rect
.y
, true);