diff options
| author | Merov Linden <merov@lindenlab.com> | 2011-09-26 16:06:57 -0700 |
|---|---|---|
| committer | Merov Linden <merov@lindenlab.com> | 2011-09-26 16:06:57 -0700 |
| commit | bb1776de6865715b2dd96185140d35e46d63c837 (patch) | |
| tree | f576aa7e9a8b28736f4997d312949c0f64a90013 /indra/llui/lltoolbar.cpp | |
| parent | 92368dbdfc5b7ac133a8722202878a109c5341a9 (diff) | |
EXP-1207 : Introduced an hasCommand() method for toolbars and toolbar view
Diffstat (limited to 'indra/llui/lltoolbar.cpp')
| -rw-r--r-- | indra/llui/lltoolbar.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index a9513b759a..5802d2adda 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -240,6 +240,20 @@ bool LLToolBar::addCommand(LLCommand * command) return true; } +bool LLToolBar::hasCommand(const std::string& command_name) +{ + bool has_command = false; + for (std::list<LLToolBarButton*>::iterator cmd = mButtons.begin(); cmd != mButtons.end(); cmd++) + { + if ((*cmd)->getName() == command_name) + { + has_command = true; + break; + } + } + return has_command; +} + BOOL LLToolBar::handleRightMouseDown(S32 x, S32 y, MASK mask) { BOOL handle_it_here = !mReadOnly; |
