diff options
author | Andrew A. de Laix <alain@lindenlab.com> | 2011-09-08 09:46:04 -0500 |
---|---|---|
committer | Andrew A. de Laix <alain@lindenlab.com> | 2011-09-08 09:46:04 -0500 |
commit | 2d19a2002501d44ce18080b6f26ceaf2dbf796e9 (patch) | |
tree | 1053ccf7b2eb2881c77909fa9b90afd09447329c /indra/llui/llview.cpp | |
parent | 9fd8fb15d9ef4de3c22605ec4a0745eb67ae9550 (diff) |
add getInfo to LLView to get state information about ui elements.
Diffstat (limited to 'indra/llui/llview.cpp')
-rw-r--r-- | indra/llui/llview.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index a630a03c92..e2b9527cc5 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -47,6 +47,7 @@ #include "v3color.h" #include "lluictrlfactory.h" #include "lltooltip.h" +#include "llsdutil.h" // for ui edit hack #include "llbutton.h" @@ -2606,3 +2607,24 @@ const LLViewDrawContext& LLViewDrawContext::getCurrentContext() return *sDrawContextStack.back(); } + +LLSD LLView::getInfo(void) +{ + LLSD info; + addInfo(info); + return info; +} + +void LLView::addInfo(LLSD & info) +{ + info["path"] = getPathname(); + info["class"] = typeid(*this).name(); + info["visible"] = getVisible(); + info["visible_chain"] = isInVisibleChain(); + info["enabled"] = getEnabled(); + info["enabled_chain"] = isInEnabledChain(); + info["available"] = isAvailable(); + LLRect rect(calcScreenRect()); + info["rect"] = LLSDMap("left", rect.mLeft)("top", rect.mTop) + ("right", rect.mRight)("bottom", rect.mBottom); +} |