[Classes] [Prev] [Next] [Methods]

CNativeTextEdit

Methods Index

Heritage
Description
Usage
Environment
Protected Data Members
Private Data Members
Public Methods
Destructor and Initializer Methods
Text Utilities
Selection Utilities
Non-text Utilities
Validation Handling
Tabbing Utilities
Inherited Utilities
Mouse Events
Get a Handle to an XVT Text Edit Object
Keyboard Navigation
Protected Methods
Constructor Methods
Internal Text Manipulation
TDI Enabling Methods

CNativeTextEdit


Heritage

Superclass: CView

Subclasses: NLineText, NTextEdit


Description

CNativeTextEdit is the abstract text editing class that provides functionality for native text edit boxes. The CNativeTextEdit branch of CView represents text edit objects, allowing the user to display text inside views, type in text, and perform the usual cut, paste, and copy operations. All CNativeTextEdit objects inherit the properties of CView, such as sizing, dragging, and so on. As an abstract class, CNativeTextEdit represents a rectangular text edit area on the screen and provides basic text manipulation methods. There is no concept of lines, paragraphs, or scrolling at this level. These text properties are embodied in the various classes that are derived from CNativeTextEdit, classes that represent the different types of text editing systems available in XVT-Power++.


Usage

This is an abstract class. You must derive your own classes from it or use such classes as NLineText or NTextEdit.


Environment

The text is drawn in the foreground color; the border is drawn with the pen color. The interior of the text box is drawn in the background color.


Protected Data Members

The following data members are used for the slow initialization required for resource instantiation.

TXEDIT itsTextEdit; The native view
int itsLimit The maximum number of characters
UNITS itsMargin The right margin, counted from the left
unsigned short itsTXAttributes The TXEDIT attributes
CFont itsTempFont A temporary font used in creation; this data member is not maintained and is not valid after construction
int itsTab The tab spacing
int itsSuspendCount Keeps count of nested Suspend() and Resume() calls.
long itsKeyFocusCmd Command sent when the text edit receives keyboard focus
long itsKeyFocusLost Command sent when the text edit loses keyboard focus
long itsTextCmd Command sent when text is changed by the user or programatically


Private Data Members

BOOLEAN itAutoSelects; Whether there is auto selection
static WINDOW itsUpdateWindow; The window needs updating


Public Methods

Destructor and Initializer Methods

virtual ~CNativeTextEdit(void);
BOOLEAN INativeTextEdit(unsigned theAttributes	= TX_BORDER,
UNITS theRightMargin = 1000,
int theCharactedLimit = 1000,
const CStringRW theInitialText = NULLString,
BOOLEAN isAutoSelected = FALSE,
BOOLEAN isVisible = TRUE,
GLUETYPE theGlue = NULLSTICKY);

Table 10. XVT Portability Toolkit Text Edit Attributes
Constants Operation of the Text Edit Object
TX_AUTOHSCROLL
Enables horizontal automatic scrolling when the user drags the mouse outside of the view rectangle.
TX_AUTOVSCROLL
Enables vertical automatic scrolling
TX_BORDER
Draws a rectangular border around the view rectangle.
TX_DISABLED
Disables the text edit system.
TX_ENABLECLEAR
Leaves the clear item in the Edit menu always enabled.
TX_INVISIBLE
Sets text to invisiblility.
TX_NOCOPY
Does not enable the Copy command on the Edit menu.
TX_NOCUT
Does not enable the Cut command on the edit menu.
TX_NOMENU
Prevents the text editing system from changing the menu of the window containing the text editing object. This attribute is useful if there is no Edit menu. If a CNativeTextEdit object is placed in a window without a menubar, TX_NOMENU must be used.
TX_NOPASTE
Does not enable the Paste command on the Edit menu.
TX_ONEPAR
Limits editing to one paragraph; ignores carriage returns.
TX_OVERTYPE
Enables "overtype" mode that allows users to replace existing characters when typing instead of inserting characters in front of existing text.
TX_READONLY
Does not allow changes to the text except from the application program.
TX_WRAP
Enables word wrap to the margin.

Text Utilities

virtual void SetText(const CStringRW& theText);
virtual BOOLEAN Append(const CStringRW& theText);
virtual CStringRW GetText(void) const;
virtual T_CNUM GetNCharInText(void) const;

Selection Utilities

virtual void SelectText(void);
virtual CStringRW GetSelectedText(void) const;
virtual T_CNUM GetNCharInSelection(void) const;

Non-text Utilities

virtual BOOLEAN Clear(void);
virtual BOOLEAN IsEmpty(void) const;
virtual void SetAttribute(
unsigned theAttribute,BOOLEAN isSet=TRUE);
virtual unsigned long GetAttributes(void) const;
virtual void SetLimit(int theCharacterLimit);
virtual int GetLimit(void) const;
virtual void SetMargin(UNITS theRightMargin);
virtual UNITS GetMargin(void) const;
virtual void Reset(void);
virtual void Suspend(void);
virtual void Resume(void);

Control and Command Settings

virtual void DoHit(CONTROL_INFO theControlInfo);
virtual void SetFocusCommands(
long theKeyFocusCommand,
long theKeyFocusLostCommand);
virtual void SetTextCommand(long theTextCommand);
long GetTextCommand( void ) const;
long GetKeyFocusCommand(void) const;
long GetKeyFocusLostCommand(void) const;

Validation Handling

virtual int Validate(int theKey,
BOOLEAN isShiftKey,
BOOLEAN isControlKey);
virtual void PostValidate();

Tabbing Utilities

void SetTabSize(int theSize);
int GetTabSize(void) const;

Inherited Utilities

virtual void Key(const CKey& theKey);
virtual void SetOrigin(const CPoint& theDelta);
virtual void SetFont(const CFont &theNewFont,
BOOLEAN isUpdate = FALSE);
virtual void Size(const CRect& theNewSize);
virtual void Show(void);
virtual void Hide(void);
virtual void Activate(void);
virtual void Deactivate(void);
virtual void Draw(const CRect& theClippingRegion);
virtual void SetGlue(GLUETYPE theGlue);
virtual BOOLEAN ClassCanGetKeyFocus(void) const;
virtual void Disable(void);
virtual void SetEnvironment(const CEnvironment& theNewEnvironment, BOOLEAN isUpdate = FALSE);
virtual void DoCommand(long theCommand, 
void* theData = NULL);

Get a Handle to an XVT Text Edit Object

TXEDIT GetXVTTextEdit(void) const;

Protected Methods

Constructor Methods

CNativeTextEdit(CSubview *theEnclosure,
const CRect& theRegion,
unsigned theAttributes = TX_BORDER,
UNITS theRightMargin = 1000,
int theCharacterLimit = 1000);
CNativeTextEdit(CSubview *theEnclosure);
CNativeTextEdit(const CNativeTextEdit& theTextEdit);
CNativeTextEdit& operator= (
const CNativeTextEdit& theTextEdit);

Internal Text Manipulation

The sole purpose of the methods in this section is to be used as utilities by classes that inherit from CNativeTextEdit.

void CreateTextEdit(void);
void GetTextInternal(T_PNUM theFirstParagraph,
T_PNUM theLastParagraph,
T_LNUM theFirstLine,
T_LNUM theLastLine,
T_CNUM theFirstChar,
T_CNUM theLastChar,
CStringRW theTextBuffer) const;
T_CNUM GetNCharInternal(T_PNUM theFirstParagraph,
T_PNUM theLastParagraph,
T_LNUM theFirstLine,
T_LNUM theLastLine,
T_CNUM theFirstChar,
T_CNUM theLastChar) const;
void GetFullPar(T_PNUM theParagraph, 
CStringRW theText) const;
void GetLineInternal(T_PNUM theParagraph, 
T_LNUM theLine, CStringRW theText) const;
void Truncate(CStringRW& theText);
void ResetColors(void);
virtual void UpdateUnits(CUnits* theUnits);
virtual void PositionTextEdit(void);

TDI Enabling Methods

virtual void DoUpdateModel(long theControllerId, 
long theCommand, const CModel* theModel);
void TdiProcessEvent(EVENT* e);
void GetPartLine(T_CNUM theFirstChar,
T_CNUM theLastChar,
T_PNUM theParagraph,
T_LNUM theLineNumber,
CStringRW theText) const;
void GetPartPar(T_CNUM theStartChar,T_CNUM theEndChar,
T_PNUM theParagraph,
T_LNUM theStartLine,
T_LNUM theEndLine,
CStringRW theText) const;
T_CNUM GetNCharInPartPar(T_CNUM theStartChar,
T_CNUM theEndChar,
T_PNUM theParagraph,
T_LNUM theStartLine,
T_LNUM theEndLine) const;



[Classes] [Prev] [Next] [Methods]

support@xvt.com


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.