Creation/Dev/Script/Client/GuiTextListCtrl: Difference between revisions

From Graal Bible
mNo edit summary
 
No edit summary
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<pre>
[[Category:Scripting Reference]]
      GuiTextListCtrl (GuiArrayCtrl):
Inherits from [[Creation/Dev/Script/Client/GuiArrayCtrl|GuiArrayCtrl]].
        clipcolumntext - boolean
 
        columns - string - of format "0 16", offset of the tabulators
=Description=
        enumerate - boolean
 
        fitparentwidth - boolean
[[Image:Guicontrol_textlist.png]]
        groupsortorder - string
 
        iconheight - integer (read only)
This control is displaying a list. Each row can have a text and an icon, also the text can be divided into several columns (using the columns offset array and tabulators in the text). Most of the time this control is put in a [[Creation/Dev/Script/Client/GuiScrollCtrl|GuiScrollCtrl]] (In order for the width variable to work it must be in a [[Creation/Dev/Script/Client/GuiScrollCtrl|GuiScrollCtrl]]).
        iconwidth - integer (read only)
 
        resizecell - boolean
=Variables=
        selected - object (read only)
 
        sortcolumn - integer
clipcolumntext - boolean
        sortmode - string
 
        sortorder - string
columns - string - of format "0 16", offset of the tabulators
        addrow(int, str) - returns object - the added row
 
        clearrows()
enumerate - boolean
        clearselection()
 
        findtext(str) - returns integer - row index
fitparentwidth - boolean
        findtextid(str) - returns integer - row id
 
        getrowatpoint(int, int) - returns integer - row index
groupsortorder - string
        getrowidatpoint(int, int) - returns integer - row id
 
        getrownumbyid(int) - returns integer
iconheight - integer (read only)
        getselectedid() - returns integer - row id
 
        getselectedids() - returns object - array of row ids
iconwidth - integer (read only)
        getselectedrow() - returns integer - row index
 
        getselectedrows() - returns object - array of row indices
resizecell - boolean
        getselectedtext() - returns string
 
        insertrow(int, int, str) - returns object - the inserted row
rows[] - array of [[Creation/Dev/Script/Client/GuiTextListEntry|GuiTextListEntry]]
        isidselected(int) - returns boolean
 
        isrowselected(int) - returns boolean
selected - object (read only)
        makevisible(int)
 
        makevisiblebyid(int)
sortcolumn - integer
        removerow(int)
 
        removerowbyid(int)
sortmode - string
        rowcount() - returns integer
 
        seticonsize(int, int)
sortorder - string
        setrowactivebyid(int, bool)
 
        setrowbyid(int, str)
 
        setselectedbyid(int)
=Functions=
        setselectedrow(int)
 
        sort()
addrow(int, str) - returns object - the added row
</pre>
 
clearrows()
 
clearselection()
 
findtext(str) - returns integer - row index
 
findtextid(str) - returns integer - row id
 
getrowatpoint(int, int) - returns integer - row index
 
getrowidatpoint(int, int) - returns integer - row id
 
getrownumbyid(int) - returns integer
 
getselectedid() - returns integer - row id
 
getselectedids() - returns object - array of row ids
 
getselectedrow() - returns integer - row index
 
getselectedrows() - returns object - array of row indices
 
getselectedtext() - returns string
 
insertrow(int, int, str) - returns object - the inserted row
 
isidselected(int) - returns boolean
 
isrowselected(int) - returns boolean
 
makevisible(int)
 
makevisiblebyid(int)
 
removerow(int)
 
removerowbyid(int)
 
rowcount() - returns integer
 
seticonsize(int, int) - sets the width and height of the icons for the entries, maximum size is 64x64
 
setrowactivebyid(int, bool)
 
setrowbyid(int, str)
 
setselectedbyid(int)
 
setselectedrow(int)
 
sort()
 
=Events=
 
onSelect(entryid,entrytext,entryindex) - a row has been selected
 
onDblClick(entryid,entrytext,entryindex) - is invoked when the mouse is double-clicked while being over a row
 
onDeleteKey(entryid,entrytext,entryindex) - the delete key was pressed while a row was selected
 
onOpenMenu(entryid,entrytext,entryindex) - is invoked when the right mouse button has been clicked while the mouse is over a row
 
onIconResized(newwidth,newheight) - the icon size has been changed via setIconSize()
 
=Example=
 
  new GuiScrollCtrl("Test_ListScroll") {
    profile = GuiBlueScrollProfile;
    x = 10;
    y = 10;
    width = 160;
    height = 80;
    hScrollBar = "dynamic";
    vScrollBar = "dynamic";
 
    new GuiTextListCtrl("Test_List") {
      profile = GuiBlueTextListProfile;
      x = y = 0;
      width = 140;
      fitparentwidth = true;
     
      clearrows();
      addrow(0,"TextList");
      addrow(1,"Second line");
      setSelectedRow(1);
    }
  }

Latest revision as of 00:56, 16 February 2010

Inherits from GuiArrayCtrl.

Description

Guicontrol textlist.png

This control is displaying a list. Each row can have a text and an icon, also the text can be divided into several columns (using the columns offset array and tabulators in the text). Most of the time this control is put in a GuiScrollCtrl (In order for the width variable to work it must be in a GuiScrollCtrl).

Variables

clipcolumntext - boolean

columns - string - of format "0 16", offset of the tabulators

enumerate - boolean

fitparentwidth - boolean

groupsortorder - string

iconheight - integer (read only)

iconwidth - integer (read only)

resizecell - boolean

rows[] - array of GuiTextListEntry

selected - object (read only)

sortcolumn - integer

sortmode - string

sortorder - string


Functions

addrow(int, str) - returns object - the added row

clearrows()

clearselection()

findtext(str) - returns integer - row index

findtextid(str) - returns integer - row id

getrowatpoint(int, int) - returns integer - row index

getrowidatpoint(int, int) - returns integer - row id

getrownumbyid(int) - returns integer

getselectedid() - returns integer - row id

getselectedids() - returns object - array of row ids

getselectedrow() - returns integer - row index

getselectedrows() - returns object - array of row indices

getselectedtext() - returns string

insertrow(int, int, str) - returns object - the inserted row

isidselected(int) - returns boolean

isrowselected(int) - returns boolean

makevisible(int)

makevisiblebyid(int)

removerow(int)

removerowbyid(int)

rowcount() - returns integer

seticonsize(int, int) - sets the width and height of the icons for the entries, maximum size is 64x64

setrowactivebyid(int, bool)

setrowbyid(int, str)

setselectedbyid(int)

setselectedrow(int)

sort()

Events

onSelect(entryid,entrytext,entryindex) - a row has been selected

onDblClick(entryid,entrytext,entryindex) - is invoked when the mouse is double-clicked while being over a row

onDeleteKey(entryid,entrytext,entryindex) - the delete key was pressed while a row was selected

onOpenMenu(entryid,entrytext,entryindex) - is invoked when the right mouse button has been clicked while the mouse is over a row

onIconResized(newwidth,newheight) - the icon size has been changed via setIconSize()

Example

 new GuiScrollCtrl("Test_ListScroll") {
   profile = GuiBlueScrollProfile;
   x = 10;
   y = 10;
   width = 160;
   height = 80;
   hScrollBar = "dynamic";
   vScrollBar = "dynamic";
   new GuiTextListCtrl("Test_List") {
     profile = GuiBlueTextListProfile;
     x = y = 0;
     width = 140;
     fitparentwidth = true;
     
     clearrows();
     addrow(0,"TextList");
     addrow(1,"Second line");
     setSelectedRow(1);
   }
 }