Property of scroll bar

new topic     » topic index » view thread      » older message » newer message

I have set up several scroll bars on the screen via a sequence.  By using
the onScroll event, I execute a procedure that is comon to all scroll bar
objects.  Is there a property of the selected scroll bar that I can check
to see if that scroll bar is the one that caused the onScroll event.

This question may make more sense if you see the code so far.  Each Scroll
bar should have it's position displayed below it (in numeric format).

Here is the code:

 include win32lib.ew
include Ports.e

--***Define Global Variables***
global sequence Scrollers,ScrollValues

Scrollers={}
ScrollValues={}

--***This is the main window***
constant MainWindow=create(Window,"Remote Parallel Port
Control",0,10,10,600,500,0)

--***Create the 15 control slides and Scroll Value Positions***
for x=1 to 15 do
 Scrollers=append(Scrollers,create
(VScroll,"",MainWindow,x*30+30,30,10,100,0))
 setScrollRange(Scrollers[x],1,255)
 setScrollPos(Scrollers[x],255)
 ScrollValues=append(ScrollValues,create
(16,"",MainWindow,x*30+30,140,30,20,0))
end for

--***Create Procedure executed for Scroll Event
procedure onScroll_Scrollers(integer ScrollPosition)
integer ActiveScroll
 for x=1 to 15 do
  if isEnabled(Scrollers[x]) then
   ActiveScroll=x
  end if
 end for
end procedure

--***Create Events to be captured
for x=1 to 15 do
 onScroll[Scrollers[x]] = routine_id("onScroll_Scrollers")
end for

WinMain(MainWindow,Normal)

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu