Edit Box Series Control Class
Brief Introduction to Edit Box Control
Edit box control is one of the essential controls in GUI system, which is mainly used to receive character input of the users and realize the function of user interaction and text edition. In Realization, it is divided into single line edit and multi-line edit. Single line edit box is used to receive single line text input with comparatively simple user content, in comparison, multi-line text is used to receive complicated and large volume of text input.
Class hierarchical relation of edit box
Example diagram

mEdit
mEditControl window class:
NCSCTRL_EDITControl English name: Edit
Brief introduction: Foundation class of edit box series controls, it is the abstract parent class of single line edit box and multi-line edit box, which defines the common use interface of the two.
Schematic diagram: Abstract class, and cannot be used directly.
Style of mEdit
mEditIt is inherited from the style of mScrollView
Style name
miniStudio property name
Explanation
NCSS_EDIT_LEFT
Align->Left
Left aligned
NCSS_EDIT_CENTER
Align->Center
Horizontal centering
NCSS_EDIT_RIGHT
Align->Right
Right aligned
NCSS_EDIT_UPPERCASE
Case->Upper
The input content is automatically converted to capital letter
NCSS_EDIT_LOWERCASE
Case->Lower
The input content is automatically converted to lower case letter
NCSS_EDIT_NOHIDESEL
HideSel->FALSE
When the edit box loses focus, the selected content still remains selected status
NCSS_EDIT_READONLY
ReadOnly->TRUE
The content is read only
NCSS_EDIT_BASELINE
BaseLine->TRUE
Content underlined display
Property of mEdit
mEditIt is inherited from the property of mScrollView.
Property
miniStudio property name
Type
Authority
Explanation
NCSP_EDIT_LIMITTEXT
MaxLength
int
RW
Character number limit value
NCSP_EDIT_CARETPOS
--
int
RW
Cursor location
Event of mEdit
mEditIt is inherited from the event of mScrollView.
Event ID
Parameter
Explanation
NCSN_EDIT_CHANGE
--
Content changes
NCSN_EDIT_CONTCHANGED
--
When edit loses the focus, the content changes
NCSN_EDIT_UPDATE
--
The content is refreshed when changed through setText and resetContent method or the property is changed
NCSN_EDIT_SELCHANGED
--
The selected part changes
NCSN_EDIT_MAXTEXT
--
Character number is saturated
NCSN_EDIT_SETFOCUS
--
Get the focus
NCSN_EDIT_KILLFOCUS
--
Lose the focus
Method of mEdit
mEditIt is inherited from the method ofmScrollView.
setContent
setContentParameter
str -- literal content displayed in edi
start -- display starting location (relative to the starting location of str), 0 represents starting from the beginning
len -- display character number, -1 represents ending till the end of str
Explanation: Set the display content of the edit box. The method will get altogether characters from No. character location from str character string, and replace the existing content in edit.
Example:
replaceText
replaceTextParameter
str -- source character string used for replacement
start -- deviation of the source text used for replacement relative to str, 0 represents starting from the beginning
len -- length used to the source text, -1 represents starting from start and ending till str
replace_start-- replace the starting location (relative to the existing content in edit)replace_end-- replace the ending location (relative to the existing content in edit)
Explanation: Replacement of character string, the method will get altogether characters starting from No. character location from str character string, and replaces the existing content from to in edit. Str is the character string to be replaced to, start is the starting location relative to str, 0 represents starting from the beginning, len is the length, -1 represents ending till the end of str,
replace_startandreplace_endare the starting point and ending point of the location to be replaced, and they are location deviation relative to the existing text content in edit.Example:
insert
Parameter
str -- source character string to be inserted
start -- starting location of the source text used, 0 represents starting from the beginning
len -- length of the source text used, -1 represents starting from start, and ending till str
at -- location of the insert point (relative to the existing content in edit), -1 represents the end
Explanation: Insert of the character string, the method will get altogether characters starting from No. character location in str character string, and it is inserting into location of No. character of the existing content in edit. Str is the character string to be inserted, start is the starting location relative to str, 0 represents starting from the beginning, len is the length, -1 represents ending till the end of str, at parameter is the location to insert, and it is the location deviation relative to the existing text content in edit
Example:
append
Parameter
str -- source character string to append
start -- starting location of the source text used, 0 represents starting from the beginning
len -- length of the source text used, -1 represents starting from start and ending till str
Explanation: Append the character string, the method will get altogether characters starting from No. character location from str character string, and append to after the existing content in edit. str is the character string to append, start is the starting location relative to str, 0 represents starting from the beginning, len is the length, and -1 represents ending till the end of str.
Example:
getTextLength
getTextLengthExplanation: Get length of the content of the character string in Edit
Example:
getContent
getContentParameter:
strbuff -- get storage location to the character string (storage space shall be distributed in advance)
buff_len-- size of strbuffstart -- starting location of the obtained content
end -- ending location of the obtained content
Explanation: Get character string content in edit, and get the content from to location from the existing content and write into strbuff, and the maximum number to write in is limited to
buff_len.Example:
setSel and getSel
setSel and getSelParameter:
start \end -- starting point and ending point of the selected region
pstart\pend -- starting point and ending point of the selected region, used for function return
Explanation: Set and get the region of the selected text, and the last two parameters correspond to the starting point and ending point of the selected region respectively
Example:
setMargin
setMarginParameter:
left,top,right,bottom -- margin of left, top, right and bottom, the parameter is not a concept of rectangle, and it just continues to use the data structure of rectangle for the convenience of parameter transmission
Explanation: Set left, top, right and bottom margin of the edit region
Example:
copy, paste, and cut
Cut, copy and paste aim at the operation of the selected region. In edit, a group of operation set using minigui cut board is realized by default, and the users can set operation set realized by itself through setCopyPaste.
makevisible
Parameter:
pos -- location needs to be visible
Explanation: Control scrolling of the edit region, making the characters of the location
posbecome visible.Example:
mSlEdit
mSlEditControl window class:
NCSCTRL_SLEDITControl English name: Single Line Edit Or SlEdit
Brief introduction: Single line text edit box
Schematic diagram:

Style of mSIEdit
mSIEditIt is inherited from the style of mEdit.
Style name
miniStudio property name
Explanation
NCSS_SLEDIT_PASSWORD
Password->TRUE
Content of the edit box is shield displayed in the mode of password input
NCSS_SLEDIT_AUTOSELECT
AutoSelect->TRUE
Automatic selected style, after the focus is obtained, the text automatically becomes selected status
Property of mSIEdit
mSIEditIt is inherited from the property of mEdit.
Property
miniStudio property name
Type
Authority
Explanation
NCSP_SLEDIT_TIPTEXT
ToolTip
char *
RW
Prompt information character string, when there is no input, information used to prompt users
NCSP_SLEDIT_PWDCHAR
PasswordChar
char
RW
Character displayed by pass word, only NCSS_SLEDIT_PASSWORD style is valid, * by default
Event of mSIEdit
mSIEditIt is inherited from the event of mEdit.
Event ID
Parameter
explanation
NCSN_SLEDIT_ENTER
--
Capture enter key information
Method of mSIEdit
mSIEditIt is inherited from the method of mEdit. There is no newly introduced method.
Programming Example of mSIEdit
mSIEditSlEditExample code:
We define use template of
SIEditin this way
Control window class:
NCSCTRL_MLEDITControl English name: Multiline Edit or
MlEditBrief introduction: Multiline text edit box
Schematic diagram:

Style of mMIEdit
mMIEditIt is inherited from the style of mEdit.
Style name
miniStudio property name
Explanation
NCSS_MLEDIT_AUTOWRAP
AutoWrap->TRUE
Automatic wrap
Property of mMIEdit
mMIEditIt is inherited from the property of mEdit.
Property
miniStudio property name
Type
Authority
Explanation
NCSP_MLEDIT_LINECOUNT
--
int
RO
Row number
NCSP_MLEDIT_LINEHEIGHT
LineHeight
int
RW
Row height
NCSP_MLEDIT_LINEFEEDISPCHAR
--
char
WO
Line break is displayed by this character
NCSP_MLEDIT_LINESEP
LineSeperator
char
RW
Line break symbol, “\n” by default
NCSP_MLEDIT_CARETSHAPE
CaretShap
int
RW
Cursor shape ED_CARETSHAPE_LINE or ED_CARETSHAPE_BLOCK
NCSP_MLEDIT_NUMOFPARAGRAPHS
--
int
RO
Number of paragraphs
Event of mMIEdit
mMIEditIt is inherited from the event of mEdit. There is no newly introduced event.
Method of mMIEdit
mMIEditIt is inherited from the method of mEdit.
Programming Example of mMIEdit
mMIEditMlEditExample code:
We define the use template of
MIEditin this way
<< Property Sheet Control Class | Table of Contents | Animation Control Class >>
Last updated