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
Listbox
30 posts
• Page 1 of 3 • 1, 2, 3
Listbox
There probably already are millions of solutions, and this is my take on it. A Ruby-driven Listbox, that works a lot like the index selector prim, but can be used on a GUI as well, for user interaction.
It has one input, which expects a comma seperated list of items, and two outputs, which are the current selected index, and the name of the selected index item.
Important: I provide it as is. Last time I reacted to proposals for improvements, but although it was quite some work, only 2 people were interested in it. That's just not worth it. But if you want to improve it, you're welcome. Just post the improved fsm here.
Have fun
It has one input, which expects a comma seperated list of items, and two outputs, which are the current selected index, and the name of the selected index item.
Important: I provide it as is. Last time I reacted to proposals for improvements, but although it was quite some work, only 2 people were interested in it. That's just not worth it. But if you want to improve it, you're welcome. Just post the improved fsm here.
Have fun
- Attachments
-
- listbox.fsm
- revision 2
added input to set the index external, fixed an issue with index bounds when clicking - (1.57 KiB) Downloaded 1602 times
-
- listbox.fsm
- obsolete, use r2
- (1.5 KiB) Downloaded 1563 times
Last edited by tulamide on Sat Jan 09, 2016 8:04 am, edited 2 times in total.
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: Listbox
That's great tulamide! you continue showering us up with clever little goodies
This is the first time I see that kind of list-box here since trog's one, which I found extremely useful for touch-screen optimized GUI designs (well, there were lot's of radio button versions, but not list-boxes. sorry if I missed your previous post). wish I could code and improve it, but I just can't yet. All I can do is to comment some optimization suggestions, since I've already implemented such menus in my designs and I know which parameters are needed to be adjustable to make it workable tool for any FS developer. Here is the list:
1) Additional Initial input - to allow selecting an index by using an external source like a preset or other menu.
2) Color inputs for background, fore, selected text, non-selected texts
3) Margin - it should be completely adjustable: color, width, roundness.
4) An ability to easily determine the space width between the indexes.
5) An ability to increase\decrease the total size of the whole list box.
Really love the up\down concept. Very useful when using touch-screens
If you could just add an option to increase\decrease the up\down button's size, it would be great as well. Overall, Its fantastic tool. Sorry I can't offer a practical help, but on the other hand, I learn a lot from those examples, so maybe one day...
I have no idea how much pain should be absorbed to implement those features, so sorry if I sound exigent. If it requires some extra- efforts, just forget about it. Its great as is as well. Thanks!!
This is the first time I see that kind of list-box here since trog's one, which I found extremely useful for touch-screen optimized GUI designs (well, there were lot's of radio button versions, but not list-boxes. sorry if I missed your previous post). wish I could code and improve it, but I just can't yet. All I can do is to comment some optimization suggestions, since I've already implemented such menus in my designs and I know which parameters are needed to be adjustable to make it workable tool for any FS developer. Here is the list:
1) Additional Initial input - to allow selecting an index by using an external source like a preset or other menu.
2) Color inputs for background, fore, selected text, non-selected texts
3) Margin - it should be completely adjustable: color, width, roundness.
4) An ability to easily determine the space width between the indexes.
5) An ability to increase\decrease the total size of the whole list box.
Really love the up\down concept. Very useful when using touch-screens
If you could just add an option to increase\decrease the up\down button's size, it would be great as well. Overall, Its fantastic tool. Sorry I can't offer a practical help, but on the other hand, I learn a lot from those examples, so maybe one day...
I have no idea how much pain should be absorbed to implement those features, so sorry if I sound exigent. If it requires some extra- efforts, just forget about it. Its great as is as well. Thanks!!
-
kortezzzz - Posts: 763
- Joined: Tue Mar 19, 2013 4:21 pm
Re: Listbox
@adam
It may please you to read that I did this one because I use it in the next version of the sprite font engine. Yes, I'm awfully slow, but I get progessively forward. And Apex is worth it
@kortezzzz
I got it right! I got it right! four "z"!
Thanks for your proposals. They all make sense and they all would add tremendously to the usage of the listbox. Luckily most of them are basically already in the code, like 2 and 5, or just need minor enhancements to it, like 1 and 4. But I won't make the mistake to invest time again, before having wait for more interest in this control. Maybe someone else is already working on these improvements? Or will be after reading that it isn't all too hard?
It may please you to read that I did this one because I use it in the next version of the sprite font engine. Yes, I'm awfully slow, but I get progessively forward. And Apex is worth it
@kortezzzz
I got it right! I got it right! four "z"!
Thanks for your proposals. They all make sense and they all would add tremendously to the usage of the listbox. Luckily most of them are basically already in the code, like 2 and 5, or just need minor enhancements to it, like 1 and 4. But I won't make the mistake to invest time again, before having wait for more interest in this control. Maybe someone else is already working on these improvements? Or will be after reading that it isn't all too hard?
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: Listbox
Luckily most of them are basically already in the code, like 2 and 5, or just need minor enhancements to it, like 1 and 4. But I won't make the mistake to invest time again, before having wait for more interest in this control. Maybe someone else is already working on these improvements? Or will be after reading that it isn't all too hard?
I'm pretty sure that some of the heavy FS-Ruby gangsters here won't find any problem to figure it out and add the the improvements, but unfortunately, I'm not one of them. yet...
I also believe that more people would find it much interesting after we add it into a some more significant schematics (like a small demo synth or an effect) that would actually demonstrate it's power. I would surely pick up the gauntlet in that case
-
kortezzzz - Posts: 763
- Joined: Tue Mar 19, 2013 4:21 pm
Re: Listbox
Just had a play with this and I love it!
The best bit, by far, is that Spogg is first on the list
Seriously, this is a great control. I really like that the arrows are position-aware too.
Tell me tulamide, how long did this take you to make from initial idea to upload? At some point I've promised myself to start learning Ruby but I wondered how much time would be needed for an expert like yourself to invest to get a result like this...
Regarding Kortezzzzzzzzzz's comments: The most important one for me is preset support. The other customisation stuff can be done by editing the Ruby code, as far as I can see. I've done this many times for other Ruby stuff to get the look I want and, as a side benfit, it's given me a bit of insight into Ruby itself.
Finally, and I know this comes up often, please don't be discouraged by lack of feedback. Just look at the viewing figures!
Cheers
Spogg
The best bit, by far, is that Spogg is first on the list
Seriously, this is a great control. I really like that the arrows are position-aware too.
Tell me tulamide, how long did this take you to make from initial idea to upload? At some point I've promised myself to start learning Ruby but I wondered how much time would be needed for an expert like yourself to invest to get a result like this...
Regarding Kortezzzzzzzzzz's comments: The most important one for me is preset support. The other customisation stuff can be done by editing the Ruby code, as far as I can see. I've done this many times for other Ruby stuff to get the look I want and, as a side benfit, it's given me a bit of insight into Ruby itself.
Finally, and I know this comes up often, please don't be discouraged by lack of feedback. Just look at the viewing figures!
Cheers
Spogg
-
Spogg - Posts: 3358
- Joined: Thu Nov 20, 2014 4:24 pm
- Location: Birmingham, England
Re: Listbox
Hey guys,
of course 'Spogg' is first on the list, it is sorted by 'most extraterrestrial'!
I don't care much for the views or the downloads. I know myself: I often just download something, because it might someday be of use although it doesn't interest me much at the time of download. I think that's what many people do. So, the only ones that are really interested are those that actually post in the thread. Why should I invest even just minutes if there is not much interest?
However, I discovered a smaller issue, where you get a non-existent index if you click in an empty area. I fixed this and quickly added an input to set the index external. This should help you, Kortezzzz, and it is also what you need, Spogg, to build a preset management.
I might make additional improvements following Kortezzzz's list, but currently I will concentrate on other work.
The time question:
This one took me around 6 hours of intense work, over two days. I work unusual, because most people will start with notes about the project, making a diagram of some sort, etc. But I have a more figurative mind, probably more like an artist's mind. I see the result as a clear image in my mind, how the control looks, how it works, how I use it, etc. I then program, until it is as I imagined it to be. Probably less effective programming style, but very fullfilling.
My answer is so detailed, because I know your motivation. I have the very same question, everytime I see something that Martin created. I just don't have the courage to just ask him.
Spogg, my biggest work so far in Ruby is my Spline class. You can find it here. It took me 4 weeks to create (in the same way as described above). I recommend that you download it. It comes bundled with an illustrated pdf manual, that assists you from the very beginnings (how to set up a RubyEdit and a view to work with the Spline class) to actual drawing of splines. And that's something that would help you, because all of the hard work is done by the class in the background, while you can learn a bit about Ruby and how to enter commands. You get instant feedback from the view, using simple instructions, which is so much more helpful then just staring at code, trying to figure out what it does. I'm sure you will love it!
of course 'Spogg' is first on the list, it is sorted by 'most extraterrestrial'!
I don't care much for the views or the downloads. I know myself: I often just download something, because it might someday be of use although it doesn't interest me much at the time of download. I think that's what many people do. So, the only ones that are really interested are those that actually post in the thread. Why should I invest even just minutes if there is not much interest?
However, I discovered a smaller issue, where you get a non-existent index if you click in an empty area. I fixed this and quickly added an input to set the index external. This should help you, Kortezzzz, and it is also what you need, Spogg, to build a preset management.
I might make additional improvements following Kortezzzz's list, but currently I will concentrate on other work.
The time question:
This one took me around 6 hours of intense work, over two days. I work unusual, because most people will start with notes about the project, making a diagram of some sort, etc. But I have a more figurative mind, probably more like an artist's mind. I see the result as a clear image in my mind, how the control looks, how it works, how I use it, etc. I then program, until it is as I imagined it to be. Probably less effective programming style, but very fullfilling.
My answer is so detailed, because I know your motivation. I have the very same question, everytime I see something that Martin created. I just don't have the courage to just ask him.
Spogg, my biggest work so far in Ruby is my Spline class. You can find it here. It took me 4 weeks to create (in the same way as described above). I recommend that you download it. It comes bundled with an illustrated pdf manual, that assists you from the very beginnings (how to set up a RubyEdit and a view to work with the Spline class) to actual drawing of splines. And that's something that would help you, because all of the hard work is done by the class in the background, while you can learn a bit about Ruby and how to enter commands. You get instant feedback from the view, using simple instructions, which is so much more helpful then just staring at code, trying to figure out what it does. I'm sure you will love it!
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: Listbox
Hi tulamide
First off, thanks for the link to the Spline Class. I shall need to read the pdf to understand any of it, but I will at some point.
Now to the listbox:
I've successfully added preset management to the lisbox. As I said, this is very important for me.
However, in testing it I am able to successfully save and retrieve any preset and the values of the string and index all re-load correctly but, if the loaded list element is not in the view, it doesn't display. I've tried a few things but it seems the display itself doesn't respond to the loaded value. Take a look at my modified version and please, go easy on an old Vulcan trying his best who has probably just got something simple very wrong...
Cheers
Spogg
First off, thanks for the link to the Spline Class. I shall need to read the pdf to understand any of it, but I will at some point.
Now to the listbox:
I've successfully added preset management to the lisbox. As I said, this is very important for me.
However, in testing it I am able to successfully save and retrieve any preset and the values of the string and index all re-load correctly but, if the loaded list element is not in the view, it doesn't display. I've tried a few things but it seems the display itself doesn't respond to the loaded value. Take a look at my modified version and please, go easy on an old Vulcan trying his best who has probably just got something simple very wrong...
Cheers
Spogg
- Attachments
-
- listbox v2 spogged 1.fsm
- (25.78 KiB) Downloaded 1446 times
-
Spogg - Posts: 3358
- Joined: Thu Nov 20, 2014 4:24 pm
- Location: Birmingham, England
Re: Listbox
Hey Spogg,
I didn't update the view, because there are so many situations, that you can't make sure, where the selected index appears in the view. For you I use an algorithm that only takes care that the end of the list will always be at the bottom, even if you select the last items. I hope this works for you?
I didn't update the view, because there are so many situations, that you can't make sure, where the selected index appears in the view. For you I use an algorithm that only takes care that the end of the list will always be at the bottom, even if you select the last items. I hope this works for you?
- Attachments
-
- listbox v2 spogged 1.fsm
- updates view when external index is selected
- (8.66 KiB) Downloaded 1538 times
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: Listbox
tulamide wrote:I didn't update the view, because there are so many situations, that you can't make sure, where the selected index appears in the view. For you I use an algorithm that only takes care that the end of the list will always be at the bottom, even if you select the last items. I hope this works for you?
Perfection! This does exactly as I wanted now. I can edit the code for appearance so I'm a very happy Vulcan (a rare thing)
Thank you so much for this tulamide.
Cheers
Spogg
-
Spogg - Posts: 3358
- Joined: Thu Nov 20, 2014 4:24 pm
- Location: Birmingham, England
30 posts
• Page 1 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 49 guests