omron — Creating a Slide Bar

Creating a Slide Bar Creating a Slide Bar eV+ allows you to create a eV+feature similar to the window scroll bars called slide bars. The syntax for a slide bar is: GSLIDE (glun, mode) slide_id = x, y, len, max_pos, arrow.inc, handle glun The logical unit of the window the slide bar is created in. mode is replaced with: 0 indicating a horizontal slide bar is to be created or updated. 1 indicating a slide bar is to be deleted. 2 indicating a vertical slide bar is to be created or updated. slide_id A number that identifies the slide bar. This number is returned to the event queue so you can distinguish which slide was moved. x y The coordinates of the top left corner of the slide bar.

len The width or height of the bar. max_pos Specifies the maximum value the slide bar returns. arrow_inc Specifies the increment the slide bar registers when the arrows are clicked. (The slide bar is created with a scroll handle and scroll arrows.) handle Specifies position the scroll handle is in when the slide bar is created. GSLIDE Example We will be interested in two events when monitoring a slide bar, event 8 (slide bar pointer move) and event 9 (slide bar button up). Additional event monitoring must be enabled with the FSET instruction. Object must be specified to monitor slide bars and move_b2 must be specified to monitor the dragging of the middle button.

The values returned in the GETEVENT array will be: l event[0] the pointer device event code l event[1] the ID of the slide bar (as specified by slide_id) l event[2] the slide bar value l event[3] the maximum slide bar value The following code will display and monitor a slide bar: ; The slide bar will be in the window open on glun ; The slide bar will use events 8 and 9. A double-click event ; will halt ; monitoring of the slide bar eV+Language User's Guide, v2.x, 18318-000 Rev A Page 172