[Lazarus] New NumbersOnly property for TCustomEdit (r43678)
poretzky at nym.mixmin.net
Fri Jan 24 16:41:45 CET 2014
On Thu, 23 Jan 2014 03:55:33 -0500, zeljko at holobit.net wrote:
>On 2014-01-22 18:50, Frank Poretzky wrote:
>> On Wed, 22 Jan 2014 11:43:49 -0200, Alexsander Rosa wrote:
>>> 2014/1/22 Mattias Gaertner <nc-gaertnma at netcologne.de>
>>>> > Frank Poretzky <poretzky at nym.mixmin.net> hat am 22. Januar 2014 um 13:12
>>>> > geschrieben:
>>>> > On Sat, 11 Jan 2014 13:57:48 +0100, Bart wrote:
>>>> > >Personally I would go for a T(Float)SpinEdit rather than a MaskEdit.
>>>> > Yes, that's the easiest way to control range-bound number input. It
>>>> > just lacks an option to get rid of those spacious up/down elements.
>>>> > Any chance to get that done?
>>>> A TSpinEdit without spins elements?
>>>> Why not use TEdit?
>> A single boolean ShowArrows property or, following your idea, an
>> integer ArrowsWidth property with '0' removing it completely would
>> solve that problem preserving a coherent codebase.
>It's not "just like that". What widgetsets supports hiding arrows ? Only
>windows or none ? On the other side we don't have ability to create
>special TEdit + Arrows which can be hidden (arrows must be child of
>TEdit), and that's probably possible only with qt and maybe with win32
>(gtk2/carbon does not support such things).
You're right. The arrow elements aren't allowed to be there in the
first place. OTOH I don't see an urgent need to support changing
visibility of the spinner part during runtime. ...
>IMO, only solution atm is to create your own class eg. TNumberEdit and
>handle input events so you can discard anything except numbers.
... So why not introduce a TCustomEdit based intermediary
TCustomFloatEdit class including the SpinEdit's Min-/Max-/Value
properties with the related logistics, from which then the
TCustomFloatSpinEdit class with the spinner part added derives? That
separation would prevent widgetset modifications as well as redundant
number filtering code.
More information about the Lazarus