Correct text position in wxDataViewCustomRenderer::RenderText() in wxGTK.

It simply ignored the passed in rectangle meaning that the text was always
drawn at the top left corner of the cell rectangle.

Also more code cleanup: collect all render call parameters in a single struct
and provide a public function to set them all at once instead of making them
public.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62595 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-11-10 17:41:50 +00:00
parent a923d77fc5
commit 2a454ffdbd
3 changed files with 50 additions and 38 deletions

View File

@@ -114,24 +114,39 @@ public:
wxDC *dc,
int state);
protected:
// store GTK render call parameters for possible later use
void GTKStashRenderParams(GdkWindow *window,
GtkWidget *widget,
GdkRectangle *background_area,
GdkRectangle *expose_area,
int flags)
{
m_renderParams.window = window;
m_renderParams.widget = widget;
m_renderParams.background_area = background_area;
m_renderParams.expose_area = expose_area;
m_renderParams.flags = flags;
}
protected:
bool Init(wxDataViewCellMode mode, int align);
private:
wxDC *m_dc;
public:
// Internal, temporary for RenderText.
GtkCellRenderer *m_text_renderer;
GdkWindow *window;
GtkWidget *widget;
GdkRectangle *background_area;
GdkRectangle *cell_area;
GdkRectangle *expose_area;
int flags;
protected:
// parameters of the original render() call stored so that we could pass
// them forward to m_text_renderer if our RenderText() is called
struct GTKRenderParams
{
GdkWindow *window;
GtkWidget *widget;
GdkRectangle *background_area;
GdkRectangle *expose_area;
int flags;
} m_renderParams;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomRenderer)
};