Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------- Configuration -------------------
- local rquiredAPIVersion = 2.42
- -----------------------------------------------------
- pcall(dofile,"scripts/ssccssccAPI.lua")
- if not interface_s or interface_s.Version < rquiredAPIVersion then
- if tpt.confirm("Download and install file", "Interface API (scripts/ssccssccAPI.lua) is required to run script. Download it now?") then
- fs.makeDirectory("scripts")
- tpt.getscript(172, "scripts/ssccssccAPI.lua", 1, 0)
- else
- tpt.log("Script is unavailable due to lack of required files.")
- return
- end
- end
- local DefaultTheme = interface_s.DefaultTheme
- --
- function dropDownDemo()
- local MainWindow = interface_s.Components.Window:new(40, 40, 150, 50,true, DefaultTheme.Window)
- MainWindow.AllowResize = false
- MainWindow.AlwaysFocused = true
- local label1 = interface_s.Components.Label:new(6,12,"Item: ",DefaultTheme.Label)
- local Combo = interface_s.Components.Combobox:new(35,10,50,12,{"Item1","Item2","Item3","Item4","Item5"},DefaultTheme.Combobox)
- local OkButton = interface_s.Components.Button:new(95, 32, 50, 12, "Ok", DefaultTheme.Button)
- OkButton:AddHint("Demo hint")
- OkButton.OnPressed = function()
- tpt.log(Combo.Items[Combo.SelectedIndex+1])
- end
- local ExitButton = interface_s.Components.Button:new(142, 0, 8, 8,"x", DefaultTheme.Button)
- ExitButton.OnPressed = (function()
- interface_s.RemoveComponent(MainWindow)
- end)
- MainWindow:AddComponent(label1)
- MainWindow:AddComponent(Combo)
- MainWindow:AddComponent(OkButton)
- MainWindow:AddComponent(ExitButton)
- interface_s.addComponent(MainWindow)
- end
- dropDownDemo()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement