Scrollpanel example?

BlitzMax Forums/MaxGUI Module/Scrollpanel example?

JoshK(Posted 2010) [#1]
This doesn't work:
Import MaxGui.Drivers
Import maxgui.proxygadgets

Strict 

Local window:TGadget
Local panel:TScrollPanel
'Gadget
Local panel2:TGadget
Local group:TGadget

window=CreateWindow("My Window",40,40,320,240)

' create a purple panel that occupies entire window client area

panel=CreateScrollPanel(0,0,ClientWidth(window),ClientHeight(window),window,SCROLLPANEL_VSCALING)'

'SetGadgetLayout panel,1,1,1,1
SetPanelColor panel,100,0,200

' and a smaller box

panel2=CreatePanel(10,10,100,1000,panel,PANEL_ACTIVE|PANEL_BORDER)
panel2.SetColor(160,255,160)

' and a group panel with a child button

panel.FitToChildren()

group=CreatePanel(120,10,100,100,panel,PANEL_GROUP)
group.settext("My Group")
CreateButton("hello",0,0,64,24,group)


While True
	WaitEvent 
	Print CurrentEvent.ToString()
	Select EventID()
		Case EVENT_WINDOWCLOSE
			End
	End Select
Wend



jsp(Posted 2010) [#2]
See code below:
I found two small issues. First you have to retrieve the client panel and second you used the FitToClient function to early. Have a look.



JoshK(Posted 2010) [#3]
Thanks.