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

Super Text Box

Post any examples or modules that you want to share here

Re: Super Text Box

Postby trogluddite » Tue Nov 20, 2012 8:13 pm

Drnkhobo wrote:Keep it up man, you picked up Ruby FASTER than I did

Ah, well I have been lucky to have some good teachers. I use the SketchUp 3D software at work, which has had its own Ruby API for many years. So although I am quite a 'newbie' still, I have learned so many things already from the 'gurus' over on their forums - and I work in an office full of guys who are top-class coders in dozens of languages.
So I have a bit of an unfair advantage! :D
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Super Text Box

Postby trogluddite » Tue Nov 20, 2012 10:04 pm

Hi All,
A fix for the "out of range" bug now uploaded to the top post.
A very silly error, I was trying to use '!' to invert the range test '!(0...@rows)===selection). But '1(0...@rows)' rakes precendence over the '===selection' part, so the return value was always the same. I refactored it using 'unless' instead of 'if', which actually makes the code a bit more tidy anyway.
Thanks for the accurate bug reports - it makes fixing this kind of thing so much easier! :)
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Super Text Box

Postby infuzion » Wed Nov 21, 2012 7:13 am

Seems neat!
I wonder if a preference array would be better than all those inputs...
infuzion
 
Posts: 109
Joined: Tue Jul 13, 2010 11:55 am
Location: Kansas City, USA, Earth, Sol

Re: Super Text Box

Postby trogluddite » Wed Nov 21, 2012 9:57 am

infuzion wrote:I wonder if a preference array would be better than all those inputs...

I did wonder about that - but individual inputs make the coding easier as you can refer to the inputs by name (so long as you labelled them of course!). Apart from the case statement in the events routine, you don't have to worry about using correct array indices all over the code, so it is more maintainable if you re-order or delete inputs.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Super Text Box

Postby unkargherth » Wed Nov 21, 2012 11:14 am

Just two questions

There's a way control the appearing of the scrollbar , such like "Never,Always,Auto"?

Can I get rid of the heading?
Free your memory, .. with a free(). Like a pointer
Cast a pointer into an integer and it becomes the integer...
Cast a pointer into a struct and it becomes the struct...
A pointer can overflow... or can crash...
Be a pointer my friend
unkargherth
 
Posts: 29
Joined: Fri Apr 08, 2005 9:46 pm

Re: Super Text Box

Postby trogluddite » Wed Nov 21, 2012 4:23 pm

unkargherth wrote:There's a way control the appearing of the scrollbar , such like "Never,Always,Auto"?
Can I get rid of the heading?

Those should be quite easy to add (or rather, take away!)
I made the design with every feature that I could think of to start with, as I figured that taking stuff out is easier than adding stuff in. Looks like the initial bugs have been sorted out, so I can now start on a bit more customisation.

BTW) Re: scroll wheel. I have looked into this on all the Ruby forums that I can find, and I don't think it is going to be possible unless the dev's can add those events to the built in system. Unlike cursor position or testing the keyboard, the scroll wheel does not have a 'state' that you can inspect; each click of the wheel has to send an event into the active window. In this case the active window is the FS3 editor environment itself, and there is no way to intercept these messages and re-direct them into our schematic.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Super Text Box

Postby Drnkhobo » Wed Nov 21, 2012 5:28 pm

trogluddite wrote: I work in an office full of guys who are top-class coders in dozens of languages.
So I have a bit of an unfair advantage! :D

Not fair!!!!!
Lucky bro, thats quite a resource you have at your side ;)
Drnkhobo
 
Posts: 312
Joined: Sun Aug 19, 2012 7:13 pm
Location: ZA

Re: Super Text Box

Postby trogluddite » Sun Nov 25, 2012 1:51 am

Latest update (Beta 03a) now available in the top post of the thread.

New features (thanks to all for the suggestions)
- Headings can now be hidden
- Scroll bar now has Show always, Never show and Auto-hide modes.
- An integer output to show how many lines of text will fit into the box.

NB) Even if you choose to hide the headings, you do still have to give a list of column names, as they are used inside the code for various things.

Also a few bits of the code have been improved to reduce unnecessary redraws,and improve CPU efficiency (especially for data sorting).
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Super Text Box

Postby matti » Wed Nov 28, 2012 7:34 pm

Wow!
This is brilliant!!

I've been trying to learn Ruby for a few days now. Just to see if it brings something useful(149$ useful) to my SM projects. I haven't gotten very far in finding things that Ruby excels at. But this, oh man.. This is exactly the kind of thing that shows off Ruby at it's best! <3
matti
 
Posts: 55
Joined: Fri Sep 24, 2010 12:06 pm

Re: Super Text Box

Postby trogluddite » Wed Nov 28, 2012 8:15 pm

Glad you like it. Matti. :D
Yes, this is just the kind of thing Ruby is good at - if you ever found yourself wishing for proper multi-dimensional arrays, unordered lists, data sorting, searching and replacing, then you will like Ruby. And no more Area->Float, Float->Area when trying to make complex graphics - that always ended up so messy!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

PreviousNext

Return to User Examples

Who is online

Users browsing this forum: No registered users and 54 guests