Aqua gets Aqua tree buttons automatically now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13021 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
4b614012da
commit
17d5bdf9e9
@ -120,6 +120,7 @@ enum wxTreeItemIcon
|
|||||||
#define wxTR_NO_LINES 0x0004 // don't generate level connectors
|
#define wxTR_NO_LINES 0x0004 // don't generate level connectors
|
||||||
#define wxTR_LINES_AT_ROOT 0x0008 // connect top-level nodes
|
#define wxTR_LINES_AT_ROOT 0x0008 // connect top-level nodes
|
||||||
#define wxTR_MAC_BUTTONS wxTR_TWIST_BUTTONS // backward compatibility
|
#define wxTR_MAC_BUTTONS wxTR_TWIST_BUTTONS // backward compatibility
|
||||||
|
#define wxTR_AQUA_BUTTONS 0x0010 // used internally
|
||||||
|
|
||||||
#define wxTR_SINGLE 0x0000 // for convenience
|
#define wxTR_SINGLE 0x0000 // for convenience
|
||||||
#define wxTR_MULTIPLE 0x0020 // can select multiple items
|
#define wxTR_MULTIPLE 0x0020 // can select multiple items
|
||||||
|
@ -675,8 +675,11 @@ bool wxGenericTreeCtrl::Create(wxWindow *parent,
|
|||||||
style |= wxTR_NO_LINES;
|
style |= wxTR_NO_LINES;
|
||||||
if (major < 10)
|
if (major < 10)
|
||||||
style |= wxTR_ROW_LINES;
|
style |= wxTR_ROW_LINES;
|
||||||
|
if (major >= 10)
|
||||||
|
style |= wxTR_AQUA_BUTTONS;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
wxScrolledWindow::Create( parent, id, pos, size,
|
wxScrolledWindow::Create( parent, id, pos, size,
|
||||||
style|wxHSCROLL|wxVSCROLL, name );
|
style|wxHSCROLL|wxVSCROLL, name );
|
||||||
|
|
||||||
@ -1989,10 +1992,36 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
|
|||||||
else if (HasFlag(wxTR_TWIST_BUTTONS))
|
else if (HasFlag(wxTR_TWIST_BUTTONS))
|
||||||
{
|
{
|
||||||
// draw the twisty button here
|
// draw the twisty button here
|
||||||
dc.SetPen(*wxBLACK_PEN);
|
|
||||||
dc.SetBrush(*m_hilightBrush);
|
|
||||||
|
|
||||||
wxPoint button[3];
|
wxPoint button[3];
|
||||||
|
dc.SetBrush(*m_hilightBrush);
|
||||||
|
|
||||||
|
if (HasFlag(wxTR_AQUA_BUTTONS))
|
||||||
|
{
|
||||||
|
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||||
|
|
||||||
|
if (item->IsExpanded())
|
||||||
|
{
|
||||||
|
button[0].x = x-6;
|
||||||
|
button[0].y = y_mid-2;
|
||||||
|
button[1].x = x+6;
|
||||||
|
button[1].y = y_mid-2;
|
||||||
|
button[2].x = x;
|
||||||
|
button[2].y = y_mid+7;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
button[0].y = y_mid-6;
|
||||||
|
button[0].x = x-2;
|
||||||
|
button[1].y = y_mid+6;
|
||||||
|
button[1].x = x-2;
|
||||||
|
button[2].y = y_mid;
|
||||||
|
button[2].x = x+7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dc.SetPen(*wxBLACK_PEN);
|
||||||
|
|
||||||
if (item->IsExpanded())
|
if (item->IsExpanded())
|
||||||
{
|
{
|
||||||
@ -2012,6 +2041,7 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
|
|||||||
button[2].y = y_mid;
|
button[2].y = y_mid;
|
||||||
button[2].x = x+3;
|
button[2].x = x+3;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
dc.DrawPolygon(3, button);
|
dc.DrawPolygon(3, button);
|
||||||
|
|
||||||
dc.SetPen(m_dottedPen);
|
dc.SetPen(m_dottedPen);
|
||||||
|
Loading…
Reference in New Issue
Block a user