GUI Classes
This page lists all the gui class objects. This will only work with: http://community.mtasa.com/index.php?p=resources&s=details&id=241
This system is created by the well known 50p!
GUI Classes made scripting gui objects easier!
Contents
- 1 Installation
- 2 Useful information
- 3 Classes
- 3.1 Button class
- 3.2 Check Box class
- 3.3 Gridlist class
- 3.4 Label class
- 3.5 Memo class
- 3.6 Progress Bar class
- 3.7 Radio Button class
- 3.8 Scroll Bar class
- 3.9 Static Image class
- 3.10 Tab class
- 3.11 Tab panel class
- 3.12 Text Box class (formally known as Edit)
- 3.13 Window class
- 3.14 Shared methods with all classes
Installation
The installation is pretty simple. All you need to do is copy and paste folder "gui_class/classes/" into your resource which you want to use these classes in. Then just copy specified lines from "gui_class/meta.xml" into your meta.xml. As you know gui_class is not actually a resource that you can use exported functions of. It just includes all the classes that make scripting GUI cleaner, so that's why you have to copy the directory and include the files which are inside into meta.xml to tell the server/client which files you're using (that is, the classes you want to use).
You can also start gui_class resource and uncomment some examples which are located in "test.lua"
Useful information
Once you create a GUI Object, it has a bunch of variables that you can access. One of them is .gui which represents the gui element that can be used with native GUI functions. Lets say, you want to use guiSetVisible() and you don't want to use object:Visible() then you can do so like this:
-- create our object local button = Button:Create( 10, 200, 100, 18, "Woot!" ); -- now use native GUI function guiSetVisible( button.gui, false );
Classes
Button class
Check Box class
Gridlist class
- GridList:Create
- GridList:AutoSizeColumn
- GridList:AddColumn
- GridList:AddRow
- GridList:Clear
- GridList:ItemData
- GridList:ItemText
- GridList:SelectedItem
- GridList:SortingEnabled
- GridList:RowCount
- GridList:ColumnCount
- GridList:InsertRowAfter
- GridList:RemoveColumn
- GridList:RemoveRow
- GridList:ScrollBars
- GridList:SelectionMode
Label class
- Label:Create
- Label:Color
- Label:VerticalAlign
- Label:HorizontalAlign
- Label:GetTextExtent
- Label:GetFontHeight
Memo class
Progress Bar class
Progress bar with this class is a little bit different from the native one. What's different is that I added a label on top, so that you can have a progress bar with some text on it.
- ProgressBar:Create
- ProgressBar:Font
- ProgressBar:LabelColor
- ProgressBar:Progress
- ProgressBar:Text
- ProgressBar:Size
Radio Button class
Scroll Bar class
Static Image class
Tab class
Tab panel class
Text Box class (formally known as Edit)
Window class
- GUISharedFuncs:Alpha
- GUISharedFuncs:BringToFront
- GUISharedFuncs:Dragable
- GUISharedFuncs:Enabled
- GUISharedFuncs:Font
- GUISharedFuncs:MoveToBack
- GUISharedFuncs:Property
- GUISharedFuncs:Text
- GUISharedFuncs:Position
- GUISharedFuncs:Size
- GUISharedFuncs:Visible
- GUISharedFuncs:AddOnClick
- GUISharedFuncs:RemoveOnClick
- GUISharedFuncs:AddOnMouseEnter
- GUISharedFuncs:RemoveOnMouseEnter
- GUISharedFuncs:AddOnMouseLeave
- GUISharedFuncs:RemoveOnMouseLeave