>
self.myOlv.Bind(wx.EVT_CONTEXT_MENU, self.onListContextMenu)
YEEESSS! Thanks Werner!
Robin also told me about it this night but I had to sleep before:)
I learned one other thing: this one doesn't appear into the OVL
source but is processed anyway (sometime logical things don't
seem so logical).
I am starting to sound like a sales person for MediaLocker;-) . Run it
add a book or two and then right click on the list, it will show you
three items, two for a report and the third will eventually allow to
save the column configuration. BTW - have to look into it why the start
up is slowish.
I had a rapid dive in the code: some things are too advanced for me
at this time but I understand most of it.
My first approach was also to use SA, as it seems a wonderful tool
from outside; however it has several drawbacks:
* some queries aren't as effective as manual ones (some cases even
trigger multiple queries - was like that 2 years ago),
* it drives the DB (but it should be the contrary),
* the worse: it must have a direct access to the basic data, in
opposition to what is done by any DB conceptor: keep base data
unreachable and access them through views & stored procedures.
I choose an inverse solution: the pgm is adapting itself to DB
modifications & rights changes (drawback: start is very long, the
time to recover all rights, kind of data, etc from DB).
It is done with the above Bind and the code building the menu is in
mlsrc.libui.olvbase.
> The main PB is a "grep RIGHT *py" into OVL source don't return
> anything linked to events:( - nor does CONTEXT (but I'm not tough
> enough to say if it's really a PB)
I am not sure but I think this is all "out of the box" stuff of the
listctrl which OLV is built on.
Yep, and this is why I'm confused (see my §2): I tried with
EVT_RIGHT_UP/DOWN, which are *also* LC intrinsics and... it didn't
work!
> And I don't know if it's even possible as I don't know how I'll
> "recharge" my new column set into a living widget.
You mean reload the total list?
No, an example:
* I've 6 columns candidate to be displayed, but in my opinion 4 are
enough to run, so I present cols 0,3,5,6,
* user, for any reason, wants to see all of them in a different
order, so by the popup menu he choose that option,
Here is the PB: how can I tell my running widget to get rid of old
cols list & reload the new one without stopping it?
I need to re-read the docs deeply because I remember a primitive
that suppress the running list of displayed columns, so the inverse
must exists as well.
Are you allowing to add columns on the fly?
No, in the whole bunch of pgms I tested (O-S & Cial), it is often an
option such as having different views and switch between them, but
experience shows it is only a gadget and once people has stabilize
its choice it don't change anymore.
So, I have only 2 options: change cols & their order or return to
original choice.
But may be I understand wrong what you're saying.
I haven't done that but I guess it should be possible by first doing
myOlv.ClearAll() and then loading your ColumnDef's and objects again.
I think so because a widget that don't support this possibility
would be useless in a production environment.
JY
···
On Wed, 28 Dec 2011 09:59:48 +0100 werner <wbruhin@free.fr> wrote:
--