GuiGridListSetColumnTitle: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{client function}}
{{client function}}
{{Needs_Example}}
This function is used to change the column title of a gridlist column.
This function is used to change the column title of a gridlist column.


Line 21: Line 20:
==Example==
==Example==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addCommandHandler("Set",function(cmd, title)
local gridlist = guiCreateGridList ( 332, 195, 286, 249, false )
With = guiGridListSetColumnTitle(grid ,c, title)
local column = guiGridListAddColumn(gridlist, "title", 0.5)
if guiGridListGetColumnTitle(grid, c) == title then
 
outputChatBox("Set Name Column Successfully Name New : "..title,0,255,0)
addCommandHandler("setTitle",
else
  function(cmd, title)
outputChatBox("Error : Your Not Set Name in Command",255,0,0)
    if title then
end
      if column then
end
          guiGridListSetColumnTitle(gridlist ,column, title)
)
  outputChatBox("Column name has been successfully changed to : "..title,0,255,0)
</syntaxhighlight>
      end
    else
      outputChatBox("[Usage] /setTitle [title]",255,0,0)
    end
  end
)</syntaxhighlight>


==See Also==
==See Also==
{{GUI_functions}}
{{GUI_functions}}

Revision as of 13:43, 30 June 2016

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

Syntax

bool guiGridListSetColumnTitle( element guiGridlist, int columnIndex, string title )

Required Arguments

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

Returns

Returns true if the new title was set, or false otherwise.

Requirements

This template will be deleted.

Example

local gridlist = guiCreateGridList ( 332, 195, 286, 249, false ) 
local column = guiGridListAddColumn(gridlist, "title", 0.5)

addCommandHandler("setTitle",
   function(cmd, title)
     if title then 
       if column then 
          guiGridListSetColumnTitle(gridlist ,column, title)	
	  outputChatBox("Column name has been successfully changed to : "..title,0,255,0)
       end 
     else
       outputChatBox("[Usage] /setTitle [title]",255,0,0)
     end
  end
)

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