Packagecom.keepcore
Classpublic class KCTextArea
InheritanceKCTextArea Inheritance mx.controls.TextArea

The KCTextArea class can be used to replace the native TextArea components with efficiency.

Samples & additional information on KCTextArea on KeepCore website.
Version 1.0.

It adds the Undo/Redo features. Undo & Redo actions are available from keyboard shortcuts and from context menu.
It can also adds a lot of interesting features:
  • Auto-size according to its contents (AutoSized property).
  • Automatic parent scrolling to let the focus on the cursor as user types text or moves with arrows (AutoScrollParent & ScrollParent properties).
  • Automatic text selection on component focus (SelectTextOnFocus property).
  • Cursor set at the end of the text on component focus (CursorOnTextEnd property).
  • Allows to let the selection visible even if component does not have focus (AlwaysShowSelection property).
  • Prevent bad control keyboard shortcuts: with IE some CTRL keyboard shortcuts produce weird characters (PreventBadControlShortcuts property).
  • Note: in the evaluation version, KeepCore logo is shown every minute.



    Public Properties
     PropertyDefined by
      AlwaysShowSelection : Boolean
    Specify if component selection must be displayed even if component does not have focus.
    KCTextArea
      AutoScrollParent : Boolean
    Specify if parent has to automatically scrolled when user types text or moves cursor with arrows.
    KCTextArea
      AutoSized : Boolean
    Specify if component must be automatically sized according to its contents.
    KCTextArea
      CursorOnTextEnd : Boolean
    Specify if cursor is set at the end of the text when component receives focus.
    KCTextArea
      htmlText : String
    [write-only] Overrides htmlText setter.
    KCTextArea
      ManageUndoRedo : Boolean
    Specify if component manages Undo/Redo feature.
    KCTextArea
      MinLineNumber : int
    Specify if component must respect a minimum line count.
    KCTextArea
      PreventBadControlShortcuts : Boolean
    Specify if bad control keyboard shortcuts have to pe prevented.
    KCTextArea
      ScrollParent : Container
    The parent used for automatic scrolling.
    KCTextArea
      SelectTextOnFocus : Boolean
    Specify if text has to be selected when component receives focus.
    KCTextArea
      text : String
    [write-only] Overrides text setter.
    KCTextArea
      Version : String
    [read-only] Component version.
    KCTextArea
    Public Methods
     MethodDefined by
      
    Class constructor The constructor manages the component context menu creation and initialization.
    In order to specify your own labels for context menu, you have to define a General.properties file in a "locales\\" folder.
    This file must contains:
  • "UndoChange": default translation is "Undo (CTRL+Z)"
  • "RedoChange": default translation is "Redo (CTRL+Y / CTRL+SHIFT+Z)"
  • "UndoAllChanges": default translation is "Undo All"
  • "RedoAllChanges": default translation is "Redo All"
  • Note: fr_FR locale management is already embedded in the component.

    KCTextArea
      
    AutoSize():void
    Force the component automatic sizing.
    KCTextArea
      
    setStyle(styleProp:String, newValue:*):void
    Overrides setStyle method.
    KCTextArea
    Protected Methods
     MethodDefined by
      
    measure():void
    Overrides measure method.
    KCTextArea
    Property detail
    AlwaysShowSelectionproperty
    AlwaysShowSelection:Boolean  [read-write]

    Specify if component selection must be displayed even if component does not have focus.

    The default value is false.

    Implementation
        public function get AlwaysShowSelection():Boolean
        public function set AlwaysShowSelection(value:Boolean):void
    AutoScrollParentproperty 
    AutoScrollParent:Boolean  [read-write]

    Specify if parent has to automatically scrolled when user types text or moves cursor with arrows.

    The default value is true.

    Implementation
        public function get AutoScrollParent():Boolean
        public function set AutoScrollParent(value:Boolean):void

    See also

    AutoSizedproperty 
    AutoSized:Boolean  [read-write]

    Specify if component must be automatically sized according to its contents.

    The default value is true.

    Implementation
        public function get AutoSized():Boolean
        public function set AutoSized(value:Boolean):void
    CursorOnTextEndproperty 
    CursorOnTextEnd:Boolean  [read-write]

    Specify if cursor is set at the end of the text when component receives focus.

    The default value is true.

    Implementation
        public function get CursorOnTextEnd():Boolean
        public function set CursorOnTextEnd(value:Boolean):void
    htmlTextproperty 
    htmlText:String  [write-only]

    Overrides htmlText setter.

    Implementation
        public function set htmlText(value:String):void
    ManageUndoRedoproperty 
    ManageUndoRedo:Boolean  [read-write]

    Specify if component manages Undo/Redo feature.

    The default value is true.

    Implementation
        public function get ManageUndoRedo():Boolean
        public function set ManageUndoRedo(value:Boolean):void
    MinLineNumberproperty 
    MinLineNumber:int  [read-write]

    Specify if component must respect a minimum line count.

    The default value is 1.

    Implementation
        public function get MinLineNumber():int
        public function set MinLineNumber(value:int):void
    PreventBadControlShortcutsproperty 
    PreventBadControlShortcuts:Boolean  [read-write]

    Specify if bad control keyboard shortcuts have to pe prevented. These shortcuts are effective on Internet Explorer (CTRL+K, CTRL+U...)

    The default value is true.

    Implementation
        public function get PreventBadControlShortcuts():Boolean
        public function set PreventBadControlShortcuts(value:Boolean):void
    ScrollParentproperty 
    ScrollParent:Container  [read-write]

    The parent used for automatic scrolling. You have to explicitly set it if the parent to scroll is not the direct component parent (component embedded in a form embedded in a Box for example).

    The default value is current parent container.

    Implementation
        public function get ScrollParent():Container
        public function set ScrollParent(value:Container):void

    See also

    SelectTextOnFocusproperty 
    SelectTextOnFocus:Boolean  [read-write]

    Specify if text has to be selected when component receives focus.

    The default value is true.

    Implementation
        public function get SelectTextOnFocus():Boolean
        public function set SelectTextOnFocus(value:Boolean):void
    textproperty 
    text:String  [write-only]

    Overrides text setter.

    Implementation
        public function set text(value:String):void
    Versionproperty 
    Version:String  [read-only]

    Component version.

    Implementation
        public function get Version():String
    Constructor detail
    KCTextArea()constructor
    public function KCTextArea()

    Class constructor The constructor manages the component context menu creation and initialization.
    In order to specify your own labels for context menu, you have to define a General.properties file in a "locales\\" folder.

    This file must contains:
  • "UndoChange": default translation is "Undo (CTRL+Z)"
  • "RedoChange": default translation is "Redo (CTRL+Y / CTRL+SHIFT+Z)"
  • "UndoAllChanges": default translation is "Undo All"
  • "RedoAllChanges": default translation is "Redo All"
  • Note: fr_FR locale management is already embedded in the component.

    Method detail
    AutoSize()method
    public function AutoSize():void

    Force the component automatic sizing. Has only effect if AutoSized property is set to true.

    measure()method 
    protected override function measure():void

    Overrides measure method. The component manages its own measurement policies.

    setStyle()method 
    public override function setStyle(styleProp:String, newValue:*):void

    Overrides setStyle method. The component resizes itself when style is dynamically changed. Sets a style property on this component instance.

    This may override a style that was set globally.

    Calling the setStyle() method can result in decreased performance. Use it only when necessary.

    Parameters
    styleProp:String — Name of the style property.
     
    newValue:* — New value for the style.