-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestForm.lua
More file actions
85 lines (66 loc) · 2.5 KB
/
TestForm.lua
File metadata and controls
85 lines (66 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
function using(pkgn) file.Write( "\\using/json.lua", http.Get( "https://raw.githubusercontent.com/G-A-Development-Team/libs/main/json.lua" ) ) LoadScript("\\using/json.lua") local pkg = json.decode(http.Get("https://raw.githubusercontent.com/G-A-Development-Team/Using/main/using.json"))["pkgs"][ pkgn ] if pkg ~= nil then file.Write( "\\using/" .. pkgn .. ".lua", http.Get( pkg ) ) LoadScript("\\using/" .. pkgn .. ".lua") else print("[using] package doesn't exist. {" .. pkgn .. "}") end end
using "Move-Resize"
using "WinFormLib"
using "WinFormColors"
using "WinFormToolbox"
using "WinForm"
local Form1 = {
Name = "Form1",
Interface = "Form",
Size = size(900, 529),
Location = point(0, 0),
MinimumSize = size(400, 350),
MaximumSize = size(1500, 800),
DragBounds = 30,
BorderStyle = "Sizable", --None
WinStyle = 11, --10
Visible = true,
BackColor = SystemColors.Control,
TitleBarColor = SystemColors.White,
ForeColor = SystemColors.Black,
Icon = "https://raw.githubusercontent.com/G-A-Development-Team/WinFormAPI/main/Icon.png",
LoadedIcon = nil,
Font = {
Name = "Microsoft Sans Serif",
Size = 15,
LoadedFont = nil,
},
Controls = {},
Update = function(props)
--Load Font
props.Font.LoadedFont = draw.CreateFont(props.Font.Name, props.Font.Size)
--Load Icon
local iconRGBA, iconWidth, iconHeight = common.DecodePNG(http.Get(props.Icon))
local iconTexture = draw.CreateTexture(iconRGBA, iconWidth, iconHeight)
props.LoadedIcon = iconTexture
return props
end,
}
Form1.Initialize = function()
local label = Toolbox.Label()
label.Properties.Name = "A Label"
label.Properties.Font.Size = 50
print(label.Properties.Name)
local button1 = Toolbox.Button()
button1.Properties.Text = "Click Me"
button1.Properties.Name = "Activate"
return {
label,
button1,
}
end
Form1.Load = function()
end
Form1 = Application.Run(Form1)
local ebtn_misc = gui.Reference("MISC");
local ebtn_gui = gui.Tab(ebtn_misc, "ebtn_gui", "Example Button");
Form1.Controls[Form1.Controls.Find("A Label")].Events.Register("MouseHover", function(mouseX, mouseY)
end)
-- Creating the object with a function embeded
local ebtn_button = gui.Button(ebtn_gui, "Clicky Clicky! #1", function()
Form1.Controls[Form1.Controls.Find("Activate")].Properties.Location = point(100, 150)
Form1.Size = size(400,650)
Form1.Controls[Form1.Controls.Find("Activate")].Events.Register("MouseClick", function (mouseX, mouseY)
print("added yo")
end)
end)