Basil Shubin wrote:
> I have continue my work of embeding dGrid widgets into existing project
> of mine that almost entirely based on XRC. My customers ask for
> following features:
>
> 1. How I can get possition of any columns in a table? Suppose user want
> to customize columns possitions and he/she want so that customisation
> will be saved. If it is possible than how I can set column positition in
> grid class when it was created on application startup? Meaning store
> column position number in a file, than read it on startup by dGrid class
> and repositioning according saved values. Any suggestion?
You get this "for free" when you use a full-blown Dabo app with a Dabo
Application object. The user can drag columns around, resize them, and
the changes "stick".
You could probably manually set up a dPref (Dabo Preference Manager) but
I'll leave that for Ed to answer because I've not done it and he knows
the inner workings.
Perhaps (I don't know) you could get away with instantiating a dApp at
the beginning of your program:
import dabo
app = dabo.dApp(MainFormClass=None, UI=None)
app.setup()
Having that instantiated may just make enough of Dabo work to get the
dGrid preferences saved.
> 2. How I can setup setup context menu for a dGrid columns labels?
In your dGrid subclass, define a event handler and set up the event binding:
class MyGrid(dabo.ui.dGrid):
...
def onGridHeaderMouseRightClick(self, evt):
# do your stuff
> 3. How I can hide any existing column? A than again save it state and a
> class behind this grid should 'builded' according this customisation?
There isn't a Visible property for columns (perhaps there should be).
You can call grid.removeColumn(columnIndex).
I don't understand the second part of the question. If it is a class
that defines which columns to show, just write the code in the subclass.
> PS. Dabo is a great thing! Thanks for it! :-)
Glad you are enjoying it. Keep asking questions.
--
pkm ~ http://paulmcnett.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users