[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: [lmi] axes editing controls

From: Vadim Zeitlin
Subject: Re[2]: [lmi] axes editing controls
Date: Thu, 29 Nov 2007 16:48:10 +0100

On Thu, 29 Nov 2007 15:36:44 +0000 Greg Chicares <address@hidden> wrote:

GC> My mistake. Now I see that I have never understood wxChoice at
GC> all.

 This control makes more sense from X11 point of view than from Windows one.
In Win32 wxChoice is just a read-only wxComboBox but in X11-based UIs they
are completely different controls: wxChoice was originally in fact a popup
menu while wxComboBox was the same thing as under Windows.

GC> So that I can learn from this mistake, please tell me whether
GC> the following hypothesis is true:
GC>   If I have a wxComboBox with style wxCB_DROPDOWN|wxCB_READONLY,
GC>   and I restrict myself to the wxControlWithItems interface plus
GC>   GetCurrentSelection(), then I can substitute a wxChoice for
GC>   the wxComboBox and there should be no observable difference.
GC> If that substitution principle holds, then I suspect I can
GC> simplify some of the code I've written.

 Yes, it is true. However you should really be using wxChoice instead of
wxComboBox with wxCB_READONLY style (wxCB_DROPDOWN is the default anyhow)
because it results in much better appearance on other platforms.

GC> > wxComboBox allows entering values not present in the list of choices, do 
GC> > really want this?
GC> We do not want that. We'd rather forbid it.

 Ok, this makes more sense to me [than using wxComboBox].

GC> On 2007-11-20 23:51Z, Vaclav Slavik wrote:
GC> |
GC> | Currently, both of these controls are always implemented as wxChoice,
GC> | even for axes like Issue Age or Duration, where the list of allowed
GC> | values is rather large integer range. Would wxSpinCtrl be better
GC> | suited here? Picking Duration value from 100-items choice control
GC> | that doesn't even fit on screen and needs scrolling under wxGTK can
GC> | be a bit tiresome...
GC> I've never built lmi with wxGTK, so perhaps I didn't pay enough
GC> attention to that comment, guessing that the "scrolling" problem
GC> would appear on any conceivable platform--but not suspecting that
GC> it might be far worse on gtk than on msw.

 It's true that it's worse under wxGTK than under wxMSW but personally I'd
say that selecting an item in a list of ~100 of them is bad enough under
MSW already. So, again, for me it would make sense to use wxSpinCtrl for
this axis. But if you don't think it warrants complicating the code under
MSW, then I don't think it warrants it under GTK neither.

 IOW, if we want to make it as convenient as possible for the users, we
should be using the appropriate controls (wxSpinCtrl for the age, maybe
wxRadioBox for axis like smoker and sex -- which is faster to use then a
combo box because it doesn't require an extra click to drop down the list
but you can select the value directly). If, however, our main goals are the
uniformity of the interface and the simplicity of the code then wxChoice
should be used. So while I do know how the controls look and behave on
different platforms, I can't make this decision -- it's really the question
of priority and so the decision should be yours.

 Thanks in advance,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]