Developer

API Reference

AEECLSID_TextWidget

Brew Release
Brew MP 1.0.2
See Also
AEECLSID_StaticWidget IModel ISHELL_CreateInstance ITextModel IWidget_GetModel IWidget_SetFlags IWidget_SetExtent IDecorator_SetWidget Model Events
Description

Note: The AEECLSID_TextWidget and AEECLSID_StaticWidget classes replace the functionality of the ITextCtl interface, which has been deprecated.
The text widget is a user interface element that provides text entry facilities to the widget framework. The widget manages interaction between the application and OEM provided services for supporting various text entry methods (multitap, T9, etc), handles display of the text entry caret, and provides accessor functions for storing and retrieving entered text. Text widgets are usually implemented in conjunction with a static widget, to provide data entry fields in an application, as illustrated below.
        Favorite Color   <------------------------ Static widget
          +-----------------------------+
          | Red                         |  <------ Text widget
          +-----------------------------+
          
        Favorite Toy
          +-----------------------------+
          | Slinky                      |
          +-----------------------------+
          
        Favorite Inanimate Object
          +-----------------------------+
          | |                           |  <-- Current field with caret ('|') at point
          +-----------------------------+      where next character will be entered.

By default, the text widget is displayed within a border and the widget can be set to support either single or multiline text entry. When configured to support multiline text entry, the text widget will set its preferred height to at least two lines. The border abides to all the same properties as other borders in the widget framework (color, thickness, transparency, etc).
The text widget is implemented as using a controller that is usually provided by the OEM as AEECLSID_TextController. However, if the OEM has not provided a text controller, the text widget will use the default text controller provided by the widget framework. Text entry is actually captured by and handled by the text controller, with that object modifying the text model tied to both the controller and the text widget. The text widget listens for changes to the text model and will be notified of changes to the model, which in turn triggers the text widget to update what the user sees on the display in response to key presses. The relationship between the text widget, controller and text model can be illustrated with the following diagram.
     How the keys the user presses go from the user's thumb to the display.
     
                       +----------------+
     Key Press ------> |                |        +--------------------+
        'a'            |      Text    +--------> |                    |
                       |   Controller   |        |     Text Model     |
                       |                |        |         +          |
                       +----------------+        +---------|----------+
                                                           |
                                                           |
                                                           |
                                                           |
                                                           V
                                                 +--------------------------------+
                               Text Widget ----> | a|                             |
                                                 +--------------------------------+

When the user presses the 'a' key, the text controller updates the text model, triggering the text widget (which is listening for changes in the text model) to retrieve the updated model contents and redraw itself, resulting in the letter 'a' being displayed at the current caret location. The caret, in turn, moves in the text direction (in this case, left to right) and awaits the next action from the user.
The text widget is also attached to a view model, which will send scroll events (with 'evCode' set to EVT_MDL_SCROLL_CHANGE) to other objects registered with the text widget's view (i.e. scroll bars, etc).
Note. Text entry keys are handled (absorbed) by the TextWidget even if they did not result in a visible change to the widget or data change in the model. For instance when the cursor is at the beginning of text the CLR key will be absorbed (TRUE wil be returned) but will not affect the cursor or current focus of the widget. If an application wishes to act different in these situations, the cursor position of the TextWidget can be analyzed, and if necessary the key can be handled by the application instead.
To create a text widget, an application would do the following:
       1. Call ISHELL_CreateInstance() with a class ID of AEECLSID_TextWidget to
          create a text widget.  ISHELL_CreateInstance() will retrieve a reference
          counted instance of the class that manages the widget.
       2. Call IWidget_GetModel() to retrieve the text model associated with the text
          widget and populate this model with any existing text.
       3. If the text widget is to contain multiple lines of text, call
          IWidget_SetFlags() with the TWF_MULTILINE flag set.
       4. Call IWidget_SetExtent() to establish the extent of the text widget
       5. If the widget is to support some indication that the text can be scrolled,
          create and attach a scrollbar by calling IDecorator_SetWidget(), making
          sure that the scrollbar and text widget share the same view model.

The text widget, by default, will be created with the following characteristics:
           Horizontal extent:  40 pixels
             Vertical extent:  16 pixels
     Background transparency:  255  (fully transparent)
      Border Padding (left) :  3
     Border Padding (right) :  2
       Border Padding (top) :  1
    Border Padding (bottom) :  1
            Background color:  RGB_WHITE
            Character height:  12 pixels
                  Text color:  (0, 0, 255) Blue
         Selected text color:  RGB_WHITE
             Selection color:  (0, 0, 128) Medium Blue
             Number of lines:  1  (i.e. multiline mode is turned off)
                        Font:  AEECLSID_FONTSYSNORMAL
     Password Mask Character:  *

Supported Events: The text widget processes events in three passes. In the first pass the text widget will pass all events to the widget's controller, which will screen for key events and other events that pertain to controllers. If the controller accepts and processes the event, the text widget will return TRUE. If the event is not handled by the controller, the text widget will pass the event to its border for normal border event handling. Note, however, that the text widget will NOT pass events that set the PROP_SELECTED_BGCOLOR property onto the border, instead choosing to handle this event as described below. Events not handled by the border will be processed by the text widget itself, as follows:
Event                 Description
-----                 ------------------------------------------------------------
EVT_WDG_SETFOCUS:     The text widget responds to this event by accepting the focus, then
                      passes the event on to its border so that the border may be modified
                      as necessary to reflect the focus change.  Once handled, the text
                      widget returns TRUE to prevent any other objects from attempting to
                      claim the focus.
                      
EVT_WDG_SETPROPERTY:  The text widget responds to this event by attempting to set the
                      property identified by the 'wParam' parameter.  The text widget
                      allows the following properties to be set.
                      
                          PROP_FONT                   --  Sets the font to be used when displaying the
                                                          text.
                          PROP_FONT_CLASS             --  Sets the font class to be used when displaying
                                                          text.
                          PROP_FONT_OUTLINEWIDTH      --  Sets the font's outline width.  Must first
                                                          use PROP_FONT to set the font to a font
                                                          object that understands this property, no
                                                          effect otherwise.
                          PROP_FONT_OUTLINECOLOR      --  Sets the font's outline color.  Must first
                                                          use PROP_FONT to set the font to a font
                                                          object that understands this property, no
                                                          effect otherwise.
                          PROP_LINEGAP                --  Sets the spacing between lines of text.
                          PROP_FGCOLOR                --  Sets the color of the text.
                          PROP_SELECTED_BGCOLOR       --  Sets the text background color for the selected widget
                          PROP_SELECTED_FGCOLOR       --  Sets the text color for the selected widget
                          PROP_TEXT_SELECTED_FGCOLOR  --  Sets the text color for the selected text in a
                                                          text widget
                          PROP_TEXT_SACTIVE_FGCOLOR   --  Sets the text color for the selected text in a
                                                          text widget when the widget is active
                          PROP_TEXT_SINACTIVE_FGCOLOR --  Sets the text color for the selected text in a 
                                                          text widget when the widget is inactive
                          PROP_TEXT_SELECTED_BGCOLOR  --  Sets the background text color for the selected text
                                                          in a text widget
                          PROP_TEXT_SACTIVE_BGCOLOR   --  Sets the background text color for the selected text 
                                                          in a text widget when the widget is active
                          PROP_TEXT_SINACTIVE_BGCOLOR --  Sets the background text color for the selected text  
                                                          in a text widget when the widget is inactive
                          PROP_FLAGS                  --  Sets various flags that effect how the text
                                                          will be displayed.
                          PROP_PASSWORDMASKCHAR       --  Sets the replacement character that will be
                                                          displayed when the text widget has been
                                                          designated as a password field.
                          PROP_CARETWIDGET            --  Sets the caret widget.
                          PROP_TEXTCONTROLLERMODEKEY  --  Sets the text controller's mode change key.
                          PROP_ELLIPSIS               --  Allows caller to override what character
                                                          is used for ellipsis truncation.
                          PROP_TEXTLAYOUTCLASSID      --  Sets the class ID of the text layout.
                          PROP_FONTMAPMODEL           --  Sets the font map model for rich text.
                          PROPEX_AVOID_RECTS          --  Sets the list of rectangles that text must avoid during layout.
                          PROPEX_TAB_STOPS            --  Sets the list of tab stops.
                      
EVT_WDG_GETPROPERTY:  The text widget responds to this event by attempting to retrieve the
                      property identified by the 'wParam' parameter.  The text widget
                      allows the following properties to be retrieved.
                      
                          PROP_FONT                   --  Retrieves the font used to display the text.
                          PROP_FONT_OUTLINEWIDTH      --  Retrieves the current outline width of the
                                                          display text if the font supports this
                                                          property.
                          PROP_FONT_OUTLINECOLOR      --  Retrieves the current outline color of the
                                                          display text if the font supports this
                                                          property.
                          PROP_LINEGAP                --  Retrieves the spacing between lines of text.
                          PROP_FGCOLOR                --  Retrieves the text color.
                          PROP_TEXT_SELECTED_FGCOLOR  --  Retrieves the text color for the selected text in a
                                                          text widget
                          PROP_TEXT_SACTIVE_FGCOLOR   --  Retrieves the text color for the selected text in a
                                                          text widget when the widget is active
                          PROP_TEXT_SINACTIVE_FGCOLOR --  Retrieves the text color for the selected text in a 
                                                          text widget when the widget is inactive
                          PROP_TEXT_SELECTED_BGCOLOR  --  Retrieves the background text color for the selected text
                                                          in a text widget
                          PROP_TEXT_SACTIVE_BGCOLOR   --  Retrieves the background text color for the selected text 
                                                          in a text widget when the widget is active
                          PROP_TEXT_SINACTIVE_BGCOLOR --  Retrieves the background text color for the selected text  
                                                          in a text widget when the widget is inactive
                          PROP_FLAGS                  --  Retrieves the flags that dictate how the
                                                          text will be displayed.
                          PROP_VIEWMODEL              --  Retrieves the view model attached to the text widget, 
                                                          incrementing the reference count of the view model.
                          PROP_CARETPOS               --  Retrieves the current caret position.
                          PROP_CARETWIDGET            --  Retrieves the caret widget.
                          PROP_TEXTCONTROLLERMODEKEY  --  Retrieves the text controller's mode change key.
                          PROP_ELLIPSIS               --  Retrieves the character used to indicate
                                                          text has been truncated.
                          PROP_TEXTLAYOUTCLASSID      --  Retrieves the class ID of the text layout. 
                          PROP_FONTMAPMODEL           --  Retrieves the font map model for rich text.
                          PROP_TEXTRECTS              --  Retrieves an array of rectangles that represent the 
                                                          display location of a range of text.
                          PROPEX_AVOID_RECTS          --  Retrieves the list of rectangles that text must avoid during layout.
                          PROPEX_TAB_STOPS            --  Retrieves the list of tab stops.


The text widget also responds to and initiates several model events, as follows:
Event                   Description
-----                   ------------------------------------------------------------
EVT_MDL_TEXT_CHANGE:    The text widget listens for changes in its attached text model and will
                        receive an EVT_MDL_TEXT_CHANGE model event when the text stored within
                        the text model changes.  The text widget responds to these changes by
                        invalidating its bounding rectangle and redrawing.
                      
EVT_MDL_TEXT_SELECT:    The text widget listens for changes in its attached text model and will
                        receive an EVT_MDL_TEXT_CHANGE model event when the selection state of
                        the text changes.  The text widget responds to these changes by
                        invalidating its bounding rectangle and redrawing.
                      
EVT_MDL_SCROLL_CHANGE:  The text widget generates EVT_MDL_SCROLL_CHANGE events to notify
                        listening objects of changes to the scroll state of the displayed text.
                        For example, in a multiline text widget, when the text has flowed past
                        the widget's vertical extent an EVT_MDL_SCROLL_CHANGE event will be
                        generated to inform other objects that the scroll state has changed.
                        An attached object such as a scrollbar could then redraw itself to
                        reflect the new scroll position.

Properties:

Property                 Description
--------                 ------------------------------------------------------------
PROP_FONT:               This property contains a pointer to the IFont that will be used to render
                         the text displayed within the text widget.
                                
                             Property Value:  IFont *

PROP_FONT_CLASS:         This property sets the class id to be used when rendering text displayed 
                         with the text widget. It is a shortcut for PROP_FONT as it saves having
                         to create the font and passing it in using PROP_FONT.

                             Property Value: AEECLSID

PROP_FONT_OUTLINEWIDTH:  This property sets the width of the outline to be applied when rendering
                         text within the static widget.  Setting this property only effects the
                         text if an IFont object (such as an IHFont)  that understands this 
                         property was set earlier via the PROP_FONT property.

                             Property Value: int

PROP_FONT_OUTLINECOLOR:  This property sets the color of the outline to be applied when rendering
                         text within the static widget.  Setting this property only effects the
                         text if an IFont object (such as an IHFont)  that understands this 
                         property was set earlier via the PROP_FONT property.

                             Property Value: RGBAVAL

PROP_FLAGS:              This property contains a set of flags that dictate the display
                         characteristics of the text being entered in the text widget.  
                         The text widget defines the following widget specific flags -
                              
                         TWF_MULTILINE
                         -------------
                         When this flag is set the text displayed by the text widget will wrap
                         at the widget's horizontal extent, thereby providing multiline text
                         entry.  When this flag is clear text entry is on a single line and does
                         not wrap -- however, the text may extend beyond the horizontal extent,
                         thereby providing an opportunity to track or manage horizontal scrolling
                         for this text.
                              
                         TWF_VERTICALNAV
                         ---------------
                         When this flag is set the text displayed by the text widget may be
                         navigated vertically via the AVK_UP and AVK_DOWN virtual key codes.
                         Events that indicate a press of either of these keys will move the
                         text entry caret to a new line, in the direction specified by the
                         pressed key.
                              
                         TWF_PASSWORD
                         ------------
                         When this flag is set, text entered into the text widget will
                         replaced by the character contained in the PROP_PASSWORDMASKCHAR
                         property, thereby lending a sense of on-screen privacy to the
                         password being entered by the user.  For example, if an application
                         wishes to provide a field into which the user enters credit card
                         information, they may wish to set the TWF_PASSWORD flag on the
                         text widget.  As the use keys in their credit card, the character
                         stored in the PROP_PASSWORDMASKCHAR property (by default, the '*"
                         character) will appear in the widget rather than the typed text.

                         TWF_SHORTENTEXT
                         ---------------
                         When this flag is set and the widget is no longer active, the widget
                         will display the start of the string.  The text that does not fit into
                         the display window will be truncated into an ellipsis.

                             Property Value:  uint32

PROP_FGCOLOR:            This property contains the color the text widget will use to draw
                         its text.  Note that the text widget maintains two separate text colors -
                         PROP_FGCOLOR, which provides the text color when entering text, and
                         PROP_SELECTED_FGCOLOR, which provides the text color of text when it is
                         selected.
                             
                             Property Value:  RGBVal

PROP_SELECTED_FGCOLOR:   This property contains the color the text widget will use to draw
                         selected text.  Note that the text widget maintains two separate text
                         colors -  PROP_SELECTED_FGCOLOR, which provides the text color of text
                         when it is selected, and PROP_FGCOLOR, which provides the text color when
                         entering text.
                             
                             Property Value:  RGBVal

PROP_SELECTED_BGCOLOR:   This property contains the color the text widget will use to draw
                         selected text.  This is NOT the color of the text, rather, it is the
                         background color upon which the selected text is drawn.  When text is
                         unselected, it is drawn over the normal background of the text widget
                         using PROP_FGCOLOR.  When the text is selected, it is drawn over a
                         PROP_SELECTED_BGCOLOR background, using PROP_SELECTED_FGCOLOR to render
                         the text.
                         
                             Property Value:  RGBVal
                             
PROP_VIEWMODEL:          This property contains a pointer to the view model that may be attached
                         to the text widget, returning that pointer in an IModel pointer passed
                         in the 'dwParam' parameter passed to the text widget with the
                         EVT_WDG_GETPROPERTY event.  The text widget uses this model as a
                         vehicle for notifying attached objects of scroll changes.  For example,
                         when the text entered into a single line text widget extends beyond the
                         widget's horizontal extent, a scroll event will be communicated to other
                         objects via the text widget's view model.
                              
                         The text widget does not support attempts to set the PROP_VIEWMODEL
                         property.

                             Property Value:  IModel *

PROP_CARETPOS:           This property contains the current position of the caret, relative to the
                         origin of the text widget.  The position is stored as a 32 bit value with
                         the horizontal position stored in the lower 16 bits, and the vertical
                         position stored in the upper 16 bits.

                             Property Value:  uint32

PROP_CARETWIDGET:        This property contains the widget used to draw the caret.  The text widget
                         creates a caret widget by default, but a custom caret can also be set. Setting
                         this property to NULL will cause no caret to be displayed.

                             Property Value:  IWidget *

PROP_STARTLINE           This property allows multiline text widgets to obtain the position of the
                         start of the line corresponding to the input position, This property is
                         used with IWidget_GetProperty only. The dwParam argument is an in/out 
                         parameter of type pointer to int. On entry, the value pointed to is a
                         position for which the line start position will be returned. On exit,
                         the returned value is the line start position.
                         
                             Property Value:  int *

PROP_PREVLINE            This property allows multiline text widgets to obtain the position of the
                         start of the previous line corresponding to the input position, This 
                         property is used with IWidget_GetProperty only. The dwParam argument is 
                         an in/out parameter of type pointer to int. On entry, the value pointed to 
                         is a position for which the previous line start position will be returned. 
                         On exit, the returned value is the previous line's start position.
                         
                             Property Value:  int *

PROP_NEXTLINE            This property allows multiline text widgets to obtain the position of the
                         start of the following line corresponding to the input position, This 
                         property is used with IWidget_GetProperty only. The dwParam argument is 
                         an in/out parameter of type pointer to int. On entry, the value pointed to 
                         is a position for which the next line's start position will be returned. 
                         On exit, the returned value is the next line's start position.
                         
                             Property Value:  int *

PROP_TEXTCONTROLLER      This property allows the caller to get the current text widget's controller,
                         or replace the current text widget's controller with an app-supplied controller.
                         
                             Property Value:  IController *

PROP_PASSWORDMASKCHAR    This property contains the replacement character to be used in password
                         entry fields.  When the TWF_PASSWORD property flag has been set on the
                         text widget, all text entered into that field will be displayed using
                         the character contained in PROP_PASSWORDMASKCHAR.
                         
                             Property Value:  AECHAR
                             
PROP_PASSWORDMASKDELAY   This property contains the time delay in milliseconds from the time a
                         character is typed and initially displayed until the time that it is
                         replaced by the mask character (PROP_PASSWORDMASKCHAR). Use a value of
                         zero to never display the typed character and only display the mask
                         character.
                         
                             Property Value: int


PROP_TEXTCONTROLLERMODEKEY  
                         This property contains the virtual key code that will be used by 
                         the text controller to cycle through the valid text input modes.  
                         Use AVK_UNDEFINED to disallow changing of the input mode by the user.

                             Property Value: AVKType


PROP_ELLIPSIS:           This property contains the character to be used to indicate when 
                         text has been truncated within a text widget.  If not set, or set 
                         to NULL, the text widget will make its best guess at determining 
                         the code point for the ellipsis character based on the device encoding.  
                         Applications may set this property to override this behavior and force 
                         the widget to use a particular character as the ellipsis, such as 
                         0x2026, the Unicode code point for the ellipsis.  This may be useful 
                         for applications that use Unicode fonts that include the ellipsis
                         character but run on a device with a non-Unicode device encoding.

                             Property Value:  AECHAR

PROP_TEXTLAYOUTCLASSID  This property contains the class ID for the text layout. The text widget
                        uses the text layout created with this class ID to lay out and draw text.
                        
                             Property Value:  AEECLSID
                                           
PROP_FONTMAPMODEL       This property contains the font map model used for rich text.
 
                             Property Value:  IFontMapModel *

PROP_TEXTRECTS           This property gets an array of rectangles that represent the display 
                         location of a range of text.

                             Property Value: WidgetTextRects*

                         The WidgetTextRects structure is defined and used as follows

                         typedef struct {
                              uint32   count;  // in: if pRects is not equal to NULL, then count 
                                               //     contains the number of AEERect allocated in
                                               //     pRects.
                                               // out: output contains the number of rects needed
                                               //      to locate the range of text,
                              uint32   flags;  // in: for future expansion, currently must be zero.
                              uint32   start;  // in: starting character index to range of text
                              uint32   end;    // in: ending character index to range of text
                              AEERect* pRects; // out: array of rects that locate the range of text.
                                               //      using the text widget coordinates.
                                               //      
                         } WidgetTextRects;

IWidget_GetTextRects


PROPEX_AVOID_RECTS       This property contains the list of rectangles that text
                         must avoid during layout. It is made up of a fixed
                         length structure followed by a variable length array of
                         AEERect elements. The fixed length structure,
                         WAvoidRects, follows -

                           typedef struct {
                              int   nCount;  // AEERect count of the following array.
                           }
                           WAvoidRects;

                         The following code snippet demonstrates how to easily
                         set this property -

                           int nAvoidRectCount = 1;
                           int nSize = WAvoidRects_CalcSize(nAvoidRectCount);
                           WAvoidRects* pAvoidRects = MALLOC(nSize);
                           if (NULL != pAvoidRects) {
                              AEERect* pAvoidRectArray = WAvoidRects_GetArray(pAvoidRects);
                              pAvoidRects->nCount = nAvoidRectCount;
                              SETAEERECT(&pAvoidRectArray[0], nLeft, nTop, nWidth, nHeight);
                              nErr = IWidget_SetAvoidRects(me->piw, nSize, pAvoidRects);
                              FREEIF(pAvoidRects);
                           }

                         The following code snippet demonstrates how to easily
                         get this property -

                           int nSize = 0;
                           WAvoidRects* pAvoidRects = NULL;
                           nErr = IWidget_GetAvoidRects(me->piw, &nSize, pAvoidRects);
                           if (AEE_SUCCESS == nErr) {
                              pAvoidRects = MALLOC(nSize);
                              if (NULL != pAvoidRects) {
                                 nErr = IWidget_GetAvoidRects(me->piw, &nSize, pAvoidRects);
                                 if (AEE_SUCCESS == nErr) {
                                    // Optional validation to prevent buffer overflow.
                                    nErr = WAvoidRects_Validate(nSize, pAvoidRects);
                                    if (AEE_SUCCESS == nErr) {
                                       // Access property fields here.
                                       int nAvoidRectCount = pAvoidRects->nCount;
                                       AEERect* pAvoidRectArray = WAvoidRects_GetArray(pAvoidRects);
                                    }
                                 }
                                 FREEIF(pAvoidRects);
                              }
                           }


PROPEX_TAB_STOPS         This property contains the list of tab stops. It is
                         made up of a fixed length structure followed by a
                         variable length array of WTabStop elements. The fixed
                         length structure, WTabStops, follows -

                           typedef struct {
                              int   nCount;  // WTabStop count of the following array.
                           }
                           WTabStops;

                         The variable length array is made up of WTabStop
                         elements shown below -

                           typedef struct {
                              int   nType;   // Type of tab stop.
                              int   nPos;    // Position of tab stop.
                           }
                           WTabStop;

                         The possible values for nType are -

                           typedef enum {
                              W_TAB_STOP_TYPE_UNKNOWN = 0,
                              W_TAB_STOP_TYPE_LEFT,
                              W_TAB_STOP_TYPE_CENTER,
                              W_TAB_STOP_TYPE_RIGHT
                           }
                           WTabStopType;

                         The following code snippet demonstrates how to easily
                         set this property -

                           int nTabStopCount = 1;
                           int nSize = WTabStops_CalcSize(nTabStopCount);
                           WTabStops* pTabStops = MALLOC(nSize);
                           if (NULL != pTabStops) {
                              WTabStop* pTabStopArray = WTabStops_GetArray(pTabStops);
                              pTabStops->nCount = nTabStopCount;
                              pTabStopArray[0].nType = W_TAB_STOP_TYPE_LEFT;
                              pTabStopArray[0].nPos = 25;
                              nErr = IWidget_SetTabStops(me->piw, nSize, pTabStops);
                              FREEIF(pTabStops);
                           }

                         The following code snippet demonstrates how to easily
                         get this property -

                           int nSize = 0;
                           WTabStops* pTabStops = NULL;
                           nErr = IWidget_GetTabStops(me->piw, &nSize, pTabStops);
                           if (AEE_SUCCESS == nErr) {
                              pTabStops = MALLOC(nSize);
                              if (NULL != pTabStops) {
                                 nErr = IWidget_GetTabStops(me->piw, &nSize, pTabStops);
                                 if (AEE_SUCCESS == nErr) {
                                    // Optional validation to prevent buffer overflow.
                                    nErr = WTabStops_Validate(nSize, pTabStops);
                                    if (AEE_SUCCESS == nErr) {
                                       // Access property fields here.
                                       int nTabStopCount = pTabStops->nCount;
                                       WTabStop* pTabStopArray = WTabStops_GetArray(pTabStops);
                                    }
                                 }
                                 FREEIF(pTabStops);
                              }
                           }


Required Model: - ITextModel
- IModel

Model Data:
   
   TextInfo modelData;

The text widget relies on a text model that contains a TextInfo data structure that contains information about and a pointer to the text that is being entered. The text widget uses this data to measure, position and draw the text. The model should return a pointer to this data structure in response to data queries from a client widget.
The text widget also relies on a view model that it simply uses as a conduit for sending scroll events to listening objects.
The models used by the text widget are created by the widget itself as default implementations but may be replaced by any client that wishes to provide their own model. However, clients that provide their own model interface to the text widget must abide by the data conventions described above, returning a pointer to a TextInfo data structure when queried for the model data.
Instantiaion
The static widget is instantiated by passing AEECLSID_TextWidget into ISHELL_CreateInstance.
Cleanup
The text widget is reference counted. When you are done with your reference to the text widget, you should release that reference. Any text widget specific cleanup will be handled for you when all references are released.
Default Interface Name
Comment
None
  • Follow