If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Req: Text Viewer in ruby with scroller
21 posts
• Page 1 of 3 • 1, 2, 3
Req: Text Viewer in ruby with scroller
I'm a little lost in the text scroller thingy
I have some knowledge of String (array), file & bitmap handling in ruby...
but this scroller isn't easy for me...
especially maybe with a redraw limiter inside?!
Any help is greatly appreciated.
I have some knowledge of String (array), file & bitmap handling in ruby...
but this scroller isn't easy for me...
especially maybe with a redraw limiter inside?!
Any help is greatly appreciated.
-
Walter Sommerfeld - Posts: 249
- Joined: Wed Jul 14, 2010 6:00 pm
- Location: HH - Made in Germany
Re: Req: Text Viewer in ruby with scroller
you can use the measureString methode for this, you can get the bounds of the area which the text would need with this (user guide page 164 for more detailed info)
while it looks like that it doesnt measure the width 100% right!?
you can see this if you change the fontsize from 2 to 2.2 it gets the right width with 2.2 but it cuts a little bit from the last t with a fontsize of 2.0
while it looks like that it doesnt measure the width 100% right!?
you can see this if you change the fontsize from 2 to 2.2 it gets the right width with 2.2 but it cuts a little bit from the last t with a fontsize of 2.0
- Attachments
-
- measure text ruby.fsm
- (3.03 KiB) Downloaded 1250 times
Last edited by Nubeat7 on Mon Sep 01, 2014 10:05 pm, edited 1 time in total.
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: Req: Text Viewer in ruby with scroller
Hi nubeat,
thanks for ur fine source... like the scroll sliders!
I really simply overlooked the Measuring Text part in the manual (just looked 2 pages further
cheers,
Danke,
Walter
thanks for ur fine source... like the scroll sliders!
I really simply overlooked the Measuring Text part in the manual (just looked 2 pages further
cheers,
Danke,
Walter
-
Walter Sommerfeld - Posts: 249
- Joined: Wed Jul 14, 2010 6:00 pm
- Location: HH - Made in Germany
Re: Req: Text Viewer in ruby with scroller
you are welcome Walter, i wouldn't have looked for it without your question, luckely there is this new setViewSize methode in 3.05 what i wanted to try but couldn't find some useful stuff for it, till now!
i reuploaded the schematic with variable slider size, so that the slider size is in relation to the shown window and the content size window, so the slider size gets smaller the more way to scroll..
i reuploaded the schematic with variable slider size, so that the slider size is in relation to the shown window and the content size window, so the slider size gets smaller the more way to scroll..
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: Req: Text Viewer in ruby with scroller
Even more awesome
setViewSize is really a tricky thing - i like it very much - good work!
Keep on doing!
setViewSize is really a tricky thing - i like it very much - good work!
Keep on doing!
-
Walter Sommerfeld - Posts: 249
- Joined: Wed Jul 14, 2010 6:00 pm
- Location: HH - Made in Germany
Re: Req: Text Viewer in ruby with scroller
@nubeat7
re:measuretextruby-2.fsm
Tried dragging it into my toolbox...instant crash
saved file/reopened...tried again....instant crash
XP/3.05 Amber
Havn't looked through file yet...
re:measuretextruby-2.fsm
Tried dragging it into my toolbox...instant crash
saved file/reopened...tried again....instant crash
XP/3.05 Amber
Havn't looked through file yet...
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: Req: Text Viewer in ruby with scroller
it looks like the toolbox doesn't like it when view is maximized, so just minimize theview on the top level and it should work..
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: Req: Text Viewer in ruby with scroller
Thanks mate,
Yeh, that works, I got some results also disconnecting some yellow stuff, while trying to work
it out. Still can't work it out though...and the need for minimizing gui??
Yeh, that works, I got some results also disconnecting some yellow stuff, while trying to work
it out. Still can't work it out though...and the need for minimizing gui??
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: Req: Text Viewer in ruby with scroller
its the setViewSize methode, i think its because the dynamic resizing of the view, but you can get rid of it too, then you just need to take care that the containing window is greater or equal to the max text area (which is defined in the measureString methode)
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: Req: Text Viewer in ruby with scroller
here is an updated version, which doesn't use the setViewSize methode (so it should work with fs 3.04 too), the maximum text area is the size of the text window, i think this is a better solution for it anyway because like this you don't need to change the max text area at the stringMeasure methode,
i also integrated a properties panel where you can set textsize, font, margins and colors...
i also integrated a properties panel where you can set textsize, font, margins and colors...
- Attachments
-
- measure text ruby1.fsm
- (5.25 KiB) Downloaded 1272 times
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
21 posts
• Page 1 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 35 guests