Lines 12-19
Link Here
|
12 |
#include <wx/wx.h> |
12 |
#include <wx/wx.h> |
13 |
#include <wx/minifram.h> |
13 |
#include <wx/minifram.h> |
14 |
#include <wx/image.h> |
14 |
#include <wx/image.h> |
|
|
15 |
#include <wx/renderer.h> |
16 |
|
15 |
#include "manager.h" |
17 |
#include "manager.h" |
16 |
|
18 |
|
|
|
19 |
#ifndef __WIN32__ |
20 |
#undef wxUSE_UXTHEME |
21 |
#endif |
22 |
|
23 |
#if wxUSE_UXTHEME |
24 |
#include "wx/msw/uxtheme.h" // XP theme handling |
25 |
#endif |
17 |
|
26 |
|
18 |
// -- various array and event implementations -- |
27 |
// -- various array and event implementations -- |
19 |
|
28 |
|
Lines 49-66
Link Here
|
49 |
wxMin((g*percent)/100,255), |
58 |
wxMin((g*percent)/100,255), |
50 |
wxMin((b*percent)/100,255)); |
59 |
wxMin((b*percent)/100,255)); |
51 |
} |
60 |
} |
52 |
|
61 |
|
53 |
static wxColor LightContrastColour(const wxColour& c) |
62 |
static wxColor LightContrastColour(const wxColour& c) |
54 |
{ |
63 |
{ |
55 |
int amount = 120; |
64 |
int amount = 120; |
56 |
|
65 |
|
57 |
// if the color is especially dark, then |
66 |
// if the color is especially dark, then |
58 |
// make the contrast even lighter |
67 |
// make the contrast even lighter |
59 |
if (c.Red() < 128 && c.Green() < 128 && c.Blue() < 128) |
68 |
if (c.Red() < 128 && c.Green() < 128 && c.Blue() < 128) |
60 |
amount = 160; |
69 |
amount = 160; |
61 |
|
70 |
|
62 |
return StepColour(c, amount); |
71 |
return StepColour(c, amount); |
63 |
} |
72 |
} |
64 |
|
73 |
|
65 |
// BitmapFromBits() is a utility function that creates a |
74 |
// BitmapFromBits() is a utility function that creates a |
66 |
// masked bitmap from raw bits (XBM format) |
75 |
// masked bitmap from raw bits (XBM format) |
Lines 122-128
Link Here
|
122 |
m_active_caption_text_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); |
131 |
m_active_caption_text_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); |
123 |
m_inactive_caption_colour = StepColour(darker1_color, 80); |
132 |
m_inactive_caption_colour = StepColour(darker1_color, 80); |
124 |
m_inactive_caption_gradient_colour = darker1_color; |
133 |
m_inactive_caption_gradient_colour = darker1_color; |
125 |
m_inactive_caption_text_colour = *wxBLACK; |
134 |
m_inactive_caption_text_colour = *wxBLACK; |
126 |
|
135 |
|
127 |
m_sash_brush = wxBrush(base_color); |
136 |
m_sash_brush = wxBrush(base_color); |
128 |
m_background_brush = wxBrush(base_color); |
137 |
m_background_brush = wxBrush(base_color); |
Lines 153-160
Link Here
|
153 |
// default metric values |
162 |
// default metric values |
154 |
m_sash_size = 4; |
163 |
m_sash_size = 4; |
155 |
m_caption_size = 17; |
164 |
m_caption_size = 17; |
|
|
165 |
m_caption_text_indent = 3; |
156 |
m_border_size = 1; |
166 |
m_border_size = 1; |
157 |
m_button_size = 14; |
167 |
m_button_size = 14; |
|
|
168 |
m_button_border_size = 0; |
158 |
m_gripper_size = 9; |
169 |
m_gripper_size = 9; |
159 |
m_gradient_type = wxAUI_GRADIENT_VERTICAL; |
170 |
m_gradient_type = wxAUI_GRADIENT_VERTICAL; |
160 |
} |
171 |
} |
Lines 163-175
Link Here
|
163 |
{ |
174 |
{ |
164 |
switch (id) |
175 |
switch (id) |
165 |
{ |
176 |
{ |
166 |
case wxAUI_ART_SASH_SIZE: return m_sash_size; |
177 |
case wxAUI_ART_SASH_SIZE: return m_sash_size; |
167 |
case wxAUI_ART_CAPTION_SIZE: return m_caption_size; |
178 |
case wxAUI_ART_CAPTION_SIZE: return m_caption_size; |
168 |
case wxAUI_ART_GRIPPER_SIZE: return m_gripper_size; |
179 |
case wxAUI_ART_CAPTION_TEXT_INDENT: return m_caption_size; |
169 |
case wxAUI_ART_PANE_BORDER_SIZE: return m_border_size; |
180 |
case wxAUI_ART_GRIPPER_SIZE: return m_gripper_size; |
170 |
case wxAUI_ART_PANE_BUTTON_SIZE: return m_button_size; |
181 |
case wxAUI_ART_PANE_BORDER_SIZE: return m_border_size; |
171 |
case wxAUI_ART_GRADIENT_TYPE: return m_gradient_type; |
182 |
case wxAUI_ART_PANE_BUTTON_SIZE: return m_button_size; |
172 |
default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break; |
183 |
case wxAUI_ART_PANE_BUTTON_BORDER_SIZE: return m_button_border_size; |
|
|
184 |
case wxAUI_ART_GRADIENT_TYPE: return m_gradient_type; |
185 |
default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break; |
173 |
} |
186 |
} |
174 |
|
187 |
|
175 |
return 0; |
188 |
return 0; |
Lines 179-191
Link Here
|
179 |
{ |
192 |
{ |
180 |
switch (id) |
193 |
switch (id) |
181 |
{ |
194 |
{ |
182 |
case wxAUI_ART_SASH_SIZE: m_sash_size = new_val; break; |
195 |
case wxAUI_ART_SASH_SIZE: m_sash_size = new_val; break; |
183 |
case wxAUI_ART_CAPTION_SIZE: m_caption_size = new_val; break; |
196 |
case wxAUI_ART_CAPTION_SIZE: m_caption_size = new_val; break; |
184 |
case wxAUI_ART_GRIPPER_SIZE: m_gripper_size = new_val; break; |
197 |
case wxAUI_ART_CAPTION_TEXT_INDENT: m_caption_text_indent = new_val; break; |
185 |
case wxAUI_ART_PANE_BORDER_SIZE: m_border_size = new_val; break; |
198 |
case wxAUI_ART_GRIPPER_SIZE: m_gripper_size = new_val; break; |
186 |
case wxAUI_ART_PANE_BUTTON_SIZE: m_button_size = new_val; break; |
199 |
case wxAUI_ART_PANE_BORDER_SIZE: m_border_size = new_val; break; |
187 |
case wxAUI_ART_GRADIENT_TYPE: m_gradient_type = new_val; break; |
200 |
case wxAUI_ART_PANE_BUTTON_SIZE: m_button_size = new_val; break; |
188 |
default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break; |
201 |
case wxAUI_ART_PANE_BUTTON_BORDER_SIZE: m_button_border_size = new_val; break; |
|
|
202 |
case wxAUI_ART_GRADIENT_TYPE: m_gradient_type = new_val; break; |
203 |
default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break; |
189 |
} |
204 |
} |
190 |
} |
205 |
} |
191 |
|
206 |
|
Lines 328-334
Link Here
|
328 |
void wxDefaultDockArt::DrawCaption(wxDC& dc, |
343 |
void wxDefaultDockArt::DrawCaption(wxDC& dc, |
329 |
const wxString& text, |
344 |
const wxString& text, |
330 |
const wxRect& rect, |
345 |
const wxRect& rect, |
331 |
wxPaneInfo& pane) |
346 |
wxPaneInfo& pane, unsigned int flags) |
332 |
{ |
347 |
{ |
333 |
dc.SetPen(*wxTRANSPARENT_PEN); |
348 |
dc.SetPen(*wxTRANSPARENT_PEN); |
334 |
dc.SetFont(m_caption_font); |
349 |
dc.SetFont(m_caption_font); |
Lines 346-352
Link Here
|
346 |
dc.GetTextExtent(wxT("ABCDEFHXfgkj"), &w, &h); |
361 |
dc.GetTextExtent(wxT("ABCDEFHXfgkj"), &w, &h); |
347 |
|
362 |
|
348 |
dc.SetClippingRegion(rect); |
363 |
dc.SetClippingRegion(rect); |
349 |
dc.DrawText(text, rect.x+3, rect.y+(rect.height/2)-(h/2)-1); |
364 |
dc.DrawText(text, rect.x+m_caption_text_indent, rect.y+(rect.height/2)-(h/2)-1); |
350 |
dc.DestroyClippingRegion(); |
365 |
dc.DestroyClippingRegion(); |
351 |
} |
366 |
} |
352 |
|
367 |
|
Lines 382-388
Link Here
|
382 |
int button, |
397 |
int button, |
383 |
int button_state, |
398 |
int button_state, |
384 |
const wxRect& _rect, |
399 |
const wxRect& _rect, |
385 |
wxPaneInfo& pane) |
400 |
wxPaneInfo& pane, unsigned int flags) |
386 |
{ |
401 |
{ |
387 |
wxRect rect = _rect; |
402 |
wxRect rect = _rect; |
388 |
|
403 |
|
Lines 394-409
Link Here
|
394 |
|
409 |
|
395 |
if (button_state == wxAUI_BUTTON_STATE_HOVER || |
410 |
if (button_state == wxAUI_BUTTON_STATE_HOVER || |
396 |
button_state == wxAUI_BUTTON_STATE_PRESSED) |
411 |
button_state == wxAUI_BUTTON_STATE_PRESSED) |
397 |
{ |
412 |
{ |
398 |
if (pane.state & wxPaneInfo::optionActive) |
413 |
if (pane.state & wxPaneInfo::optionActive) |
399 |
{ |
414 |
{ |
400 |
dc.SetBrush(wxBrush(StepColour(m_active_caption_colour, 120))); |
415 |
dc.SetBrush(wxBrush(StepColour(m_active_caption_colour, 120))); |
401 |
dc.SetPen(wxPen(StepColour(m_active_caption_colour, 70))); |
416 |
dc.SetPen(wxPen(StepColour(m_active_caption_colour, 70))); |
402 |
} |
417 |
} |
403 |
else |
418 |
else |
404 |
{ |
419 |
{ |
405 |
dc.SetBrush(wxBrush(StepColour(m_inactive_caption_colour, 120))); |
420 |
dc.SetBrush(wxBrush(StepColour(m_inactive_caption_colour, 120))); |
406 |
dc.SetPen(wxPen(StepColour(m_inactive_caption_colour, 70))); |
421 |
dc.SetPen(wxPen(StepColour(m_inactive_caption_colour, 70))); |
407 |
} |
422 |
} |
408 |
|
423 |
|
409 |
// draw the background behind the button |
424 |
// draw the background behind the button |
Lines 1607-1612
Link Here
|
1607 |
int gripper_size = m_art->GetMetric(wxAUI_ART_GRIPPER_SIZE); |
1622 |
int gripper_size = m_art->GetMetric(wxAUI_ART_GRIPPER_SIZE); |
1608 |
int pane_border_size = m_art->GetMetric(wxAUI_ART_PANE_BORDER_SIZE); |
1623 |
int pane_border_size = m_art->GetMetric(wxAUI_ART_PANE_BORDER_SIZE); |
1609 |
int pane_button_size = m_art->GetMetric(wxAUI_ART_PANE_BUTTON_SIZE); |
1624 |
int pane_button_size = m_art->GetMetric(wxAUI_ART_PANE_BUTTON_SIZE); |
|
|
1625 |
int pane_button_border_size = m_art->GetMetric(wxAUI_ART_PANE_BUTTON_BORDER_SIZE); |
1610 |
|
1626 |
|
1611 |
// find out the orientation of the item (orientation for panes |
1627 |
// find out the orientation of the item (orientation for panes |
1612 |
// is the same as the dock's orientation) |
1628 |
// is the same as the dock's orientation) |
Lines 1661-1669
Link Here
|
1661 |
{ |
1677 |
{ |
1662 |
wxPaneButton& button = pane.buttons.Item(i); |
1678 |
wxPaneButton& button = pane.buttons.Item(i); |
1663 |
|
1679 |
|
1664 |
sizer_item = caption_sizer->Add(pane_button_size, |
1680 |
sizer_item = caption_sizer->Add(pane_button_size, pane_button_size, 0, wxALIGN_TOP|wxTOP|wxRIGHT|wxBOTTOM, pane_button_border_size); |
1665 |
caption_size, |
|
|
1666 |
0, wxEXPAND); |
1667 |
|
1681 |
|
1668 |
part.type = wxDockUIPart::typePaneButton; |
1682 |
part.type = wxDockUIPart::typePaneButton; |
1669 |
part.dock = &dock; |
1683 |
part.dock = &dock; |
Lines 3214-3230
Link Here
|
3214 |
} |
3228 |
} |
3215 |
|
3229 |
|
3216 |
return; |
3230 |
return; |
3217 |
} |
|
|
3218 |
|
3219 |
|
3220 |
// if a key modifier is pressed while dragging the frame, |
3221 |
// don't dock the window |
3222 |
if (wxGetKeyState(WXK_ALT)) |
3223 |
{ |
3224 |
HideHint(); |
3225 |
return; |
3226 |
} |
3231 |
} |
3227 |
|
3232 |
|
|
|
3233 |
|
3234 |
// if a key modifier is pressed while dragging the frame, |
3235 |
// don't dock the window |
3236 |
if (wxGetKeyState(WXK_ALT)) |
3237 |
{ |
3238 |
HideHint(); |
3239 |
return; |
3240 |
} |
3241 |
|
3228 |
|
3242 |
|
3229 |
DrawHintRect(wnd, client_pt, action_offset); |
3243 |
DrawHintRect(wnd, client_pt, action_offset); |
3230 |
|
3244 |
|
Lines 3253-3268
Link Here
|
3253 |
// of the frame to the mouse pointer |
3267 |
// of the frame to the mouse pointer |
3254 |
wxPoint frame_pos = pane.frame->GetPosition(); |
3268 |
wxPoint frame_pos = pane.frame->GetPosition(); |
3255 |
wxPoint action_offset(pt.x-frame_pos.x, pt.y-frame_pos.y); |
3269 |
wxPoint action_offset(pt.x-frame_pos.x, pt.y-frame_pos.y); |
3256 |
|
3270 |
|
3257 |
|
3271 |
|
3258 |
// if a key modifier is pressed while dragging the frame, |
3272 |
// if a key modifier is pressed while dragging the frame, |
3259 |
// don't dock the window |
3273 |
// don't dock the window |
3260 |
if (wxGetKeyState(WXK_ALT)) |
3274 |
if (wxGetKeyState(WXK_ALT)) |
3261 |
{ |
3275 |
{ |
3262 |
HideHint(); |
3276 |
HideHint(); |
3263 |
return; |
3277 |
return; |
3264 |
} |
3278 |
} |
3265 |
|
3279 |
|
3266 |
|
3280 |
|
3267 |
// do the drop calculation |
3281 |
// do the drop calculation |
3268 |
DoDrop(m_docks, m_panes, pane, client_pt, action_offset); |
3282 |
DoDrop(m_docks, m_panes, pane, client_pt, action_offset); |
Lines 3346-3364
Link Here
|
3346 |
break; |
3360 |
break; |
3347 |
case wxDockUIPart::typeBackground: |
3361 |
case wxDockUIPart::typeBackground: |
3348 |
m_art->DrawBackground(*dc, part.orientation, part.rect); |
3362 |
m_art->DrawBackground(*dc, part.orientation, part.rect); |
|
|
3363 |
break; |
3364 |
case wxDockUIPart::typePaneBorder: |
3365 |
m_art->DrawBorder(*dc, part.rect, *part.pane); |
3349 |
break; |
3366 |
break; |
3350 |
case wxDockUIPart::typeCaption: |
3367 |
case wxDockUIPart::typeCaption: |
3351 |
m_art->DrawCaption(*dc, part.pane->caption, part.rect, *part.pane); |
3368 |
m_art->DrawCaption(*dc, part.pane->caption, part.rect, *part.pane, m_flags); |
3352 |
break; |
3369 |
break; |
3353 |
case wxDockUIPart::typeGripper: |
3370 |
case wxDockUIPart::typeGripper: |
3354 |
m_art->DrawGripper(*dc, part.rect, *part.pane); |
3371 |
m_art->DrawGripper(*dc, part.rect, *part.pane); |
3355 |
break; |
3372 |
break; |
3356 |
case wxDockUIPart::typePaneBorder: |
|
|
3357 |
m_art->DrawBorder(*dc, part.rect, *part.pane); |
3358 |
break; |
3359 |
case wxDockUIPart::typePaneButton: |
3373 |
case wxDockUIPart::typePaneButton: |
3360 |
m_art->DrawPaneButton(*dc, part.button->button_id, |
3374 |
m_art->DrawPaneButton(*dc, part.button->button_id, |
3361 |
wxAUI_BUTTON_STATE_NORMAL, part.rect, *part.pane); |
3375 |
wxAUI_BUTTON_STATE_NORMAL, part.rect, *part.pane, m_flags); |
3362 |
break; |
3376 |
break; |
3363 |
} |
3377 |
} |
3364 |
} |
3378 |
} |
Lines 3484-3490
Link Here
|
3484 |
button_ui_part->button->button_id, |
3498 |
button_ui_part->button->button_id, |
3485 |
state, |
3499 |
state, |
3486 |
button_ui_part->rect, |
3500 |
button_ui_part->rect, |
3487 |
*hit_test->pane); |
3501 |
*hit_test->pane, m_flags); |
3488 |
} |
3502 |
} |
3489 |
|
3503 |
|
3490 |
void wxFrameManager::OnLeftDown(wxMouseEvent& event) |
3504 |
void wxFrameManager::OnLeftDown(wxMouseEvent& event) |
Lines 3982-3984
Link Here
|
3982 |
Update(); |
3996 |
Update(); |
3983 |
} |
3997 |
} |
3984 |
} |
3998 |
} |
|
|
3999 |
|
4000 |
|
4001 |
ModernDockArt::ModernDockArt(wxWindow* win) : wxDefaultDockArt(), m_win(win) |
4002 |
{ |
4003 |
bool usingTheme = false; |
4004 |
|
4005 |
// Get the size of a small close button (themed) |
4006 |
#if wxUSE_UXTHEME |
4007 |
if (wxUxThemeEngine::Get()) |
4008 |
{ |
4009 |
wxUxThemeHandle hTheme(m_win, L"WINDOW"); |
4010 |
if (hTheme) |
4011 |
{ |
4012 |
usingTheme = true; |
4013 |
|
4014 |
wxClientDC dc(m_win); |
4015 |
HDC hdc = GetHdcOf(dc); |
4016 |
wxSize size(13, 15); |
4017 |
SIZE sz; |
4018 |
wxUxThemeEngine::Get()->GetThemePartSize(hTheme, hdc, 19 /*WP_SMALLCLOSEBUTTON*/, |
4019 |
1 /* CBS_NORMAL */, NULL, TS_TRUE, &sz); |
4020 |
|
4021 |
m_button_size = sz.cx; |
4022 |
} |
4023 |
} |
4024 |
#endif // wxUSE_UXTHEME |
4025 |
|
4026 |
m_button_border_size = 3; |
4027 |
m_caption_text_indent = 6; |
4028 |
m_caption_size = 22; |
4029 |
|
4030 |
// We only highlight the active pane with the caption text being in bold. |
4031 |
// So we do not want a special colour for active elements. |
4032 |
m_active_caption_colour = m_inactive_caption_colour; |
4033 |
m_active_close_bitmap = m_inactive_close_bitmap; |
4034 |
}; |
4035 |
|
4036 |
void ModernDockArt::DrawCaption(wxDC& dc, |
4037 |
const wxString& text, |
4038 |
const wxRect& rect, |
4039 |
wxPaneInfo& pane, unsigned int flags) |
4040 |
{ |
4041 |
dc.SetPen(*wxTRANSPARENT_PEN); |
4042 |
|
4043 |
DrawCaptionBackground(dc, rect, |
4044 |
(pane.state & wxPaneInfo::optionActive)?true:false, flags); |
4045 |
|
4046 |
// Active captions are drawn with bold text |
4047 |
// if (pane.state & wxPaneInfo::optionActive) |
4048 |
m_caption_font.SetWeight(wxFONTWEIGHT_BOLD); |
4049 |
// else |
4050 |
//m_caption_font.SetWeight(wxFONTWEIGHT_NORMAL); |
4051 |
dc.SetFont(m_caption_font); |
4052 |
|
4053 |
m_active_caption_text_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); |
4054 |
dc.SetTextForeground(m_active_caption_text_colour); |
4055 |
|
4056 |
wxCoord w,h; |
4057 |
dc.GetTextExtent(wxT("ABCDEFHXfgkj"), &w, &h); |
4058 |
|
4059 |
dc.SetClippingRegion(rect); |
4060 |
dc.DrawText(text, rect.x+m_caption_text_indent, rect.y+(rect.height/2)-(h/2)-1); |
4061 |
dc.DestroyClippingRegion(); |
4062 |
} |
4063 |
|
4064 |
void ModernDockArt::DrawCaptionBackground(wxDC& dc, |
4065 |
const wxRect& rect, |
4066 |
bool active, unsigned int flags) |
4067 |
{ |
4068 |
// Clear the background |
4069 |
dc.SetBrush(m_background_brush); |
4070 |
dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height); |
4071 |
|
4072 |
bool usingTheme = false; |
4073 |
|
4074 |
#if wxUSE_UXTHEME |
4075 |
|
4076 |
if (wxUxThemeEngine::Get()) |
4077 |
{ |
4078 |
wxUxThemeHandle hTheme(m_win, L"WINDOW"); |
4079 |
|
4080 |
if (hTheme) |
4081 |
{ |
4082 |
usingTheme = true; |
4083 |
|
4084 |
RECT rc; |
4085 |
wxRect rectangle = rect; |
4086 |
rectangle.x--; |
4087 |
rectangle.y--; |
4088 |
rectangle.width+=2; |
4089 |
rectangle.height+=2; |
4090 |
wxCopyRectToRECT(rectangle, rc); |
4091 |
|
4092 |
if( active || !(flags & wxAUI_MGR_ALLOW_ACTIVE_PANE) ) |
4093 |
wxUxThemeEngine::Get()->DrawThemeBackground(hTheme, GetHdcOf(dc), 5, 1, &rc, NULL); |
4094 |
else |
4095 |
wxUxThemeEngine::Get()->DrawThemeBackground(hTheme, GetHdcOf(dc), 5, 2, &rc, NULL); |
4096 |
} |
4097 |
} |
4098 |
|
4099 |
#endif |
4100 |
|
4101 |
if (!usingTheme) wxRendererNative::Get().DrawHeaderButton(m_win, dc, rect, wxCONTROL_FOCUSED); |
4102 |
} |
4103 |
|
4104 |
|
4105 |
void ModernDockArt::DrawPaneButton(wxDC& dc,int button, |
4106 |
int button_state, |
4107 |
const wxRect& _rect, |
4108 |
wxPaneInfo& pane, unsigned int flags) |
4109 |
{ |
4110 |
bool usingTheme = false; |
4111 |
|
4112 |
#if wxUSE_UXTHEME |
4113 |
if (wxUxThemeEngine::Get()) |
4114 |
{ |
4115 |
wxUxThemeHandle hTheme(m_win, L"WINDOW"); |
4116 |
if (hTheme) |
4117 |
{ |
4118 |
usingTheme = true; |
4119 |
|
4120 |
// Get the real button position (compensating for borders) |
4121 |
const wxRect rect(_rect.x, _rect.y+m_button_border_size, m_button_size, m_button_size); |
4122 |
|
4123 |
// Draw the themed close button |
4124 |
RECT rc; |
4125 |
wxCopyRectToRECT(rect, rc); |
4126 |
|
4127 |
int state = 4; // CBS_DISABLED |
4128 |
|
4129 |
if( (pane.state & wxPaneInfo::optionActive) || !(flags & wxAUI_MGR_ALLOW_ACTIVE_PANE) ) // active pane |
4130 |
{ |
4131 |
switch (button_state) |
4132 |
{ |
4133 |
case wxAUI_BUTTON_STATE_NORMAL: |
4134 |
state = 1; // CBS_NORMAL |
4135 |
break; |
4136 |
case wxAUI_BUTTON_STATE_HOVER: |
4137 |
state = 2; // CBS_HOT |
4138 |
break; |
4139 |
case wxAUI_BUTTON_STATE_PRESSED: |
4140 |
state = 3; // CBS_PUSHED |
4141 |
break; |
4142 |
default: |
4143 |
wxASSERT_MSG(false, wxT("Unknown state")); |
4144 |
} |
4145 |
} |
4146 |
else // inactive pane |
4147 |
{ |
4148 |
switch (button_state) |
4149 |
{ |
4150 |
case wxAUI_BUTTON_STATE_NORMAL: |
4151 |
state = 5; // CBS_NORMAL |
4152 |
break; |
4153 |
case wxAUI_BUTTON_STATE_HOVER: |
4154 |
state = 6; // CBS_HOT |
4155 |
break; |
4156 |
case wxAUI_BUTTON_STATE_PRESSED: |
4157 |
state = 7; // CBS_PUSHED |
4158 |
break; |
4159 |
default: |
4160 |
wxASSERT_MSG(false, wxT("Unknown state")); |
4161 |
} |
4162 |
} |
4163 |
|
4164 |
wxUxThemeEngine::Get()->DrawThemeBackground(hTheme, GetHdcOf(dc), 19 /*WP_SMALLCLOSEBUTTON*/, |
4165 |
state, &rc, NULL); |
4166 |
|
4167 |
} |
4168 |
} |
4169 |
#endif // wxUSE_UXTHEME |
4170 |
|
4171 |
// Fallback to default closebutton if themes are not enabled |
4172 |
if (!usingTheme) wxDefaultDockArt::DrawPaneButton(dc, button, button_state, _rect, pane); |
4173 |
} |