[Gambas-devel] ValueBox
Fabián Flores Vadell
fabianfloresvadell at ...176...
Wed Apr 21 18:08:03 CEST 2010
> I won't do the previous methods, because TextBox is a native control in both
> gb.qt and gb.gtk, and so its methods must be native methods.
>
> All that is syntactic sugar that can be implemented by extending the TextBox
> directly in Gambas code.
OK, I understand.
> I don't see the need of the mask property outside of the TextBox or
> MaskedBox
> control, because it implies both formatting the displayed text and managing
> the key events.
I was thinking that the mask would be just a facility to do easier to
write patterns that determine what a control will accept as input. So,
if mask would be available as a Gambas class or simply a function,
could be used anywhere, and the Gambas user could use it for its own
purposes (e.g. to filter the input in a custom control).
> Don't forget that the user may want to edit just a date, just a time, or
> both
> date and time. The same DateBox control should allow all that. And have a
> popup calendar for the date part.
Yes.
> I'm not sure if using inheritance for implementing all the possible features
> of ValueBox is a good idea.
Why, do you think that?
I don't know if would be a good idea but I think than this should be explored.
Finally, what I want is find a good OO design, because I don't like
the idea of a very extensive class. I tend to think that this would be
a class write according to the paradigm modular / structured rather
than OO, and probably would result in poorly cohesive class.
What do you think?
> I'm not against DateBox, but I don't like having
> dozen of different controls for editing different things.
Oh, no. That isn't the idea. But the ValueBox could be a wrapper class
for diferent specifics controls.
> I prefer an unique interface, ValueBox, whose behaviour is entirely defined
> by
> its Type property.
Yes, I agree.
> Don't forget that I want to use this control in the GUI
> database component, to easily edit database fields. I want to let the user
> have an optional gambas-specific metadata table in its database, that the
> component will use to configure the ValueBox that will edit each field.
Absolutely. We agree about that, but the differences are about design.
Probably your perspective is correct, only that I still haven't clear.
--
Fabián Flores Vadell
www.speedbooksargentina.blogspot.com
More information about the Devel
mailing list