aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/lltabcontainer.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-30 13:04:20 -0500
committerJacek Antonelli2009-04-30 13:07:16 -0500
commitca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch)
tree8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/llui/lltabcontainer.cpp
parentSecond Life viewer sources 1.22.11 (diff)
downloadmeta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz
Second Life viewer sources 1.23.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/llui/lltabcontainer.cpp58
1 files changed, 46 insertions, 12 deletions
diff --git a/linden/indra/llui/lltabcontainer.cpp b/linden/indra/llui/lltabcontainer.cpp
index 6b028d4..f416948 100644
--- a/linden/indra/llui/lltabcontainer.cpp
+++ b/linden/indra/llui/lltabcontainer.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -70,6 +71,7 @@ LLTabContainer::LLTabContainer(const std::string& name, const LLRect& rect, TabP
70 : 71 :
71 LLPanel(name, rect, bordered), 72 LLPanel(name, rect, bordered),
72 mCurrentTabIdx(-1), 73 mCurrentTabIdx(-1),
74 mNextTabIdx(-1),
73 mTabsHidden(FALSE), 75 mTabsHidden(FALSE),
74 mScrolled(FALSE), 76 mScrolled(FALSE),
75 mScrollPos(0), 77 mScrollPos(0),
@@ -1149,9 +1151,37 @@ BOOL LLTabContainer::selectTab(S32 which)
1149 { 1151 {
1150 return FALSE; 1152 return FALSE;
1151 } 1153 }
1152 1154
1155 if (!selected_tuple->mPrecommitChangeCallback)
1156 {
1157 return setTab(which);
1158 }
1159
1160 mNextTabIdx = which;
1161 selected_tuple->mPrecommitChangeCallback(selected_tuple->mUserData, false);
1162 return TRUE;
1163}
1164
1165BOOL LLTabContainer::setTab(S32 which)
1166{
1167 if (which == -1)
1168 {
1169 if (mNextTabIdx == -1)
1170 {
1171 return FALSE;
1172 }
1173 which = mNextTabIdx;
1174 mNextTabIdx = -1;
1175 }
1176
1177 LLTabTuple* selected_tuple = getTab(which);
1178 if (!selected_tuple)
1179 {
1180 return FALSE;
1181 }
1182
1153 BOOL is_visible = FALSE; 1183 BOOL is_visible = FALSE;
1154 if (getTab(which)->mButton->getEnabled()) 1184 if (selected_tuple->mButton->getEnabled())
1155 { 1185 {
1156 setCurrentPanelIndex(which); 1186 setCurrentPanelIndex(which);
1157 1187
@@ -1331,6 +1361,15 @@ void LLTabContainer::setTabChangeCallback(LLPanel* tab, void (*on_tab_clicked)(v
1331 } 1361 }
1332} 1362}
1333 1363
1364void LLTabContainer::setTabPrecommitChangeCallback(LLPanel* tab, void (*on_precommit)(void*, bool))
1365{
1366 LLTabTuple* tuplep = getTabByPanel(tab);
1367 if (tuplep)
1368 {
1369 tuplep->mPrecommitChangeCallback = on_precommit;
1370 }
1371}
1372
1334void LLTabContainer::setTabUserData(LLPanel* tab, void* userdata) 1373void LLTabContainer::setTabUserData(LLPanel* tab, void* userdata)
1335{ 1374{
1336 LLTabTuple* tuplep = getTabByPanel(tab); 1375 LLTabTuple* tuplep = getTabByPanel(tab);
@@ -1370,11 +1409,6 @@ void LLTabContainer::onTabBtn( void* userdata )
1370 LLTabTuple* tuple = (LLTabTuple*) userdata; 1409 LLTabTuple* tuple = (LLTabTuple*) userdata;
1371 LLTabContainer* self = tuple->mTabContainer; 1410 LLTabContainer* self = tuple->mTabContainer;
1372 self->selectTabPanel( tuple->mTabPanel ); 1411 self->selectTabPanel( tuple->mTabPanel );
1373
1374 if( tuple->mOnChangeCallback )
1375 {
1376 tuple->mOnChangeCallback( tuple->mUserData, true );
1377 }
1378 1412
1379 tuple->mTabPanel->setFocus(TRUE); 1413 tuple->mTabPanel->setFocus(TRUE);
1380} 1414}
@@ -1624,14 +1658,14 @@ void LLTabContainer::initButtons()
1624 in_id = "UIImgBtnJumpLeftInUUID"; 1658 in_id = "UIImgBtnJumpLeftInUUID";
1625 mJumpPrevArrowBtn = new LLButton(std::string("Jump Left Arrow"), jump_left_arrow_btn_rect, 1659 mJumpPrevArrowBtn = new LLButton(std::string("Jump Left Arrow"), jump_left_arrow_btn_rect,
1626 out_id, in_id, LLStringUtil::null, 1660 out_id, in_id, LLStringUtil::null,
1627 &LLTabContainer::onJumpFirstBtn, this, LLFontGL::sSansSerif ); 1661 &LLTabContainer::onJumpFirstBtn, this, LLFontGL::getFontSansSerif() );
1628 mJumpPrevArrowBtn->setFollowsLeft(); 1662 mJumpPrevArrowBtn->setFollowsLeft();
1629 1663
1630 out_id = "UIImgBtnScrollLeftOutUUID"; 1664 out_id = "UIImgBtnScrollLeftOutUUID";
1631 in_id = "UIImgBtnScrollLeftInUUID"; 1665 in_id = "UIImgBtnScrollLeftInUUID";
1632 mPrevArrowBtn = new LLButton(std::string("Left Arrow"), left_arrow_btn_rect, 1666 mPrevArrowBtn = new LLButton(std::string("Left Arrow"), left_arrow_btn_rect,
1633 out_id, in_id, LLStringUtil::null, 1667 out_id, in_id, LLStringUtil::null,
1634 &LLTabContainer::onPrevBtn, this, LLFontGL::sSansSerif ); 1668 &LLTabContainer::onPrevBtn, this, LLFontGL::getFontSansSerif() );
1635 mPrevArrowBtn->setHeldDownCallback(onPrevBtnHeld); 1669 mPrevArrowBtn->setHeldDownCallback(onPrevBtnHeld);
1636 mPrevArrowBtn->setFollowsLeft(); 1670 mPrevArrowBtn->setFollowsLeft();
1637 1671
@@ -1640,7 +1674,7 @@ void LLTabContainer::initButtons()
1640 mJumpNextArrowBtn = new LLButton(std::string("Jump Right Arrow"), jump_right_arrow_btn_rect, 1674 mJumpNextArrowBtn = new LLButton(std::string("Jump Right Arrow"), jump_right_arrow_btn_rect,
1641 out_id, in_id, LLStringUtil::null, 1675 out_id, in_id, LLStringUtil::null,
1642 &LLTabContainer::onJumpLastBtn, this, 1676 &LLTabContainer::onJumpLastBtn, this,
1643 LLFontGL::sSansSerif); 1677 LLFontGL::getFontSansSerif());
1644 mJumpNextArrowBtn->setFollowsRight(); 1678 mJumpNextArrowBtn->setFollowsRight();
1645 1679
1646 out_id = "UIImgBtnScrollRightOutUUID"; 1680 out_id = "UIImgBtnScrollRightOutUUID";
@@ -1648,7 +1682,7 @@ void LLTabContainer::initButtons()
1648 mNextArrowBtn = new LLButton(std::string("Right Arrow"), right_arrow_btn_rect, 1682 mNextArrowBtn = new LLButton(std::string("Right Arrow"), right_arrow_btn_rect,
1649 out_id, in_id, LLStringUtil::null, 1683 out_id, in_id, LLStringUtil::null,
1650 &LLTabContainer::onNextBtn, this, 1684 &LLTabContainer::onNextBtn, this,
1651 LLFontGL::sSansSerif); 1685 LLFontGL::getFontSansSerif());
1652 mNextArrowBtn->setFollowsRight(); 1686 mNextArrowBtn->setFollowsRight();
1653 1687
1654 if( getTabPosition() == TOP ) 1688 if( getTabPosition() == TOP )