Dgs-dxmemo: Difference between revisions
No edit summary |
|||
Line 9: | Line 9: | ||
==Properties== | ==Properties== | ||
===text=== | ===text=== | ||
This is equivalent to [[ | This is equivalent to [[dgsSetText]]/[[dgsGetText]]. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"text",text)</syntaxhighlight> | ||
*'''text''' : A ''table'' of the text of the memo.( Because of multi lines, I use table instead of string ) | *'''text''' : A ''table'' of the text of the memo.( Because of multi lines, I use table instead of string ) | ||
===textLength=== | ===textLength=== | ||
This is for scroll bar detection. You had better not touch it. | This is for scroll bar detection. You had better not touch it. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"textLength",textlen)</syntaxhighlight> | ||
*'''textlen''' : A table stores the length of text in every line. | *'''textlen''' : A table stores the length of text in every line. | ||
===textcolor=== | ===textcolor=== | ||
The color which can be translated by [[tocolor]] of the text of the memo. | The color which can be translated by [[tocolor]] of the text of the memo. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"textcolor",textcolor)</syntaxhighlight> | ||
*'''textcolor''' : An integer of the color of the text of the memo. | *'''textcolor''' : An integer of the color of the text of the memo. | ||
===textsize=== | ===textsize=== | ||
The scale of the text of the memo. ''Learn More [[dxDrawText]]'' | The scale of the text of the memo. ''Learn More [[dxDrawText]]'' | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"textsize",{scaleX,scaleY})</syntaxhighlight> | ||
*'''scaleX''' : A float of the 2D X scale of the text of the memo. | *'''scaleX''' : A float of the 2D X scale of the text of the memo. | ||
*'''scaleY''' : A float of the 2D Y scale of the text of the memo. | *'''scaleY''' : A float of the 2D Y scale of the text of the memo. | ||
Line 31: | Line 31: | ||
===cursorposXY=== | ===cursorposXY=== | ||
The position in which the caret stays. | The position in which the caret stays. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"cursorposXY",{index,line})</syntaxhighlight> | ||
*'''index''' : An integer of the index of the text in current line of the memo. | *'''index''' : An integer of the index of the text in current line of the memo. | ||
*'''line''' : An integer of the line of the memo. | *'''line''' : An integer of the line of the memo. | ||
Line 37: | Line 37: | ||
===selectfrom=== | ===selectfrom=== | ||
The position from which the text is selected. | The position from which the text is selected. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"selectfrom",{index,line})</syntaxhighlight> | ||
*'''index''' : An integer of the index of the text in the line where the text is selected from of the memo. | *'''index''' : An integer of the index of the text in the line where the text is selected from of the memo. | ||
*'''line''' : An integer of the line where the text is selected from of the memo. | *'''line''' : An integer of the line where the text is selected from of the memo. | ||
===font=== | ===font=== | ||
This is equivalent to [[ | This is equivalent to [[dgsSetFont]]/[[dgsGetFont]]. ''Learn More [[dxDrawText]]'' | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"font",font)</syntaxhighlight> | ||
*'''font''' : A [[Element/DX_font|dx font element]] of the text font of the memo. | *'''font''' : A [[Element/DX_font|dx font element]] of the text font of the memo. | ||
===rightLength=== | ===rightLength=== | ||
The max value of the index and line of the memo. This is for scroll bar detection. | The max value of the index and line of the memo. This is for scroll bar detection. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"rightLength",{index,line})</syntaxhighlight> | ||
*'''index''' : An integer of the max value of the index of the memo. | *'''index''' : An integer of the max value of the index of the memo. | ||
*'''line''' : An integer of the max value of the line of the memo. | *'''line''' : An integer of the max value of the line of the memo. | ||
Line 54: | Line 54: | ||
===showPos=== | ===showPos=== | ||
The min value of the x position of the text of the memo starts to show in the render target. ( I don't know how to explain it. XD ) | The min value of the x position of the text of the memo starts to show in the render target. ( I don't know how to explain it. XD ) | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"showPos",posX)</syntaxhighlight> | ||
*'''posX''' : An integer indicates how many the pixels of the text are moved to left. | *'''posX''' : An integer indicates how many the pixels of the text are moved to left. | ||
===showLine=== | ===showLine=== | ||
The min value of the line of the text of the memo starts to show in the render target. ( I don't know how to explain it. XD ) | The min value of the line of the text of the memo starts to show in the render target. ( I don't know how to explain it. XD ) | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"showLine",line)</syntaxhighlight> | ||
*'''line''' : An integer indicates how many lines are moved to top. | *'''line''' : An integer indicates how many lines are moved to top. | ||
Line 74: | Line 74: | ||
This is Text_ | This is Text_ | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"cursorStyle",cursorStyle)</syntaxhighlight> | ||
*'''cursorStyle''' : An integer of the caret style of the memo. | *'''cursorStyle''' : An integer of the caret style of the memo. | ||
===cursorThick=== | ===cursorThick=== | ||
This property allows us to change the thickness of caret of the memo. | This property allows us to change the thickness of caret of the memo. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"cursorThick",cursorThick)</syntaxhighlight> | ||
*'''cursorThick''' : An integer of the thickness of the caret of the memo. | *'''cursorThick''' : An integer of the thickness of the caret of the memo. | ||
===scrollBarThick=== | ===scrollBarThick=== | ||
This property allows us to change the thickness of scroll bars of the memo. | This property allows us to change the thickness of scroll bars of the memo. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"scrollBarThick",scrollBarThick)</syntaxhighlight> | ||
*'''scrollBarThick''' : An integer of the thickness of scroll bars of the memo. | *'''scrollBarThick''' : An integer of the thickness of scroll bars of the memo. | ||
===cursorOffset=== | ===cursorOffset=== | ||
The offset of the caret of the memo. | The offset of the caret of the memo. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"cursorOffset",{offsetX,offsetY})</syntaxhighlight> | ||
*'''offsetX''' : A float of the 2D X position offset of the caret of the memo. | *'''offsetX''' : A float of the 2D X position offset of the caret of the memo. | ||
*'''offsetY''' : A float of the 2D Y position offset of the caret of the memo. | *'''offsetY''' : A float of the 2D Y position offset of the caret of the memo. | ||
Line 95: | Line 95: | ||
===readOnly=== | ===readOnly=== | ||
This is equivalent to [[dgsDxMemoSetReadOnly]]/[[dgsDxMemoGetReadOnly]]. | This is equivalent to [[dgsDxMemoSetReadOnly]]/[[dgsDxMemoGetReadOnly]]. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"readOnly",readOnly)</syntaxhighlight> | ||
*'''readOnly''' : A bool indicates whether the memo is only readable. | *'''readOnly''' : A bool indicates whether the memo is only readable. | ||
===readOnlyCaretShow=== | ===readOnlyCaretShow=== | ||
Whether the caret of memo will show/hide under read-only mode. | Whether the caret of memo will show/hide under read-only mode. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"readOnlyCaretShow",readOnlyCaretShow)</syntaxhighlight> | ||
*'''readOnlyCaretShow''' : A bool indicates whether the caret is shown or hidden when the memo is read-only. | *'''readOnlyCaretShow''' : A bool indicates whether the caret is shown or hidden when the memo is read-only. | ||
===side=== | ===side=== | ||
The border size of the memo. | The border size of the memo. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"side",side)</syntaxhighlight> | ||
*'''side''' : A float of the border size of the memo. | *'''side''' : A float of the border size of the memo. | ||
===sidecolor=== | ===sidecolor=== | ||
The border color which can be translated by [[tocolor]] of the memo. | The border color which can be translated by [[tocolor]] of the memo. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"sidecolor",sidecolor)</syntaxhighlight> | ||
*'''sidecolor''' : An integer of the color of the border of the memo. | *'''sidecolor''' : An integer of the color of the border of the memo. | ||
===useFloor=== | ===useFloor=== | ||
Whether use math.floor when calculating position and size of memo. | Whether use math.floor when calculating position and size of memo. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"useFloor",useFloor)</syntaxhighlight> | ||
*'''useFloor''' : A bool indicates whether to use math.floor when calculating position and size of memo. | *'''useFloor''' : A bool indicates whether to use math.floor when calculating position and size of memo. | ||
===selectcolor=== | ===selectcolor=== | ||
The color which can be translated by [[tocolor]] of the rectangle of test selection of the memo. | The color which can be translated by [[tocolor]] of the rectangle of test selection of the memo. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"selectcolor",selectcolor)</syntaxhighlight> | ||
*'''selectcolor''' : An integer of the color of the rectangle of test selection of the memo. | *'''selectcolor''' : An integer of the color of the rectangle of test selection of the memo. | ||
===memo=== | ===memo=== | ||
This property stores a gui-memo which is used to input characters. | This property stores a gui-memo which is used to input characters. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"memo",gmemo)</syntaxhighlight> | ||
*'''gmemo''' : A gui-memo. | *'''gmemo''' : A gui-memo. | ||
===renderTarget=== | ===renderTarget=== | ||
This property stores a render target of the memo. | This property stores a render target of the memo. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"renderTarget",renderTarget)</syntaxhighlight> | ||
*'''renderTarget''' : A render target that is used to render the text. | *'''renderTarget''' : A render target that is used to render the text. | ||
===scrollbars=== | ===scrollbars=== | ||
This property stores two scroll bars which can be got by [[dgsDxMemoGetScrollBar]] of the memo. | This property stores two scroll bars which can be got by [[dgsDxMemoGetScrollBar]] of the memo. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">dgsSetProperty(memo,"scrollbars",{Vertical,Horizontal})</syntaxhighlight> | ||
*'''Vertical''' : A vertical scroll bar of the memo. | *'''Vertical''' : A vertical scroll bar of the memo. | ||
*'''Horizontal''' : A horizontal scroll bar of the memo. | *'''Horizontal''' : A horizontal scroll bar of the memo. |
Revision as of 14:45, 12 February 2018
DGS Properties is always used to change the gui style and make it more fantastic.
This page shows the properties of dgs-dxmemo that you could use.
Main Functions
Properties
text
This is equivalent to dgsSetText/dgsGetText.
dgsSetProperty(memo,"text",text)
- text : A table of the text of the memo.( Because of multi lines, I use table instead of string )
textLength
This is for scroll bar detection. You had better not touch it.
dgsSetProperty(memo,"textLength",textlen)
- textlen : A table stores the length of text in every line.
textcolor
The color which can be translated by tocolor of the text of the memo.
dgsSetProperty(memo,"textcolor",textcolor)
- textcolor : An integer of the color of the text of the memo.
textsize
The scale of the text of the memo. Learn More dxDrawText
dgsSetProperty(memo,"textsize",{scaleX,scaleY})
- scaleX : A float of the 2D X scale of the text of the memo.
- scaleY : A float of the 2D Y scale of the text of the memo.
cursorposXY
The position in which the caret stays.
dgsSetProperty(memo,"cursorposXY",{index,line})
- index : An integer of the index of the text in current line of the memo.
- line : An integer of the line of the memo.
selectfrom
The position from which the text is selected.
dgsSetProperty(memo,"selectfrom",{index,line})
- index : An integer of the index of the text in the line where the text is selected from of the memo.
- line : An integer of the line where the text is selected from of the memo.
font
This is equivalent to dgsSetFont/dgsGetFont. Learn More dxDrawText
dgsSetProperty(memo,"font",font)
- font : A dx font element of the text font of the memo.
rightLength
The max value of the index and line of the memo. This is for scroll bar detection.
dgsSetProperty(memo,"rightLength",{index,line})
- index : An integer of the max value of the index of the memo.
- line : An integer of the max value of the line of the memo.
showPos
The min value of the x position of the text of the memo starts to show in the render target. ( I don't know how to explain it. XD )
dgsSetProperty(memo,"showPos",posX)
- posX : An integer indicates how many the pixels of the text are moved to left.
showLine
The min value of the line of the text of the memo starts to show in the render target. ( I don't know how to explain it. XD )
dgsSetProperty(memo,"showLine",line)
- line : An integer indicates how many lines are moved to top.
cursorStyle
This is equivalent to dgsDxMemoSetCaretStyle/dgsDxMemoGetCaretStyle.
This property allows us to change the style of caret of the memo. ( 0 is "|"; 1 is "_" )
Example(0):
This is Text|
Example(1):
This is Text_
dgsSetProperty(memo,"cursorStyle",cursorStyle)
- cursorStyle : An integer of the caret style of the memo.
cursorThick
This property allows us to change the thickness of caret of the memo.
dgsSetProperty(memo,"cursorThick",cursorThick)
- cursorThick : An integer of the thickness of the caret of the memo.
scrollBarThick
This property allows us to change the thickness of scroll bars of the memo.
dgsSetProperty(memo,"scrollBarThick",scrollBarThick)
- scrollBarThick : An integer of the thickness of scroll bars of the memo.
cursorOffset
The offset of the caret of the memo.
dgsSetProperty(memo,"cursorOffset",{offsetX,offsetY})
- offsetX : A float of the 2D X position offset of the caret of the memo.
- offsetY : A float of the 2D Y position offset of the caret of the memo.
readOnly
This is equivalent to dgsDxMemoSetReadOnly/dgsDxMemoGetReadOnly.
dgsSetProperty(memo,"readOnly",readOnly)
- readOnly : A bool indicates whether the memo is only readable.
readOnlyCaretShow
Whether the caret of memo will show/hide under read-only mode.
dgsSetProperty(memo,"readOnlyCaretShow",readOnlyCaretShow)
- readOnlyCaretShow : A bool indicates whether the caret is shown or hidden when the memo is read-only.
side
The border size of the memo.
dgsSetProperty(memo,"side",side)
- side : A float of the border size of the memo.
sidecolor
The border color which can be translated by tocolor of the memo.
dgsSetProperty(memo,"sidecolor",sidecolor)
- sidecolor : An integer of the color of the border of the memo.
useFloor
Whether use math.floor when calculating position and size of memo.
dgsSetProperty(memo,"useFloor",useFloor)
- useFloor : A bool indicates whether to use math.floor when calculating position and size of memo.
selectcolor
The color which can be translated by tocolor of the rectangle of test selection of the memo.
dgsSetProperty(memo,"selectcolor",selectcolor)
- selectcolor : An integer of the color of the rectangle of test selection of the memo.
memo
This property stores a gui-memo which is used to input characters.
dgsSetProperty(memo,"memo",gmemo)
- gmemo : A gui-memo.
renderTarget
This property stores a render target of the memo.
dgsSetProperty(memo,"renderTarget",renderTarget)
- renderTarget : A render target that is used to render the text.
scrollbars
This property stores two scroll bars which can be got by dgsDxMemoGetScrollBar of the memo.
dgsSetProperty(memo,"scrollbars",{Vertical,Horizontal})
- Vertical : A vertical scroll bar of the memo.
- Horizontal : A horizontal scroll bar of the memo.
See Also
General Properties
Unique Properties For DGS Core Elements
- dgs-dx3dinterface
- dgs-dx3dimage
- dgs-dx3dtext
- dgs-dx3dline
- dgs-dxbutton
- dgs-dxcheckbox
- dgs-dxcombobox
- dgs-dxdetectarea
- dgs-dxedit
- dgs-dxgridlist
- dgs-dximage
- dgs-dxlabel
- dgs-dxline
- dgs-dxmemo
- dgs-dxprogressbar
- dgs-dxradiobutton
- dgs-dxscrollbar
- dgs-dxscrollpane
- dgs-dxselector
- dgs-dxswitchbutton
- dgs-dxtabpanel
- dgs-dxtab
- dgs-dxwindow