DgsGridListScrollTo: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Client function}} __NOTOC__ This function scrolls the grid list to the specific item. ==Syntax== <syntaxhighlight lang="lua"> bool dgsGridListScrollTo( element gridList, i...")
 
No edit summary
 
Line 20: Line 20:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
DGS = exports.dgs
DGS = exports.dgs
 
gridlist = DGS:dgsCreateGridList(500,50,600,600,false)
gridlist = dgsCreateGridList(500,50,600,600,false)
DGS:dgsGridListAddColumn(gridlist,"test1",0.4)
dgsGridListAddColumn(gridlist,"test1",0.4)
DGS:dgsGridListAddColumn(gridlist,"test2",0.8)
dgsGridListAddColumn(gridlist,"test2",0.8)
DGS:dgsGridListAddColumn(gridlist,"test3",0.8)
dgsGridListAddColumn(gridlist,"test3",0.8)
for i=1,500 do
for i=1,500 do
local row = dgsGridListAddRow(gridlist)
local row = DGS:dgsGridListAddRow(gridlist)
dgsGridListSetItemText(gridlist,row,1,i.."-1")
DGS:dgsGridListSetItemText(gridlist,row,1,i.."-1")
dgsGridListSetItemText(gridlist,row,2,i.."-2")
DGS:dgsGridListSetItemText(gridlist,row,2,i.."-2")
dgsGridListSetItemText(gridlist,row,3,i.."-3")
DGS:dgsGridListSetItemText(gridlist,row,3,i.."-3")
end
end
setTimer(function()
setTimer(function()
dgsGridListScrollTo(gridlist,300,2)
DGS:dgsGridListScrollTo(gridlist,300,2)
end,100,1)
end,100,1)
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 06:41, 19 April 2021

This function scrolls the grid list to the specific item.

Syntax

bool dgsGridListScrollTo( element gridList, int row, int column )

Required Arguments

  • gridList: The dgs grid list element.
  • row: An integer of the row index of the grid list you want to scroll to.
  • column: An integer of the column index of the grid list you want to scroll to.

Returns

Returns true if successful, false otherwise.

Example

This example creates a grid list, puts 2 items in to display the text "Hello" and "world" and clears the grid list after 5 seconds.

DGS = exports.dgs
gridlist = DGS:dgsCreateGridList(500,50,600,600,false)
DGS:dgsGridListAddColumn(gridlist,"test1",0.4)
DGS:dgsGridListAddColumn(gridlist,"test2",0.8)
DGS:dgsGridListAddColumn(gridlist,"test3",0.8)
for i=1,500 do
	local row = DGS:dgsGridListAddRow(gridlist)
	DGS:dgsGridListSetItemText(gridlist,row,1,i.."-1")
	DGS:dgsGridListSetItemText(gridlist,row,2,i.."-2")
	DGS:dgsGridListSetItemText(gridlist,row,3,i.."-3")
end
setTimer(function()
	DGS:dgsGridListScrollTo(gridlist,300,2)
end,100,1)

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