Hi. Sorry for late response. I have not internet yesterday. 2013/5/20 Igor Stasenko <siguc...@gmail.com>
> On 19 May 2013 22:01, Denis Kudriashov <dionisi...@gmail.com> wrote: > > Hello. > > > > New TxText version 0.8 is ready: > > > > - editor stuff extracted to separate packages TxText-Editor and > > TxTextTests-Editor > > - edit decorators implemented: > > > > TxNoneEditDecorator- basic editing > then maybe it should be named as basiceditdecorator? > I named it "none" edit decorator because It actually not performs any decoration around basic editing operations. TxNoneEditDecorator just performs it. Concrete edit decorator can execute specific action on text to perform requested edit operation. There are three edit operations: #insertCharacters:at:, #removeNextCharacterAt:, #removePreviousCharacterAt:. They take aTextSelection as "at" argument. For example TxInsertModeEditDecorator extends text selection before characters insertion: TxInsertModeEditDecorato>>insertCharacters: aString at: aTextSelection aTextSelection isEmpty ifTrue: [aTextSelection end moveRight: aString size] aTextSelection replaceWith: aString > > > TxMaskedEditDecorator- input masked values like phone numbers > > TxInsertModeEditDecorator - input with "insert mode" where any new > character > > replace next one. > insert mode is actually opposite - inserts when you type. > replace mode is replaces when you type. > I choose this name because on Windows you have "insert key" to activate such mode in many text editors. > > > TxSmartCharsEditDecorator- input smart characters like ()[]{} > > TxSingleLineEditDecorator - general way to decorate editing with simple > > decoration format. TxSmartNumbersDecorationFormat is example. It > transform > > text with number format like: '10 000 000' or '10'000'000'. > > > btw, can you wrap decorators on top of each other i.e. > > Masked-SimgleLine > so i could have a single-line editor for entering only a phone number? > Now with mask decorator you have single line text field. Multilined mask is not supported (I dont try it actually). When you insert miltiline text to masked field only first line will be used. I make such restriction to simplify implementation. Actually I never see multilined masked field. Decorators can not be wrapped in general way. Maybe some of it. But there is no cases in current decorators. Main reason: most of decorators change cursor position with very specific way. And wrapping decorators will lead to unpredictable and useless results. Your example Masked-SingleLine (if mask can be multilined) is not about wrapping decorators. It is about input "filtering" . It is my next task. I want put at text morph specification of correct input. So you can forbid "cr" characters, can allow only numbers and etc. And at same time decorators can restrict input by its implementation requirements which happens with masked decorator. But edit decorators and "filters" are different concepts (I not choose name for "filters" yet). TxSingleLineEditDecorator implements general way to edit single line text with simple decoration format. Maybe it should be renamed. TxSingleLineEditDecorator transforms full text by decoration format after any edit operation. And it saves logical cursor position after transformation. Look at methods of TxSmartNumbersDecorationFormat as example. I will be happy if you introduce more clever names. Good names is difficult task for single brain. Especially if you are not native english speaker. But many of you already suggest different names. How we can agree on any one? Best regards, Denis > also, going ahead.. how easy/hard would be to implement a password input > field, > when model contains what user types, but display all *** chars? > > > According methods were added to TxTextMorph: > > > > #editDecorator: - set specific edit decorator (TxNoneEditDecorator by > > default) > > #inputContents - returns "native" value (undecorated). > > #displayedContents - returns raw text model asString > > > > See new examples on TxTextMorph class side. > > > > Best regards, > > Denis > > > > -- > Best regards, > Igor Stasenko. > >