Computer Science Canada [Class] Sliders |
Author: | Raknarg [ Sat Aug 04, 2012 5:33 pm ] | ||
Post subject: | [Class] Sliders | ||
To add to my collection of random GUI objects, I made a slider class. Lets go through the essentials: proc initialize (x1_, y1_, x2_, y2_, borderc_, backc_, linec_, barc_, value_, minValue_, maxValue_ : int) x1, y1, x2, y2: works like box coordinates. Make sure the 1's are smaller than the 2's. borderc, backc, linec, barc: The colours of the slider. Border colour, background colour, the line in the middle's colour, and the sliding bar colour. value, minValue, maxValue: Min value and max value are the parameters for the slider. It goes in segments from minValue to maxValue, so if it's from 5 to 10, the bar will have six different possible positions and values, ranging from 5 to 10. Value keeps track of the slider bar. Here's an example I made with this, a colour mixer (make sure this program and the unit are saved in the same file):
|
Author: | Raknarg [ Sat Aug 04, 2012 9:20 pm ] |
Post subject: | RE:[Class] Sliders |
also if anyone is actually interested, 2 things: I made it adjustable between horizontal and vertical if wanted. Also If anyone wants anything or has any ideas, I'm open to suggestions, I'm just compiling a bunch of gui widgets |
Author: | Raknarg [ Sat Aug 04, 2012 11:05 pm ] |
Post subject: | Re: [Class] Sliders |
Nevermind I'm updating anyways. Also added reversability |
Author: | Atma Weapon [ Thu Sep 13, 2012 3:31 pm ] |
Post subject: | RE:[Class] Sliders |
I'm getting an error. "Unit symbol is button. Not 'Buttons' " ? What am I doing wrong? |
Author: | QuantumPhysics [ Thu Sep 13, 2012 7:04 pm ] |
Post subject: | RE:[Class] Sliders |
I like it. |
Author: | evildaddy911 [ Sat Sep 15, 2012 10:15 am ] |
Post subject: | RE:[Class] Sliders |
i suggest using real values for the "maxvalue", "minValue" and "value" variables, other than that, pretty damn good! |
Author: | Raknarg [ Mon Sep 17, 2012 5:47 pm ] |
Post subject: | RE:[Class] Sliders |
@evildaddy personal preference You can easily change it yourself. @Atma Weapon.. I don't really know. Did you try making your own program? Are you missing anything? |