Re: Win32Lib: listbox: select item with RIGHT mouse click?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Matthew,

Could you explain what you mean by a "hit test"(ie, hits what, since no
index is returned), & how to use LB_GETITEMRECT and LB_GETTOPINDEX for the
hit testing?  (Are you talking about getting the size( y extent) of the
listbox, the y position of the right-mouse click in the listbox, the number
of items in the listbox, the y size of each item, & then compute which item
was clicked on from all that??)

Dan

Matthew wrote:



> I don't think there's any automatic way to do this.  You'd have to trap
the
> right click, do a hit test and select the item, if any.  There are built
in
> functions for Listviews and Treeviews, but I think you'd have to do this
> manually for a regular list box.  You'd want to use a combination of
> LB_GETITEMRECT and LB_GETTOPINDEX for the hit testing, to get the
> information on what the first visible item is in the list box, and then
the
> size of the items...
>
> Matt Lewis
>
>
>
> > -----Original Message-----
> > From: Dan B Moyer
> >
> > When you LEFT click on an item in a listbox, it gets
> > selected, and you can
> > use getIndex to tell you which item was selected, and cause an action
> > relative to that item with a left double-click (which can be
> > done in one
> > motion: move cursor to item, then double-click); but I'd also
> > like to make
> > something happen if an item is RIGHT clicked, but it seems I
> > have to select
> > the item first with a left click, and then do a right click.
> >
> > Is there a way to cause a right click alone to select an item
> > in a list and
> > thence be able to act with regard to that item?
> >
> > Dan
> >

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu