[Lazarus] New NumbersOnly property for TCustomEdit (r43678)
zeljko at holobit.net
zeljko at holobit.net
Thu Jan 23 09:55:33 CET 2014
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?
> You're right, that sounds weird. But why extend a TEdit and add
> Min-/Max-/Value properties including all the logistics behind them to
> get what the Float-/SpinEdit controls already offer?
>> Frank, are you complaining about the SIZE of the arrows?
>> Maybe you need smaller ones (or a property to set their size).
> Sometimes I'd like to have them completely removed, not least to gain
> Think of a 2-dimensional matrix of numbers, which have to be observed
> though hardly changed, where it may be disturbing to see all those
> values separated by spacious arrows.
> And for what reason do I need gradual ups and downs when entering a
> TCP port number, where there's no logical neighborhood between most of
> them and keyboard usage is the only sufficient way to change a value
> (SMTP ports: ..25..465..587..65535)? In those frequent cases offering
> arrows looks like a joke.
> 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).
IMO, only solution atm is to create your own class eg. TNumberEdit and
handle input events so you can discard anything except numbers.
More information about the Lazarus