DgsGridListGetItemColor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 5: Line 5:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool DgsDxGridListGetItemColor ( element gridList, int rowIndex, int columnIndex, bool notSplitColor )
bool dgsDxGridListGetItemColor ( element gridList, int rowIndex, int columnIndex [, bool notSplitColor = false ] )
</syntaxhighlight>  
</syntaxhighlight>  


Line 12: Line 12:
*'''rowIndex:''' Row index.
*'''rowIndex:''' Row index.
*'''columnIndex:''' Column index.
*'''columnIndex:''' Column index.
*'''notSplitColor :''' Whether to split color into r,g,b and a.
 
===Optional Arguments===
*'''notSplitColor :''' Whether to split color into r,g,b and a instead of a single number.


===Returns===
===Returns===
Line 18: Line 20:


==Example==  
==Example==  
'''Example 1'''
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
DGS = exports.dgs
local numberList = DGS:dgsCreateGridList ( 0.80, 0.10, 0.15, 0.60, true )
local column = DGS:dgsGridListAddColumn ( numberList, "Column Title", 0.85 )
local row = DGS:dgsGridListAddRow ( numberList )
local myItem = DGS:dgsGridListSetItemText ( numberList, row, column, tostring( math.random(0, 10) ) )
local color = DGS:dgsGridListGetItemColor ( numberList, row, column, true )
outputChatBox("Color: "..color)
</syntaxhighlight>
</section>
'''Example 2'''
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--TODO
DGS = exports.dgs
local numberList = DGS:dgsCreateGridList ( 0.80, 0.10, 0.15, 0.60, true )
local column = DGS:dgsGridListAddColumn ( numberList, "Column Title", 0.85 )
local row = DGS:dgsGridListAddRow ( numberList )
local myItem = DGS:dgsGridListSetItemText ( numberList, row, column, tostring( math.random(0, 10) ) )
local r,g,b,a = DGS:dgsGridListGetItemColor ( numberList, row, column )
outputChatBox("R: "..r.." ; G: "..g.." ; B: "..b.." ; A: "..a)
</syntaxhighlight>
</syntaxhighlight>
</section>
</section>

Revision as of 14:10, 18 January 2018

This function get the color of a gridlist item.

Syntax

bool dgsDxGridListGetItemColor ( element gridList, int rowIndex, int columnIndex [, bool notSplitColor = false ] )

Required Arguments

  • gridList: The dgs grid list element.
  • rowIndex: Row index.
  • columnIndex: Column index.

Optional Arguments

  • notSplitColor : Whether to split color into r,g,b and a instead of a single number.

Returns

Returns an integer of the color value if the item color was get successfully, and if notSplitColor sets to true, returns four int values representing the amount of red, green, blue and alpha , false otherwise.

Example

Example 1

Click to collapse [-]
Client
DGS = exports.dgs
local numberList = DGS:dgsCreateGridList ( 0.80, 0.10, 0.15, 0.60, true )
local column = DGS:dgsGridListAddColumn ( numberList, "Column Title", 0.85 )
local row = DGS:dgsGridListAddRow ( numberList )
local myItem = DGS:dgsGridListSetItemText ( numberList, row, column, tostring( math.random(0, 10) ) )
local color = DGS:dgsGridListGetItemColor ( numberList, row, column, true )
outputChatBox("Color: "..color)

Example 2

Click to collapse [-]
Client
DGS = exports.dgs
local numberList = DGS:dgsCreateGridList ( 0.80, 0.10, 0.15, 0.60, true )
local column = DGS:dgsGridListAddColumn ( numberList, "Column Title", 0.85 )
local row = DGS:dgsGridListAddRow ( numberList )
local myItem = DGS:dgsGridListSetItemText ( numberList, row, column, tostring( math.random(0, 10) ) )
local r,g,b,a = DGS:dgsGridListGetItemColor ( numberList, row, column )
outputChatBox("R: "..r.." ; G: "..g.." ; B: "..b.." ; A: "..a)

See Also

Custom Cursor Functions

Multi Language Supports

Animation

3D Element

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Menu

Label

Layout

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Basic Shape Plugins

Circle

Quadrilateral

Rounded Rectangle

Other Plugins

Blur Box

Canvas

Chart

Color Picker

Effect 3D

Gradient

Mask

Media Browser

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Screen Source

SVG

Tooltips