aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/gwin_list.h
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2015-04-30 11:32:10 +1000
committerinmarket <andrewh@inmarket.com.au>2015-04-30 11:32:10 +1000
commit0501f24f47adcd6439b469a6dc5244961b291f9c (patch)
tree12f41ca892b428b0c8871cb73b51cd51407475e0 /src/gwin/gwin_list.h
parent83c0eb35261704499bad756049c158133f7486eb (diff)
downloaduGFX-0501f24f47adcd6439b469a6dc5244961b291f9c.tar.gz
uGFX-0501f24f47adcd6439b469a6dc5244961b291f9c.tar.bz2
uGFX-0501f24f47adcd6439b469a6dc5244961b291f9c.zip
Add the ability to change a gwin list selection via the api
Add the ability to scroll a particular item into the current view.
Diffstat (limited to 'src/gwin/gwin_list.h')
-rw-r--r--src/gwin/gwin_list.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gwin/gwin_list.h b/src/gwin/gwin_list.h
index a55d4cb8..28506778 100644
--- a/src/gwin/gwin_list.h
+++ b/src/gwin/gwin_list.h
@@ -264,6 +264,37 @@ int gwinListGetSelected(GHandle gh);
*/
const char* gwinListGetSelectedText(GHandle gh);
+/**
+ * @brief Set whether a specific item is selected or not
+ *
+ * @param[in] gh The widget handle (must be a list handle)
+ * @param[in] item The item ID
+ * @param[in] doSelect TRUE to select the item or FALSE to deselect the item
+ *
+ * @note Changing the selection using this api call will NOT send the list selection
+ * change event.
+ * @note With a single select list selecting an item with this call will deselect
+ * any existing selected item. De-selecting an item with this call will not
+ * cause a new item to be automatically selected.
+ * @note De-selecting an item that is not selected will not effect any items that
+ * are selected, even in single-select mode.
+ * @api
+ */
+void gwinListSetSelected(GHandle gh, int item, bool_t doSelect);
+
+/**
+ * @brief Scroll the list so the specified item is in view
+ *
+ * @param[in] gh The widget handle (must be a list handle)
+ * @param[in] item The item ID
+ *
+ * @note This will typically scroll the selected item to the top of the list
+ * unless the item is in the last page of list items.
+ *
+ * @api
+ */
+void gwinListViewItem(GHandle gh, int item);
+
#if GWIN_NEED_LIST_IMAGES || defined(__DOXYGEN__)
/**
* @brief Set the image for a list item