[Gambas-user] Chronic columnview Woes

Fabien Bodard gambas.fr at ...626...
Wed May 15 23:59:31 CEST 2013


In fact I think I need a better explanation or an example...
What do you really want ?

To generate a kind of elementclick event?

Normally you just have to do.:
$sKey = cvw.Item.Key
In the cvw_Click event
And then use the value of $sKey in the cvw_menu event

Or maybe I have missed something and so tell us more

Best regards,
Fabien Bodard
 Le 15 mai 2013 08:44, "Richard Terry" <rterry at ...1823...> a écrit :

> Fabien Bodard wrote:
> > Use a flag!!!
> > Le 15 mai 2013 03:46, "Richard Terry" <rterry at ...1823...> a écrit
> :
> >
> Sorry Fabien, don't mean to be a pest but if this was a simple problem
> I've figure it myself. I don't understand why this code works erratically.
>
> Could you explain what you mean by use a flag with a couple of lines of
> sample code.
>
> Regards
>
> richard
>
> >
> >> Benoît Minisini wrote:
> >>
> >>> Le 08/05/2013 02:03, Richard Terry a écrit :
> >>>
> >>>
> >>>> Hi List,
> >>>>
> >>>>
> >>>>
> >>>  > ...
> >>>  >
> >>>
> >>>
> >>>> However, lets say I want to popup a menu of the letters collection:
> >>>>
> >>>> If I right mouse click on the list to bring up the menu the
> >>>> cvwLetters_Menu event triggers, but if one inspects the cvwLetters
> >>>> control itself in the IDE, the cvwLetters.item.key is null, however
> the
> >>>> cvwletters.selected[0] does contain the value one would expect to be
> in
> >>>> the cvwLetters.item.key.
> >>>>
> >>>> I've tried doing e.g cvwLetters.movecurrent() before popping up the
> >>>> menu, this does not seem to make much difference.
> >>>>
> >>>>
> >>> The Menu event is not an event managed by the ColumnView control, but
> by
> >>> its Control parent class. This is the reason why the Item property is
> >>> not set during the Menu event handler. The Menu event is raised even if
> >>> you don't click on an item.
> >>>
> >>> Normally, the Click event will be raised before the Menu event, and so
> >>> you can store the key of the ColumnView.Item property during the Click
> >>> event handler (which is a ColumnView event) to use it later during the
> >>> Menu event handler.
> >>>
> >>>
> >>>
> >>>> Also I've a chronic problem trying to generate a columnview click
> event
> >>>> in code, with a similar outcome to the above - the item.key is not set
> >>>>
> >>>>
> >>> The Item property *is* set during a Click event handler. What are you
> >>> talking about with "generate a columnview click event"?
> >>>
> >>>
> >>>
> >> What I meant was this. Lets say you have loaded the columnview with
> >> data. Now, if the user was sitting in front of the program and wanted to
> >> select an item in the columnview, then he would click on the column
> >> which one would then trap the event and do something with it.
> >>
> >> I often need to be able to emulate that in code, ie have the program do
> >> the same thing. Doing this
> >>
> >> columnview1.Movefirst()
> >> columnview1.item.selected = True
> >>
> >> will sometimes work ie this triggeres the columnview1_Select() routine
> >> and any code associated with this.
> >>
> >> Hope this is clearer.
> >>
> >> Regards
> >>
> >> Richard
> >>
> >> Richard
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> AlienVault Unified Security Management (USM) platform delivers complete
> >> security visibility with the essential security capabilities. Easily and
> >> efficiently configure, manage, and operate all of your security controls
> >> from a single console and one unified framework. Download a free trial.
> >> http://p.sf.net/sfu/alienvault_d2d
> >> _______________________________________________
> >> Gambas-user mailing list
> >> Gambas-user at lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/gambas-user
> >>
> >>
> >
> ------------------------------------------------------------------------------
> > AlienVault Unified Security Management (USM) platform delivers complete
> > security visibility with the essential security capabilities. Easily and
> > efficiently configure, manage, and operate all of your security controls
> > from a single console and one unified framework. Download a free trial.
> > http://p.sf.net/sfu/alienvault_d2d
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> >
>
>
> ------------------------------------------------------------------------------
> AlienVault Unified Security Management (USM) platform delivers complete
> security visibility with the essential security capabilities. Easily and
> efficiently configure, manage, and operate all of your security controls
> from a single console and one unified framework. Download a free trial.
> http://p.sf.net/sfu/alienvault_d2d
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list