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 // StepColour() it a utility function that simply darkens
60 // or lightens a color, based on the specified percentage
61 static wxColor
StepColour(const wxColor
& c
, int percent
)
63 int r
= c
.Red(), g
= c
.Green(), b
= c
.Blue();
64 return wxColour((unsigned char)wxMin((r
*percent
)/100,255),
65 (unsigned char)wxMin((g
*percent
)/100,255),
66 (unsigned char)wxMin((b
*percent
)/100,255));
69 static wxColor
LightContrastColour(const wxColour
& c
)
73 // if the color is especially dark, then
74 // make the contrast even lighter
75 if (c
.Red() < 128 && c
.Green() < 128 && c
.Blue() < 128)
78 return StepColour(c
, amount
);
81 // BitmapFromBits() is a utility function that creates a
82 // masked bitmap from raw bits (XBM format)
83 static wxBitmap
BitmapFromBits(const unsigned char bits
[], int w
, int h
,
84 const wxColour
& color
)
86 wxImage img
= wxBitmap((const char*)bits
, w
, h
).ConvertToImage();
87 img
.Replace(0,0,0,123,123,123);
88 img
.Replace(255,255,255,color
.Red(),color
.Green(),color
.Blue());
89 img
.SetMaskColour(123,123,123);
94 static void DrawGradientRectangle(wxDC
& dc
,
96 const wxColour
& start_color
,
97 const wxColour
& end_color
,
100 int rd
, gd
, bd
, high
= 0;
101 rd
= end_color
.Red() - start_color
.Red();
102 gd
= end_color
.Green() - start_color
.Green();
103 bd
= end_color
.Blue() - start_color
.Blue();
105 if (direction
== wxAUI_GRADIENT_VERTICAL
)
106 high
= rect
.GetHeight()-1;
108 high
= rect
.GetWidth()-1;
110 for (int i
= 0; i
<= high
; ++i
)
115 r
= start_color
.Red() + ((i
*rd
*100)/high
)/100;
116 g
= start_color
.Green() + ((i
*gd
*100)/high
)/100;
117 b
= start_color
.Blue() + ((i
*bd
*100)/high
)/100;
119 wxPen
p(wxColor((unsigned char)r
,
124 if (direction
== wxAUI_GRADIENT_VERTICAL
)
125 dc
.DrawLine(rect
.x
, rect
.y
+i
, rect
.x
+rect
.width
, rect
.y
+i
);
127 dc
.DrawLine(rect
.x
+i
, rect
.y
, rect
.x
+i
, rect
.y
+rect
.height
);
132 wxAuiDefaultDockArt
::wxAuiDefaultDockArt()
135 wxBrush toolbarbrush
;
136 toolbarbrush
.MacSetTheme( kThemeBrushToolbarBackground
);
137 wxColor base_colour
= toolbarbrush
.GetColour();
139 wxColor base_colour
= wxSystemSettings
::GetColour(wxSYS_COLOUR_3DFACE
);
142 m_base_colour
= base_colour
;
143 wxColor darker1_colour
= StepColour(base_colour
, 85);
144 wxColor darker2_colour
= StepColour(base_colour
, 70);
145 wxColor darker3_colour
= StepColour(base_colour
, 60);
146 wxColor darker4_colour
= StepColour(base_colour
, 50);
147 wxColor darker5_colour
= StepColour(base_colour
, 40);
149 m_active_caption_colour
= wxSystemSettings
::GetColour(wxSYS_COLOUR_HIGHLIGHT
);
150 m_active_caption_gradient_colour
= LightContrastColour(wxSystemSettings
::GetColour(wxSYS_COLOUR_HIGHLIGHT
));
151 m_active_caption_text_colour
= wxSystemSettings
::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT
);
152 m_inactive_caption_colour
= darker1_colour
;
153 m_inactive_caption_gradient_colour
= StepColour(base_colour
, 97);
154 m_inactive_caption_text_colour
= *wxBLACK
;
157 m_sash_brush
= toolbarbrush
;
158 m_background_brush
= toolbarbrush
;
159 m_gripper_brush
= toolbarbrush
;
161 m_sash_brush
= wxBrush(base_colour
);
162 m_background_brush
= wxBrush(base_colour
);
163 m_gripper_brush
= wxBrush(base_colour
);
165 m_border_pen
= wxPen(darker2_colour
);
166 m_gripper_pen1
= wxPen(darker5_colour
);
167 m_gripper_pen2
= wxPen(darker3_colour
);
168 m_gripper_pen3
= *wxWHITE_PEN
;
171 m_caption_font
= *wxSMALL_FONT
;
173 m_caption_font
= wxFont(8, wxDEFAULT
, wxNORMAL
, wxNORMAL
, FALSE
);
176 // some built in bitmaps
177 #if defined( __WXMAC__ )
178 static unsigned char close_bits
[]={
179 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFE, 0x03, 0xF8, 0x01, 0xF0, 0x19, 0xF3,
180 0xB8, 0xE3, 0xF0, 0xE1, 0xE0, 0xE0, 0xF0, 0xE1, 0xB8, 0xE3, 0x19, 0xF3,
181 0x01, 0xF0, 0x03, 0xF8, 0x0F, 0xFE, 0xFF, 0xFF };
183 static unsigned char close_bits
[]={
184 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xf3, 0xcf, 0xf9,
185 0x9f, 0xfc, 0x3f, 0xfe, 0x3f, 0xfe, 0x9f, 0xfc, 0xcf, 0xf9, 0xe7, 0xf3,
186 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
189 static unsigned char maximize_bits
[] = {
190 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xf7, 0xf7, 0x07, 0xf0,
191 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0x07, 0xf0,
192 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
194 static unsigned char restore_bits
[]={
195 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xf0, 0x1f, 0xf0, 0xdf, 0xf7,
196 0x07, 0xf4, 0x07, 0xf4, 0xf7, 0xf5, 0xf7, 0xf1, 0xf7, 0xfd, 0xf7, 0xfd,
197 0x07, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
199 static unsigned char pin_bits
[]={
200 0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xfc,0xdf,0xfc,0xdf,0xfc,
201 0xdf,0xfc,0xdf,0xfc,0xdf,0xfc,0x0f,0xf8,0x7f,0xff,0x7f,0xff,
202 0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
205 m_inactive_close_bitmap
= BitmapFromBits(close_bits
, 16, 16, *wxWHITE
);
206 m_active_close_bitmap
= BitmapFromBits(close_bits
, 16, 16, *wxWHITE
);
208 m_inactive_close_bitmap
= BitmapFromBits(close_bits
, 16, 16, m_inactive_caption_text_colour
);
209 m_active_close_bitmap
= BitmapFromBits(close_bits
, 16, 16, m_active_caption_text_colour
);
213 m_inactive_maximize_bitmap
= BitmapFromBits(maximize_bits
, 16, 16, *wxWHITE
);
214 m_active_maximize_bitmap
= BitmapFromBits(maximize_bits
, 16, 16, *wxWHITE
);
216 m_inactive_maximize_bitmap
= BitmapFromBits(maximize_bits
, 16, 16, m_inactive_caption_text_colour
);
217 m_active_maximize_bitmap
= BitmapFromBits(maximize_bits
, 16, 16, m_active_caption_text_colour
);
221 m_inactive_restore_bitmap
= BitmapFromBits(restore_bits
, 16, 16, *wxWHITE
);
222 m_active_restore_bitmap
= BitmapFromBits(restore_bits
, 16, 16, *wxWHITE
);
224 m_inactive_restore_bitmap
= BitmapFromBits(restore_bits
, 16, 16, m_inactive_caption_text_colour
);
225 m_active_restore_bitmap
= BitmapFromBits(restore_bits
, 16, 16, m_active_caption_text_colour
);
228 m_inactive_pin_bitmap
= BitmapFromBits(pin_bits
, 16, 16, m_inactive_caption_text_colour
);
229 m_active_pin_bitmap
= BitmapFromBits(pin_bits
, 16, 16, m_active_caption_text_colour
);
231 // default metric values
232 #if defined(__WXMAC__)
234 GetThemeMetric( kThemeMetricSmallPaneSplitterHeight
, &height
);
235 m_sash_size
= height
;
236 #elif defined(__WXGTK__)
237 m_sash_size
= wxRendererNative
::Get().GetSplitterParams(NULL
).widthSash
;
245 m_gradient_type
= wxAUI_GRADIENT_VERTICAL
;
248 int wxAuiDefaultDockArt
::GetMetric(int id
)
252 case wxAUI_ART_SASH_SIZE
: return m_sash_size
;
253 case wxAUI_ART_CAPTION_SIZE
: return m_caption_size
;
254 case wxAUI_ART_GRIPPER_SIZE
: return m_gripper_size
;
255 case wxAUI_ART_PANE_BORDER_SIZE
: return m_border_size
;
256 case wxAUI_ART_PANE_BUTTON_SIZE
: return m_button_size
;
257 case wxAUI_ART_GRADIENT_TYPE
: return m_gradient_type
;
258 default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break;
264 void wxAuiDefaultDockArt
::SetMetric(int id
, int new_val
)
268 case wxAUI_ART_SASH_SIZE
: m_sash_size
= new_val
; break;
269 case wxAUI_ART_CAPTION_SIZE
: m_caption_size
= new_val
; break;
270 case wxAUI_ART_GRIPPER_SIZE
: m_gripper_size
= new_val
; break;
271 case wxAUI_ART_PANE_BORDER_SIZE
: m_border_size
= new_val
; break;
272 case wxAUI_ART_PANE_BUTTON_SIZE
: m_button_size
= new_val
; break;
273 case wxAUI_ART_GRADIENT_TYPE
: m_gradient_type
= new_val
; break;
274 default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break;
278 wxColour wxAuiDefaultDockArt
::GetColour(int id
)
282 case wxAUI_ART_BACKGROUND_COLOUR
: return m_background_brush
.GetColour();
283 case wxAUI_ART_SASH_COLOUR
: return m_sash_brush
.GetColour();
284 case wxAUI_ART_INACTIVE_CAPTION_COLOUR
: return m_inactive_caption_colour
;
285 case wxAUI_ART_INACTIVE_CAPTION_GRADIENT_COLOUR
: return m_inactive_caption_gradient_colour
;
286 case wxAUI_ART_INACTIVE_CAPTION_TEXT_COLOUR
: return m_inactive_caption_text_colour
;
287 case wxAUI_ART_ACTIVE_CAPTION_COLOUR
: return m_active_caption_colour
;
288 case wxAUI_ART_ACTIVE_CAPTION_GRADIENT_COLOUR
: return m_active_caption_gradient_colour
;
289 case wxAUI_ART_ACTIVE_CAPTION_TEXT_COLOUR
: return m_active_caption_text_colour
;
290 case wxAUI_ART_BORDER_COLOUR
: return m_border_pen
.GetColour();
291 case wxAUI_ART_GRIPPER_COLOUR
: return m_gripper_brush
.GetColour();
292 default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break;
298 void wxAuiDefaultDockArt
::SetColour(int id
, const wxColor
& colour
)
302 case wxAUI_ART_BACKGROUND_COLOUR
: m_background_brush
.SetColour(colour
); break;
303 case wxAUI_ART_SASH_COLOUR
: m_sash_brush
.SetColour(colour
); break;
304 case wxAUI_ART_INACTIVE_CAPTION_COLOUR
: m_inactive_caption_colour
= colour
; break;
305 case wxAUI_ART_INACTIVE_CAPTION_GRADIENT_COLOUR
: m_inactive_caption_gradient_colour
= colour
; break;
306 case wxAUI_ART_INACTIVE_CAPTION_TEXT_COLOUR
: m_inactive_caption_text_colour
= colour
; break;
307 case wxAUI_ART_ACTIVE_CAPTION_COLOUR
: m_active_caption_colour
= colour
; break;
308 case wxAUI_ART_ACTIVE_CAPTION_GRADIENT_COLOUR
: m_active_caption_gradient_colour
= colour
; break;
309 case wxAUI_ART_ACTIVE_CAPTION_TEXT_COLOUR
: m_active_caption_text_colour
= colour
; break;
310 case wxAUI_ART_BORDER_COLOUR
: m_border_pen
.SetColour(colour
); break;
311 case wxAUI_ART_GRIPPER_COLOUR
:
312 m_gripper_brush
.SetColour(colour
);
313 m_gripper_pen1
.SetColour(StepColour(colour
, 40));
314 m_gripper_pen2
.SetColour(StepColour(colour
, 60));
316 default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break;
320 void wxAuiDefaultDockArt
::SetFont(int id
, const wxFont
& font
)
322 if (id
== wxAUI_ART_CAPTION_FONT
)
323 m_caption_font
= font
;
326 wxFont wxAuiDefaultDockArt
::GetFont(int id
)
328 if (id
== wxAUI_ART_CAPTION_FONT
)
329 return m_caption_font
;
333 void wxAuiDefaultDockArt
::DrawSash(wxDC
& dc
, wxWindow
*window
, int orientation
, const wxRect
& rect
)
335 #if defined(__WXMAC__)
336 HIRect splitterRect
= CGRectMake( rect
.x
, rect
.y
, rect
.width
, rect
.height
);
337 CGContextRef cgContext
;
338 #if wxMAC_USE_CORE_GRAPHICS
339 cgContext
= (CGContextRef
) dc
.GetGraphicsContext()->GetNativeContext() ;
342 GetPortBounds( (CGrafPtr
) dc
.m_macPort
, &bounds
) ;
343 QDBeginCGContext( (CGrafPtr
) dc
.m_macPort
, &cgContext
) ;
344 CGContextTranslateCTM( cgContext
, 0 , bounds
.bottom
- bounds
.top
) ;
345 CGContextScaleCTM( cgContext
, 1 , -1 ) ;
348 HIThemeSplitterDrawInfo drawInfo
;
349 drawInfo
.version
= 0 ;
350 drawInfo
.state
= kThemeStateActive
;
351 drawInfo
.adornment
= kHIThemeSplitterAdornmentNone
;
352 HIThemeDrawPaneSplitter( &splitterRect
, &drawInfo
, cgContext
, kHIThemeOrientationNormal
) ;
354 #if wxMAC_USE_CORE_GRAPHICS
356 QDEndCGContext( (CGrafPtr
) dc
.m_macPort
, &cgContext
) ;
359 #elif defined(__WXGTK__)
361 GdkRectangle gdk_rect
;
362 if (orientation
== wxVERTICAL
)
366 gdk_rect
.width
= m_sash_size
;
367 gdk_rect
.height
= rect
.height
;
373 gdk_rect
.width
= rect
.width
;
374 gdk_rect
.height
= m_sash_size
;
378 if (!window
->m_wxwindow
) return;
379 if (!GTK_PIZZA(window
->m_wxwindow
)->bin_window
) return;
383 window
->m_wxwindow
->style
,
384 GTK_PIZZA(window
->m_wxwindow
)->bin_window
,
385 // flags & wxCONTROL_CURRENT ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL,
388 NULL
/* no clipping */,
395 (orientation
== wxVERTICAL
) ? GTK_ORIENTATION_VERTICAL
: GTK_ORIENTATION_HORIZONTAL
400 wxUnusedVar(orientation
);
401 dc
.SetPen(*wxTRANSPARENT_PEN
);
402 dc
.SetBrush(m_sash_brush
);
403 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
408 void wxAuiDefaultDockArt
::DrawBackground(wxDC
& dc
, wxWindow
*WXUNUSED(window
), int, const wxRect
& rect
)
410 dc
.SetPen(*wxTRANSPARENT_PEN
);
412 // we have to clear first, otherwise we are drawing a light striped pattern
413 // over an already darker striped background
414 dc
.SetBrush(*wxWHITE_BRUSH
) ;
415 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
417 dc
.SetBrush(m_background_brush
);
418 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
421 void wxAuiDefaultDockArt
::DrawBorder(wxDC
& dc
, wxWindow
*WXUNUSED(window
), const wxRect
& _rect
,
424 dc
.SetPen(m_border_pen
);
425 dc
.SetBrush(*wxTRANSPARENT_BRUSH
);
428 int i
, border_width
= GetMetric(wxAUI_ART_PANE_BORDER_SIZE
);
430 if (pane
.IsToolbar())
432 for (i
= 0; i
< border_width
; ++i
)
434 dc
.SetPen(*wxWHITE_PEN
);
435 dc
.DrawLine(rect
.x
, rect
.y
, rect
.x
+rect
.width
, rect
.y
);
436 dc
.DrawLine(rect
.x
, rect
.y
, rect
.x
, rect
.y
+rect
.height
);
437 dc
.SetPen(m_border_pen
);
438 dc
.DrawLine(rect
.x
, rect
.y
+rect
.height
-1,
439 rect
.x
+rect
.width
, rect
.y
+rect
.height
-1);
440 dc
.DrawLine(rect
.x
+rect
.width
-1, rect
.y
,
441 rect
.x
+rect
.width
-1, rect
.y
+rect
.height
);
447 for (i
= 0; i
< border_width
; ++i
)
449 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
456 void wxAuiDefaultDockArt
::DrawCaptionBackground(wxDC
& dc
, const wxRect
& rect
, bool active
)
458 if (m_gradient_type
== wxAUI_GRADIENT_NONE
)
461 dc
.SetBrush(wxBrush(m_active_caption_colour
));
463 dc
.SetBrush(wxBrush(m_inactive_caption_colour
));
465 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
, rect
.height
);
471 // on mac the gradients are expected to become darker from the top
473 DrawGradientRectangle(dc
, rect
,
474 m_active_caption_colour
,
475 m_active_caption_gradient_colour
,
478 // on other platforms, active gradients become lighter at the top
479 DrawGradientRectangle(dc
, rect
,
480 m_active_caption_gradient_colour
,
481 m_active_caption_colour
,
488 // on mac the gradients are expected to become darker from the top
489 DrawGradientRectangle(dc
, rect
,
490 m_inactive_caption_gradient_colour
,
491 m_inactive_caption_colour
,
494 // on other platforms, inactive gradients become lighter at the bottom
495 DrawGradientRectangle(dc
, rect
,
496 m_inactive_caption_colour
,
497 m_inactive_caption_gradient_colour
,
505 void wxAuiDefaultDockArt
::DrawCaption(wxDC
& dc
, wxWindow
*WXUNUSED(window
),
506 const wxString
& text
,
510 dc
.SetPen(*wxTRANSPARENT_PEN
);
511 dc
.SetFont(m_caption_font
);
513 DrawCaptionBackground(dc
, rect
,
514 (pane
.state
& wxAuiPaneInfo
::optionActive
)?
true:false);
516 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
517 dc
.SetTextForeground(m_active_caption_text_colour
);
519 dc
.SetTextForeground(m_inactive_caption_text_colour
);
523 dc
.GetTextExtent(wxT("ABCDEFHXfgkj"), &w
, &h
);
525 dc
.SetClippingRegion(rect
);
526 dc
.DrawText(text
, rect
.x
+3, rect
.y
+(rect
.height
/2)-(h
/2)-1);
527 dc
.DestroyClippingRegion();
530 void wxAuiDefaultDockArt
::DrawGripper(wxDC
& dc
, wxWindow
*WXUNUSED(window
),
534 dc
.SetPen(*wxTRANSPARENT_PEN
);
535 dc
.SetBrush(m_gripper_brush
);
537 dc
.DrawRectangle(rect
.x
, rect
.y
, rect
.width
,rect
.height
);
539 if (!pane
.HasGripperTop())
544 dc
.SetPen(m_gripper_pen1
);
545 dc
.DrawPoint(rect
.x
+3, rect
.y
+y
);
546 dc
.SetPen(m_gripper_pen2
);
547 dc
.DrawPoint(rect
.x
+3, rect
.y
+y
+1);
548 dc
.DrawPoint(rect
.x
+4, rect
.y
+y
);
549 dc
.SetPen(m_gripper_pen3
);
550 dc
.DrawPoint(rect
.x
+5, rect
.y
+y
+1);
551 dc
.DrawPoint(rect
.x
+5, rect
.y
+y
+2);
552 dc
.DrawPoint(rect
.x
+4, rect
.y
+y
+2);
555 if (y
> rect
.GetHeight()-5)
564 dc
.SetPen(m_gripper_pen1
);
565 dc
.DrawPoint(rect
.x
+x
, rect
.y
+3);
566 dc
.SetPen(m_gripper_pen2
);
567 dc
.DrawPoint(rect
.x
+x
+1, rect
.y
+3);
568 dc
.DrawPoint(rect
.x
+x
, rect
.y
+4);
569 dc
.SetPen(m_gripper_pen3
);
570 dc
.DrawPoint(rect
.x
+x
+1, rect
.y
+5);
571 dc
.DrawPoint(rect
.x
+x
+2, rect
.y
+5);
572 dc
.DrawPoint(rect
.x
+x
+2, rect
.y
+4);
575 if (x
> rect
.GetWidth()-5)
581 void wxAuiDefaultDockArt
::DrawPaneButton(wxDC
& dc
, wxWindow
*WXUNUSED(window
),
589 if (button_state
== wxAUI_BUTTON_STATE_PRESSED
)
595 if (button_state
== wxAUI_BUTTON_STATE_HOVER
||
596 button_state
== wxAUI_BUTTON_STATE_PRESSED
)
598 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
600 dc
.SetBrush(wxBrush(StepColour(m_active_caption_colour
, 120)));
601 dc
.SetPen(wxPen(StepColour(m_active_caption_colour
, 70)));
605 dc
.SetBrush(wxBrush(StepColour(m_inactive_caption_colour
, 120)));
606 dc
.SetPen(wxPen(StepColour(m_inactive_caption_colour
, 70)));
609 // draw the background behind the button
610 dc
.DrawRectangle(rect
.x
, rect
.y
, 15, 15);
617 case wxAUI_BUTTON_MAXIMIZE_RESTORE
:
618 if (pane
.IsMaximized()) {
619 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
620 bmp
= m_active_restore_bitmap
;
622 bmp
= m_inactive_restore_bitmap
;
624 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
625 bmp
= m_active_maximize_bitmap
;
627 bmp
= m_inactive_maximize_bitmap
;
630 case wxAUI_BUTTON_CLOSE
:
631 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
632 bmp
= m_active_close_bitmap
;
634 bmp
= m_inactive_close_bitmap
;
636 case wxAUI_BUTTON_PIN
:
637 if (pane
.state
& wxAuiPaneInfo
::optionActive
)
638 bmp
= m_active_pin_bitmap
;
640 bmp
= m_inactive_pin_bitmap
;
644 // draw the button itself
645 dc
.DrawBitmap(bmp
, rect
.x
, rect
.y
, true);