GuiGridListGetColumnTitle: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Remove obsolete Requirements section)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{client function}}
{{client function}}
{{Needs_Example}}
This function is used to get the column title of a gridlist column.
This function is used to get the column title of a gridlist column.


Line 7: Line 6:
string guiGridListGetColumnTitle( element guiGridlist, int columnIndex )
string guiGridListGetColumnTitle( element guiGridlist, int columnIndex )
</syntaxhighlight>
</syntaxhighlight>
{{OOP||[[Element/GUI/Gridlist|GuiGridList]]:getColumnTitle}}


===Required Arguments===
===Required Arguments===
Line 14: Line 14:
===Returns===
===Returns===
Returns a string containing the column title, or ''false'' otherwise.
Returns a string containing the column title, or ''false'' otherwise.
==Requirements==
{{Requirements|n/a|1.3.1-9.04949.0}}


==Example==
==Example==
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local theList = guiCreateGridList(0.80, 0.10, 0.15, 0.60, true) -- Create the grid list
local column = guiGridListAddColumn(theList, "New column", 0.9) -- Create a new column in the grid list
 
function GetColumnTitle()
function GetColumnTitle()
theList = guiCreateGridList(0.80, 0.10, 0.15, 0.60, true) -- Create the grid list
  if column then
column = guiGridListAddColumn(theList, "New column", 0.9) -- Create a new column in the grid list
    local ColumnTitle = guiGridListGetColumnTitle(theList,column)  
local ColumnTitle = guiGridListGetColumnTitle(theList, 1)
    outputChatBox("The Column Title Is: "..ColumnTitle, 0, 255, 0)--Get The column title in the chat
outputChatBox("The Column Title Is: "..ColumnTitle, 0, 255, 0)--Get The column title in the chat
  end
end
end
addCommandHandler("GetTitle", GetColumnTitle)
addCommandHandler("GetTitle", GetColumnTitle)
Line 32: Line 33:
==See Also==
==See Also==
{{GUI_functions}}
{{GUI_functions}}
{{GUI_events}}

Latest revision as of 17:09, 7 November 2024

This function is used to get the column title of a gridlist column.

Syntax

string guiGridListGetColumnTitle( element guiGridlist, int columnIndex )

OOP Syntax Help! I don't understand this!

Method: GuiGridList:getColumnTitle(...)


Required Arguments

  • guiGridlist: The grid list you want to get the column title from
  • columnIndex: Column ID

Returns

Returns a string containing the column title, or false otherwise.

Example

Click to collapse [-]
Client

local theList = guiCreateGridList(0.80, 0.10, 0.15, 0.60, true) -- Create the grid list
local column = guiGridListAddColumn(theList, "New column", 0.9) -- Create a new column in the grid list
  
function GetColumnTitle()
  if column then 
    local ColumnTitle = guiGridListGetColumnTitle(theList,column) 
    outputChatBox("The Column Title Is: "..ColumnTitle, 0, 255, 0)--Get The column title in the chat
  end 
end
addCommandHandler("GetTitle", GetColumnTitle)

See Also

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI