Hi,
I was looking for such solution as well. I need to highlight the current
selected cell's column and row header. Like in Spreadsheets. I have
looked into your code. But I don't know how to calculate the header.
w = self.Header
Also I am not sure about the OnHeaderPaint method. How to bind it?
Your example gave me an insight how it could be done. A tiny full
example would help much.
jan bodnar
Dabo has abstracted things somewhat. More directly, for a column header:
# add this to Grid's __init__ method
colLabelWindow = self.GetGridColLabelWindow()
colLabelWindow.Bind(wx.EVT_PAINT, self._onColHeaderPaint)
I presume that for the row header window, you would use GetGridRowLabelWindow(), though I haven't tried that yet myself.
HTH
Rad
···
----- Original Message ----- From: "jan bodnar" <jan.bodnar@chello.sk>
To: <wxPython-users@lists.wxwidgets.org>
Sent: Thursday, June 30, 2005 4:48 PM
Subject: Re: [wxPython-users] colorize single grid labels?
Hi,
I was looking for such solution as well. I need to highlight the current
selected cell's column and row header. Like in Spreadsheets. I have
looked into your code. But I don't know how to calculate the header.
w = self.Header
Also I am not sure about the OnHeaderPaint method. How to bind it?
Your example gave me an insight how it could be done. A tiny full
example would help much.
jan bodnar
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
I was looking for such solution as well. I need to highlight the current
selected cell's column and row header. Like in Spreadsheets. I have
looked into your code. But I don't know how to calculate the header.
w = self.Header
Just look at the Dabo code. 'Header' is a grid property, and it is defined to return grid.GetGridColLabelWindow().
One of the primary design goals of Dabo is to simplify interacting with your UI objects. We have strived to make working with UI controls as simple and direct as possible. Wouldn't you rather refer to a grid's Header instead of having to call GetGridColLabelWindow() and deal with the result?
Honestly, I would recommend Dabo to anyone working with wxPython, even if they don't use the database connectivity that is built in. I've had several developers write to me telling me of how easy it was to create GUI apps using Dabo, and only a few of these folks used the whole framework. The rest simply preferred the simplified coding of the UI that we offer in Dabo to the C-like nature of wxPython.
Also I am not sure about the OnHeaderPaint method. How to bind it?
Your example gave me an insight how it could be done. A tiny full
example would help much.
In Dabo, we bind the wxPython event wx.EVT_PAINT to raise a Dabo Paint event. When working with Dabo grids, all you have to do is add code to the dGrid.onHeaderPaint() method to augment what the framework classes already do for you.
I strongly urge everyone working with wxPython to take a look at Dabo's UI implementation. It greatly simplifies working with UI objects by wrapping the wxPython classes with a consistent API.
___/
/
__/
/
____/
Ed Leafe
http://leafe.com/
http://dabodev.com/
···
On Jun 30, 2005, at 5:48 PM, jan bodnar wrote: