Community
Participate
Working Groups
Dropping down a CCombo causes the owning Shell to lose focus. This is *very* distracting to the user, since the titlebar color changes (and the Active ViewPart), and CCombos are often found on the Toolbar adjacent the titlebar. Also, there can be other unintended side effects if the hosting control is paying attention to focus, and doesn't anticipate its shell to lose foucs.
It's not likely that we will be able to do anything about this for R2.0.
Could a technique similar to the one thats used for the HoverHelp example be used here? In the HoverHelp example, the popup window is never open()-ed, just set visible. Therefore it never gains focus. I've played around with it a little and the only problem I can see right now, is that if you do give the window focus (i.e. click on it, like the user will have to click on an item in the CCombo's list), then for whatever reason, the window will actually receive focus the next time its setVisible(true). This is on winXP.
I've found that if I setActive() the parent shell, the focus will not return to the popup shell when it is again made visible. So basically the popup shell only recieves focus for a split second to actually process the user's click, then the parent is made active and it is made invisible. The result is a very very minor flash when the user clicks.
Created attachment 21766 [details] Sample technique without flashing I'm attaching a small sample that I wrote. It shows the basic concept. It works rather well on XP. I believe the concept itself is portable but I'm not sure if there are quirks on the other platform that might need to be accounted for (probably).
Chris, thanks for the suggestion. However, if the list does not have focus when it becomes visible, the user can not use the keyboard (up and down arrows or typing first letter of match) to select an item from the list. This breaks accessibility and is inconsistent with the behaviour of the native Combo widget.
Created attachment 46591 [details] patch I started looking at this yesterday. It's possible to leave the focus in the Text and forward the events to the list. Of course if the user clicks on the list it will be given focus, but I don't know of a work around for that.
Is it possible to implement CCombo without using Shell?
I tried it on Eclipse 3.6.1 / Ubuntu 10.04. The main shell does not lose the focus but the ViewPart containing the CCombo still loses the focus. In ideal case, CCombo should never capture the focus but at least it can behave like the content assist shell in Eclipse. It captures keyboard events and also mouse wheel without getting the focus from the EditorPart. EditorPart does not lose focus until you clicked in the content assist shell.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.