LibSimpleWidgets is a library which provides a set of simple widgets not provided by the official Rift API. It integrates into the UI.CreateFrame function, adding several new frame types:

SimpleCheckbox (checkbox with a label)

SimpleGrid (grid of widgets)

SimpleList (list of selectable items, single/multi-select)

SimpleScrollList (same as above, scrollable, handles very large lists, recommended as replacement for SimpleList+SimpleScrollView)

SimpleRadioButton (radio button with a label)

SimpleScrollView (wraps any fixed-height frame)

SimpleSelect (dropdown list)

SimpleSlider (slider with the current value displayed next to it)

SimpleTabView (tabbed frames)

SimpleTextArea (multi-line textfield in scrollview)

SimpleTooltip (mouseover popup frame with text)

SimpleWindow (draggable RiftWindow)

The new frame types inherit all of Frame's functions and add a few more functions specific to each widget.

SimpleRadioButton has a companion function called RadioButtonGroup, which returns a controller object that manages a group of radio buttons to ensure that only one is selected at a time and to generate an event when the selected radio button changes.

The Layout function, given a table describing a widget layout, will create frames and lay them out accordingly. If you've ever used AceConfig and AceGUI, then you'll find this familiar. You can call Layout with the same parent frame and config table to refresh the widgets without creating new frames.

v1.14.1 (28 April 2013)
- Add RemoveAllRows function to Grid.
- Fix Grid SetRows to hide old rows.
- Fix ScrollView's content frame resizing to use SetWidth instead of setting a TOPRIGHT point. This prevents a conflict when a Grid has been put into a ScrollView before rows are added to the Grid.
- Raise Select's dropdown layer to ensure that it's on top of everything else.
- Clarify Grid's SetRows documentation.
- Add simple example for Grid to documentation.

v1.6.1 (6 December 2011)
- Added GetSelectedIndices, GetSelectedItems and GetSelectedValues functions to SimpleList.
- Ensure that we never try to position SimpleScrollView's scrollbar outside of its min/max range.

v1.5.4 (30 November 2011)
- Reverted v1.5.2 change and instead fixed SimpleList and SimpleSelect to clear the current selection when SetItems is called. This doesn't trigger an ItemSelect event.

v1.5.3 (30 November 2011)
- Fixed SimpleList and SimpleSelect to trigger an ItemSelect event when the previously selected index is reselected after the list is updated by SetItems.

v1.5.2 (19 November 2011)
- Use a RiftButton with the 'close' skin for the close button on SimpleWindows.
- Use a RiftScrollbar in SimpleScrollView.
- Added GetFontColor/SetFontColor to SimpleTooltip.
- Added GetFontColor/SetFontColor to SimpleCheckbox.

v1.5.1 (16 November 2011)
- Fixed a bug when SimpleScrollView is given a content frame that already has points or sizes set. (Thanks Matrix)
- Fixed a bug when SimpleScrollView is given a content frame that has a height of 0. (Thanks Matrix)

v1.5 (11 November 2011)
- Updated select widget in Layout function to support new values and index features in SimpleSelect.
- The event handlers created by SimpleTooltip's InjectEvents now call the tooltipTextFunc with the tooltip frame as the first parameter.
- Fixed anchoring of SimpleSlider internal frames.
- Added font size support to SimpleCheckbox, SimpleList, SimpleSelect and SimpleTooltip.
- SimpleSelect no longer automatically sets its own width and height when first created.
- Added ResizeToDefault funciton for SimpleSelect.

v1.4 (7 November 2011)
- Added the ability to associate values with items in SimpleList and SimpleSelect.
- Added the ability to use indices with SimpleList and SimpleSelect.
- SimpleList now triggers ItemSelect event when the selection is cleared.
- Reselecting the same item in SimpleList should not trigger the ItemSelect event.
- Fixed "unknown event" bug in EventProxy when a custom event is cleared by setting to nil.
- Layout function can now be used to update an existing widget layout.
- Added spacer type to Layout function.

v1.2 (25 October 2011)
- Added optional close button to SimpleWindow.
- Added SetBackgroundColor function SimpleSelect.
- Fixed double ItemSelected notification in SimpleList.
- Improved technique used by SetBorder for adding the border. Works with translucent frames now.
- Added SimpleCheckbox widget.
- Added SimpleSlider widget.
- Added Layout function for arrange a set of widgets according to a config table.
- Added EventProxy function which creates a replacement Event table for a frame which contains custom events but can also use the events from the frame's original Event table. This has replaced the Register*Handler functions.
- Added events for various widgets.

I've noticed an issue with the SimpleScrollList. I was finding that I couldn't select items after having changed the contents of a list a few times. I finally tracked the issue down to the ReleaseItemFrame function. It was setting the itemFrame visibility to false, but still leaving the bgFrame visible. The released bgFrame was sometimes capturing the mouse events over the correct frame. I fixed the issue locally by changing ReleaseItemFrame as below:

I've just posted v1.14.2, which fixes the pass-through for MouseIn, MouseOut and MouseMove events on frames which had a SimpleTooltip injected into them. It also fixes the RemoveEvents function for SimpleTooltip to properly restore the original mouse events.

i was working on an addon using your LibSimpleWidgets and was making some scroll windows using SimpleScrollView and i wanted to use :SetPosition to set the scrollbar to the beginning, but that was not working.

i was working on an addon using your LibSimpleWidgets and was making some scroll windows using SimpleScrollView and i wanted to use :SetPosition to set the scrollbar to the beginning, but that was not working.

Sorry for the slowness in replies, guys, I'm not getting email notifications of comments being posted.

Solsis, if it is at all possible, I will update this addon for when the old event system is removed. However, as far as I know, the old event system still currently works. I know this sucks, you have to use different event handling mechanisms if you use raw widgets and my widgets, but there is nothing I can do about it until Zorba adds the ability to define custom frame events. You're right that backwards compatibility is basically pointless.

All my custom widgets are normal Frames, with additional child frames or other modifications. So theoretically you could use the new event system on them for standard Rift events and then use the old system for the custom events (ItemSelected, etc.). I don't know if that would be better, but it's an option.

I'll continue to look into this to see if there is anything I can do before Zorba fixes it, but that is the state of things as they currently stand.

i really love the way this lib works Makes everything easier, thank you for that

But i have one question: How would i populate the second column of the layout?

If you're referring to the Layout function, it does it automatically. If there are two half-width widgets one after the other in the config structure, they will be placed next to each other. But a half-width widget is followed by a full-width widget, then the space to the right of the half-width widget will be left blank and the full-width widget will be on the next row.

So the ordering of your widgets in the config structure is important. You should use the "order" field in each widget table to define the order in which they appear.