Re: [WIN] Win32Lib Combo *list* not respond to *right* click?
- Posted by Dan B Moyer <DANMOYER at PRODIGY.NET> Nov 03, 2000
- 390 views
------=_NextPart_000_000F_01C045AF.0D515040 charset="iso-8859-1" Al, Thanks for your offer to look at my program! It's not at all sensitive, it's just a "variation" on a portion of Judith's improvement of the IDE, which allows the user to paste any Euphoria or Win32Lib routine directly into the IDE Code Editor by just selecting it from a (categorized) list(s) in two pairs of combo boxes (one pair for Euphoria categories & routines, another pair for Win32Lib). I have that working, and then thought to make "right click" on a routine's name in one of those combo box's list make a jump to the html doc section describing that routine, & discovered that I couldn't make right click *work* in the list of a combo box. It *does* "work" in the *edit* portion of the combo box, though. I've attached a short demo of the problem, it's just your original with a few modifications. I tried it with Win32Lib .50, .53, and with .54 (with the CB_ constants commented out for .54, 'cause they're in it). In the demo, if you "open" (drop-down) the list by clicking on either the edit box or the triangle, and then try to *right click* on an item in the list, *nothing at all happens*. If you *left click* an item, the list closes, and the item left-clicked on (which gets properly selected), is placed into the "edit" box (really a static label in a simple combo), and *this* is where right click *does* sort-of work: if you *right click* on the "edit" box, ITEM NUMBER 1 gets put into the "edit" box (no matter what had been selected by left click), & pulled out by your routine to be put into a data label. I didn't zip up everything you asked for because I think when you see how the demo works, you really won't need anything else; if you still think you need to see the whole thing after looking at the demo, let me know & I'll put it all together for you. Dan ----- Original Message ----- From: "Al Getz" <xaxo at AOL.COM> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Friday, November 03, 2000 11:41 AM Subject: Re: [WIN] Win32Lib Combo *list* not respond to *right* click? > Hi Dan, > > Sorry i didnt see your question earlier, i had been busy with some > other things, including watching the World Championship Chess Match > in London, where Garry Kasparov was up against a contender for the title, > Vlad Kramnik, who now has won it, and is now the new world champion. > > First off, i would like to get a copy of your program you are running > so i could take a look at it, if its a sensitive program, > perhaps you could just include the combo box part, but just make sure > it runs as is so i can view the problem first hand. If you would zip > it up with your current version of WinLib you are using with it, that > would provide me with all i should need to find out whats going on. > I'll run it myself, that way i can see exactly what isnt working. > > Aside from that, i would modify the procedure you emailed > to simply print out the return values to the only possible calls that > could be causing a problem like so: > > ------------------------------------------------- > --start Eu code: > procedure onMouse_EuRoutinesCombo(integer event, integer x, integer y, > integer shift) > atom index,bool,height,topindex,indexoffset > sequence itemtext > > > if event=RIGHT_DOWN then -- note: can use "RightDown", also > -- start of "housekeeping" to allow right click to work: > height=sendMessage(EuRoutinesCombo,CB_GETITEMHEIGHT,0,0) > ?height > topindex=sendMessage(EuRoutinesCombo,CB_GETTOPINDEX,0,0) > ?topindex > indexoffset=floor(y/height) > ?indexoffset > index=indexoffset+topindex > ?index > bool=sendMessage(EuRoutinesCombo,CB_SETCURSEL,index,0) > ?bool > index +=1 > ?index > -- NOTE: USE "index" TO REFERENCE TO ITEM SELECTED BY RIGHT CLICK > -- end of right click housekeeping > > end if > end if > end procedure > > onMouse[EuRoutinesCombo]=routine_id("onMouse_EuRoutinesCombo") > > --end eu code > ------------------------------------- > > This might sound trivial, but, there are only really a few places where > this can fail: namely, the responses to the messages sent. > > Run your base program through an exercise that you can easily repeat, > when you click on the item in the location you were talking about, view > the variables (printed with ?) in the console window and verify that > their values are reasonable: > if you click on item number 5 with item 1 on top, the > values printed out should reflect that fact each and every time. > If you then repeat the process, clicking on item 6, the new index > should come out to be one more then last time, etc. > Verify that the index is truely zero based as well. > Sometimes the documentation says one thing, and it turns out > to be something else. > Note that if you dont get any response at all in the console window, > the mouse isnt being captured in that part of your window. > That may require a different technique. > > See what happens, but i would really like to take a look at this > first hand in any case. > > One last note, if the combo box is "owner drawn", you must specify > an item index in order to get the height. > > If you have the time please email me a working demo of the problem complete > with the version of winlib you are using. > > --Al ------=_NextPart_000_000F_01C045AF.0D515040 name="CmboPrbm.EXW" Content-Transfer-Encoding: quoted-printable