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 );