3D PLM Enterprise Architecture |
User Interface - Dialogs |
CATDlgEditorEdit single or multiple line text |
Quick Reference |
CATDialog | +---CATDlgControl | +---CATDlgEditor
The editor allows the end user to enter a text, numerics, or both, or modify existing ones. The text can extend on one or several lines. Scrollbars can be added if the text is longer than the editor display area. |
Use editors whenever you propose to the end user to edit or modify a text or unpredictable numerical values.
[Top]
[Top]
[Top]
The editor is dedicated to text or numerical value edition.
These following kinds of multiple list can be constructed.
default |
_pEditor = new CATDlgEditor (iParent, iName); |
Multiline |
_pMEditor = new CATDlgEditor (iParent, iName, CATDlgEdtMultiline); |
[Top]
You can manage the line with the following methods:
int NumberOfLines = _pEditor->GetLineCount(); |
get a line contents |
set a line contents CATUnicodeString oLineContents; int iLineNumber = 2; _pEditor->GetLine(oLineContents, iLineNumber); |
set a line contents |
... iLineNumber = 3; CATUnicodeString * _iLineToSet = "Line to set"; _pEditor->SetLine(*iLineContents, iLineNumber); |
get all text |
CATUnicodeString oAllText, iAllText; oAllText = _pEditor->GetText(); |
set all text |
... iAllText = ... _pEditor->SetText(iAllText); |
get integer value |
int IntValue = _pEditor->GetIntegerValue(); |
get float value |
float FloatValue = _pEditor->GetFloatValue(); |
clear line 2 |
int iLineNumber = 2; _pEditor->ClearLine(iLineNumber) |
The default value -1 deletes all the lines.
get max char |
int MaxCharacter; MaxCharacter = _pEditor->GetMaxCharacterWidth(); ... |
set max char |
MaxCharacter = 20; _pEditor->SetMaxCharacterWidth(MaxCharacter); |
declare a function |
CATDlgEditorCallback MyFunction; _pEditor->SetVerifyCallback(MyFunction, _iUsefulData); |
MyFunction is the function to execute and _iUsefulData is the contents of the filed casted as a pointer to void.
[Top]
You can manage the line display with the following methods:
get number of visible char |
int NumberOfVisibleChar; NumberOfVisibleChar = _pEditor->GetVisibleTextWidth(); ... |
setnumber of visible char |
NumberOfVisibleChar = 20: _pEditor->SetVisibleTextWidth(NumberOfVisibleChar); |
get visible height |
int VisibleTextHeight; TextHeight = _pEditor->GetVisibleTextHeight(); ... |
set visible height |
TextHeight = 8; _pEditor->SetVisibleTextHeight(TextHeight); |
get 1st visible char |
int FirstVisibleChar; FirstVisibleChar = _pEditor->GetFirstColumn(); ... |
set 1st visible char |
FirstVisibleChar = 5; _pEditor->SetFirstColumn(FirstVisibleChar); |
get 1st line position |
int FirstLine; FirstLine = _pEditor->GetFirstLine(); ... |
set 1st line position |
FirstLine = 3; _pEditor->SetFirstLine(FirstLine); |
[Top]
Set a callback on an editor to be informed whenever the end user modify the text as follows:
AddAnalyseNotificationCB(
_pEditor, // multiple list
_pEditor->
|
[Top]
The editor title should be set by the resource file using a key built with the identifier you declare as the second parameter of the editor constructor. This title is never displayed. If you want to comment the editable field of the editor in your dialog, use a label.
[Top]
Version: 1 [Jan 2000] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.