Jump to content

dgs ScrollPane help


evoxxx

Recommended Posts

  • Scripting Moderators

i am working on a new function to solve your question. As soon as the new function finishes, i will post the method to realize what you want. :D thanks for your supports.

  • Like 1
Link to comment
  • Scripting Moderators
	wind = dgsCreateWindow(0.2*sW,0,0.4*sW,0.4*sH,"Example Scroll Pane (exclude this window)",false)
	pane = dgsCreateScrollPane(20,0,200,200,false,wind)
	dgsScrollPaneSetScrollBarState(pane,false)
	scrollbar = dgsCreateScrollBar(0,0,20,180,false,false,wind)
	dgsSetProperty(scrollbar,"theScrollPane",pane)
	dgsSetProperty(scrollbar,"functions",[[
		local scb = dgsScrollPaneGetScrollBar(dgsElementData[self].theScrollPane)[1]
		dgsElementData[self].multiplier = dgsElementData[scb].multiplier
		dgsElementData[self].length = dgsElementData[scb].length
	]])
	addEventHandler("onDgsScrollPaneScroll",pane,function(vertical)
		dgsScrollBarSetScrollPosition(scrollbar,vertical)
	end)
	
	addEventHandler("onDgsScrollBarScrollPositionChange",scrollbar,function(value)
		local scbs = dgsScrollPaneGetScrollBar(pane)
		dgsScrollBarSetScrollPosition(scbs[1],value)
	end)
	
	gdlt = dgsCreateImage(0.5,0,1.1,1.1,_,true,pane,tocolor(255,255,255,255))
	gdlt2 = dgsCreateImage(0.1,0,0.7,0.7,_,true,pane,tocolor(0,255,255,255))

With the latest DGS, this is an example to handle your situation.

  • Like 1
Link to comment
  • 2 months later...
On 19/02/2019 at 16:40, thisdp said:

	wind = dgsCreateWindow(0.2*sW,0,0.4*sW,0.4*sH,"Example Scroll Pane (exclude this window)",false)
	pane = dgsCreateScrollPane(20,0,200,200,false,wind)
	dgsScrollPaneSetScrollBarState(pane,false)
	scrollbar = dgsCreateScrollBar(0,0,20,180,false,false,wind)
	dgsSetProperty(scrollbar,"theScrollPane",pane)
	dgsSetProperty(scrollbar,"functions",[[
		local scb = dgsScrollPaneGetScrollBar(dgsElementData[self].theScrollPane)[1]
		dgsElementData[self].multiplier = dgsElementData[scb].multiplier
		dgsElementData[self].length = dgsElementData[scb].length
	]])
	addEventHandler("onDgsScrollPaneScroll",pane,function(vertical)
		dgsScrollBarSetScrollPosition(scrollbar,vertical)
	end)
	
	addEventHandler("onDgsScrollBarScrollPositionChange",scrollbar,function(value)
		local scbs = dgsScrollPaneGetScrollBar(pane)
		dgsScrollBarSetScrollPosition(scbs[1],value)
	end)
	
	gdlt = dgsCreateImage(0.5,0,1.1,1.1,_,true,pane,tocolor(255,255,255,255))
	gdlt2 = dgsCreateImage(0.1,0,0.7,0.7,_,true,pane,tocolor(0,255,255,255))

With the latest DGS, this is an example to handle your situation.

Thank you, very much

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...