Jump to content

dgs ScrollPane help


evoxxx

Recommended Posts

Posted

Hello.

Sry for my english :d
How i can create scrollbar in scrollpane on the left from the text?
(now i have scrollpane, scrollbar in right side, and text in child of scrollpane and i want to create scrollbar in left side)

  • Scripting Moderators
Posted

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
  • Scripting Moderators
Posted
	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
  • 2 months later...
Posted
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

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...