turbobadger
turbobadger copied to clipboard
Easy way to implement layout widget with auto wrap elements
I need something similar to WPF WrapPanel (http://wpftutorial.net/WrapPanel.html) for tags cloud control. What is easy and right way to implement this?
I had plans to implement that in TBLayout (with a new overflow mode "LAYOUT_OVERFLOW_WRAP"). I'm not sure it's such a good idea to put even more stuff in TBLayout though. There's some other things (better multipass constraint handling and column features) i wish to add there as well, and it would all add up and get quite big. Perhaps it would be best to just make a new widget and possibly refactorize things that can be reused.
If you just want to quick fix it, you could just use a TBEditField with styling enabled, and insert all widgets/items by embedding them in the text flow. Either by using the existing content factory, or make your own. It wouldn't be possible to use gravity and stuff on specific widgets, but you probably don't need that.