46 if( !wxControl::Create( aParent, aId, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxDefaultValidator,
47 wxT(
"COLLAPSIBLE_PANE_HEADER" ) ) )
52 m_sizer =
new wxBoxSizer( wxVERTICAL );
58 m_pane =
new wxPanel(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxNO_BORDER,
59 wxT(
"COLLAPSIBLE_PANE_PANEL" ) );
233 if( !wxControl::Create( aParent, aId, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxDefaultValidator,
234 wxT(
"COLLAPSIBLE_PANE_HEADER" ) ) )
296 wxPaintDC dc(
this );
297 wxRect rect( wxPoint( 0, 0 ), GetClientSize() );
300 wxBrush brush = dc.GetBrush();
301 brush.SetColour( GetParent()->GetBackgroundColour() );
302 dc.SetBrush( brush );
303 dc.SetPen( *wxTRANSPARENT_PEN );
304 dc.DrawRectangle( rect );
311 wxColor highlightColor = wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT );
313 dc.SetPen( wxPen( highlightColor ) );
314 dc.SetBrush( wxBrush( highlightColor.ChangeLightness( darkMode ? 40 : 170 ) ) );
315 dc.DrawRectangle( rect );
319 int indexAccel = wxControl::FindAccelIndex( GetLabel(), &
text );
322 wxSize textSize = dc.GetTextExtent(
text );
323 wxRect arrowRect( 0, 0, textSize.GetHeight(), textSize.GetHeight() );
324 wxRect textRect( arrowRect.GetRight() +
m_parent->GetMargin(), 0, textSize.GetWidth(), textSize.GetHeight() );
326 arrowRect = arrowRect.CenterIn( rect, wxVERTICAL );
327 textRect = textRect.CenterIn( rect, wxVERTICAL );
330 bool isActive =
true;
331 wxTopLevelWindow* tlw =
dynamic_cast<wxTopLevelWindow*
>( wxGetTopLevelParent(
this ) );
333 if( tlw && !tlw->IsActive() )
340 wxColour clr = isActive ? wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT )
341 : wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT );
343 dc.SetTextForeground( clr );
344 dc.DrawLabel(
text, textRect, wxALIGN_CENTER_VERTICAL, indexAccel );
350 flags |= wxCONTROL_CURRENT;
352 int focusSize = GetSystemMetrics( SM_CXFOCUSBORDER );
355 wxRendererNative::Get().DrawFocusRect(
this, dc, textRect.Inflate( focusSize ), flags );
411 wxPoint btmCorner( aRect.GetLeft() + aRect.GetWidth() / 2, aRect.GetTop() + 3 * aRect.GetHeight() / 4 );
414 wxPoint rtCorner( aRect.GetLeft() + 3 * aRect.GetWidth() / 4, aRect.GetTop() + aRect.GetHeight() / 2 );
417 wxPoint otherCorner( 0, 0 );
420 otherCorner = wxPoint( aRect.GetLeft() + aRect.GetWidth() / 2, aRect.GetTop() + aRect.GetHeight() / 4 );
422 otherCorner = wxPoint( aRect.GetLeft() + aRect.GetWidth() / 4, aRect.GetTop() + aRect.GetHeight() / 2 );
433 wxColour clr = aIsActive ? wxSystemSettings::GetColour( wxSYS_COLOUR_HOTLIGHT )
434 : wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT );
437 aDC.SetPen( wxPen( clr ) );
438 aDC.SetBrush( wxBrush( clr ) );
442 points.Append( &btmCorner );
443 points.Append( &rtCorner );
444 points.Append( &otherCorner );
446 aDC.DrawPolygon( &points );