Further header button details
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -554,7 +554,7 @@ void wxHeaderCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
if (i == count-1)
|
if (i == count-1)
|
||||||
{
|
{
|
||||||
colWidth = wxMax( colWidth, vw - xpos );
|
colWidth = wxMax( colWidth, vw - xpos );
|
||||||
state |= wxCONTROL_EXPANDED;
|
state |= wxCONTROL_DIRTY;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -349,6 +349,9 @@ wxRendererGeneric::DrawHeaderButtonContents(wxWindow *win,
|
|||||||
dc.GetTextExtent( label, &tw, &th, &td);
|
dc.GetTextExtent( label, &tw, &th, &td);
|
||||||
labelWidth += tw;
|
labelWidth += tw;
|
||||||
y = rect.y + wxMax(0, (rect.height - (th+td)) / 2);
|
y = rect.y + wxMax(0, (rect.height - (th+td)) / 2);
|
||||||
|
#ifdef __WXGTK__
|
||||||
|
y += 2; // No idea why.
|
||||||
|
#endif
|
||||||
|
|
||||||
// truncate and add an ellipsis (...) if the text is too wide.
|
// truncate and add an ellipsis (...) if the text is too wide.
|
||||||
int targetWidth = rect.width - arrowSpace - bmpWidth - 2*margin;
|
int targetWidth = rect.width - arrowSpace - bmpWidth - 2*margin;
|
||||||
|
@@ -54,6 +54,9 @@ public:
|
|||||||
wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE,
|
wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE,
|
||||||
wxHeaderButtonParams* params = NULL);
|
wxHeaderButtonParams* params = NULL);
|
||||||
|
|
||||||
|
virtual int GetHeaderButtonHeight(wxWindow *win);
|
||||||
|
|
||||||
|
|
||||||
// draw the expanded/collapsed icon for a tree control item
|
// draw the expanded/collapsed icon for a tree control item
|
||||||
virtual void DrawTreeItemButton(wxWindow *win,
|
virtual void DrawTreeItemButton(wxWindow *win,
|
||||||
wxDC& dc,
|
wxDC& dc,
|
||||||
@@ -173,7 +176,7 @@ wxRendererGTK::DrawHeaderButton(wxWindow *win,
|
|||||||
GtkWidget *button = wxGTKPrivate::GetHeaderButtonWidget();
|
GtkWidget *button = wxGTKPrivate::GetHeaderButtonWidget();
|
||||||
if (flags & wxCONTROL_SPECIAL)
|
if (flags & wxCONTROL_SPECIAL)
|
||||||
button = wxGTKPrivate::GetHeaderButtonWidgetFirst();
|
button = wxGTKPrivate::GetHeaderButtonWidgetFirst();
|
||||||
if (flags & wxCONTROL_EXPANDED)
|
if (flags & wxCONTROL_DIRTY)
|
||||||
button = wxGTKPrivate::GetHeaderButtonWidgetLast();
|
button = wxGTKPrivate::GetHeaderButtonWidgetLast();
|
||||||
|
|
||||||
GdkWindow* gdk_window = wxGetGdkWindowForDC(win, dc);
|
GdkWindow* gdk_window = wxGetGdkWindowForDC(win, dc);
|
||||||
@@ -208,6 +211,17 @@ wxRendererGTK::DrawHeaderButton(wxWindow *win,
|
|||||||
return DrawHeaderButtonContents(win, dc, rect, flags, sortArrow, params);
|
return DrawHeaderButtonContents(win, dc, rect, flags, sortArrow, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int wxRendererGTK::GetHeaderButtonHeight(wxWindow *WXUNUSED(win))
|
||||||
|
{
|
||||||
|
GtkWidget *button = wxGTKPrivate::GetHeaderButtonWidget();
|
||||||
|
|
||||||
|
GtkRequisition req;
|
||||||
|
GTK_WIDGET_GET_CLASS(button)->size_request(button, &req);
|
||||||
|
|
||||||
|
return req.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// draw a ">" or "v" button
|
// draw a ">" or "v" button
|
||||||
void
|
void
|
||||||
wxRendererGTK::DrawTreeItemButton(wxWindow* win,
|
wxRendererGTK::DrawTreeItemButton(wxWindow* win,
|
||||||
|
Reference in New Issue
Block a user