Home » U++ Library support » Slider&ProgressIndicator » Slider with thermometer like scale
| Slider with thermometer like scale [message #27646] |
Tue, 27 July 2010 17:42  |
 |
koldo
Messages: 3458 Registered: August 2008
|
Senior Veteran |
|
|
Hello all
Is it planned in short term to mark the slider on its side with gradations like a thermometer scale?
If no, do you have any aesthetic ideas about how to do it?
Did you include it in the same Slider ctrl or you would do a new LengthMarkings class.
Best regards
Iñaki
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: Slider with thermometer like scale [message #27835 is a reply to message #27728] |
Fri, 06 August 2010 01:28   |
avpavp
Messages: 19 Registered: September 2009
|
Promising Member |
|
|
Here's my latest SliderCtrl.
I changed the way most of the labels and ticks were handled. Now things are based on Major and Minor ticks.
Major ticks have text labels. If you had a slider going from say, 0 - 200, you might set MajorTicks to 25, which would put larger ticks and text labels at 0, 25, 50, 75 ... 200.
Then you might set MinorTicks to 5, which would put minor ticks (smaller, no text) at 5, 10, 15, 20, 30, 35, ...
Also, you can set the tick sizes for Major and minor, 0 to 100 % of the size of the ctrl from the slider line to the edge.
Finally, you can set the tick location to above/below the line (left and right too).
I'd like to submit this for inclusion in the core once all the kinks are worked out. I gather I should generate the topic++ files or something? I looked around as much as I could, and couldn't really figure out how to do this. If Ultimate++ wants tpp or t++ or topic++ files I humbly suggest you make it a little better known how to create such files...
Thanks,
Anthony
-
Attachment: Slider.zip
(Size: 4.10KB, Downloaded 523 times)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: Slider with thermometer like scale [message #28208 is a reply to message #27646] |
Mon, 23 August 2010 10:52   |
jerson
Messages: 202 Registered: June 2010 Location: Bombay, India
|
Experienced Member |

|
|
Hi Koldo
I have done as you suggested. There are some places where I need to improve -
1 - how to set CONTROL or INDICATOR from USC code.
2 - in SlideSw, I am unable to set the value on the slidesw indicator when clicking on the slidesw control away from the thumb. If I click and move the thumb the indicator updates correctly.
3 - how to set the vector of Names from either USC or code. Right now, I am doing it right inside the control which is not desirable.
The controls in the file are JFSlider, SlideSw, JFStaticText and MyMeter. The last one of course is specific to my requirement, but, I let it remain in the group. Later I can plan to gather all the USC code into 1 file. Is there any more details on ESC script than what is in the documentation; it seems quite lacking in detail. Things like enum_property, >Ctrl, Frame frame @1; do not make sense at all and do not seem to appear in the docs.
Thanks for your help
[Updated on: Mon, 23 August 2010 11:19] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: Slider with thermometer like scale [message #28979 is a reply to message #28977] |
Thu, 30 September 2010 08:36   |
 |
koldo
Messages: 3458 Registered: August 2008
|
Senior Veteran |
|
|
| Quote: | - Click outside the thumb, there is a fn Jump(), call Jump( true ) to get the behavior you are requesting.
|
Great! 
| Quote: | - user defined formatting fn, this sounds like a great idea. So it would be a virtual fn I guess? Or is there a better way?
|
I prefer a Callback, because:
- If it is used a virtual function
-- You need to create a derived new class
--- So in the layout designer you get an empty box instead of a nice widget 
To see an example, go to Scatter package, cbModifFormatX.
For example:
graph.LabelFormat = THISBACK(MyFormatFunction);
...
void MyClass::MyFormatFunction(String &s, int val) {
int min = int(val/60);
int secs = val - 60*min;
s = Format("%02d:%02d", min, sec);
}
| Quote: | - I don't know much about .usc files, but I will try, can you point me to some information?
- Your idea to better use the space is a good one. I will look into this as well.
|
I would remove before the slider spacing. After that I would go to .usc, as usc will copy original C++ code as much as possible.
Best regards
Iñaki
|
|
|
|
Goto Forum:
Current Time: Sun Apr 26 08:53:46 GMT+2 2026
Total time taken to generate the page: 0.01892 seconds
|