Monday, June 30, 2008

CCombo. My arch nemesis.

CCombo is the emulated combo box that appears in Eclipse in, for instance, combos in table cell editors. This widget constantly causes me problems throughout WOLips because it's one of the most glaringly non-native components in the SWT family. Here are some pictures to illustrate:

CCombo Closed:

CCombo Opened:

Native (Leopard) Closed:

Native (Leopard) Opened:

Notice that in the closed form, there's no designator that shows that it is a combo (the up/down arrow icon). Currently there's not enough API in tables to add icons like this. I haven't looked at what i would take to fix that. In the open form, it's just all-sorts-a'-wrong. It's not the Leopard window style, it doesn't have proper keyboard navigation like native. Entity Modeler fixes some of this. In fact, if you were to look at this control outside of Entity Modeler, the focus ring is offset incorrectly by several pixels as well (it hangs outside of its table cell by about 3 pixels). Unfortunately, emulating is just never going to be right here. We can get away with it for tabs, because there is no native tab widget (yet), but for combo's, there are just too many expectations. I think the correct fix for this is to make CCombo a native widget on OS X, but currently C* widgets don't have native replacements (they are in the .custom instead of the .carbon package).

5 comments:

eric said...

IMO, the worst part of CCombo isn't the looks, it's the usability. The clickable area of any given option is only as big as the text inside of it. So if you have a short option name, like "date" in the screenshot, clicking anywhere outside the text not only doesn't select the correct option, it closes the CCombo with the original selection unchanged. Total fail.

L. Mihalkovic said...

the whole idea of all the Cxxxx widgets is that they are portable between platforms... so a native CCombo would defeat the purpose... I think.

Mike Schrag said...

I think the point of them is that they are cross-platform, but I think it's a huge limitation of the platform. It's a relatively arbitrary decision in SWT which controls get native status and which are emulated. My understand is actually that CCombo was introduced because of limitations on Windows, but now all the platforms get to enjoy it.

It makes far more sense to me to have all the SWT controls implemented in platform-specific ways So I agree it defeats the purpose of the current design of Cxxx, but I think the current design is flawed.

L. Mihalkovic said...

.... sigh... I have had my share of 'discussion' with steve n about what I perceived as SWT design flaws... I read hundreds of past postings in the SWT mailing list.. can't say I have seen many people successful at making their voices heard... so I will do like you and publish my mods outside of eclipse.

Mike Schrag said...

In Steve's defense, he's juggling a lot of platforms that all need to work properly, so I can at least appreciate the complexity of the problem. It's really easy for me to roll in on the Mac and say "this is broken" without really understanding the implications across the 10 (or whatever it is) platforms that SWT supports. I figured I would just plug away, though, and if people like it, there will be more pressure to get it included in SWT and possibly get a higher priority for getting fixed.