Dgs-dxgridlist: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Moved to mouseButtons property)
 
(32 intermediate revisions by 3 users not shown)
Line 8: Line 8:


==Properties==
==Properties==
===autoSort===
This property determines whether auto sort is enabled. ''See [[dgsGridListSetAutoSortEnabled]]/[[dgsGridListGetAutoSortEnabled]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"autoSort",autoSort)</syntaxhighlight>
*'''autoSort:''' A bool of auto sort state.
===backgroundOffset===
This property determines the offset between the left border and row background.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"backgroundOffset",backgroundOffset)</syntaxhighlight>
*'''backgroundOffset:''' An integer of the offset between the left border and row background.
===bgColor===
===bgColor===
This property determines the background color of the grid list.
This property determines the background color of the grid list.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"bgColor",bgColor)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"bgColor",bgColor)</syntaxhighlight>
*'''bgColor''' : An integer of the color that can be converted by [[tocolor]].
*'''bgColor:''' An integer of the color that can be converted by [[tocolor]].


===bgImage===
===bgImage===
This property determines the background image of the grid list.
This property determines the background image of the grid list. To adjust the color of the image, use property '''bgColor'''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"bgImage",bgImage)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"bgImage",bgImage)</syntaxhighlight>
*'''bgImage''' : A material element that serves as the background image of the grid list (texture/shader/screen source/renderTarget).
*'''bgImage:''' A material element that serves as the background image of the grid list (texture/shader/screen source/renderTarget).


===columnImage===
===clip===
This property determines the background image of the column of the grid list.
Whether the clip property is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnImage",columnImage)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"clip",clip)</syntaxhighlight>
*'''bgImage''' : A material element that serves as the background image of the column of the grid list (texture/shader/screen source/renderTarget).
*'''clip:''' If set to true, the parts of the text that don't fit within the bounding box will be cut off.


===columnColor===
===columnColor===
This property determines the background color of the column of the grid list.
This property determines the background color of the column of the grid list.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnColor",columnColor)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnColor",columnColor)</syntaxhighlight>
*'''columnColor''' : An integer of the color that can be converted by [[tocolor]].
*'''columnColor:''' An integer of the color that can be converted by [[tocolor]].
 
===columnTextColor===
This property determines the color of the column text of the grid list.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnTextColor",columnTextColor)</syntaxhighlight>
*'''columnTextColor''' : An integer of the color that can be converted by [[tocolor]].
 
===columnTextSize===
This property determines the scale of the column text of the grid list.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnTextSize",{scaleX,scaleY})</syntaxhighlight>
*'''scaleX''' : A float of the 2D X scale of the text of the column.
*'''scaleY''' : A float of the 2D Y scale of the text of the column.
 
===columnOffset===
This property determines the global offset between the left border and column text.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnOffset",columnOffset)</syntaxhighlight>
*'''columnOffset''' : An integer of offset of the column.


===columnData===
===columnData===
This property stores column data.
This property stores column data.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnData",columnData)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnData",columnData)</syntaxhighlight>
*'''columnData''' : A table stores all column data.
*'''columnData:''' A table stores all column data.
'''Data Structure'''
'''Data Structure'''
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
Line 57: Line 51:
}
}
</syntaxhighlight>
</syntaxhighlight>
===columnHeight===
This property determines the column height of the grid list.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnHeight",columnHeight)</syntaxhighlight>
*'''columnHeight:''' An integer of column height of the grid list.
===columnImage===
This property determines the background image of the column of the grid list.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnImage",columnImage)</syntaxhighlight>
*'''columnImage:''' A material element that serves as the background image of the column of the grid list (texture/shader/screen source/renderTarget).
===columnMoveOffset===
This property stores the move offset of column that is used to render.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnMoveOffset",columnMoveOffset)</syntaxhighlight>
*'''columnMoveOffset:''' A float stores the move offset of column that is used to render.
===columnOffset===
This property determines the global offset between the left border and column text.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnOffset",columnOffset)</syntaxhighlight>
*'''columnOffset:''' An integer of offset of the column.


===columnRelative===
===columnRelative===
This property determines whether the column length is relative or not. ''See [[dgsGridListSetColumnRelative]]/[[dgsGridListGetColumnRelative]]''
This property determines whether the column length is relative or not. ''See [[dgsGridListSetColumnRelative]]/[[dgsGridListGetColumnRelative]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnRelative",columnRelative)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnRelative",columnRelative)</syntaxhighlight>
*'''columnRelative''' : A bool of the relative state of the column length.
*'''columnRelative:''' A bool of the relative state of the column length.


===columnShadow===
===columnShadow===
The shadow text of the column.
The shadow text of the column.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnShadow",{offsetX,offsetY,color})</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnShadow",{offsetX,offsetY,color})</syntaxhighlight>
*'''offsetX''' : A float of the 2D X offset of the shadow text of the column.
*'''offsetX:''' A float of the 2D X offset of the shadow text of the column.
*'''offsetY''' : A float of the 2D Y offset of the shadow text of the column.
*'''offsetY:''' A float of the 2D Y offset of the shadow text of the column.
*'''color''' : An integer of the color of the shadow text of the column.
*'''color:''' An integer of the color of the shadow text of the column.
 
===columnTextColor===
This property determines the color of the column text of the grid list.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnTextColor",columnTextColor)</syntaxhighlight>
*'''columnTextColor:''' An integer of the color that can be converted by [[tocolor]].
 
===columnTextPosOffset===
This property adjusts the offset of the text of the column, which can solve text misplacing caused by font.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnTextPosOffset",{offsetX,offsetY})</syntaxhighlight>
*'''offsetX:''' A float of the 2D X offset of the text of the column.
*'''offsetY:''' A float of the 2D Y offset of the text of the column.
 
===columnTextSize===
This property determines the scale of the column text of the grid list.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnTextSize",{scaleX,scaleY})</syntaxhighlight>
*'''scaleX:''' A float of the 2D X scale of the text of the column.
*'''scaleY:''' A float of the 2D Y scale of the text of the column.


===columnHeight===
===columnWordBreak===
This property determines the column height of the grid list.
This property determines whether word break property for column is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnHeight",columnHeight)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"columnWordBreak",columnWordBreak)</syntaxhighlight>
*'''columnHeight''' : An integer of column height of the grid list.
*'''columnWordBreak:''' A bool indicates whether the word break is enabled.
 
===colorCoded===
Whether the color code is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"colorCoded",colorCoded)</syntaxhighlight>
*'''colorCoded:''' Set to true to enable embedded #FFFFFF color codes.
 
===defaultColumnOffset===
This property determines offset of normal row column (is different from but works with columnOffset). ''See [[dgsGridListSetRowAsSection]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"defaultColumnOffset",defaultColumnOffset)</syntaxhighlight>
*'''defaultColumnOffset:''' An integer of the offset of normal row column.
 
===defaultSortFunctions===
This property determines the default sort function of grid list when clicking column.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"defaultSortFunctions",{lowerSortFunction,upperSortFunction})</syntaxhighlight>
*'''lowerSortFunction:''' A string of the lower sort function name.
*'''upperSortFunction:''' A string of the upper sort function name.
Here are three groups can be use:
*'''greaterLower'''/'''greaterUpper''': Sorting directly with string.
*'''numGreaterLowerNumFirst'''/'''numGreaterUpperNumFirst''': Sorting support number order with number first.
*'''numGreaterLowerStrFirst'''/'''numGreaterUpperStrFirst''': Sorting support number order with string first.
*'''longerLower'''/'''longerUpper''': Sorting according to the utf8 length of the string.
 
===defaultSortIcons===
This property determines the icons of the default sort function.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"defaultSortIcons",{iconA,iconB})</syntaxhighlight>
*'''iconA:''' A string of the lower sort icon ('''▲''' By default).
*'''iconB:''' A string of the upper sort icon ('''▼''' By default).
 
===font===
This is equivalent to [[dgsSetFont]]/[[dgsGetFont]]. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"font",font)</syntaxhighlight>
*'''font:''' A [[Element/DX_font|dx font element]] of the default text font of the gridlist.
 
===leading===
This property determines the space between rows.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"leading",leading)</syntaxhighlight>
*'''leading:''' How many pixels between rows
 
===multiSelection===
This property determines whether multi selection is enabled or not. ''See [[dgsGridListSetMultiSelectionEnabled]]/[[dgsGridListGetMultiSelectionEnabled]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"multiSelection",multiSelection)</syntaxhighlight>
*'''multiSelection:''' A bool of the state of the multi selection.
 
===mode===
This property determines the render mode of grid list.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"mode",mode)</syntaxhighlight>
*'''mode:''' A bool of the state of render mode. Detail:
**'''true:''' No render target mode (Crappy and have a lot of bugs but doesn't take video memory)
**'''false:''' Render target mode (Great quality but takes video memory)
 
===moveHardness===
This property determines how hard will the grid list moves when scrolling.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"moveHardness",{scrollHardness,dragHardness})</syntaxhighlight>
*'''scrollHardness:''' A float determins how hard will the grid list moves when scrolling with wheel ( should be larger than 0, lower than 1 ).
*'''dragHardness:''' A float determins how hard will the grid list moves when dragging with mouse ( should be larger than 0, lower than 1 ).


===selectedColumn===
===preSelect===
This property stores the index of which column the cursor is hovering. ''See [[dgsGridListGetEnterColumn]]''
This property stores the item id the cursor is hovering on.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"selectedColumn",selectedColumn)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"preSelect",{rowIndex,columnIndex})</syntaxhighlight>
*'''columnHeight''' : Column Index.
*'''rowIndex:''' Row Index
*'''columnIndex:''' Column Index


===rowColor===
===rowColor===
This property determines the default 3 states' colors of row. ''See [[dgsGridListSetRowBackGroundColor]]/[[dgsGridListGetRowBackGroundColor]]''
This property determines the default 3 states' colors of row. ''See [[dgsGridListSetRowBackGroundColor]]/[[dgsGridListGetRowBackGroundColor]]''. Note that this property does not affect rows that were created before the property was changed.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowColor",{colorDefault,colorHoving,colorSelected})</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowColor",{colorDefault,colorHoving,colorSelected})</syntaxhighlight>
*'''colorDefault:''' An integer of the color of the row (Default State).
*'''colorDefault:''' An integer of the color of the row (Default State).
*'''colorHoving:''' An integer of the color of the row (Hoving State).
*'''colorHoving:''' An integer of the color of the row (Hoving State).
*'''colorSelected:''' An integer of the color of the row (Selected State).
*'''colorSelected:''' An integer of the color of the row (Selected State).
===rowImage===
This property determines the default 3 states' background image of row. ''See [[dgsGridListGetRowBackGroundImage]]/[[dgsGridListSetRowBackGroundImage]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowImage",{imageDefault,cimageHoving,imageSelected})</syntaxhighlight>
*'''imageDefault:''' A texture of the image of the row (Default State).
*'''cimageHoving:''' A texture of the image of the row (Hoving State).
*'''imageSelected:''' A texture of the image of the row (Selected State).
===rowTextColor===
This property determines the default color of the row text of the grid list.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowTextColor",rowTextColor)</syntaxhighlight>
*'''rowTextColor''' : An integer of the color that can be converted by [[tocolor]].
===rowTextSize===
This property determines the default scale of the row text of the grid list.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowTextSize",{scaleX,scaleY})</syntaxhighlight>
*'''scaleX''' : A float of the 2D X scale of the text of the row.
*'''scaleY''' : A float of the 2D Y scale of the text of the row.


===rowData===
===rowData===
This property stores row data.
This property stores row data.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowData",rowData)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowData",rowData)</syntaxhighlight>
*'''rowData''' : A table stores all row data.
*'''rowData:''' A table stores all row data.
'''Data Structure'''
'''Data Structure'''
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
Line 114: Line 183:


[1] = {
[1] = {
[-4] = columnOffset, --columnOffset
[-4] = columnOffset, --column offset
[-3] = {normal,hovering,selected}, --bgImage
[-3] = {normal,hovering,selected}, --background image
[-2] = true/false, --selectable
[-2] = true/false, --selectable
[-1] = true/false, --clickable
[-1] = true/false, --clickable
[0] = {normal,hovering,selected}, --bgColor
[0] = {normal,hovering,selected}, --background color
[1] = {text,color,colorcoded,scalex,scaley,font,{image,color,imagex,imagey,imagew,imageh},unselectable,unclickable}, --Column 1
[1] = {text,color,colorcoded,scalex,scaley,font,{image,color,imagex,imagey,imagew,imageh},unselectable,unclickable}, --Column 1
[2] = {text,color,colorcoded,scalex,scaley,font,{image,color,imagex,imagey,imagew,imageh},unselectable,unclickable}, --Column 2
[2] = {text,color,colorcoded,scalex,scaley,font,{image,color,imagex,imagey,imagew,imageh},unselectable,unclickable}, --Column 2
Line 124: Line 193:
}, --Row 1
}, --Row 1
[2] = {
[2] = {
[-4] = columnOffset, --columnOffset
[-4] = columnOffset, --column offset
[-3] = {normal,hovering,selected}, --bgImage
[-3] = {normal,hovering,selected}, --background image
[-2] = true/false, --selectable
[-2] = true/false, --selectable
[-1] = true/false, --clickable
[-1] = true/false, --clickable
[0] = {normal,hovering,selected}, --bgColor
[0] = {normal,hovering,selected}, --background color
[1] = {text,color,colorcoded,scalex,scaley,font,{image,color,imagex,imagey,imagew,imageh},unselectable,unclickable}, --Column 1
[1] = {text,color,colorcoded,scalex,scaley,font,{image,color,imagex,imagey,imagew,imageh},unselectable,unclickable}, --Column 1
[2] = {text,color,colorcoded,scalex,scaley,font,{image,color,imagex,imagey,imagew,imageh},unselectable,unclickable}, --Column 2
[2] = {text,color,colorcoded,scalex,scaley,font,{image,color,imagex,imagey,imagew,imageh},unselectable,unclickable}, --Column 2
...
...
}, --Row 2
}, --Row 2
}
</syntaxhighlight>
===rowHeight===
This property determines the row height of the grid list.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowHeight",rowHeight)</syntaxhighlight>
*'''rowHeight:''' An integer of row height of the grid list.
===rowImage===
This property determines the default 3 states' background image of row. ''See [[dgsGridListGetRowBackGroundImage]]/[[dgsGridListSetRowBackGroundImage]]''. Note that this property does not affect rows that were created before the property was changed.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowImage",{normalImage,hoveringImage,selectedImage})</syntaxhighlight>
*'''normalImage:''' A texture of the image of the row (Normal State).
*'''hoveringImage:''' A texture of the image of the row (Hoving State).
*'''selectedImage:''' A texture of the image of the row (Selected State).
===rowImageStyle===
This property determines the style of row background image.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowImageStyle",style)</syntaxhighlight>
*'''style:''' An integer of the style of row background image. Available values are as follows:
**'''1:''' Every item uses a complete background image.
**'''2:''' Every row uses a complete background image.
**'''3:''' Only the visible area of every row uses a complete background image.
===rowMoveOffset===
This property stores the move offset of row that is used to render.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowMoveOffset",rowMoveOffset)</syntaxhighlight>
*'''rowMoveOffset:''' A float stores the move offset of row that is used to render.
===rowSelect===
This property stores the selected rows.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowSelect",data)</syntaxhighlight>
*'''data:''' the data.
'''Data Structure'''
<syntaxhighlight lang="lua">
{
[Column1] = {
Row1,
Row2,
...
},
[Column2] = {
Row1,
Row2,
...
},
...
}
}
</syntaxhighlight>
</syntaxhighlight>
Line 139: Line 254:
The shadow text of the row.
The shadow text of the row.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowShadow",{offsetX,offsetY,color})</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowShadow",{offsetX,offsetY,color})</syntaxhighlight>
*'''offsetX''' : A float of the 2D X offset of the shadow text of the row.
*'''offsetX:''' A float of the 2D X offset of the shadow text of the row.
*'''offsetY''' : A float of the 2D Y offset of the shadow text of the row.
*'''offsetY:''' A float of the 2D Y offset of the shadow text of the row.
*'''color''' : An integer of the color of the shadow text of the row.
*'''color:''' An integer of the color of the shadow text of the row.
 
===rowShowUnclippedOnly===
This property will force the grid list only show those unclipped row
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowShowUnclippedOnly",rowShowUnclippedOnly)</syntaxhighlight>
*'''rowShowUnclippedOnly:''' A bool indicates if the only the unclipped rows will be shown in grid list.
 
===rowTextColor===
This property determines the default color of the row text of the grid list.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowTextColor",rowTextColor)</syntaxhighlight>
*'''rowTextColor:''' An integer of the color of the row text that can be converted by [[tocolor]]. Note that this property does not affect rows that were created before the property was changed.


===rowHeight===
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowTextColor",{normalColor,hoveringColor,selectedColor})</syntaxhighlight>
This property determines the row height of the grid list.
*'''normalColor:''' A integer of the color of the row text that can be converted by [[tocolor]](Normal State).
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowHeight",rowHeight)</syntaxhighlight>
*'''hoveringColor:''' A integer of the color of the row text that can be converted by [[tocolor]](Hoving State).
*'''rowHeight''' : An integer of row height of the grid list.
*'''selectedColor:''' A integer of the color of the row text that can be converted by [[tocolor]](Selected State).


===sortEnabled===
===rowTextPosOffset===
This property determines whether sort is enabled. ''See [[dgsGridListSetSortEnabled]]/[[dgsGridListGetSortEnabled]]''
This property adjusts the offset of the text of the row, which can solve text misplacing caused by font.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"sortEnabled",sortEnabled)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowTextPosOffset",{offsetX,offsetY})</syntaxhighlight>
*'''sortEnabled''' : A bool of sort state.
*'''offsetX:''' A float of the 2D X offset of the text of the row.
*'''offsetY:''' A float of the 2D Y offset of the text of the row.


===autoSort===
===rowTextSize===
This property determines whether auto sort is enabled. ''See [[dgsGridListSetAutoSortEnabled]]/[[dgsGridListGetAutoSortEnabled]]''
This property determines the default scale of the row text of the grid list. Note that this property does not affect rows that were created before the property was changed.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"autoSort",autoSort)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowTextSize",{scaleX,scaleY})</syntaxhighlight>
*'''autoSort''' : A bool of auto sort state.
*'''scaleX:''' A float of the 2D X scale of the text of the row.
*'''scaleY:''' A float of the 2D Y scale of the text of the row.


===sortColumn===
===rowWordBreak===
This property determines target sort column. ''See [[dgsGridListSetSortColumn]]''
This property determines whether word break property for row is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"sortColumn",sortColumn)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"rowWordBreak",rowWordBreak)</syntaxhighlight>
*'''sortColumn''' : An integer of the specific column to be sorted by.
*'''rowWordBreak:''' A bool indicates whether the word break is enabled.


===sectionColumnOffset===
===scrollBarAlignment===
This property determines offset of section row column (is different from but works with columnOffset). ''See [[dgsGridListSetRowAsSection]]''
This property sets the alignment of the scroll bars in the grid list.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"sectionColumnOffset",sectionColumnOffset)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist, "scrollBarAlignment",{vertical})</syntaxhighlight>  <!--,horizontal})</syntaxhighlight> !-->
*'''sectionColumnOffset''' : An integer of the offset of section row column.
*'''vertical:''' Specifies the alignment of the vertical scroll bar, which can be set to:
**'''left:''' Aligns the vertical scroll bar to the left of the grid list.
**'''right:''' Aligns the vertical scroll bar to the right of the grid list.
<!--*'''horizontal:''' Specifies the alignment of the horizontal scroll bar, which can be set to:
**'''top:''' Aligns the horizontal scroll bar to the top of the grid list.
**'''bottom:''' Aligns the horizontal scroll bar to the bottom of the grid list.!-->


===defaultColumnOffset===
===scrollBarState===
This property determines offset of normal row column (is different from but works with columnOffset). ''See [[dgsGridListSetRowAsSection]]''
This property forces the visibility of scroll bar. ''See [[dgsGridListSetScrollBarState]]/[[dgsGridListGetScrollBarState]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"defaultColumnOffset",defaultColumnOffset)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"scrollBarState",{vertical,horizontal})</syntaxhighlight>
*'''defaultColumnOffset''' : An integer of the offset of normal row column.
*'''vertical:''' A bool of the state of the vertical scroll bar.
*'''horizontal:''' A bool of the state of the horizontal scroll bar.
**'''true:''' Force to be visible
**'''false:''' Force to be invisible
**'''nil:''' Auto


===scrollBarThick===
===scrollBarThick===
This property determines the thickness of scroll bar.
This property determines the thickness of scroll bar.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"scrollBarThick",scrollBarThick)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"scrollBarThick",scrollBarThick)</syntaxhighlight>
*'''scrollBarThick''' : An integer of the thickness of scroll bar.
*'''scrollBarThick:''' An integer of the thickness of scroll bar.


===font===
===sectionColumnOffset===
This is equivalent to [[dgsSetFont]]/[[dgsGetFont]]. ''Learn More [[dxDrawText]]''
This property determines offset of section row column (is different from but works with columnOffset). ''See [[dgsGridListSetRowAsSection]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"font",font)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"sectionColumnOffset",sectionColumnOffset)</syntaxhighlight>
*'''font''' : A [[Element/DX_font|dx font element]] of the default text font of the gridlist.
*'''sectionColumnOffset:''' An integer of the offset of section row column.


===sectionFont===
===sectionFont===
This property determines the font of the text of which row is in section mode. ''Learn More [[dxDrawText]]''
This property determines the font of the text of which row is in section mode. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"sectionFont",sectionFont)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"sectionFont",sectionFont)</syntaxhighlight>
*'''sectionFont''' : A [[Element/DX_font|dx font element]] of the text of which row is in section mode.
*'''sectionFont:''' A [[Element/DX_font|dx font element]] of the text of which row is in section mode.
 
===colorcoded===
Whether the color code is enabled or not. ''Learn More [[dxDrawText]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"colorcoded",colorcoded)</syntaxhighlight>
*'''colorcoded''' : Set to true to enable embedded #FFFFFF color codes.


===selectionMode===
===selectionMode===
This property stores current selection mode of grid list. ''See [[dgsGridListSetSelectionMode]]/[[dgsGridListGetSelectionMode]]''
This property stores current selection mode of grid list. ''See [[dgsGridListSetSelectionMode]]/[[dgsGridListGetSelectionMode]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"selectionMode",selectionMode)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"selectionMode",selectionMode)</syntaxhighlight>
*'''selectionMode''' : The mode of the selection.  Can be the following values:
*'''selectionMode:''' The mode of the selection.  Can be the following values:
**'''1:''' row selection
**'''1:''' row selection
**'''2:''' column selection
**'''2:''' column selection
**'''3:''' cell selection
**'''3:''' cell selection


===multiSelection===
===selectedColumn===
This property determines whether multi selection is enabled or not. ''See [[dgsGridListSetMultiSelectionEnabled]]/[[dgsGridListGetMultiSelectionEnabled]]''
This property stores the index of which column the cursor is hovering. ''See [[dgsGridListGetEnterColumn]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"multiSelection",multiSelection)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"selectedColumn",selectedColumn)</syntaxhighlight>
*'''multiSelection''' : A bool of the state of the multi selection.
*'''columnHeight:''' Column Index.


===mode===
===sortColumn===
This property determines the render mode of grid list.
This property determines target sort column. ''See [[dgsGridListSetSortColumn]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"mode",mode)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"sortColumn",sortColumn)</syntaxhighlight>
*'''mode''' : A bool of the state of render mode. Detail:
*'''sortColumn:''' An integer of the specific column to be sorted by.
**'''true''' : No render target mode (Crappy and have a lot of bugs but doesn't take video memory)
**'''false''' : Render target mode (Great quality but takes video memory)


===clip===
===sortEnabled===
Whether the clip property is enabled or not. ''Learn More [[dxDrawText]]''
This property determines whether sort is enabled. ''See [[dgsGridListSetSortEnabled]]/[[dgsGridListGetSortEnabled]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"clip",clip)</syntaxhighlight>
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"sortEnabled",sortEnabled)</syntaxhighlight>
*'''clip''' : If set to true, the parts of the text that don't fit within the bounding box will be cut off.
*'''sortEnabled:''' A bool of sort state.
 
===scrollBarState===
This property forces the visibility of scroll bar. ''See [[dgsGridListSetScrollBarState]]/[[dgsGridListGetScrollBarState]]''
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"scrollBarState",{vertical,horizontal})</syntaxhighlight>
*'''vertical''' : A bool of the state of the vertical scroll bar.
*'''horizontal''' : A bool of the state of the horizontal scroll bar.
**'''true''' : Force to be visible
**'''false''' : Force to be invisible
**'''nil''' : Auto


===backgroundOffset===
==See Also==
This property determines the offset between the left border and row background.
{{DGSPROPERTIES}}
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"backgroundOffset",backgroundOffset)</syntaxhighlight>
*'''backgroundOffset''' : An integer of the offset between the left border and row background.
 
===rowSelect===
This property determines the offset between the left border and row background.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"backgroundOffset",backgroundOffset)</syntaxhighlight>
*'''backgroundOffset''' : An integer of the offset between the left border and row background.
 
===preSelect===
This property stores the item id the cursor is hovering on.
<syntaxhighlight lang="lua">dgsSetProperty(gridlist,"preSelect",data)</syntaxhighlight>
*'''data''' : the data.
'''Data Structure'''
<syntaxhighlight lang="lua">
{
[Column1] = {
Row1,
Row2,
...
},
[Column2] = {
Row1,
Row2,
...
},
...
}
</syntaxhighlight>

Latest revision as of 14:12, 11 June 2023

DGS Properties is always used to change the gui style and make it more fantastic.

This page shows the properties of dgs-dxgridlist that you could use.

Main Functions

Properties

autoSort

This property determines whether auto sort is enabled. See dgsGridListSetAutoSortEnabled/dgsGridListGetAutoSortEnabled

dgsSetProperty(gridlist,"autoSort",autoSort)
  • autoSort: A bool of auto sort state.

backgroundOffset

This property determines the offset between the left border and row background.

dgsSetProperty(gridlist,"backgroundOffset",backgroundOffset)
  • backgroundOffset: An integer of the offset between the left border and row background.

bgColor

This property determines the background color of the grid list.

dgsSetProperty(gridlist,"bgColor",bgColor)
  • bgColor: An integer of the color that can be converted by tocolor.

bgImage

This property determines the background image of the grid list. To adjust the color of the image, use property bgColor

dgsSetProperty(gridlist,"bgImage",bgImage)
  • bgImage: A material element that serves as the background image of the grid list (texture/shader/screen source/renderTarget).

clip

Whether the clip property is enabled or not. Learn More dxDrawText

dgsSetProperty(gridlist,"clip",clip)
  • clip: If set to true, the parts of the text that don't fit within the bounding box will be cut off.

columnColor

This property determines the background color of the column of the grid list.

dgsSetProperty(gridlist,"columnColor",columnColor)
  • columnColor: An integer of the color that can be converted by tocolor.

columnData

This property stores column data.

dgsSetProperty(gridlist,"columnData",columnData)
  • columnData: A table stores all column data.

Data Structure

{
	{ text, Width, AllWidthFront, Alignment, color, colorcoded, sizeX, sizeY, font },
	{ text, Width, AllWidthFront, Alignment, color, colorcoded, sizeX, sizeY, font },
	{ text, Width, AllWidthFront, Alignment, color, colorcoded, sizeX, sizeY, font },
	...
}

columnHeight

This property determines the column height of the grid list.

dgsSetProperty(gridlist,"columnHeight",columnHeight)
  • columnHeight: An integer of column height of the grid list.

columnImage

This property determines the background image of the column of the grid list.

dgsSetProperty(gridlist,"columnImage",columnImage)
  • columnImage: A material element that serves as the background image of the column of the grid list (texture/shader/screen source/renderTarget).

columnMoveOffset

This property stores the move offset of column that is used to render.

dgsSetProperty(gridlist,"columnMoveOffset",columnMoveOffset)
  • columnMoveOffset: A float stores the move offset of column that is used to render.

columnOffset

This property determines the global offset between the left border and column text.

dgsSetProperty(gridlist,"columnOffset",columnOffset)
  • columnOffset: An integer of offset of the column.

columnRelative

This property determines whether the column length is relative or not. See dgsGridListSetColumnRelative/dgsGridListGetColumnRelative

dgsSetProperty(gridlist,"columnRelative",columnRelative)
  • columnRelative: A bool of the relative state of the column length.

columnShadow

The shadow text of the column.

dgsSetProperty(gridlist,"columnShadow",{offsetX,offsetY,color})
  • offsetX: A float of the 2D X offset of the shadow text of the column.
  • offsetY: A float of the 2D Y offset of the shadow text of the column.
  • color: An integer of the color of the shadow text of the column.

columnTextColor

This property determines the color of the column text of the grid list.

dgsSetProperty(gridlist,"columnTextColor",columnTextColor)
  • columnTextColor: An integer of the color that can be converted by tocolor.

columnTextPosOffset

This property adjusts the offset of the text of the column, which can solve text misplacing caused by font.

dgsSetProperty(gridlist,"columnTextPosOffset",{offsetX,offsetY})
  • offsetX: A float of the 2D X offset of the text of the column.
  • offsetY: A float of the 2D Y offset of the text of the column.

columnTextSize

This property determines the scale of the column text of the grid list.

dgsSetProperty(gridlist,"columnTextSize",{scaleX,scaleY})
  • scaleX: A float of the 2D X scale of the text of the column.
  • scaleY: A float of the 2D Y scale of the text of the column.

columnWordBreak

This property determines whether word break property for column is enabled or not. Learn More dxDrawText

dgsSetProperty(gridlist,"columnWordBreak",columnWordBreak)
  • columnWordBreak: A bool indicates whether the word break is enabled.

colorCoded

Whether the color code is enabled or not. Learn More dxDrawText

dgsSetProperty(gridlist,"colorCoded",colorCoded)
  • colorCoded: Set to true to enable embedded #FFFFFF color codes.

defaultColumnOffset

This property determines offset of normal row column (is different from but works with columnOffset). See dgsGridListSetRowAsSection

dgsSetProperty(gridlist,"defaultColumnOffset",defaultColumnOffset)
  • defaultColumnOffset: An integer of the offset of normal row column.

defaultSortFunctions

This property determines the default sort function of grid list when clicking column.

dgsSetProperty(gridlist,"defaultSortFunctions",{lowerSortFunction,upperSortFunction})
  • lowerSortFunction: A string of the lower sort function name.
  • upperSortFunction: A string of the upper sort function name.

Here are three groups can be use:

  • greaterLower/greaterUpper: Sorting directly with string.
  • numGreaterLowerNumFirst/numGreaterUpperNumFirst: Sorting support number order with number first.
  • numGreaterLowerStrFirst/numGreaterUpperStrFirst: Sorting support number order with string first.
  • longerLower/longerUpper: Sorting according to the utf8 length of the string.

defaultSortIcons

This property determines the icons of the default sort function.

dgsSetProperty(gridlist,"defaultSortIcons",{iconA,iconB})
  • iconA: A string of the lower sort icon ( By default).
  • iconB: A string of the upper sort icon ( By default).

font

This is equivalent to dgsSetFont/dgsGetFont. Learn More dxDrawText

dgsSetProperty(gridlist,"font",font)

leading

This property determines the space between rows.

dgsSetProperty(gridlist,"leading",leading)
  • leading: How many pixels between rows

multiSelection

This property determines whether multi selection is enabled or not. See dgsGridListSetMultiSelectionEnabled/dgsGridListGetMultiSelectionEnabled

dgsSetProperty(gridlist,"multiSelection",multiSelection)
  • multiSelection: A bool of the state of the multi selection.

mode

This property determines the render mode of grid list.

dgsSetProperty(gridlist,"mode",mode)
  • mode: A bool of the state of render mode. Detail:
    • true: No render target mode (Crappy and have a lot of bugs but doesn't take video memory)
    • false: Render target mode (Great quality but takes video memory)

moveHardness

This property determines how hard will the grid list moves when scrolling.

dgsSetProperty(gridlist,"moveHardness",{scrollHardness,dragHardness})
  • scrollHardness: A float determins how hard will the grid list moves when scrolling with wheel ( should be larger than 0, lower than 1 ).
  • dragHardness: A float determins how hard will the grid list moves when dragging with mouse ( should be larger than 0, lower than 1 ).

preSelect

This property stores the item id the cursor is hovering on.

dgsSetProperty(gridlist,"preSelect",{rowIndex,columnIndex})
  • rowIndex: Row Index
  • columnIndex: Column Index

rowColor

This property determines the default 3 states' colors of row. See dgsGridListSetRowBackGroundColor/dgsGridListGetRowBackGroundColor. Note that this property does not affect rows that were created before the property was changed.

dgsSetProperty(gridlist,"rowColor",{colorDefault,colorHoving,colorSelected})
  • colorDefault: An integer of the color of the row (Default State).
  • colorHoving: An integer of the color of the row (Hoving State).
  • colorSelected: An integer of the color of the row (Selected State).

rowData

This property stores row data.

dgsSetProperty(gridlist,"rowData",rowData)
  • rowData: A table stores all row data.

Data Structure

{

	[1] = {
		[-4] = columnOffset,				--column offset
		[-3] = {normal,hovering,selected},		--background image
		[-2] = true/false,				--selectable
		[-1] = true/false,				--clickable
		[0] = {normal,hovering,selected},		--background color
		[1] = {text,color,colorcoded,scalex,scaley,font,{image,color,imagex,imagey,imagew,imageh},unselectable,unclickable},	--Column 1
		[2] = {text,color,colorcoded,scalex,scaley,font,{image,color,imagex,imagey,imagew,imageh},unselectable,unclickable},	--Column 2
		...
	},		--Row 1
	[2] = {
		[-4] = columnOffset,				--column offset
		[-3] = {normal,hovering,selected},		--background image
		[-2] = true/false,				--selectable
		[-1] = true/false,				--clickable
		[0] = {normal,hovering,selected},		--background color
		[1] = {text,color,colorcoded,scalex,scaley,font,{image,color,imagex,imagey,imagew,imageh},unselectable,unclickable},	--Column 1
		[2] = {text,color,colorcoded,scalex,scaley,font,{image,color,imagex,imagey,imagew,imageh},unselectable,unclickable},	--Column 2
		...
	},		--Row 2
}

rowHeight

This property determines the row height of the grid list.

dgsSetProperty(gridlist,"rowHeight",rowHeight)
  • rowHeight: An integer of row height of the grid list.

rowImage

This property determines the default 3 states' background image of row. See dgsGridListGetRowBackGroundImage/dgsGridListSetRowBackGroundImage. Note that this property does not affect rows that were created before the property was changed.

dgsSetProperty(gridlist,"rowImage",{normalImage,hoveringImage,selectedImage})
  • normalImage: A texture of the image of the row (Normal State).
  • hoveringImage: A texture of the image of the row (Hoving State).
  • selectedImage: A texture of the image of the row (Selected State).

rowImageStyle

This property determines the style of row background image.

dgsSetProperty(gridlist,"rowImageStyle",style)
  • style: An integer of the style of row background image. Available values are as follows:
    • 1: Every item uses a complete background image.
    • 2: Every row uses a complete background image.
    • 3: Only the visible area of every row uses a complete background image.

rowMoveOffset

This property stores the move offset of row that is used to render.

dgsSetProperty(gridlist,"rowMoveOffset",rowMoveOffset)
  • rowMoveOffset: A float stores the move offset of row that is used to render.

rowSelect

This property stores the selected rows.

dgsSetProperty(gridlist,"rowSelect",data)
  • data: the data.

Data Structure

{
	[Column1] = {
		Row1,
		Row2,
		...
	},
	[Column2] = {
		Row1,
		Row2,
		...
	},
	...
}

rowShadow

The shadow text of the row.

dgsSetProperty(gridlist,"rowShadow",{offsetX,offsetY,color})
  • offsetX: A float of the 2D X offset of the shadow text of the row.
  • offsetY: A float of the 2D Y offset of the shadow text of the row.
  • color: An integer of the color of the shadow text of the row.

rowShowUnclippedOnly

This property will force the grid list only show those unclipped row

dgsSetProperty(gridlist,"rowShowUnclippedOnly",rowShowUnclippedOnly)
  • rowShowUnclippedOnly: A bool indicates if the only the unclipped rows will be shown in grid list.

rowTextColor

This property determines the default color of the row text of the grid list.

dgsSetProperty(gridlist,"rowTextColor",rowTextColor)
  • rowTextColor: An integer of the color of the row text that can be converted by tocolor. Note that this property does not affect rows that were created before the property was changed.
dgsSetProperty(gridlist,"rowTextColor",{normalColor,hoveringColor,selectedColor})
  • normalColor: A integer of the color of the row text that can be converted by tocolor(Normal State).
  • hoveringColor: A integer of the color of the row text that can be converted by tocolor(Hoving State).
  • selectedColor: A integer of the color of the row text that can be converted by tocolor(Selected State).

rowTextPosOffset

This property adjusts the offset of the text of the row, which can solve text misplacing caused by font.

dgsSetProperty(gridlist,"rowTextPosOffset",{offsetX,offsetY})
  • offsetX: A float of the 2D X offset of the text of the row.
  • offsetY: A float of the 2D Y offset of the text of the row.

rowTextSize

This property determines the default scale of the row text of the grid list. Note that this property does not affect rows that were created before the property was changed.

dgsSetProperty(gridlist,"rowTextSize",{scaleX,scaleY})
  • scaleX: A float of the 2D X scale of the text of the row.
  • scaleY: A float of the 2D Y scale of the text of the row.

rowWordBreak

This property determines whether word break property for row is enabled or not. Learn More dxDrawText

dgsSetProperty(gridlist,"rowWordBreak",rowWordBreak)
  • rowWordBreak: A bool indicates whether the word break is enabled.

scrollBarAlignment

This property sets the alignment of the scroll bars in the grid list.

dgsSetProperty(gridlist, "scrollBarAlignment",{vertical})
  • vertical: Specifies the alignment of the vertical scroll bar, which can be set to:
    • left: Aligns the vertical scroll bar to the left of the grid list.
    • right: Aligns the vertical scroll bar to the right of the grid list.

scrollBarState

This property forces the visibility of scroll bar. See dgsGridListSetScrollBarState/dgsGridListGetScrollBarState

dgsSetProperty(gridlist,"scrollBarState",{vertical,horizontal})
  • vertical: A bool of the state of the vertical scroll bar.
  • horizontal: A bool of the state of the horizontal scroll bar.
    • true: Force to be visible
    • false: Force to be invisible
    • nil: Auto

scrollBarThick

This property determines the thickness of scroll bar.

dgsSetProperty(gridlist,"scrollBarThick",scrollBarThick)
  • scrollBarThick: An integer of the thickness of scroll bar.

sectionColumnOffset

This property determines offset of section row column (is different from but works with columnOffset). See dgsGridListSetRowAsSection

dgsSetProperty(gridlist,"sectionColumnOffset",sectionColumnOffset)
  • sectionColumnOffset: An integer of the offset of section row column.

sectionFont

This property determines the font of the text of which row is in section mode. Learn More dxDrawText

dgsSetProperty(gridlist,"sectionFont",sectionFont)
  • sectionFont: A dx font element of the text of which row is in section mode.

selectionMode

This property stores current selection mode of grid list. See dgsGridListSetSelectionMode/dgsGridListGetSelectionMode

dgsSetProperty(gridlist,"selectionMode",selectionMode)
  • selectionMode: The mode of the selection. Can be the following values:
    • 1: row selection
    • 2: column selection
    • 3: cell selection

selectedColumn

This property stores the index of which column the cursor is hovering. See dgsGridListGetEnterColumn

dgsSetProperty(gridlist,"selectedColumn",selectedColumn)
  • columnHeight: Column Index.

sortColumn

This property determines target sort column. See dgsGridListSetSortColumn

dgsSetProperty(gridlist,"sortColumn",sortColumn)
  • sortColumn: An integer of the specific column to be sorted by.

sortEnabled

This property determines whether sort is enabled. See dgsGridListSetSortEnabled/dgsGridListGetSortEnabled

dgsSetProperty(gridlist,"sortEnabled",sortEnabled)
  • sortEnabled: A bool of sort state.

See Also

General Properties

Unique Properties For DGS Core Elements

Extra Properties For DGS Plugins