Re #333 Added missing GfuiScrollListGetSelectedElementIndex
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@4628 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: c34bc1b35acb9e6d0fd96a52af4bb99fe77d277a Former-commit-id: a182938e9d76d177558371c1f3c4e4569105bf97
This commit is contained in:
parent
10a911d912
commit
c3783bbf01
2 changed files with 23 additions and 0 deletions
|
@ -299,6 +299,28 @@ GfuiScrollListClearSelection(void *scr, int id)
|
|||
return true;
|
||||
}
|
||||
|
||||
/** Get the selected element from the scroll list.
|
||||
@ingroup gui
|
||||
@param scr Current screen
|
||||
@param id Scroll list Id
|
||||
@return Index of the retrieved element
|
||||
<br>-1 if none selected
|
||||
*/
|
||||
int
|
||||
GfuiScrollListGetSelectedElementIndex(void *scr, int id)
|
||||
{
|
||||
tGfuiObject* object = gfuiGetObject(scr, id);
|
||||
if (!object || object->widget != GFUI_SCROLLIST)
|
||||
return -1;
|
||||
|
||||
tGfuiScrollList* scrollist = &(object->u.scrollist);
|
||||
|
||||
if (scrollist->elts == NULL)
|
||||
return -1;
|
||||
|
||||
return scrollist->selectedElt;
|
||||
}
|
||||
|
||||
/** Get the selected element from the scroll list.
|
||||
@ingroup gui
|
||||
@param scr Current screen
|
||||
|
|
|
@ -519,6 +519,7 @@ TGFCLIENT_API int GfuiScrollListMoveSelectedElement(void* scr, int Id, int delta
|
|||
TGFCLIENT_API const char* GfuiScrollListExtractSelectedElement(void* scr, int Id, void** userData);
|
||||
TGFCLIENT_API const char* GfuiScrollListExtractElement(void* scr, int Id, int index, void** userData);
|
||||
TGFCLIENT_API void GfuiScrollListClear(void* scr, int Id);
|
||||
TGFCLIENT_API int GfuiScrollListGetSelectedElementIndex(void *scr, int id);
|
||||
TGFCLIENT_API const char* GfuiScrollListGetSelectedElement(void* scr, int Id, void** userData);
|
||||
TGFCLIENT_API bool GfuiScrollListSetSelectedElement(void* scr, int Id, unsigned int selectElement);
|
||||
TGFCLIENT_API bool GfuiScrollListClearSelection(void* scr, int Id);
|
||||
|
|
Loading…
Reference in a new issue