| Methods Index |
CNativeTextEditSubclasses:
NScrollText
NTextEdit adds the capability to organize the text inside a text box into paragraphs and lines. NTextEdit objects consist of multi-line text editing boxes that can be placed inside CView. They provide full editing support, including cut, copy, and paste operations.
NTextEdit object. Users can then type inside the editing box.
NTextEdit(CSubview* theEnclosure,
const CRect& theRegion,
unsigned theAttributes = TX_BORDER,
int theRightMargin = 1000,
int theCharacterLimit = 1000);
theEnclosure is a pointer to the subview that will contain the text box. theRegion is a coordinate location, local to the enclosure, that is used to place the text box. If the text box has a border, which is the default, then the border rectangle is drawn around the CRect. This CRect object is inset by 4 pixels inside the border. The bottom of the CRect may be inset even more to ensure that an integral number of lines will fit into the text box.In addition, this constructor takes an unsigned value pertaining to the XVT attributes that the text edit system can have. These attributes can be OR'd and passed in together, as described in the text editing chapter of the XVT Portability Toolkit Guide. For further information on the possible values for
theAttributes, see Table 10. NTextEdit(const NTextEdit& theTextEdit);
NTextEdit& operator=(const NTextEdit& theTextEdit);
virtual ~NTextEdit();
BOOLEAN ITextEdit(
unsigned theAttributes = TX_BORDER,
int theRightMargin = 1000,
int theCharacterLimit = 1000,
const CStringRW theInitialText = NULLString,
BOOLEAN isAutoSelected = FALSE,
BOOLEAN isVisible = TRUE,
long theGlue = NULLSTICKY);
CNativeTextEdit. It takes an unsigned value pertaining to the XVT attributes that the text edit system can have. These attributes can be OR'd and passed in together, as described in the text editing chapter of the XVT Portability Toolkit Guide. For further information on the possible values for theAttributes, see Table 10.void GetInsertPosition(T_PNUM* thePar,
T_LNUM* theLine, T_CNUM* theChar) const;
thePar is the paragraph the cursor is in. theLine is the line within the paragraph. theChar is the character position within the line of the paragraph.
void SetInsertPosition(T_PNUM thePar,
T_LNUM theLine, T_CNUM theChar);
thePar is the paragraph the cursor is to be placed. theLine is the line within the paragraph. theChar is the character position within the line of the paragraph.
virtual BOOLEAN SetParagraph(
const CStringRW& theText, T_PNUM theParagraph);
virtual BOOLEAN AddParagraph(
const CStringRW& theText, T_PNUM theParagraph);
(theParagraph==USHRT_MAX), the paragraph is added at the end of the text.
virtual BOOLEAN AppendToParagraph(
const CStringRW& theText, T_PNUM theParagraph);
virtual BOOLEAN DeleteParagraph(T_PNUM theParagraph);
theParagraph from the text box. Numbering of paragraphs starts at zero. This method returns TRUE if the paragraph is successfully deleted.
virtual CStringRW GetParagraph(
T_PNUM theParagraph) const;
GetParagraph returns the designated paragraph.
virtual void SelectParagraph(T_PNUM theParagraph,
T_LNUM theStartLine = 0,
T_LNUM theEndLine = LAST,
T_CNUM theStartChar = 0,
T_CNUM theEndChar = LAST);
virtual T_CNUM GetNCharInPar(
T_PNUM theParagraph) const;
virtual T_PNUM GetNParInText(void) const;
virtual T_PNUM GetNParInSelection(void) const;
virtual void SetLine(const CStringRW& theText,
T_PNUM theParagraph, T_LNUM theLine);
virtual CStringRW GetLine(T_PNUM theParagraph,
T_LNUM theLine) const;
GetLine returns the designated line.
virtual void SelectLine(
T_LNUM theLine = 0,
T_PNUM theParagraph = 0,
T_CNUM theStartingChar = 0,
T_CNUM theEndingChar = LAST);
virtual T_CNUM GetNCharInLine(
T_PNUM theParagraph=0, T_LNUM theLine=0) const;
virtual T_LNUM GetNLineInPar(T_PNUM theParagraph) const;
virtual T_LNUM GetNLineInText(void) const;
virtual T_LNUM GetNLineInSelection(void) const;
virtual CStringRW GetSomeText(
T_PNUM theStartParagraph,
T_PNUM theEndParagraph,
T_LNUM theStartLine,
T_LNUM theEndLine,
T_CNUM theStartChar,
T_CNUM theEndChar);
GetSomeText takes the numbers of the starting and ending paragraphs, the numbers of the starting and ending lines, and the numbers of the starting and ending characters.
virtual void SelectSomeText(
T_PNUM theStartParagraph,
T_PNUM theEndParagraph,
T_LNUM theStartLine,
T_LNUM theEndLine,
T_CNUM theStartChar,
T_CNUM theEndChar);
NTextEdit(CSubview* theEnclosure);