From 6be205ecb5f945c000705c93a6e9e738263752de Mon Sep 17 00:00:00 2001 From: "kevin.larke" Date: Thu, 30 Apr 2020 15:10:54 -0400 Subject: [PATCH] cwUi.h/cpp : Added findElementAppId(). --- cwUi.cpp | 12 +++++++++++- cwUi.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cwUi.cpp b/cwUi.cpp index 5534270..831afc2 100644 --- a/cwUi.cpp +++ b/cwUi.cpp @@ -281,7 +281,7 @@ namespace cw e->appId = m->appId; } - printf("uuid:%i appId:%i par-uuid:%i %s\n", e->uuId,e->appId,e->parent==nullptr ? -1 : e->parent->uuId, cwStringNullGuard(e->eleName)); + //printf("uuid:%i appId:%i par-uuid:%i %s\n", e->uuId,e->appId,e->parent==nullptr ? -1 : e->parent->uuId, cwStringNullGuard(e->eleName)); return e; } @@ -960,6 +960,16 @@ unsigned cw::ui::findElementUuId( handle_t h, const char* eleName ) return _findElementUuId(p,eleName); } +unsigned cw::ui::findElementAppId( handle_t h, unsigned uuId ) +{ + ui_t* p = _handleToPtr(h); + + ele_t* ele = _uuIdToEle( p, uuId ); + + return ele==nullptr ? kInvalidId : ele->uuId; +} + + cw::rc_t cw::ui::createFromObject( handle_t h, const object_t* o, unsigned wsSessId, unsigned parentUuId, const char* eleName ) { ui_t* p = _handleToPtr(h); diff --git a/cwUi.h b/cwUi.h index bab764f..2702782 100644 --- a/cwUi.h +++ b/cwUi.h @@ -91,6 +91,7 @@ namespace cw unsigned findElementUuId( handle_t h, unsigned parentUuId, const char* eleName ); unsigned findElementUuId( handle_t h, unsigned parentUuId, unsigned appId ); const char* findElementName( handle_t h, unsigned uuId ); + unsigned findElementAppId( handle_t h, unsigned uuId ); // Return the uuid of the first matching 'eleName'. unsigned findElementUuId( handle_t h, const char* eleName );