Support

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

Post any examples or modules that you want to share here

Re: Req: Text Viewer in ruby with scroller

Postby billv » Tue Sep 02, 2014 7:37 pm

Ok, I Havn't used setviewSize yet....
Thanks Nubeat7...nice work..straight in the toolbox...all good. :)
billv
 
Posts: 1157
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia

Re: Req: Text Viewer in ruby with scroller

Postby Perfect Human Interface » Tue Sep 02, 2014 9:34 pm

Oh this is cool. Nice work Nubeat.
I tried changing window sizes and it didn't go very well though (using version 3.0.4). Also it would be nice if the scrollbar mouse interaction could be based on exact mouse position so it doesn't scroll slower or faster than the cursor.
Perfect Human Interface
 
Posts: 643
Joined: Sun Mar 10, 2013 7:32 pm

Re: Req: Text Viewer in ruby with scroller

Postby Nubeat7 » Tue Sep 02, 2014 10:43 pm

Perfect Human Interface wrote:I tried changing window sizes and it didn't go very well though (using version 3.0.4).

what do you mean with that?
just unlock the parent window and set the size you need for text window and sliders..

Perfect Human Interface wrote:Also it would be nice if the scrollbar mouse interaction could be based on exact mouse position so it doesn't scroll slower or faster than the cursor.


you can change the sensitivity in the properties panel... 5 is the value you would need for that
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: Req: Text Viewer in ruby with scroller

Postby Nubeat7 » Tue Sep 02, 2014 11:11 pm

Nubeat7 wrote:
Perfect Human Interface wrote:I tried changing window sizes and it didn't go very well though (using version 3.0.4).

what do you mean with that?
just unlock the parent window and set the size you need for text window and sliders..


if you dont want to change this by hand all the time you can also include the sliders into the scroll area like i did here in the older scroll and zoom version - if you click and drag in the lower right corner you can scroll x&y at the same time with this ;)
Attachments
scroll and zoom.fsm
(153.52 KiB) Downloaded 1211 times
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: Req: Text Viewer in ruby with scroller

Postby Walter Sommerfeld » Wed Sep 03, 2014 2:08 pm

perfect nubeat! :o

btw: any chance to check in ruby that a Bitmap is done loading?
I tried this with a bitmap array but got to much (wrong) triggers... :(

U know: Give somebody an inch, and he will take a mile. ;)
User avatar
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

Postby Perfect Human Interface » Wed Sep 03, 2014 3:58 pm

Ah I see now. Yeah it might be nice if the bars just scaled with the view size (complicated as that may be) but this works just fine! Maybe you could add an option to remove the X slider in the properties, since you'd probably rather set the text area to width and use word-wrap. Although I did notice that the word wrap didn't work quite right in some cases and would cut off some letters.
Perfect Human Interface
 
Posts: 643
Joined: Sun Mar 10, 2013 7:32 pm

Re: Req: Text Viewer in ruby with scroller

Postby TheOm » Wed Sep 03, 2014 4:10 pm

I also made a simple one. It's just like the "green" version.
Attachments
text view.fsm
(1.4 KiB) Downloaded 1275 times
Last edited by TheOm on Wed Sep 03, 2014 6:26 pm, edited 1 time in total.
TheOm
 
Posts: 103
Joined: Tue Jan 28, 2014 7:35 pm
Location: Germany

Re: Req: Text Viewer in ruby with scroller

Postby Nubeat7 » Wed Sep 03, 2014 4:57 pm

thanks Om, thats nice, whats that methode for ? setTextRenderingHint "clearTypeGridFit" and where did you know about it?
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: Req: Text Viewer in ruby with scroller

Postby TheOm » Wed Sep 03, 2014 6:12 pm

I read about it in the User Guide. I think it sets what method is used for Text smoothing and hinting.
I played around with it and found that at least on my PC the modes "off" and "clearTypeGridFit" look much clearer and less blurry than the antiAlias modes, which are the default.
TheOm
 
Posts: 103
Joined: Tue Jan 28, 2014 7:35 pm
Location: Germany

Re: Req: Text Viewer in ruby with scroller

Postby DaveyBoy » Wed Jul 10, 2019 1:04 pm

I know this is a really old post but I came across this phenomenon in one of my current projects.

From Nubeat7's original reply:
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


Page 165 of the user manual solves this:
Flag = 2048
Specifies that the space at the end of each line is included in a string measurement. By default, the
boundary rectangle returned by the Graphics::MeasureString method excludes the space at the end of
each line. Set this flag to include that space in the measurement.


Thought I'd mention this as it may help someone else :)
User avatar
DaveyBoy
 
Posts: 131
Joined: Wed May 11, 2016 9:18 pm
Location: Leeds UK

PreviousNext

Return to User Examples

Who is online

Users browsing this forum: No registered users and 35 guests