diff options
Diffstat (limited to 'indra/newview/llpreviewtexture.cpp')
-rw-r--r-- | indra/newview/llpreviewtexture.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index c1cb386556..7fdc5c8b5f 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -105,7 +105,7 @@ BOOL LLPreviewTexture::postBuild() { getChild<LLButton>("Keep")->setLabel(getString("Copy")); childSetAction("Keep",LLPreview::onBtnCopyToInv,this); - getChildView("Discard")->setVisible( false); + childSetVisible("Discard", false); } else if (mShowKeepDiscard) { @@ -114,13 +114,13 @@ BOOL LLPreviewTexture::postBuild() } else { - getChildView("Keep")->setVisible( false); - getChildView("Discard")->setVisible( false); + childSetVisible("Keep", false); + childSetVisible("Discard", false); } childSetAction("save_tex_btn", LLPreviewTexture::onSaveAsBtn, this); - getChildView("save_tex_btn")->setVisible( true); - getChildView("save_tex_btn")->setEnabled(canSaveAs()); + childSetVisible("save_tex_btn", true); + childSetEnabled("save_tex_btn", canSaveAs()); if (!mCopyToInv) { @@ -129,8 +129,8 @@ BOOL LLPreviewTexture::postBuild() if (item) { childSetCommitCallback("desc", LLPreview::onText, this); - getChild<LLUICtrl>("desc")->setValue(item->getDescription()); - getChild<LLLineEditor>("desc")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); + childSetText("desc", item->getDescription()); + childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); } } @@ -289,7 +289,8 @@ void LLPreviewTexture::reshape(S32 width, S32 height, BOOL called_from_parent) { LLPreview::reshape(width, height, called_from_parent); - LLRect dim_rect(getChildView("dimensions")->getRect()); + LLRect dim_rect; + childGetRect("dimensions", dim_rect); S32 horiz_pad = 2 * (LLPANEL_BORDER_WIDTH + PREVIEW_PAD) + PREVIEW_RESIZE_HANDLE_SIZE; @@ -411,11 +412,12 @@ void LLPreviewTexture::updateDimensions() mUpdateDimensions = FALSE; - getChild<LLUICtrl>("dimensions")->setTextArg("[WIDTH]", llformat("%d", mImage->getFullWidth())); - getChild<LLUICtrl>("dimensions")->setTextArg("[HEIGHT]", llformat("%d", mImage->getFullHeight())); + childSetTextArg("dimensions", "[WIDTH]", llformat("%d", mImage->getFullWidth())); + childSetTextArg("dimensions", "[HEIGHT]", llformat("%d", mImage->getFullHeight())); - LLRect dim_rect(getChildView("dimensions")->getRect()); + LLRect dim_rect; + childGetRect("dimensions", dim_rect); S32 horiz_pad = 2 * (LLPANEL_BORDER_WIDTH + PREVIEW_PAD) + PREVIEW_RESIZE_HANDLE_SIZE; @@ -489,8 +491,9 @@ void LLPreviewTexture::updateDimensions() // Hide the aspect ratio label if the window is too narrow // Assumes the label should be to the right of the dimensions - LLRect aspect_label_rect(getChildView("aspect_ratio")->getRect()); - getChildView("aspect_ratio")->setVisible( dim_rect.mRight < aspect_label_rect.mLeft); + LLRect aspect_label_rect; + childGetRect("aspect_ratio", aspect_label_rect); + childSetVisible("aspect_ratio", dim_rect.mRight < aspect_label_rect.mLeft); } @@ -547,7 +550,7 @@ void LLPreviewTexture::loadAsset() mAssetStatus = PREVIEW_ASSET_LOADING; mUpdateDimensions = TRUE; updateDimensions(); - getChildView("save_tex_btn")->setEnabled(canSaveAs()); + childSetEnabled("save_tex_btn", canSaveAs()); } LLPreview::EAssetStatus LLPreviewTexture::getAssetStatus() |