aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lltoolview.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/lltoolview.cpp
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/newview/lltoolview.cpp')
-rw-r--r--linden/indra/newview/lltoolview.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/linden/indra/newview/lltoolview.cpp b/linden/indra/newview/lltoolview.cpp
index 8aed5f8..ebdbcbb 100644
--- a/linden/indra/newview/lltoolview.cpp
+++ b/linden/indra/newview/lltoolview.cpp
@@ -72,7 +72,8 @@ LLToolView::LLToolView(const std::string& name, const LLRect& rect)
72 72
73LLToolView::~LLToolView() 73LLToolView::~LLToolView()
74{ 74{
75 mContainList.deleteAllData(); 75 for_each(mContainList.begin(), mContainList.end(), DeletePointer());
76 mContainList.clear();
76} 77}
77 78
78//*TODO:translate? 79//*TODO:translate?
@@ -118,7 +119,7 @@ void LLToolView::addTool(const LLString& icon_off, const LLString& icon_on, LLPa
118 addChild(contain->mPanel); 119 addChild(contain->mPanel);
119 } 120 }
120 121
121 mContainList.addData(contain); 122 mContainList.push_back(contain);
122} 123}
123 124
124 125
@@ -130,7 +131,7 @@ LLRect LLToolView::getButtonRect(S32 button_index)
130 const S32 HORIZ_SPACING = TOOL_SIZE + 5; 131 const S32 HORIZ_SPACING = TOOL_SIZE + 5;
131 const S32 VERT_SPACING = TOOL_SIZE + 14; 132 const S32 VERT_SPACING = TOOL_SIZE + 14;
132 133
133 S32 tools_per_row = mRect.getWidth() / HORIZ_SPACING; 134 S32 tools_per_row = getRect().getWidth() / HORIZ_SPACING;
134 135
135 S32 row = button_index / tools_per_row; 136 S32 row = button_index / tools_per_row;
136 S32 column = button_index % tools_per_row; 137 S32 column = button_index % tools_per_row;
@@ -153,11 +154,10 @@ void LLToolView::draw()
153 // turn off highlighting for all containers 154 // turn off highlighting for all containers
154 // and hide all option panels except for the selected one. 155 // and hide all option panels except for the selected one.
155 LLTool* selected = gToolMgr->getCurrentToolset()->getSelectedTool(); 156 LLTool* selected = gToolMgr->getCurrentToolset()->getSelectedTool();
156 for( LLToolContainer* contain = mContainList.getFirstData(); 157 for (contain_list_t::iterator iter = mContainList.begin();
157 contain != NULL; 158 iter != mContainList.end(); ++iter)
158 contain = mContainList.getNextData()
159 )
160 { 159 {
160 LLToolContainer* contain = *iter;
161 BOOL state = (contain->mTool == selected); 161 BOOL state = (contain->mTool == selected);
162 contain->mButton->setToggleState( state ); 162 contain->mButton->setToggleState( state );
163 if (contain->mPanel) 163 if (contain->mPanel)
@@ -175,8 +175,10 @@ LLToolContainer* LLToolView::findToolContainer( LLTool *tool )
175{ 175{
176 // Find the container for this tool 176 // Find the container for this tool
177 llassert( tool ); 177 llassert( tool );
178 for( LLToolContainer* contain = mContainList.getFirstData(); contain; contain = mContainList.getNextData() ) 178 for (contain_list_t::iterator iter = mContainList.begin();
179 iter != mContainList.end(); ++iter)
179 { 180 {
181 LLToolContainer* contain = *iter;
180 if( contain->mTool == tool ) 182 if( contain->mTool == tool )
181 { 183 {
182 return contain; 184 return contain;
@@ -196,3 +198,4 @@ void LLToolView::onClickToolButton(void* userdata)
196} 198}
197 199
198 200
201