MAINT-1534 Fix for calls to find widgets getting out of hand.

master
Dave Parks 2012-09-11 15:55:36 -05:00
parent d1c34bff37
commit 7aca8ad6b8
12 changed files with 59 additions and 15 deletions

View File

@ -117,7 +117,8 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p)
mButtonEnterSignal(NULL),
mButtonLeaveSignal(NULL),
mButtonRemoveSignal(NULL),
mDragAndDropTarget(false)
mDragAndDropTarget(false),
mCaretIcon(NULL)
{
mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_WITH_TEXT] = p.button_icon_and_text;
mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_ONLY] = p.button_icon;
@ -830,7 +831,12 @@ void LLToolBar::draw()
LLUI::translate((F32)getRect().mLeft, (F32)getRect().mBottom);
// Position the caret
LLIconCtrl* caret = getChild<LLIconCtrl>("caret");
if (!mCaretIcon)
{
mCaretIcon = getChild<LLIconCtrl>("caret");
}
LLIconCtrl* caret = mCaretIcon;
caret->setVisible(FALSE);
if (mDragAndDropTarget && !mButtonCommands.empty())
{

View File

@ -37,6 +37,7 @@
class LLToolBar;
class LLToolBarButton;
class LLIconCtrl;
typedef boost::function<void (S32 x, S32 y, LLToolBarButton* button)> tool_startdrag_callback_t;
typedef boost::function<BOOL (S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type)> tool_handledrag_callback_t;
@ -284,6 +285,8 @@ private:
button_signal_t* mButtonRemoveSignal;
std::string mButtonTooltipSuffix;
LLIconCtrl* mCaretIcon;
};

View File

@ -110,7 +110,9 @@ public:
mFrom(),
mSessionID(),
mMinUserNameWidth(0),
mUserNameFont(NULL)
mUserNameFont(NULL),
mUserNameTextBox(NULL),
mTimeBoxTextBox(NULL)
{}
static LLChatHistoryHeader* createInstance(const std::string& file_name)
@ -187,6 +189,9 @@ public:
setMouseEnterCallback(boost::bind(&LLChatHistoryHeader::showInfoCtrl, this));
setMouseLeaveCallback(boost::bind(&LLChatHistoryHeader::hideInfoCtrl, this));
mUserNameTextBox = getChild<LLTextBox>("user_name");
mTimeBoxTextBox = getChild<LLTextBox>("time_box");
return LLPanel::postBuild();
}
@ -377,8 +382,8 @@ public:
/*virtual*/ void draw()
{
LLTextBox* user_name = getChild<LLTextBox>("user_name");
LLTextBox* time_box = getChild<LLTextBox>("time_box");
LLTextBox* user_name = mUserNameTextBox; //getChild<LLTextBox>("user_name");
LLTextBox* time_box = mTimeBoxTextBox; //getChild<LLTextBox>("time_box");
LLRect user_name_rect = user_name->getRect();
S32 user_name_width = user_name_rect.getWidth();
@ -568,6 +573,8 @@ protected:
S32 mMinUserNameWidth;
const LLFontGL* mUserNameFont;
LLTextBox* mUserNameTextBox;
LLTextBox* mTimeBoxTextBox;
};
LLUICtrl* LLChatHistoryHeader::sInfoCtrl = NULL;

View File

@ -698,19 +698,28 @@ void LLPanelStandStopFlying::updatePosition()
S32 y_pos = 0;
S32 bottom_tb_center = 0;
if (LLToolBar* toolbar_bottom = gToolBarView->getChild<LLToolBar>("toolbar_bottom"))
if (LLToolBar* toolbar_bottom = gToolBarView->getToolbar(LLToolBarView::TOOLBAR_BOTTOM))
{
y_pos = toolbar_bottom->getRect().getHeight();
bottom_tb_center = toolbar_bottom->getRect().getCenterX();
}
S32 left_tb_width = 0;
if (LLToolBar* toolbar_left = gToolBarView->getChild<LLToolBar>("toolbar_left"))
if (LLToolBar* toolbar_left = gToolBarView->getToolbar(LLToolBarView::TOOLBAR_LEFT))
{
left_tb_width = toolbar_left->getRect().getWidth();
}
if(LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("state_management_buttons_container"))
if (!mStateManagementButtons.get())
{
LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("state_management_buttons_container");
if (panel_ssf_container)
{
mStateManagementButtons = panel_ssf_container->getHandle();
}
}
if(LLPanel* panel_ssf_container = mStateManagementButtons.get())
{
panel_ssf_container->setOrigin(0, y_pos);
}

View File

@ -172,6 +172,8 @@ private:
*/
LLHandle<LLPanel> mOriginalParent;
LLHandle<LLPanel> mStateManagementButtons;
/**
* True if the panel is currently attached to the movement controls floater.
*

View File

@ -246,19 +246,28 @@ void LLPanelPathfindingRebakeNavmesh::updatePosition()
S32 y_pos = 0;
S32 bottom_tb_center = 0;
if (LLToolBar* toolbar_bottom = gToolBarView->getChild<LLToolBar>("toolbar_bottom"))
if (LLToolBar* toolbar_bottom = gToolBarView->getToolbar(LLToolBarView::TOOLBAR_BOTTOM))
{
y_pos = toolbar_bottom->getRect().getHeight();
bottom_tb_center = toolbar_bottom->getRect().getCenterX();
}
S32 left_tb_width = 0;
if (LLToolBar* toolbar_left = gToolBarView->getChild<LLToolBar>("toolbar_left"))
if (LLToolBar* toolbar_left = gToolBarView->getToolbar(LLToolBarView::TOOLBAR_LEFT))
{
left_tb_width = toolbar_left->getRect().getWidth();
}
if(LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("state_management_buttons_container"))
if (!mStateManagementButtons.get())
{
LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("state_management_buttons_container");
if (panel_ssf_container)
{
mStateManagementButtons = panel_ssf_container->getHandle();
}
}
if(LLPanel* panel_ssf_container = mStateManagementButtons.get())
{
panel_ssf_container->setOrigin(0, y_pos);
}

View File

@ -87,6 +87,7 @@ private:
LLButton* mNavMeshRebakeButton;
LLButton* mNavMeshSendingButton;
LLButton* mNavMeshBakingButton;
LLHandle<LLPanel> mStateManagementButtons;
LLPathfindingNavMesh::navmesh_slot_t mNavMeshSlot;
boost::signals2::connection mRegionCrossingSlot;

View File

@ -101,6 +101,8 @@ BOOL LLSidepanelTaskInfo::postBuild()
mDetailsBtn = getChild<LLButton>("details_btn");
mDetailsBtn->setClickedCallback(boost::bind(&LLSidepanelTaskInfo::onDetailsButtonClicked, this));
mDeedBtn = getChild<LLButton>("button deed");
mLabelGroupName = getChild<LLNameBox>("Group Name Proxy");
childSetCommitCallback("Object Name", LLSidepanelTaskInfo::onCommitName,this);
@ -263,7 +265,7 @@ void LLSidepanelTaskInfo::disableAll()
void LLSidepanelTaskInfo::refresh()
{
LLButton* btn_deed_to_group = getChild<LLButton>("button deed");
LLButton* btn_deed_to_group = mDeedBtn;
if (btn_deed_to_group)
{
std::string deedText;

View File

@ -113,6 +113,7 @@ private:
LLButton* mPayBtn;
LLButton* mBuyBtn;
LLButton* mDetailsBtn;
LLButton* mDeedBtn;
protected:
LLViewerObject* getObject();

View File

@ -76,7 +76,8 @@ LLToolBarView::LLToolBarView(const LLToolBarView::Params& p)
mShowToolbars(true),
mDragToolbarButton(NULL),
mDragItem(NULL),
mToolbarsLoaded(false)
mToolbarsLoaded(false),
mBottomToolbarPanel(NULL)
{
for (S32 i = 0; i < TOOLBAR_COUNT; i++)
{
@ -100,6 +101,7 @@ BOOL LLToolBarView::postBuild()
mToolbars[TOOLBAR_LEFT] = getChild<LLToolBar>("toolbar_left");
mToolbars[TOOLBAR_RIGHT] = getChild<LLToolBar>("toolbar_right");
mToolbars[TOOLBAR_BOTTOM] = getChild<LLToolBar>("toolbar_bottom");
mBottomToolbarPanel = getChild<LLView>("bottom_toolbar_panel");
for (int i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++)
{

View File

@ -108,7 +108,8 @@ public:
static BOOL handleDropTool(void* cargo_data, S32 x, S32 y, LLToolBar* toolbar);
static void resetDragTool(LLToolBarButton* toolbarButton);
LLInventoryObject* getDragItem();
LLView* getBottomToolbar() { return mBottomToolbarPanel; }
LLToolBar* getToolbar(EToolBarLocation toolbar) { return mToolbars[toolbar]; }
bool isModified() const;
protected:
@ -133,6 +134,7 @@ private:
LLToolBarButton* mDragToolbarButton;
LLInventoryObject* mDragItem;
bool mShowToolbars;
LLView* mBottomToolbarPanel;
};
extern LLToolBarView* gToolBarView;

View File

@ -4998,7 +4998,7 @@ S32 LLViewerWindow::getChatConsoleBottomPad()
S32 offset = 0;
if(gToolBarView)
offset += gToolBarView->getChild<LLView>("bottom_toolbar_panel")->getRect().getHeight();
offset += gToolBarView->getBottomToolbar()->getRect().getHeight();
return offset;
}