1. [WIN]Win32Lib: v50 : trap click in SIMPLE combo?
- Posted by Dan B Moyer <DANMOYER at PRODIGY.NET> Nov 30, 2000
- 507 views
Does anyone know how to trap a click event on the label of a "simple" combo? This is a combo with a label replacing the top edit box. Problem seems to be that because it has a label, and labels don't respond to events, I can't get a hook into it; yet clicking on the label does open the combo box list, so *something* is able to sense and respond to a click. Dan Moyer
2. Re: [WIN]Win32Lib: v50 : trap click in SIMPLE combo?
- Posted by Derek Parnell <DerekP at IXCHANGE.COM.AU> Dec 01, 2000
- 493 views
Hi Dan, > > Does anyone know how to trap a click event on the label of a > "simple" combo? No, win32lib doesn't capture this. I'll research it this weekend. > This is a combo with a label replacing the top edit box. I don't actually know what you mean by "replacing". Simple Combos don't have labels. Are you referring to a LText control that is displayed over the top of a SimpleCombo control? I can't picture what you are trying to do? > Problem seems to > be that because it has a label, and labels don't respond to > events, I can't > get a hook into it; yet clicking on the label does open the > combo box list, Again, a SimpleCombo doesn't have a label, so I don't know what you are talking about. > so *something* is able to sense and respond to a click. I'll see if I can get onClick and/or onChange to fire for SimpleCombos. ----- Derek.
3. Re: [WIN]Win32Lib: v50 : trap click in SIMPLE combo?
- Posted by Dan B Moyer <DANMOYER at PRODIGY.NET> Dec 01, 2000
- 487 views
Derek, I'm sorry, habit mislead me to use a not standard term in my post. The "SimpleCombo style of combo box defined by Win32Lib has a "static text control" as an *inherent* part of it (instead of the *editable* control the regular "Combo" has), and since "static text" controls are often used as "labels" in a window, I just referred to it as a "label" instead of "static text control". I got in a habit of calling such "static text control"s in my programs "label1", "label2", etc, and forgot that they're really "static text control"s. That "label" ("static text control" ) is created by the inclusion of CBS_DROPDOWNLIST as a style when the SimpleCombo is created, which is "Similar to CBS_DROPDOWN, except that the edit control is replaced by a static text item that displays the current selection in the list box. " It's that *inherent* (not added on) "static text control", or "label" which I would like to be able to trap clicks on, but in v50, if it's possible. I tried most everything I could think of, except onEvent, 'cause I don't know how to use that. I know that Win32Lib says that static text controls don't trap events, but my presumption is that onEvent intercepts all windows "stuff"(?), and windows certainly knows when the "static text control" (label) in a SimpleCombo has been clicked on, so I figure maybe onEvent should somehow be able to respond to a click on a "label" ("static text control") which is part of a combo box? Dan ----- Original Message ----- From: "Derek Parnell" <DerekP at IXCHANGE.COM.AU> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Thursday, November 30, 2000 8:21 PM Subject: Re: [WIN]Win32Lib: v50 : trap click in SIMPLE combo? > Hi Dan, > > > > Does anyone know how to trap a click event on the label of a > > "simple" combo? > > No, win32lib doesn't capture this. I'll research it this weekend. > > > This is a combo with a label replacing the top edit box. > > I don't actually know what you mean by "replacing". Simple Combos don't have > labels. Are you referring to a LText control that is displayed over the top > of a SimpleCombo control? I can't picture what you are trying to do? > > > Problem seems to > > be that because it has a label, and labels don't respond to > > events, I can't > > get a hook into it; yet clicking on the label does open the > > combo box list, > > Again, a SimpleCombo doesn't have a label, so I don't know what you are > talking about. > > > so *something* is able to sense and respond to a click. > > I'll see if I can get onClick and/or onChange to fire for SimpleCombos. > > ----- > Derek.
4. Re: [WIN]Win32Lib: v50 : trap click in SIMPLE combo?
- Posted by Derek Parnell <dparnell at BIGPOND.NET.AU> Dec 01, 2000
- 495 views
- Last edited Dec 02, 2000
Dan, try the following code to see if if might suit... -------------------------- include win32lib.ew integer w,c,s w = create(Window, "Test", 0, 0, 0, 500, 400,0) s = create(StatusBar, "", w, 0, 0, 0, 0, 0) c = create(Combo, "", w, 5, 5, 300, 100, 0) procedure ee(atom msg, atom wparam, atom lparam) sequence t if msg = WM_PARENTNOTIFY then if wparam = WM_LBUTTONDOWN then t = "Left" elsif wparam = WM_RBUTTONDOWN then t = "Right" else t = sprintf("%d", wparam) end if setText(s, t) end if end procedure onEvent[c] = routine_id("ee") addItem(c, "One") addItem(c, "Two") WinMain(w, 0) ---- Derek
5. Re: [WIN]Win32Lib: v50 : trap click in SIMPLE combo?
- Posted by Dan B Moyer <DANMOYER at PRODIGY.NET> Dec 01, 2000
- 497 views
Derek, *Very* nearly! It works with "Combo" style, only problem is, I'm trying to use either a SimpleCombo, or in it's cousin as it's been defined in 54.5, Combo with styles or_all({WS_VSCROLL, WS_CHILD,WS_VISIBLE,CBS_DROPDOWNLIST,CBS_HASSTRINGS,WS_TABSTOP }), and apparently the dropdownlist creating the "static text control" either isn't trapped by onEvent, or isn't sent to "WM_PARENTNOTIFY"?? However, that IS a good example to include with "onEvent" in the Win32LIb doc! :) Dan ----- Original Message ----- From: "Derek Parnell" <dparnell at BIGPOND.NET.AU> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Friday, December 01, 2000 4:53 AM Subject: Re: [WIN]Win32Lib: v50 : trap click in SIMPLE combo? > Dan, > try the following code to see if if might suit... > -------------------------- > include win32lib.ew > integer w,c,s > > w = create(Window, "Test", 0, 0, 0, 500, 400,0) > s = create(StatusBar, "", w, 0, 0, 0, 0, 0) > c = create(Combo, "", w, 5, 5, 300, 100, 0) > > > procedure ee(atom msg, atom wparam, atom lparam) > > sequence t > > if msg = WM_PARENTNOTIFY then > if wparam = WM_LBUTTONDOWN then > t = "Left" > elsif wparam = WM_RBUTTONDOWN then > t = "Right" > else > t = sprintf("%d", wparam) > end if > setText(s, t) > end if > end procedure > onEvent[c] = routine_id("ee") > > addItem(c, "One") > addItem(c, "Two") > > WinMain(w, 0) > ---- > Derek
6. Re: [WIN]Win32Lib: v50 : trap click in SIMPLE combo?
- Posted by Derek Parnell <dparnell at BIGPOND.NET.AU> Dec 02, 2000
- 492 views
Dan, I don't know what I was thinking. My previous example was typed after I'd just flown back home from Sydney. Well its a beautiful morning now here in Melbourne and my mental cobwebs have disappeared (I guess). All you have to do is change win32lib.ew thus... classAttr[SimpleCombo]=0 becomes classAttr[SimpleCombo]=w32Clickable This will now send onMouse events, and onClick when a selection from the dropdown list is made. A similar change for Combobox, etc... should also work for those control types too. ------ Derek Parnell Melbourne, Australia (Vote [1] The Cheshire Cat for Internet Mascot)
7. Re: [WIN]Win32Lib: v50 : trap click in SIMPLE combo?
- Posted by Dan B Moyer <DANMOYER at PRODIGY.NET> Dec 01, 2000
- 468 views
Derek, That's ok; besides, it was a *good* example, just not quite what I needed! :) But I think your last suggestion only works with v 54.5?? See, I'm trying to get this to work with v50, 'cause it relates to my modification of Judith's IDE & that's not yet built to run under 54.5. I'm beginning to think that maybe I *can't* do this under v50 (& even if I could, by making changes to v50, that wouldn't really help, 'cause I wouldn't want to have to distribute the changed Win32Lib in order to get my mod to the IDE to work). Wolfgang has sent me a list of Combo Box Notifications, not sure if they will help, but I'll give them a look. Maybe if I tell you exactly what I'm trying to do, that might help: In my mod of Judith's IDE I have pairs of combo boxes, one above the other in each pair; each of mine have a list of *categories* in the top box, and a (variable) list of routines in the bottom of the pair; when a category is selected from the top of a pair, it causes the bottom combo to become populated with the appropriate list of routines for that category, opens the bottom list, and either closes automatically or is closed by command (I forget which); this much works, you can see it in the latest version at user contributions at RDS. What is supposed to happen next is that if the user clicks on the *categories* list while the lower *routines* list is down, it is *supposed* to close the lower list so it doesn't show "under" the other list if the lower list is too long. This also does work. The problem is that all of that works when the combo box is a *regular* combo box, with an *editable* control at the top, and if that is accidentally changed by a user, it crashes the IDE; so I thought to make it *uneditable* to fix that "crash potential", but when I do that, I loose the "close the bottom list when the top list opens" capability, because I was using "onGotFocus" to let me know when the user had clicked on the top combo, and when I use "SimpleCombo" it doesn't/can't get focus because it has a static text item, which can't get focus. If that's not clear in relation to my Mod, I'll try to send you a demo, but I'm having trouble with my phone lines & can't be sure when I'll be able to send/receive email. Dan ----- Original Message ----- From: "Derek Parnell" <dparnell at BIGPOND.NET.AU> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Friday, December 01, 2000 1:48 PM Subject: Re: [WIN]Win32Lib: v50 : trap click in SIMPLE combo? > Dan, > I don't know what I was thinking. My previous example was typed after I'd > just flown back home from Sydney. Well its a beautiful morning now here in > Melbourne and my mental cobwebs have disappeared (I guess). > > All you have to do is change win32lib.ew thus... > > classAttr[SimpleCombo]=0 > > becomes > > classAttr[SimpleCombo]=w32Clickable > > This will now send onMouse events, and onClick when a selection from the > dropdown list is made. > > A similar change for Combobox, etc... should also work for those control > types too. > > ------ > Derek Parnell > Melbourne, Australia > (Vote [1] The Cheshire Cat for Internet Mascot)
8. Re: [WIN]Win32Lib: v50 : trap click in SIMPLE combo?
- Posted by Derek Parnell <dparnell at BIGPOND.NET.AU> Dec 02, 2000
- 512 views
------ Derek Parnell Melbourne, Australia (Vote [1] The Cheshire Cat for Internet Mascot) ----- Original Message ----- From: "Dan B Moyer" <DANMOYER at PRODIGY.NET> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Saturday, December 02, 2000 10:15 AM Subject: Re: [WIN]Win32Lib: v50 : trap click in SIMPLE combo? > Derek, > > That's ok; besides, it was a *good* example, just not quite what I needed! > :) > > But I think your last suggestion only works with v 54.5?? See, I'm trying > to get this to work with v50, 'cause it relates to my modification of > Judith's IDE & that's not yet built to run under 54.5. I'm beginning to > think that maybe I *can't* do this under v50 (& even if I could, by making > changes to v50, that wouldn't really help, 'cause I wouldn't want to have to > distribute the changed Win32Lib in order to get my mod to the IDE to work). > > Wolfgang has sent me a list of Combo Box Notifications, not sure if they > will help, but I'll give them a look. > > Maybe if I tell you exactly what I'm trying to do, that might help: > In my mod of Judith's IDE I have pairs of combo boxes, one above the other > in each pair; each of mine have a list of *categories* in the top box, and a > (variable) list of routines in the bottom of the pair; when a category is > selected from the top of a pair, it causes the bottom combo to become > populated with the appropriate list of routines for that category, opens the > bottom list, and either closes automatically or is closed by command (I > forget which); this much works, you can see it in the latest version at user > contributions at RDS. > > What is supposed to happen next is that if the user clicks on the > *categories* list while the lower *routines* list is down, it is *supposed* > to close the lower list so it doesn't show "under" the other list if the > lower list is too long. This also does work. > > The problem is that all of that works when the combo box is a *regular* > combo box, with an *editable* control at the top, and if that is > accidentally changed by a user, it crashes the IDE; so I thought to make it > *uneditable* to fix that "crash potential", but when I do that, I loose the > "close the bottom list when the top list opens" capability, because I was > using "onGotFocus" to let me know when the user had clicked on the top > combo, and when I use "SimpleCombo" it doesn't/can't get focus because it > has a static text item, which can't get focus. > > If that's not clear in relation to my Mod, I'll try to send you a demo, but > I'm having trouble with my phone lines & can't be sure when I'll be able to > send/receive email. > > Dan > > > > > ----- Original Message ----- > From: "Derek Parnell" <dparnell at BIGPOND.NET.AU> > To: <EUPHORIA at LISTSERV.MUOHIO.EDU> > Sent: Friday, December 01, 2000 1:48 PM > Subject: Re: [WIN]Win32Lib: v50 : trap click in SIMPLE combo? > > > > Dan, > > I don't know what I was thinking. My previous example was typed after I'd > > just flown back home from Sydney. Well its a beautiful morning now here > in > > Melbourne and my mental cobwebs have disappeared (I guess). > > > > All you have to do is change win32lib.ew thus... > > > > classAttr[SimpleCombo]=0 > > > > becomes > > > > classAttr[SimpleCombo]=w32Clickable > > > > This will now send onMouse events, and onClick when a selection from the > > dropdown list is made. > > > > A similar change for Combobox, etc... should also work for those control > > types too. > > > > ------ > > Derek Parnell > > Melbourne, Australia > > (Vote [1] The Cheshire Cat for Internet Mascot) Dan, I know exactly what you are trying to achieve. Simply put, you wish to populate the contents of one list based on the selection in another list. I needed the same function and that's when I discovered that win32lib v0.50 and earlier delibrately ignored mouse events (except right-down) from controls that had a parent control. It did this to get out of trying to handle "double" events happening for some controls that issued their own mouse events. I've rewritten mousehandling in the current library to cater for this type of thing. The only thing you can do for v0.50 is to use onEvent (because that gets *all* events) and roll-your-own mousehandling for the control. It would be similar to your wdemo.exw code except that you filter out messages you don't want. Good luck. ----- Derek.