Tomas, I've got a custom listbox that we use to solve this problem. If you're interested, I've just uploaded it to our website:
<http://www.stretchedout.com/rbclasses/ListBox_MultiItemContext.zip> We made it use the existing event names, so it should be pretty plug- n-play, but just reviewing the code, I noticed that we're not doing anything with the return value of the ContextualMenuAction event. I just looked it up in the LR and there doesn't seem to be a definition. Personally, I can't remember ever using it. Anyone know what returning true or false from this event will do for you (so I can fix the class). Also, If anyone finds any bugs, please let me know offlist so I can get them fixed for everyone... GregO On May 15, 2007, at 3:32 am, Tomas Camin wrote: > http://www.realsoftware.com/feedback/viewreport.php?reportid=gpjyqnro > http://www.realsoftware.com/feedback/viewreport.php?reportid=fygbuwxk > http://www.realsoftware.com/feedback/viewreport.php?reportid=lvdlmdas > >> Unfortunately calling menuitem.popup from mousedown or cellclick has >> some side effects under win (http://www.realsoftware.com/feedback/ >> viewreport.php?reportid=xkojzmiw and others). I need to use >> constructcontextual menu, which btw should be the preferred way. >> >> I presume then that this is a bug. >> >> >> >> >> >>> >>> On 14-May-07, at 10:44 AM, Tomas Camin wrote: >>> >>>> Hi, >>>> >>>> under Windows and Mac (linux not tested) when >>>> mylistbox.selectiontype=Listbox.SelectionMultiple current row >>>> selection will be lost when right clicking (or cmd clicking): >>>> >>>> start an empty project >>>> add a listbox and populate it with a couple of items >>>> set selectiontype=Listbox.SelectionMultiple >>>> add some items to the contextual menu >>>> >>>> run the app >>>> select some rows >>>> right click (or cmd click) >>>> previous selection is lost and only one row is selected. >>>> >>>> Is this a bug or am I doing something wrong? >>>> >>>> Instead of constructcontextualmenu I've been using a workaround >>>> suggested by Karen in an older post (calling menuitem.popup in >>>> mousedown) but there is a bug under Windows that force me to use >>>> the >>>> constructcontextualmenu. >>>> >>>> Now some code: >>>> >>>> -- mylistbox.constructcontextualmenu: >>>> dim m as MenuItem >>>> >>>> >>>> m=New MenuItem >>>> m.text="menuitem test" >>>> base.append m >>>> >>>> return true >>>> >>>> -- mylistbox.open: >>>> dim i as integer >>>> >>>> >>>> for i=0 to 100 >>>> me.AddRow "test" >>>> next >>>> >>>> me.SelectionType=Listbox.SelectionMultiple >>>> >>> >>> if you check I think you'll find you get both the cellclick and >>> mousedown and that's what seems to be deselecting everything >>> >>> you can catch this by inserting, in the cellclick, something like >>> >>> if Keyboard.AsyncControlKey or IsContextualClick then >>> return true >>> end if >>> >>> and the selection will not be changed BUT the >>> ConstructContextualMenu >>> will not be called either >>> >>> If you could use the menuitem.popup then you could have the >>> contextual menu show up >>> >>> You could use something like >>> >>> if Keyboard.AsyncControlKey or IsContextualClick then >>> dim base as New MenuItem >>> dim m as MenuItem >>> >>> >>> m=New MenuItem >>> m.text="menuitem test" >>> >>> base.append m >>> >>> m = base.PopUp >>> >>> return true >>> end if >>> >>> >>> Not sure how you get this effect if you have to use >>> ConstructContextualMenu >>> >>> >>> _______________________________________________ >>> Unsubscribe or switch delivery mode: >>> <http://www.realsoftware.com/support/listmanager/> >>> >>> Search the archives: >>> <http://support.realsoftware.com/listarchives/lists.html> >> >> _______________________________________________ >> Unsubscribe or switch delivery mode: >> <http://www.realsoftware.com/support/listmanager/> >> >> Search the archives: >> <http://support.realsoftware.com/listarchives/lists.html> > > _______________________________________________ > Unsubscribe or switch delivery mode: > <http://www.realsoftware.com/support/listmanager/> > > Search the archives: > <http://support.realsoftware.com/listarchives/lists.html> > _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
