Add wxRenderer::GetHeaderButtonMargin().
Used for best size calculations of column width. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -200,6 +200,9 @@ public:
|
|||||||
// height if available, or a generic height based on the window's font.
|
// height if available, or a generic height based on the window's font.
|
||||||
virtual int GetHeaderButtonHeight(wxWindow *win) = 0;
|
virtual int GetHeaderButtonHeight(wxWindow *win) = 0;
|
||||||
|
|
||||||
|
// Returns the margin on left and right sides of header button's label
|
||||||
|
virtual int GetHeaderButtonMargin(wxWindow *win) = 0;
|
||||||
|
|
||||||
|
|
||||||
// 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,
|
||||||
@@ -401,6 +404,9 @@ public:
|
|||||||
virtual int GetHeaderButtonHeight(wxWindow *win)
|
virtual int GetHeaderButtonHeight(wxWindow *win)
|
||||||
{ return m_rendererNative.GetHeaderButtonHeight(win); }
|
{ return m_rendererNative.GetHeaderButtonHeight(win); }
|
||||||
|
|
||||||
|
virtual int GetHeaderButtonMargin(wxWindow *win)
|
||||||
|
{ return m_rendererNative.GetHeaderButtonMargin(win); }
|
||||||
|
|
||||||
virtual void DrawTreeItemButton(wxWindow *win,
|
virtual void DrawTreeItemButton(wxWindow *win,
|
||||||
wxDC& dc,
|
wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
|
@@ -204,6 +204,8 @@ public:
|
|||||||
|
|
||||||
virtual int GetHeaderButtonHeight(wxWindow *win);
|
virtual int GetHeaderButtonHeight(wxWindow *win);
|
||||||
|
|
||||||
|
virtual int GetHeaderButtonMargin(wxWindow *win);
|
||||||
|
|
||||||
virtual void DrawTreeItemButton(wxWindow *win, wxDC& dc,
|
virtual void DrawTreeItemButton(wxWindow *win, wxDC& dc,
|
||||||
const wxRect& rect, int flags = 0);
|
const wxRect& rect, int flags = 0);
|
||||||
|
|
||||||
@@ -494,6 +496,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual int GetHeaderButtonHeight(wxWindow* win) = 0;
|
virtual int GetHeaderButtonHeight(wxWindow* win) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns the horizontal margin on the left and right sides of header
|
||||||
|
button's label.
|
||||||
|
|
||||||
|
@since 2.9.2
|
||||||
|
*/
|
||||||
|
virtual int GetHeaderButtonMargin(wxWindow *win) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get the splitter parameters, see wxSplitterRenderParams.
|
Get the splitter parameters, see wxSplitterRenderParams.
|
||||||
The @a win parameter should be a wxSplitterWindow.
|
The @a win parameter should be a wxSplitterWindow.
|
||||||
|
@@ -67,6 +67,8 @@ public:
|
|||||||
|
|
||||||
virtual int GetHeaderButtonHeight(wxWindow *win);
|
virtual int GetHeaderButtonHeight(wxWindow *win);
|
||||||
|
|
||||||
|
virtual int GetHeaderButtonMargin(wxWindow *win);
|
||||||
|
|
||||||
virtual void DrawTreeItemButton(wxWindow *win,
|
virtual void DrawTreeItemButton(wxWindow *win,
|
||||||
wxDC& dc,
|
wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
@@ -445,6 +447,11 @@ int wxRendererGeneric::GetHeaderButtonHeight(wxWindow *win)
|
|||||||
return h + d + 2 * HEADER_OFFSET_Y + EXTRA_HEIGHT;
|
return h + d + 2 * HEADER_OFFSET_Y + EXTRA_HEIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int wxRendererGeneric::GetHeaderButtonMargin(wxWindow *WXUNUSED(win))
|
||||||
|
{
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// draw the plus or minus sign
|
// draw the plus or minus sign
|
||||||
void
|
void
|
||||||
|
@@ -56,6 +56,8 @@ public:
|
|||||||
|
|
||||||
virtual int GetHeaderButtonHeight(wxWindow *win);
|
virtual int GetHeaderButtonHeight(wxWindow *win);
|
||||||
|
|
||||||
|
virtual int GetHeaderButtonMargin(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,
|
||||||
@@ -226,6 +228,12 @@ int wxRendererGTK::GetHeaderButtonHeight(wxWindow *WXUNUSED(win))
|
|||||||
return req.height;
|
return req.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int wxRendererGTK::GetHeaderButtonMargin(wxWindow *WXUNUSED(win))
|
||||||
|
{
|
||||||
|
wxFAIL_MSG( "GetHeaderButtonMargin() not implemented" );
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// draw a ">" or "v" button
|
// draw a ">" or "v" button
|
||||||
void
|
void
|
||||||
|
@@ -197,6 +197,8 @@ public:
|
|||||||
|
|
||||||
virtual int GetHeaderButtonHeight(wxWindow *win);
|
virtual int GetHeaderButtonHeight(wxWindow *win);
|
||||||
|
|
||||||
|
virtual int GetHeaderButtonMargin(wxWindow *win);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// wrapper of DrawFrameControl()
|
// wrapper of DrawFrameControl()
|
||||||
void DoDrawFrameControl(UINT type,
|
void DoDrawFrameControl(UINT type,
|
||||||
@@ -517,6 +519,11 @@ int wxRendererMSW::GetHeaderButtonHeight(wxWindow * WXUNUSED(win))
|
|||||||
return Header_Layout(hwndHeader, &hdl) ? wp.cy : DEFAULT_HEIGHT;
|
return Header_Layout(hwndHeader, &hdl) ? wp.cy : DEFAULT_HEIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int wxRendererMSW::GetHeaderButtonMargin(wxWindow *WXUNUSED(win))
|
||||||
|
{
|
||||||
|
return 10;
|
||||||
|
}
|
||||||
|
|
||||||
// Uses the theme to draw the border and fill for something like a wxTextCtrl
|
// Uses the theme to draw the border and fill for something like a wxTextCtrl
|
||||||
void wxRendererMSW::DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, int flags)
|
void wxRendererMSW::DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, int flags)
|
||||||
{
|
{
|
||||||
|
@@ -62,6 +62,8 @@ public:
|
|||||||
|
|
||||||
virtual int GetHeaderButtonHeight(wxWindow *win);
|
virtual int GetHeaderButtonHeight(wxWindow *win);
|
||||||
|
|
||||||
|
virtual int GetHeaderButtonMargin(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,
|
||||||
@@ -225,6 +227,12 @@ int wxRendererMac::GetHeaderButtonHeight(wxWindow* WXUNUSED(win))
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int wxRendererMac::GetHeaderButtonMargin(wxWindow *WXUNUSED(win))
|
||||||
|
{
|
||||||
|
wxFAIL_MSG( "GetHeaderButtonMargin() not implemented" );
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
void wxRendererMac::DrawTreeItemButton( wxWindow *win,
|
void wxRendererMac::DrawTreeItemButton( wxWindow *win,
|
||||||
wxDC& dc,
|
wxDC& dc,
|
||||||
const wxRect& rect,
|
const wxRect& rect,
|
||||||
|
Reference in New Issue
Block a user