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)
|
||||
{
|
||||
colWidth = wxMax( colWidth, vw - xpos );
|
||||
state |= wxCONTROL_EXPANDED;
|
||||
state |= wxCONTROL_DIRTY;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -349,6 +349,9 @@ wxRendererGeneric::DrawHeaderButtonContents(wxWindow *win,
|
||||
dc.GetTextExtent( label, &tw, &th, &td);
|
||||
labelWidth += tw;
|
||||
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.
|
||||
int targetWidth = rect.width - arrowSpace - bmpWidth - 2*margin;
|
||||
|
@@ -54,6 +54,9 @@ public:
|
||||
wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE,
|
||||
wxHeaderButtonParams* params = NULL);
|
||||
|
||||
virtual int GetHeaderButtonHeight(wxWindow *win);
|
||||
|
||||
|
||||
// draw the expanded/collapsed icon for a tree control item
|
||||
virtual void DrawTreeItemButton(wxWindow *win,
|
||||
wxDC& dc,
|
||||
@@ -173,7 +176,7 @@ wxRendererGTK::DrawHeaderButton(wxWindow *win,
|
||||
GtkWidget *button = wxGTKPrivate::GetHeaderButtonWidget();
|
||||
if (flags & wxCONTROL_SPECIAL)
|
||||
button = wxGTKPrivate::GetHeaderButtonWidgetFirst();
|
||||
if (flags & wxCONTROL_EXPANDED)
|
||||
if (flags & wxCONTROL_DIRTY)
|
||||
button = wxGTKPrivate::GetHeaderButtonWidgetLast();
|
||||
|
||||
GdkWindow* gdk_window = wxGetGdkWindowForDC(win, dc);
|
||||
@@ -208,6 +211,17 @@ wxRendererGTK::DrawHeaderButton(wxWindow *win,
|
||||
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
|
||||
void
|
||||
wxRendererGTK::DrawTreeItemButton(wxWindow* win,
|
||||
|
Reference in New Issue
Block a user