Hi
I've been testing BlueGUI v.2 and have just about exhausted all the Windows, Toolbar and Statusbar commands. So I have moved on to Scrollbars and Trackbars but I am having problems getting this code to compile.
if not gui_constants then end
global posval
statusbar = createstatusbar(0)
addstatuspanel statusbar,150
addstatuspanel statusbar,150
addstatuspanel statusbar,150
addstatuspanel statusbar,150
minval = 0
maxval = 100
posval = 0
thumbsize = 10
panel = createpanel(0,0,640,480,0)
#constant scrollbar1 = createscrollbar(30,30,17,300,1,panel)
#constant scrollbar2 = createscrollbar(47,330,300,17,0,panel)
#constant trackbar1 = createtrackbar(47,30,300,17,0,panel)
#constant trackbar2 = createtrackbar(347,30,17,300,1,panel)
settrackbartickfrequency trackbar1,10
settrackbartickfrequency trackbar2,10
Labpos = createlabel(80,150,50,20,"Position",panel)
#constant pos = createedit(130,150,50,20,0,panel)
#constant udpos = createUpDown(0,0,0,0,pos,panel)
Labmin = createlabel(80,180,50,20,"Min",panel)
min = createedit(130,180,50,20,0,panel)
#constant udmin = createUpDown(0,0,0,0,min,panel)
Labmax = createlabel(80,210,50,20,"Max",panel)
max = createedit(130,210,50,20,0,panel)
#constant udmax = createUpDown(0,0,0,0,max,panel)
Labthumb = createlabel(80,240,50,20,"Thumb",panel)
thumb = createedit(130,240,50,20,0,panel)
#constant udthumb = createUpDown(0,0,0,0,thumb,panel)
setgadgettext min,str$(minval)
setgadgettext max,str$(maxval)
setgadgettext pos,str$(posval)
setgadgettext thumb,str$(thumbsize)
setscrollbarrange scrollbar1,minval,maxval
setscrollbarrange scrollbar2,minval,maxval
settrackbarrange trackbar1,minval,maxval
settrackbarrange trackbar2,minval,maxval
resetmainwindow
do
getevent
if eventsource()<>0 then esource = eventsource()
if eventtype()<>0 then etype = eventtype()
setstatustext statusbar,1,"Event Source = "+str$(eSource)
setstatustext statusbar,2,"Event Type = "+str$(eType)
setstatustext statusbar,3,"Key Up = "+Str$(KEYUP)
setstatustext statusbar,4,"pos = "+str$(pos)
select eventtype()
case MOUSE_CLICK
select eventsource()
case scrollbar1
posval = getscrollbarposition(scrollbar1)
redraw()
endcase
case scrollbar2
posval = getscrollbarposition(scrollbar2)
redraw()
endcase
case pos
posval = val(getgadgettext(pos))
redraw()
endcase
case trackbar1
posval = gettrackbarposition(trackbar1)
redraw()
endcase
case trackbar2
posval = gettrackbarposition(trackbar2)
redraw()
endcase
endselect
endcase
case UP_KEY
select eventsource()
case udpos
posval = val(getgadgettext(pos))
redraw()
endcase
case udmin
rem min adjust
redraw()
endcase
case udmax
rem max adjust
redraw()
endcase
case udthumb
rem thumb adjust
redraw()
endcase
endselect
endcase
endselect
loop
function ReDraw()
setgadgettext pos,str$(posval)
setscrollbarposition scrollbar1,posval
setscrollbarposition scrollbar2,posval
settrackbarposition trackbar1,posval
settrackbarposition trackbar2,posval
endfunction
I didn't want to post this in the bug report forum because I am not sure if the problem is with my inept coding. I wasn't entirely sure of how SELECT, CASE etc worked, so, I asked for help
here:
But with my new found knowledge I could still not understand why the compiler was failing at the first CASE command.
Please take a look at it and let me know if it is my crappy coding or if I have found another bug.
Thanks