[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Safe and consistent dereferencing and casting [Was: Code revie
From: |
Greg Chicares |
Subject: |
Re: [lmi] Safe and consistent dereferencing and casting [Was: Code review: product editor] |
Date: |
Mon, 16 Apr 2007 08:35:13 +0000 |
User-agent: |
Thunderbird 1.5.0.10 (Windows/20070221) |
On 2007-03-26 10:45Z, Evgeniy Tarassov wrote:
> On 3/24/07, Greg Chicares <address@hidden> wrote:
['multidimgrid_any.hpp']
>> and there I was wondering whether static type checking would be
>> possible, e.g.:
>>
>> - Windows axis_choice_wins_;
>> + std::vector<MultiDimAxisAnyChoice*> axis_choice_wins_;
>
> Currently the code does not force an axis to use a wxChoice as a
> widget for its value selection. It could use anything. On another hand
> lmi does not have (yet?) an axis which which is more complicated than
> a list of values
I can't imagine we'd ever want any other kind of axis.
Almost all axes are fixed enumerations. The only one that isn't
is the duration axis, which can be transformed into a string
list, as is presently done: [0, N] --> "0", "1", ...
> and the default wxChoice approach is used for every
> in 'lmi' axis. If you think that we do not benefit from such a feature
> (being generic) and that it brings too much of pointers joggling, then
> removing this 'feature' we will simplify the code a lot (since we will
> be able to move the value selection code from axis directly into
> MultiDimGrid, which will eliminate couple of helper functions and
> another couple of virtuals).
I'd consider that a beneficial change.
Can we use wxControlWithItems instead of wxChoice, without
adding any overhead or complexity? That would leave open the
possibility of using a listbox (or whatever), even though I
don't see a reason to use a different widget today. I'm only
guessing that you've written MultiDimAxisAnyChoice to use
the wxControlWithItems API, so that polymorphism would take
care of this without any need for downcasting--preserving
all the flexibility that we can get without paying for it,
while simplifying the code as above.