The big problem is that my work on ScuiLib (from now on HGui) is discountinued because of real life, like all of us.
Moreover I've to complete Emula and after that I've to release AMC for MorphOS along with a great & complex update... I'd be happy to have someone to work too but right now I prefer to work alone, just because in some periods I've no time to dedicate to these projects.
Clyde, I'm not able to find your e-mail sorry! I'm receiving tons af spam and maybe I haven't noticed your message: can you tell me when you have sent it?
About the code, here it is, but don't be scared! There are several nested gadgets to test the library and the scaling routines:
Code: Select all
;--- Create a new window with a nice background ---
mywin3 = HGui.Window:new({ position = { x = 200, y = 200 }, sizemax = { w = 800, h = 400 }, background = "testbg1.jpg" })
;--- Load a sample to attach to one of the button in the example ---
test_sample = LoadSample(Nil, "TestSound.wav")
;--- Load an icon for one of our buttons and clone it with another shade for a different button state ---
GFX.Icon.Add("Test_Icon", "TestIcon.png", { w = 32, h = 32 })
GFX.Icon.TClone("Test_Icon2", "Test_Icon", { Color = $FFFFFF, Level = 128 })
;--- Interrupt gadget rendering while we are building the interface ---
HGui.SetAutoRendering(False)
;--- Gadget creations... ---
mygad1 = HGui.Gadget:new(#HGUI_BOX_GADGET, { name = "MyGAD1", window = mywin3 })
mygad2 = HGui.Gadget:new(#HGUI_VDIVIDER_GADGET, { name = "MyGAD2", window = mywin3 })
mygad3 = HGui.Gadget:new(#HGUI_BOX_GADGET, { name = "MyGAD3", window = mywin3 })
mygad4 = HGui.Gadget:new(#HGUI_LABEL_GADGET, { caption = { "LABEL1" },
name = "MyGAD4", window = mywin3 })
mygad5 = HGui.Gadget:new(#HGUI_GROUP_GADGET, { name = "myGAD5",
Caption = { "GROUP" },
Group_LabelGap = 10,
Group_LabelSide = #HGUI_ALIGN_RIGHT,
window = mywin3 })
mygad6 = HGui.Gadget:new(#HGUI_LABEL_GADGET, { angle = 90, caption = { "Vertical!" },
name = "MyGAD6", window = mywin3 })
mygad7 = HGui.Gadget:new(#HGUI_BOX_GADGET, { name = "MyGADsette", window = mywin3 })
mygad7a = HGui.Gadget:new(#HGUI_BUTTON_GADGET, { tip = { "This is a [color=$ff0000]sample[/color] tip text",
"in two [u]lines[/u]" },
look = { icons = { iname = "Test_Icon",
hname = "Test_Icon2",
Alignment = #HGUI_ALIGN_LEFT +
#HGUI_ALIGN_VCENTER }},
caption = { "BUTTON", "YEAH!" },
sounds = { onpushed = test_sample },
actions = { onpushed = EventTester },
name = "MyGAD7a", window = mywin3 })
mygad7b = HGui.Gadget:new(#HGUI_BUTTON_GADGET, { look = { vectors = { idata = GFX.Vectors.BuiltIn.sarrow_left,
pdata = GFX.Vectors.BuiltIn.arrow_left }},
caption = { "BUTTON 2" },
actions = { onpushed = EventTester },
name = "MyGAD7b", window = mywin3 })
mygad8 = HGui.Gadget:new(#HGUI_BOX_GADGET, { name = "MyGAD8", window = mywin3 })
mygad9 = HGui.Gadget:new(#HGUI_HDIVIDER_GADGET, { name = "MyGAD9", window = mywin3 })
;--- Define GUI hierarchy & layout ---
mywin3.rootgadget:setlayout({ gadgets = { mygad1, mygad2, mygad3 },
weights = { -0.45, 6, 0.55 },
gap = 0,
borders = { top = 1, bottom = 1, left = 1, right = 1 } }, True )
mygad3:setlayout({ gadgets = { mygad4, mygad5 },
weights = { 0.20, 0.80 },
gap = 2,
borders = { top = 2, bottom = 2, left = 2, right = 2 } }, True )
mygad5:setlayout({ gadgets = { mygad6, mygad7, mygad9, mygad8 },
weights = { 16, 0.45, 6, -0.55 },
gap = 1,
Type = #HGUI_HORIZONTAL_LAYOUT,
borders = { top = 4, bottom = 4, left = 4, right = 4 } }, True )
mygad7:setlayout({ gadgets = { mygad7a, mygad7b },
weights = { 0.50, 0.50 },
gap = 2,
borders = { top = 2, bottom = 2, left = 2, right = 2 } }, True )
;--- Restore gadgets rendering ---
HGui.SetAutoRendering(True)
;--- Refresh the GUI ---
mywin3:draw_gui()
Repeat
WaitEvent()
Forever