From b362329a467563f9f2078deae99734cf0816b30f Mon Sep 17 00:00:00 2001 From: Leonard Ritter Date: Tue, 9 Sep 2014 12:58:15 +0200 Subject: [PATCH] added uiGetItemCount() --- oui.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/oui.h b/oui.h index 17555ac..829fd1a 100644 --- a/oui.h +++ b/oui.h @@ -497,6 +497,9 @@ OUI_EXPORT int uiPrevSibling(int item); // Querying // -------- +// return the total number of allocated items +OUI_EXPORT int uiGetItemCount(); + // return the current state of the item. This state is only valid after // a call to uiProcess(). // The returned value is one of UI_COLD, UI_HOT, UI_ACTIVE, UI_FROZEN. @@ -934,6 +937,12 @@ int uiGetExtendItem() { return ui_context->extend_item; } +// return the total number of allocated items +OUI_EXPORT int uiGetItemCount() { + assert(ui_context); + return ui_context->count; +} + UIitem *uiItemPtr(int item) { assert(ui_context && (item >= 0) && (item < ui_context->count)); return ui_context->items + item;