cwUi.h/cpp : Added findElementAppId().

This commit is contained in:
kevin.larke 2020-04-30 15:10:54 -04:00
parent fab87f7050
commit 6be205ecb5
2 changed files with 12 additions and 1 deletions

View File

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

1
cwUi.h
View File

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