Modernized lluictrl. Added LLViewModel. Fixed focus callbacks being called excessively. Updated LLButton, and implemented boost::signals2 to replace old callback handling.
This commit is contained in:
@@ -79,6 +79,7 @@ set(llui_SOURCE_FILES
|
||||
lluistring.cpp
|
||||
llundo.cpp
|
||||
llviewborder.cpp
|
||||
llviewmodel.cpp
|
||||
llview.cpp
|
||||
llviewquery.cpp
|
||||
)
|
||||
@@ -146,6 +147,7 @@ set(llui_HEADER_FILES
|
||||
lluixmltags.h
|
||||
llundo.h
|
||||
llviewborder.h
|
||||
llviewmodel.h
|
||||
llview.h
|
||||
llviewquery.h
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -41,6 +41,8 @@
|
||||
#include "llfontgl.h"
|
||||
#include "lluiimage.h"
|
||||
#include "lluistring.h"
|
||||
#include "llinitparam.h"
|
||||
#include "lluicolor.h"
|
||||
|
||||
//
|
||||
// Constants
|
||||
@@ -85,21 +87,26 @@ public:
|
||||
const LLFontGL* mGLFont = NULL,
|
||||
const std::string& unselected_label = LLStringUtil::null,
|
||||
const std::string& selected_label = LLStringUtil::null );
|
||||
public:
|
||||
|
||||
virtual ~LLButton();
|
||||
void init(void (*click_callback)(void*), void *callback_data, const LLFontGL* font, const std::string& control_name);
|
||||
~LLButton();
|
||||
// For backward compatability only
|
||||
typedef boost::function<void(void*)> button_callback_t;
|
||||
|
||||
|
||||
void addImageAttributeToXML(LLXMLNodePtr node, const std::string& imageName,
|
||||
const LLUUID& imageID,const std::string& xmlTagName) const;
|
||||
void addImageAttributeToXML(LLXMLNodePtr node, const LLPointer<LLUIImage>, const std::string& xmlTagName) const;
|
||||
void init(void (*click_callback)(void*), void *callback_data, const std::string& control_name);
|
||||
virtual LLXMLNodePtr getXML(bool save_children = true) const;
|
||||
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
|
||||
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
|
||||
|
||||
virtual void setAlpha( F32 alpha ) { mAlpha = alpha; }
|
||||
virtual BOOL handleUnicodeCharHere(llwchar uni_char);
|
||||
virtual BOOL handleKeyHere(KEY key, MASK mask);
|
||||
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
|
||||
virtual void draw();
|
||||
|
||||
virtual void onMouseCaptureLost();
|
||||
@@ -109,29 +116,48 @@ public:
|
||||
void setUnselectedLabelColor( const LLColor4& c ) { mUnselectedLabelColor = c; }
|
||||
void setSelectedLabelColor( const LLColor4& c ) { mSelectedLabelColor = c; }
|
||||
|
||||
void setClickedCallback( void (*cb)(void *data), void* data = NULL ); // mouse down and up within button
|
||||
void setMouseDownCallback( void (*cb)(void *data) ) { mMouseDownCallback = cb; } // mouse down within button
|
||||
void setMouseUpCallback( void (*cb)(void *data) ) { mMouseUpCallback = cb; } // mouse up, EVEN IF NOT IN BUTTON
|
||||
void setHeldDownCallback( void (*cb)(void *data) ) { mHeldDownCallback = cb; } // Mouse button held down and in button
|
||||
|
||||
/*boost::signals2::connection setClickedCallback(const CommitCallbackParam& cb);
|
||||
boost::signals2::connection setMouseDownCallback(const CommitCallbackParam& cb);
|
||||
boost::signals2::connection setMouseUpCallback(const CommitCallbackParam& cb);
|
||||
boost::signals2::connection setHeldDownCallback(const CommitCallbackParam& cb);*/
|
||||
|
||||
boost::signals2::connection setClickedCallback( const commit_signal_t::slot_type& cb ); // mouse down and up within button
|
||||
boost::signals2::connection setMouseDownCallback( const commit_signal_t::slot_type& cb );
|
||||
boost::signals2::connection setMouseUpCallback( const commit_signal_t::slot_type& cb ); // mouse up, EVEN IF NOT IN BUTTON
|
||||
// Passes a 'count' parameter in the commit param payload, i.e. param["count"])
|
||||
boost::signals2::connection setHeldDownCallback( const commit_signal_t::slot_type& cb ); // Mouse button held down and in button
|
||||
|
||||
|
||||
// *TODO: Deprecate (for backwards compatability only)
|
||||
boost::signals2::connection setClickedCallback( button_callback_t cb, void* data );
|
||||
boost::signals2::connection setMouseDownCallback( button_callback_t cb, void* data );
|
||||
boost::signals2::connection setMouseUpCallback( button_callback_t cb, void* data );
|
||||
boost::signals2::connection setHeldDownCallback( button_callback_t cb, void* data );
|
||||
|
||||
void setHeldDownDelay( F32 seconds, S32 frames = 0) { mHeldDownDelay = seconds; mHeldDownFrameDelay = frames; }
|
||||
|
||||
F32 getHeldDownTime() const { return mMouseDownTimer.getElapsedTimeF32(); }
|
||||
|
||||
BOOL getIsToggle() const { return mIsToggle; }
|
||||
void setIsToggle(BOOL is_toggle) { mIsToggle = is_toggle; }
|
||||
BOOL toggleState();
|
||||
BOOL getToggleState() const { return mToggleState; }
|
||||
BOOL getToggleState() const;
|
||||
void setToggleState(BOOL b);
|
||||
|
||||
void setHighlight(bool b);
|
||||
void setFlashing( BOOL b );
|
||||
BOOL getFlashing() const { return mFlashing; }
|
||||
|
||||
void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; }
|
||||
LLFontGL::HAlign getHAlign() const { return mHAlign; }
|
||||
void setLeftHPad( S32 pad ) { mLeftHPad = pad; }
|
||||
S32 getLeftHPad() const { return mLeftHPad; }
|
||||
S32 getLeftHPad() const { return mLeftHPad; }
|
||||
void setRightHPad( S32 pad ) { mRightHPad = pad; }
|
||||
S32 getRightHPad() const { return mRightHPad; }
|
||||
S32 getRightHPad() const { return mRightHPad; }
|
||||
|
||||
void setImageOverlayTopPad( S32 pad ) { mImageOverlayTopPad = pad; }
|
||||
S32 getImageOverlayTopPad() const { return mImageOverlayTopPad; }
|
||||
void setImageOverlayBottomPad( S32 pad ) { mImageOverlayBottomPad = pad; }
|
||||
S32 getImageOverlayBottomPad() const { return mImageOverlayBottomPad; }
|
||||
|
||||
const std::string getLabelUnselected() const { return wstring_to_utf8str(mUnselectedLabel); }
|
||||
const std::string getLabelSelected() const { return wstring_to_utf8str(mSelectedLabel); }
|
||||
@@ -139,35 +165,31 @@ public:
|
||||
void setImageColor(const std::string& color_control);
|
||||
void setImageColor(const LLColor4& c);
|
||||
/*virtual*/ void setColor(const LLColor4& c);
|
||||
/*virtual*/ void setAlpha(F32 alpha);
|
||||
|
||||
void setImages(const std::string &image_name, const std::string &selected_name);
|
||||
void setDisabledImages(const std::string &image_name, const std::string &selected_name);
|
||||
void setDisabledImages(const std::string &image_name, const std::string &selected_name, const LLColor4& c);
|
||||
|
||||
void setHoverImages(const std::string &image_name, const std::string &selected_name);
|
||||
|
||||
void setDisabledImageColor(const LLColor4& c) { mDisabledImageColor = c; }
|
||||
|
||||
void setDisabledSelectedLabelColor( const LLColor4& c ) { mDisabledSelectedLabelColor = c; }
|
||||
|
||||
void setImageOverlay(const std::string& image_name, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white);
|
||||
void setImageOverlay(const LLUUID& image_id, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white);
|
||||
LLPointer<LLUIImage> getImageOverlay() { return mImageOverlay; }
|
||||
LLFontGL::HAlign getImageOverlayHAlign() const { return mImageOverlayAlignment; }
|
||||
|
||||
|
||||
virtual void setValue(const LLSD& value );
|
||||
virtual LLSD getValue() const;
|
||||
|
||||
void autoResize(); // resize with label of current btn state
|
||||
void resize(LLUIString label); // resize with label input
|
||||
void setLabel( const LLStringExplicit& label);
|
||||
virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text );
|
||||
void setLabelUnselected(const LLStringExplicit& label);
|
||||
void setLabelSelected(const LLStringExplicit& label);
|
||||
void setDisabledLabel(const LLStringExplicit& disabled_label);
|
||||
void setDisabledSelectedLabel(const LLStringExplicit& disabled_label);
|
||||
void setDisabledLabelColor( const LLColor4& c ) { mDisabledLabelColor = c; }
|
||||
|
||||
void setFont(const LLFontGL *font)
|
||||
{ mGLFont = ( font ? font : LLFontGL::getFontSansSerif()); }
|
||||
const LLFontGL* getFont() const { return mGLFont; }
|
||||
const LLUIString& getCurrentLabel() const;
|
||||
|
||||
void setScaleImage(BOOL scale) { mScaleImage = scale; }
|
||||
BOOL getScaleImage() const { return mScaleImage; }
|
||||
|
||||
@@ -175,132 +197,130 @@ public:
|
||||
|
||||
void setBorderEnabled(BOOL b) { mBorderEnabled = b; }
|
||||
|
||||
static void onHeldDown(void *userdata); // to be called by gIdleCallbacks
|
||||
|
||||
void setHoverGlowStrength(F32 strength) { mHoverGlowStrength = strength; }
|
||||
|
||||
void setImageUnselected(const std::string &image_name);
|
||||
const std::string& getImageUnselectedName() const { return mImageUnselectedName; }
|
||||
void setImageSelected(const std::string &image_name);
|
||||
const std::string& getImageSelectedName() const { return mImageSelectedName; }
|
||||
void setImageHoverSelected(const std::string &image_name);
|
||||
void setImageHoverUnselected(const std::string &image_name);
|
||||
void setImageDisabled(const std::string &image_name);
|
||||
void setImageDisabledSelected(const std::string &image_name);
|
||||
|
||||
void setImageUnselected(LLPointer<LLUIImage> image);
|
||||
void setImageSelected(LLPointer<LLUIImage> image);
|
||||
void setImageHoverSelected(LLPointer<LLUIImage> image);
|
||||
void setImageHoverUnselected(LLPointer<LLUIImage> image);
|
||||
void setImageDisabled(LLPointer<LLUIImage> image);
|
||||
void setImageDisabledSelected(LLPointer<LLUIImage> image);
|
||||
|
||||
void setImageFlash(LLPointer<LLUIImage> image);
|
||||
void setImagePressed(LLPointer<LLUIImage> image);
|
||||
|
||||
void setCommitOnReturn(BOOL commit) { mCommitOnReturn = commit; }
|
||||
BOOL getCommitOnReturn() const { return mCommitOnReturn; }
|
||||
|
||||
static void onHeldDown(void *userdata); // to be called by gIdleCallbacks
|
||||
void setHelpURLCallback(const std::string &help_url);
|
||||
const std::string& getHelpURL() const { return mHelpURL; }
|
||||
|
||||
void setForcePressedState(bool b) { mForcePressedState = b; }
|
||||
|
||||
void setAutoResize(bool auto_resize) { mAutoResize = auto_resize; }
|
||||
|
||||
bool getIsToggle() const { return mIsToggle; }
|
||||
bool setIsToggle(bool toggle) { return mIsToggle = toggle; }
|
||||
|
||||
protected:
|
||||
|
||||
virtual void drawBorder(const LLColor4& color, S32 size);
|
||||
|
||||
void setImageUnselectedID(const LLUUID &image_id);
|
||||
const LLUUID& getImageUnselectedID() const { return mImageUnselectedID; }
|
||||
void setImageSelectedID(const LLUUID &image_id);
|
||||
const LLUUID& getImageSelectedID() const { return mImageSelectedID; }
|
||||
void setImageHoverSelectedID(const LLUUID &image_id);
|
||||
void setImageHoverUnselectedID(const LLUUID &image_id);
|
||||
void setImageDisabledID(const LLUUID &image_id);
|
||||
void setImageDisabledSelectedID(const LLUUID &image_id);
|
||||
const LLPointer<LLUIImage>& getImageUnselected() const { return mImageUnselected; }
|
||||
const LLPointer<LLUIImage>& getImageSelected() const { return mImageSelected; }
|
||||
|
||||
void getOverlayImageSize(S32& overlay_width, S32& overlay_height);
|
||||
|
||||
LLFrameTimer mMouseDownTimer;
|
||||
bool mNeedsHighlight;
|
||||
S32 mButtonFlashCount;
|
||||
F32 mButtonFlashRate;
|
||||
|
||||
private:
|
||||
|
||||
void (*mClickedCallback)(void* data );
|
||||
void (*mMouseDownCallback)(void *data);
|
||||
void (*mMouseUpCallback)(void *data);
|
||||
void (*mHeldDownCallback)(void *data);
|
||||
void drawBorder(LLUIImage* imagep, const LLColor4& color, S32 size);
|
||||
void resetMouseDownTimer();
|
||||
|
||||
commit_signal_t* mMouseDownSignal;
|
||||
commit_signal_t* mMouseUpSignal;
|
||||
commit_signal_t* mHeldDownSignal;
|
||||
|
||||
const LLFontGL *mGLFont;
|
||||
|
||||
S32 mMouseDownFrame;
|
||||
F32 mHeldDownDelay; // seconds, after which held-down callbacks get called
|
||||
S32 mHeldDownFrameDelay; // frames, after which held-down callbacks get called
|
||||
S32 mMouseDownFrame;
|
||||
S32 mMouseHeldDownCount; // Counter for parameter passed to held-down callback
|
||||
F32 mHeldDownDelay; // seconds, after which held-down callbacks get called
|
||||
S32 mHeldDownFrameDelay; // frames, after which held-down callbacks get called
|
||||
|
||||
LLPointer<LLUIImage> mImageOverlay;
|
||||
LLFontGL::HAlign mImageOverlayAlignment;
|
||||
LLColor4 mImageOverlayColor;
|
||||
LLFontGL::HAlign mImageOverlayAlignment;
|
||||
LLUIColor mImageOverlayColor;
|
||||
LLUIColor mImageOverlaySelectedColor;
|
||||
LLUIColor mImageOverlayDisabledColor;
|
||||
|
||||
LLPointer<LLUIImage> mImageUnselected;
|
||||
LLUIString mUnselectedLabel;
|
||||
LLColor4 mUnselectedLabelColor;
|
||||
LLPointer<LLUIImage> mImageUnselected;
|
||||
LLUIString mUnselectedLabel;
|
||||
LLUIColor mUnselectedLabelColor;
|
||||
|
||||
LLPointer<LLUIImage> mImageSelected;
|
||||
LLUIString mSelectedLabel;
|
||||
LLColor4 mSelectedLabelColor;
|
||||
LLPointer<LLUIImage> mImageSelected;
|
||||
LLUIString mSelectedLabel;
|
||||
LLUIColor mSelectedLabelColor;
|
||||
|
||||
LLPointer<LLUIImage> mImageHoverSelected;
|
||||
LLPointer<LLUIImage> mImageHoverSelected;
|
||||
|
||||
LLPointer<LLUIImage> mImageHoverUnselected;
|
||||
LLPointer<LLUIImage> mImageHoverUnselected;
|
||||
|
||||
LLPointer<LLUIImage> mImageDisabled;
|
||||
LLUIString mDisabledLabel;
|
||||
LLColor4 mDisabledLabelColor;
|
||||
LLPointer<LLUIImage> mImageDisabled;
|
||||
LLUIColor mDisabledLabelColor;
|
||||
|
||||
LLPointer<LLUIImage> mImageDisabledSelected;
|
||||
LLUIString mDisabledSelectedLabel;
|
||||
LLColor4 mDisabledSelectedLabelColor;
|
||||
LLPointer<LLUIImage> mImageDisabledSelected;
|
||||
LLUIString mDisabledSelectedLabel;
|
||||
LLUIColor mDisabledSelectedLabelColor;
|
||||
|
||||
LLUUID mImageUnselectedID;
|
||||
LLUUID mImageSelectedID;
|
||||
LLUUID mImageHoverSelectedID;
|
||||
LLUUID mImageHoverUnselectedID;
|
||||
LLUUID mImageDisabledID;
|
||||
LLUUID mImageDisabledSelectedID;
|
||||
std::string mImageUnselectedName;
|
||||
std::string mImageSelectedName;
|
||||
std::string mImageHoverSelectedName;
|
||||
std::string mImageHoverUnselectedName;
|
||||
std::string mImageDisabledName;
|
||||
std::string mImageDisabledSelectedName;
|
||||
LLPointer<LLUIImage> mImagePressed;
|
||||
LLPointer<LLUIImage> mImagePressedSelected;
|
||||
|
||||
LLColor4 mHighlightColor;
|
||||
LLColor4 mUnselectedBgColor;
|
||||
LLColor4 mSelectedBgColor;
|
||||
LLColor4 mFlashBgColor;
|
||||
/* There are two ways an image can flash- by making changes in color according to flash_color attribute
|
||||
or by changing icon from current to the one specified in image_flash. Second way is used only if
|
||||
flash icon name is set in attributes(by default it isn't). First way is used otherwise. */
|
||||
LLPointer<LLUIImage> mImageFlash;
|
||||
|
||||
LLColor4 mImageColor;
|
||||
LLColor4 mDisabledImageColor;
|
||||
LLUIColor mFlashBgColor;
|
||||
|
||||
BOOL mIsToggle;
|
||||
BOOL mToggleState;
|
||||
BOOL mScaleImage;
|
||||
LLUIColor mImageColor;
|
||||
LLUIColor mDisabledImageColor;
|
||||
|
||||
BOOL mDropShadowedText;
|
||||
bool mIsToggle;
|
||||
bool mScaleImage;
|
||||
|
||||
BOOL mBorderEnabled;
|
||||
bool mDropShadowedText;
|
||||
bool mAutoResize;
|
||||
bool mBorderEnabled;
|
||||
bool mFlashing;
|
||||
|
||||
BOOL mFlashing;
|
||||
LLFontGL::HAlign mHAlign;
|
||||
S32 mLeftHPad;
|
||||
S32 mRightHPad;
|
||||
S32 mBottomVPad; // under text label
|
||||
|
||||
LLFontGL::HAlign mHAlign;
|
||||
S32 mLeftHPad;
|
||||
S32 mRightHPad;
|
||||
S32 mImageOverlayTopPad;
|
||||
S32 mImageOverlayBottomPad;
|
||||
|
||||
F32 mHoverGlowStrength;
|
||||
F32 mCurGlowStrength;
|
||||
/*
|
||||
* Space between image_overlay and label
|
||||
*/
|
||||
S32 mImgOverlayLabelSpace;
|
||||
|
||||
BOOL mNeedsHighlight;
|
||||
BOOL mCommitOnReturn;
|
||||
F32 mHoverGlowStrength;
|
||||
F32 mCurGlowStrength;
|
||||
|
||||
std::string mHelpURL;
|
||||
bool mCommitOnReturn;
|
||||
bool mFadeWhenDisabled;
|
||||
|
||||
LLPointer<LLUIImage> mImagep;
|
||||
bool mForcePressedState;
|
||||
bool mDisplayPressedState;
|
||||
|
||||
LLFrameTimer mFlashingTimer;
|
||||
std::string mHelpURL;
|
||||
|
||||
LLFrameTimer mFlashingTimer;
|
||||
|
||||
bool mHandleRightMouse;
|
||||
|
||||
F32 mAlpha;
|
||||
};
|
||||
|
||||
#endif // LL_LLBUTTON_H
|
||||
|
||||
@@ -113,37 +113,27 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const std::string& name, const LLRect& rect,
|
||||
LLCHECKBOXCTRL_VPAD,
|
||||
LLCHECKBOXCTRL_BTN_SIZE + LLCHECKBOXCTRL_SPACING + text_width + LLCHECKBOXCTRL_HPAD,
|
||||
llmax( text_height, LLCHECKBOXCTRL_BTN_SIZE ) + LLCHECKBOXCTRL_VPAD);
|
||||
std::string active_true_id, active_false_id;
|
||||
std::string inactive_true_id, inactive_false_id;
|
||||
if (mRadioStyle)
|
||||
{
|
||||
active_true_id = "UIImgRadioActiveSelectedUUID";
|
||||
active_false_id = "UIImgRadioActiveUUID";
|
||||
inactive_true_id = "UIImgRadioInactiveSelectedUUID";
|
||||
inactive_false_id = "UIImgRadioInactiveUUID";
|
||||
mButton = new LLButton(std::string("Radio control button"), btn_rect,
|
||||
active_false_id, active_true_id, control_which,
|
||||
&LLCheckBoxCtrl::onButtonPress, this, LLFontGL::getFontSansSerif() );
|
||||
mButton->setDisabledImages( inactive_false_id, inactive_true_id );
|
||||
mButton->setHoverGlowStrength(0.35f);
|
||||
}
|
||||
else
|
||||
{
|
||||
active_false_id = "UIImgCheckboxActiveUUID";
|
||||
active_true_id = "UIImgCheckboxActiveSelectedUUID";
|
||||
inactive_true_id = "UIImgCheckboxInactiveSelectedUUID";
|
||||
inactive_false_id = "UIImgCheckboxInactiveUUID";
|
||||
mButton = new LLButton(std::string("Checkbox control button"), btn_rect,
|
||||
active_false_id, active_true_id, control_which,
|
||||
&LLCheckBoxCtrl::onButtonPress, this, LLFontGL::getFontSansSerif() );
|
||||
mButton->setDisabledImages( inactive_false_id, inactive_true_id );
|
||||
mButton->setHoverGlowStrength(0.35f);
|
||||
}
|
||||
|
||||
std::string active_true_id = mRadioStyle ? "UIImgRadioActiveSelectedUUID" : "UIImgCheckboxActiveSelectedUUID";
|
||||
std::string active_false_id = mRadioStyle ? "UIImgRadioActiveUUID" : "UIImgCheckboxActiveUUID";
|
||||
std::string inactive_true_id = mRadioStyle ? "UIImgRadioInactiveSelectedUUID" : "UIImgCheckboxInactiveSelectedUUID";
|
||||
std::string inactive_false_id = mRadioStyle ? "UIImgRadioInactiveUUID" : "UIImgCheckboxInactiveUUID";
|
||||
std::string button_name = mRadioStyle ? "Radio control button" : "Checkbox control button";
|
||||
|
||||
mButton = new LLButton( button_name, btn_rect,
|
||||
active_false_id, active_true_id, control_which,
|
||||
&LLCheckBoxCtrl::onButtonPress, this, LLFontGL::getFontSansSerif() );
|
||||
|
||||
mButton->setImageDisabledSelected(LLUI::getUIImage(inactive_true_id));
|
||||
mButton->setImageDisabled(LLUI::getUIImage(inactive_false_id));
|
||||
mButton->setHoverGlowStrength(0.35f);
|
||||
|
||||
mButton->setIsToggle(TRUE);
|
||||
mButton->setToggleState( initial_value );
|
||||
mButton->setFollowsLeft();
|
||||
mButton->setFollowsBottom();
|
||||
mButton->setCommitOnReturn(FALSE);
|
||||
mButton->setScaleImage(FALSE);
|
||||
addChild(mButton);
|
||||
}
|
||||
|
||||
@@ -156,22 +146,8 @@ LLCheckBoxCtrl::~LLCheckBoxCtrl()
|
||||
// static
|
||||
void LLCheckBoxCtrl::onButtonPress( void *userdata )
|
||||
{
|
||||
LLCheckBoxCtrl* self = (LLCheckBoxCtrl*) userdata;
|
||||
|
||||
if (self->mRadioStyle)
|
||||
{
|
||||
self->setValue(TRUE);
|
||||
}
|
||||
|
||||
self->setControlValue(self->getValue());
|
||||
// HACK: because buttons don't normally commit
|
||||
LLCheckBoxCtrl* self = (LLCheckBoxCtrl*)userdata;
|
||||
self->onCommit();
|
||||
|
||||
if (self->mKeyboardFocusOnClick)
|
||||
{
|
||||
self->setFocus( TRUE );
|
||||
self->onFocusReceived();
|
||||
}
|
||||
}
|
||||
|
||||
void LLCheckBoxCtrl::onCommit()
|
||||
@@ -179,6 +155,7 @@ void LLCheckBoxCtrl::onCommit()
|
||||
if( getEnabled() )
|
||||
{
|
||||
setTentative(FALSE);
|
||||
setControlValue(getValue());
|
||||
LLUICtrl::onCommit();
|
||||
}
|
||||
}
|
||||
@@ -186,7 +163,15 @@ void LLCheckBoxCtrl::onCommit()
|
||||
void LLCheckBoxCtrl::setEnabled(BOOL b)
|
||||
{
|
||||
LLView::setEnabled(b);
|
||||
mButton->setEnabled(b);
|
||||
|
||||
if (b)
|
||||
{
|
||||
mLabel->setColor( mTextEnabledColor.get() );
|
||||
}
|
||||
else
|
||||
{
|
||||
mLabel->setColor( mTextDisabledColor.get() );
|
||||
}
|
||||
}
|
||||
|
||||
void LLCheckBoxCtrl::clear()
|
||||
@@ -219,21 +204,6 @@ void LLCheckBoxCtrl::reshape(S32 width, S32 height, BOOL called_from_parent)
|
||||
LLUICtrl::reshape(width, height, called_from_parent);
|
||||
}
|
||||
|
||||
void LLCheckBoxCtrl::draw()
|
||||
{
|
||||
if (getEnabled())
|
||||
{
|
||||
mLabel->setColor( mTextEnabledColor );
|
||||
}
|
||||
else
|
||||
{
|
||||
mLabel->setColor( mTextDisabledColor );
|
||||
}
|
||||
|
||||
// Draw children
|
||||
LLUICtrl::draw();
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLCheckBoxCtrl::setValue(const LLSD& value )
|
||||
{
|
||||
@@ -246,6 +216,18 @@ LLSD LLCheckBoxCtrl::getValue() const
|
||||
return mButton->getValue();
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLCheckBoxCtrl::setTentative(BOOL b)
|
||||
{
|
||||
mButton->setTentative(b);
|
||||
}
|
||||
|
||||
//virtual
|
||||
BOOL LLCheckBoxCtrl::getTentative() const
|
||||
{
|
||||
return mButton->getTentative();
|
||||
}
|
||||
|
||||
void LLCheckBoxCtrl::setLabel( const LLStringExplicit& label )
|
||||
{
|
||||
mLabel->setText( label );
|
||||
@@ -282,7 +264,7 @@ BOOL LLCheckBoxCtrl::isDirty() const
|
||||
{
|
||||
if ( mButton )
|
||||
{
|
||||
return (mSetValue != mButton->getToggleState());
|
||||
return mButton->isDirty();
|
||||
}
|
||||
return FALSE; // Shouldn't get here
|
||||
}
|
||||
@@ -293,11 +275,12 @@ void LLCheckBoxCtrl::resetDirty()
|
||||
{
|
||||
if ( mButton )
|
||||
{
|
||||
mSetValue = mButton->getToggleState();
|
||||
mButton->resetDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// virtual
|
||||
LLXMLNodePtr LLCheckBoxCtrl::getXML(bool save_children) const
|
||||
{
|
||||
|
||||
@@ -82,7 +82,6 @@ public:
|
||||
|
||||
virtual void setEnabled( BOOL b );
|
||||
|
||||
virtual void draw();
|
||||
virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
|
||||
|
||||
// LLUICtrl interface
|
||||
@@ -91,8 +90,8 @@ public:
|
||||
BOOL get() { return (BOOL)getValue().asBoolean(); }
|
||||
void set(BOOL value) { setValue(value); }
|
||||
|
||||
virtual void setTentative(BOOL b) { mButton->setTentative(b); }
|
||||
virtual BOOL getTentative() const { return mButton->getTentative(); }
|
||||
virtual void setTentative(BOOL b);
|
||||
virtual BOOL getTentative() const;
|
||||
|
||||
virtual BOOL setLabelArg( const std::string& key, const LLStringExplicit& text );
|
||||
|
||||
@@ -108,6 +107,9 @@ public:
|
||||
void setLabel( const LLStringExplicit& label );
|
||||
std::string getLabel() const;
|
||||
|
||||
void setFont( const LLFontGL* font ) { mFont = font; }
|
||||
const LLFontGL* getFont() { return mFont; }
|
||||
|
||||
virtual void setControlName(const std::string& control_name, LLView* context);
|
||||
virtual std::string getControlName() const;
|
||||
|
||||
@@ -121,8 +123,9 @@ protected:
|
||||
LLButton* mButton;
|
||||
LLTextBox* mLabel;
|
||||
const LLFontGL* mFont;
|
||||
LLColor4 mTextEnabledColor;
|
||||
LLColor4 mTextDisabledColor;
|
||||
|
||||
LLUIColor mTextEnabledColor;
|
||||
LLUIColor mTextDisabledColor;
|
||||
BOOL mRadioStyle;
|
||||
BOOL mInitialValue; // Value set in constructor
|
||||
BOOL mSetValue; // Value set programmatically
|
||||
|
||||
@@ -85,13 +85,13 @@ LLComboBox::LLComboBox( const std::string& name, const LLRect &rect, const std::
|
||||
LLRect(),
|
||||
LLStringUtil::null,
|
||||
NULL, this);
|
||||
mButton->setImageUnselected(std::string("square_btn_32x128.tga"));
|
||||
mButton->setImageSelected(std::string("square_btn_selected_32x128.tga"));
|
||||
mButton->setImageDisabled(std::string("square_btn_32x128.tga"));
|
||||
mButton->setImageDisabledSelected(std::string("square_btn_selected_32x128.tga"));
|
||||
mButton->setImageUnselected(LLUI::getUIImage("square_btn_32x128.tga"));
|
||||
mButton->setImageSelected(LLUI::getUIImage("square_btn_selected_32x128.tga"));
|
||||
mButton->setImageDisabled(LLUI::getUIImage("square_btn_32x128.tga"));
|
||||
mButton->setImageDisabledSelected(LLUI::getUIImage("square_btn_selected_32x128.tga"));
|
||||
mButton->setScaleImage(TRUE);
|
||||
|
||||
mButton->setMouseDownCallback(onButtonDown);
|
||||
mButton->setMouseDownCallback(boost::bind(&LLComboBox::onButtonDown,this));
|
||||
mButton->setFont(LLFontGL::getFontSansSerifSmall());
|
||||
mButton->setFollows(FOLLOWS_LEFT | FOLLOWS_BOTTOM | FOLLOWS_RIGHT);
|
||||
mButton->setHAlign( LLFontGL::LEFT );
|
||||
@@ -244,8 +244,6 @@ void LLComboBox::clear()
|
||||
}
|
||||
mButton->setLabelSelected(LLStringUtil::null);
|
||||
mButton->setLabelUnselected(LLStringUtil::null);
|
||||
mButton->setDisabledLabel(LLStringUtil::null);
|
||||
mButton->setDisabledSelectedLabel(LLStringUtil::null);
|
||||
mList->deselectAllItems();
|
||||
}
|
||||
|
||||
@@ -445,8 +443,6 @@ void LLComboBox::setLabel(const LLStringExplicit& name)
|
||||
{
|
||||
mButton->setLabelUnselected(name);
|
||||
mButton->setLabelSelected(name);
|
||||
mButton->setDisabledLabel(name);
|
||||
mButton->setDisabledSelectedLabel(name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1218,7 +1214,7 @@ LLFlyoutButton::LLFlyoutButton(
|
||||
LLRect(), LLStringUtil::null, NULL, this);
|
||||
mActionButton->setScaleImage(TRUE);
|
||||
|
||||
mActionButton->setClickedCallback(onActionButtonClick);
|
||||
mActionButton->setClickedCallback(boost::bind(&LLFlyoutButton::onActionButtonClick, this));
|
||||
mActionButton->setFollowsAll();
|
||||
mActionButton->setHAlign( LLFontGL::HCENTER );
|
||||
mActionButton->setLabel(label);
|
||||
|
||||
@@ -707,6 +707,8 @@ const std::string& LLFloater::getCurrentTitle() const
|
||||
|
||||
void LLFloater::setTitle( const std::string& title )
|
||||
{
|
||||
if(mTitle == title)
|
||||
return;
|
||||
mTitle = title;
|
||||
applyTitle();
|
||||
}
|
||||
@@ -1742,8 +1744,8 @@ void LLFloater::buildButtons()
|
||||
buttonp->setFollowsRight();
|
||||
buttonp->setToolTip( sButtonToolTips[i] );
|
||||
buttonp->setImageColor(LLUI::sColorsGroup->getColor("FloaterButtonImageColor"));
|
||||
buttonp->setHoverImages(sButtonPressedImageNames[i],
|
||||
sButtonPressedImageNames[i]);
|
||||
buttonp->setImageHoverSelected(LLUI::getUIImage(sButtonPressedImageNames[i]));
|
||||
buttonp->setImageHoverUnselected(LLUI::getUIImage(sButtonPressedImageNames[i]));
|
||||
buttonp->setScaleImage(TRUE);
|
||||
buttonp->setSaveToXML(false);
|
||||
addChild(buttonp);
|
||||
|
||||
@@ -127,7 +127,7 @@ LLScrollbar::LLScrollbar(
|
||||
line_up_btn->setFollowsLeft();
|
||||
line_up_btn->setFollowsBottom();
|
||||
}
|
||||
line_up_btn->setHeldDownCallback( &LLScrollbar::onLineUpBtnPressed );
|
||||
line_up_btn->setHeldDownCallback( boost::bind(&LLScrollbar::onLineUpBtnPressed, (void*)this) );
|
||||
line_up_btn->setTabStop(FALSE);
|
||||
line_up_btn->setScaleImage(TRUE);
|
||||
|
||||
@@ -138,7 +138,7 @@ LLScrollbar::LLScrollbar(
|
||||
&LLScrollbar::onLineDownBtnPressed, this, LLFontGL::getFontSansSerif() );
|
||||
line_down_btn->setFollowsRight();
|
||||
line_down_btn->setFollowsBottom();
|
||||
line_down_btn->setHeldDownCallback( &LLScrollbar::onLineDownBtnPressed );
|
||||
line_down_btn->setHeldDownCallback( boost::bind(&LLScrollbar::onLineDownBtnPressed, this) );
|
||||
line_down_btn->setTabStop(FALSE);
|
||||
line_down_btn->setScaleImage(TRUE);
|
||||
addChild(line_down_btn);
|
||||
|
||||
@@ -3679,9 +3679,9 @@ LLColumnHeader::LLColumnHeader(const std::string& label, const LLRect &rect, LLS
|
||||
mButton->setTabStop(FALSE);
|
||||
// require at least two frames between mouse down and mouse up event to capture intentional "hold" not just bad framerate
|
||||
mButton->setHeldDownDelay(LLUI::sConfigGroup->getF32("ColumnHeaderDropDownDelay"), 2);
|
||||
mButton->setHeldDownCallback(onHeldDown);
|
||||
mButton->setClickedCallback(onClick);
|
||||
mButton->setMouseDownCallback(onMouseDown);
|
||||
mButton->setHeldDownCallback(boost::bind(&LLColumnHeader::onHeldDown, this));
|
||||
mButton->setClickedCallback(boost::bind(&LLColumnHeader::onClick, this));
|
||||
mButton->setMouseDownCallback(boost::bind(&LLColumnHeader::onMouseDown, this));
|
||||
|
||||
mButton->setCallbackUserData(this);
|
||||
mButton->setToolTip(label);
|
||||
@@ -3843,8 +3843,8 @@ void LLColumnHeader::setImage(const std::string &image_name)
|
||||
{
|
||||
if (mButton)
|
||||
{
|
||||
mButton->setImageSelected(image_name);
|
||||
mButton->setImageUnselected(image_name);
|
||||
mButton->setImageSelected(LLUI::getUIImage(image_name));
|
||||
mButton->setImageUnselected(LLUI::getUIImage(image_name));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ LLSpinCtrl::LLSpinCtrl( const std::string& name, const LLRect& rect, const std::
|
||||
&LLSpinCtrl::onUpBtn, this, LLFontGL::getFontSansSerif() );
|
||||
mUpBtn->setFollowsLeft();
|
||||
mUpBtn->setFollowsBottom();
|
||||
mUpBtn->setHeldDownCallback( &LLSpinCtrl::onUpBtn );
|
||||
mUpBtn->setHeldDownCallback(boost::bind(&LLSpinCtrl::onUpBtn,this));
|
||||
mUpBtn->setTabStop(FALSE);
|
||||
addChild(mUpBtn);
|
||||
|
||||
@@ -115,7 +115,7 @@ LLSpinCtrl::LLSpinCtrl( const std::string& name, const LLRect& rect, const std::
|
||||
&LLSpinCtrl::onDownBtn, this, LLFontGL::getFontSansSerif() );
|
||||
mDownBtn->setFollowsLeft();
|
||||
mDownBtn->setFollowsBottom();
|
||||
mDownBtn->setHeldDownCallback( &LLSpinCtrl::onDownBtn );
|
||||
mDownBtn->setHeldDownCallback(boost::bind(&LLSpinCtrl::onDownBtn,this));
|
||||
mDownBtn->setTabStop(FALSE);
|
||||
addChild(mDownBtn);
|
||||
|
||||
|
||||
@@ -803,7 +803,7 @@ void LLTabContainer::addTabPanel(LLPanel* child,
|
||||
LLStringUtil::null,
|
||||
LLStringUtil::null,
|
||||
LLStringUtil::null,
|
||||
&LLTabContainer::onTabBtn, NULL,
|
||||
NULL, NULL,
|
||||
font,
|
||||
trimmed_label, trimmed_label);
|
||||
btn->setImages(std::string("tab_left.tga"), std::string("tab_left_selected.tga"));
|
||||
@@ -825,7 +825,7 @@ void LLTabContainer::addTabPanel(LLPanel* child,
|
||||
btn = new LLButton(std::string(child->getName()) + " tab",
|
||||
btn_rect,
|
||||
LLStringUtil::null, LLStringUtil::null, LLStringUtil::null,
|
||||
&LLTabContainer::onTabBtn, NULL, // set userdata below
|
||||
NULL, NULL, // set userdata below
|
||||
font,
|
||||
trimmed_label, trimmed_label );
|
||||
btn->setVisible( FALSE );
|
||||
@@ -865,7 +865,7 @@ void LLTabContainer::addTabPanel(LLPanel* child,
|
||||
if (btn)
|
||||
{
|
||||
btn->setSaveToXML(false);
|
||||
btn->setCallbackUserData( tuple );
|
||||
btn->setClickedCallback(&LLTabContainer::onTabBtn, tuple);
|
||||
addChild( btn, 0 );
|
||||
}
|
||||
if (child)
|
||||
@@ -1682,7 +1682,7 @@ void LLTabContainer::initButtons()
|
||||
mPrevArrowBtn = new LLButton(std::string("Left Arrow"), left_arrow_btn_rect,
|
||||
out_id, in_id, LLStringUtil::null,
|
||||
&LLTabContainer::onPrevBtn, this, LLFontGL::getFontSansSerif() );
|
||||
mPrevArrowBtn->setHeldDownCallback(onPrevBtnHeld);
|
||||
mPrevArrowBtn->setHeldDownCallback(boost::bind(LLTabContainer::onPrevBtnHeld, this));
|
||||
mPrevArrowBtn->setFollowsLeft();
|
||||
|
||||
out_id = "UIImgBtnJumpRightOutUUID";
|
||||
@@ -1717,12 +1717,12 @@ void LLTabContainer::initButtons()
|
||||
}
|
||||
}
|
||||
|
||||
mPrevArrowBtn->setHeldDownCallback(onPrevBtnHeld);
|
||||
mPrevArrowBtn->setHeldDownCallback(boost::bind(&LLTabContainer::onPrevBtnHeld, this));
|
||||
mPrevArrowBtn->setSaveToXML(false);
|
||||
mPrevArrowBtn->setTabStop(FALSE);
|
||||
addChild(mPrevArrowBtn);
|
||||
|
||||
mNextArrowBtn->setHeldDownCallback(onNextBtnHeld);
|
||||
mNextArrowBtn->setHeldDownCallback(boost::bind(&LLTabContainer::onNextBtnHeld, this));
|
||||
mNextArrowBtn->setSaveToXML(false);
|
||||
mNextArrowBtn->setTabStop(FALSE);
|
||||
addChild(mNextArrowBtn);
|
||||
|
||||
@@ -42,6 +42,7 @@ static LLRegisterWidget<LLUICtrl> r("ui_ctrl");
|
||||
// NOTE: the LLFocusableElement implementation has been moved to llfocusmgr.cpp, to mirror the header where the class is defined.
|
||||
|
||||
LLUICtrl::LLUICtrl() :
|
||||
mViewModel(LLViewModelPtr(new LLViewModel)),
|
||||
mCommitSignal(NULL),
|
||||
mValidateSignal(NULL),
|
||||
mCommitCallback(NULL),
|
||||
@@ -62,6 +63,7 @@ LLUICtrl::LLUICtrl(const std::string& name, const LLRect& rect, BOOL mouse_opaqu
|
||||
LLView( name, rect, mouse_opaque, reshape ),
|
||||
mCommitSignal(NULL),
|
||||
mValidateSignal(NULL),
|
||||
mViewModel(LLViewModelPtr(new LLViewModel)),
|
||||
mCommitCallback( on_commit_callback),
|
||||
mValidateCallback( NULL ),
|
||||
mCallbackUserData( callback_userdata ),
|
||||
@@ -101,12 +103,33 @@ BOOL LLUICtrl::isCtrl() const
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLUICtrl::setValue(const LLSD& value)
|
||||
{
|
||||
mViewModel->setValue(value);
|
||||
}
|
||||
|
||||
//virtual
|
||||
LLSD LLUICtrl::getValue() const
|
||||
{
|
||||
return LLSD();
|
||||
return mViewModel->getValue();
|
||||
}
|
||||
|
||||
/// When two widgets are displaying the same data (e.g. during a skin
|
||||
/// change), share their ViewModel.
|
||||
void LLUICtrl::shareViewModelFrom(const LLUICtrl& other)
|
||||
{
|
||||
// Because mViewModel is an LLViewModelPtr, this assignment will quietly
|
||||
// dispose of the previous LLViewModel -- unless it's already shared by
|
||||
// somebody else.
|
||||
mViewModel = other.mViewModel;
|
||||
}
|
||||
|
||||
//virtual
|
||||
LLViewModel* LLUICtrl::getViewModel() const
|
||||
{
|
||||
return mViewModel;
|
||||
}
|
||||
// virtual
|
||||
BOOL LLUICtrl::setTextArg( const std::string& key, const LLStringExplicit& text )
|
||||
{
|
||||
@@ -169,43 +192,12 @@ void LLUICtrl::onFocusReceived()
|
||||
{
|
||||
// trigger callbacks
|
||||
LLFocusableElement::onFocusReceived();
|
||||
|
||||
// find first view in hierarchy above new focus that is a LLUICtrl
|
||||
LLView* viewp = getParent();
|
||||
LLUICtrl* last_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getLastKeyboardFocus());
|
||||
|
||||
while (viewp && !viewp->isCtrl())
|
||||
{
|
||||
viewp = viewp->getParent();
|
||||
}
|
||||
|
||||
// and if it has newly gained focus, call onFocusReceived()
|
||||
LLUICtrl* ctrlp = static_cast<LLUICtrl*>(viewp);
|
||||
if (ctrlp && (!last_focus || !last_focus->hasAncestor(ctrlp)))
|
||||
{
|
||||
ctrlp->onFocusReceived();
|
||||
}
|
||||
}
|
||||
|
||||
void LLUICtrl::onFocusLost()
|
||||
{
|
||||
// trigger callbacks
|
||||
LLFocusableElement::onFocusLost();
|
||||
|
||||
// find first view in hierarchy above old focus that is a LLUICtrl
|
||||
LLView* viewp = getParent();
|
||||
while (viewp && !viewp->isCtrl())
|
||||
{
|
||||
viewp = viewp->getParent();
|
||||
}
|
||||
|
||||
// and if it has just lost focus, call onFocusReceived()
|
||||
LLUICtrl* ctrlp = static_cast<LLUICtrl*>(viewp);
|
||||
// hasFocus() includes any descendants
|
||||
if (ctrlp && !ctrlp->hasFocus())
|
||||
{
|
||||
ctrlp->onFocusLost();
|
||||
}
|
||||
}
|
||||
|
||||
// virtual
|
||||
@@ -229,12 +221,13 @@ BOOL LLUICtrl::acceptsTextInput() const
|
||||
//virtual
|
||||
BOOL LLUICtrl::isDirty() const
|
||||
{
|
||||
return FALSE;
|
||||
return mViewModel->isDirty();
|
||||
};
|
||||
|
||||
//virtual
|
||||
void LLUICtrl::resetDirty()
|
||||
{
|
||||
mViewModel->resetDirty();
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
||||
@@ -38,11 +38,13 @@
|
||||
#include "llrect.h"
|
||||
#include "llsd.h"
|
||||
|
||||
#include "llviewmodel.h" // *TODO move dependency to .cpp file
|
||||
|
||||
class LLUICtrl
|
||||
: public LLView
|
||||
{
|
||||
public:
|
||||
typedef boost::function<void (LLUICtrl* ctrl, const LLSD& param)> commit_callback_t;
|
||||
typedef boost::signals2::signal<void (LLUICtrl* ctrl, const LLSD& param)> commit_signal_t;
|
||||
typedef boost::signals2::signal<bool (LLUICtrl* ctrl, const LLSD& param), boost_boolean_combiner> enable_signal_t;
|
||||
|
||||
@@ -56,6 +58,10 @@ public:
|
||||
U32 reshape=FOLLOWS_NONE);
|
||||
/*virtual*/ ~LLUICtrl();
|
||||
|
||||
// We need this virtual so we can override it with derived versions
|
||||
virtual LLViewModel* getViewModel() const;
|
||||
// We shouldn't ever need to set this directly
|
||||
//virtual void setViewModel(const LLViewModelPtr&);
|
||||
// LLView interface
|
||||
/*virtual*/ void initFromXML(LLXMLNodePtr node, LLView* parent);
|
||||
/*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const;
|
||||
@@ -63,8 +69,6 @@ public:
|
||||
/*virtual*/ void onFocusReceived();
|
||||
/*virtual*/ void onFocusLost();
|
||||
/*virtual*/ BOOL isCtrl() const;
|
||||
/*virtual*/ void setTentative(BOOL b);
|
||||
/*virtual*/ BOOL getTentative() const;
|
||||
|
||||
// From LLFocusableElement
|
||||
/*virtual*/ void setFocus( BOOL b );
|
||||
@@ -77,7 +81,14 @@ public:
|
||||
virtual class LLCtrlListInterface* getListInterface();
|
||||
virtual class LLCtrlScrollInterface* getScrollInterface();
|
||||
|
||||
virtual void setTentative(BOOL b);
|
||||
virtual BOOL getTentative() const;
|
||||
virtual void setValue(const LLSD& value);
|
||||
virtual LLSD getValue() const;
|
||||
/// When two widgets are displaying the same data (e.g. during a skin
|
||||
/// change), share their ViewModel.
|
||||
virtual void shareViewModelFrom(const LLUICtrl& other);
|
||||
|
||||
virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text );
|
||||
virtual void setIsChrome(BOOL is_chrome);
|
||||
|
||||
@@ -141,6 +152,8 @@ protected:
|
||||
|
||||
commit_signal_t* mCommitSignal;
|
||||
enable_signal_t* mValidateSignal;
|
||||
|
||||
LLViewModelPtr mViewModel;
|
||||
void (*mCommitCallback)( LLUICtrl* ctrl, void* userdata );
|
||||
BOOL (*mValidateCallback)( LLUICtrl* ctrl, void* userdata );
|
||||
|
||||
|
||||
@@ -504,16 +504,6 @@ LLRect LLView::getRequiredRect()
|
||||
return mRect;
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLView::onFocusLost()
|
||||
{
|
||||
}
|
||||
|
||||
//virtual
|
||||
void LLView::onFocusReceived()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL LLView::focusNextRoot()
|
||||
{
|
||||
LLView::child_list_t result = LLView::getFocusRootsQuery().run(this);
|
||||
|
||||
@@ -411,10 +411,6 @@ public:
|
||||
BOOL getSaveToXML() const { return mSaveToXML; }
|
||||
void setSaveToXML(BOOL b) { mSaveToXML = b; }
|
||||
|
||||
// inherited from LLFocusableElement
|
||||
/* virtual */ void onFocusLost();
|
||||
/* virtual */ void onFocusReceived();
|
||||
|
||||
typedef enum e_hit_test_type
|
||||
{
|
||||
HIT_TEST_USE_BOUNDING_RECT,
|
||||
|
||||
157
indra/llui/llviewmodel.cpp
Normal file
157
indra/llui/llviewmodel.cpp
Normal file
@@ -0,0 +1,157 @@
|
||||
/**
|
||||
* @file llviewmodel.cpp
|
||||
* @author Nat Goodspeed
|
||||
* @date 2008-08-08
|
||||
* @brief Implementation for llviewmodel.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2008&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
// Precompiled header
|
||||
#include "linden_common.h"
|
||||
// associated header
|
||||
#include "llviewmodel.h"
|
||||
// STL headers
|
||||
// std headers
|
||||
// external library headers
|
||||
// other Linden headers
|
||||
|
||||
///
|
||||
LLViewModel::LLViewModel()
|
||||
: mDirty(false)
|
||||
{
|
||||
}
|
||||
|
||||
/// Instantiate an LLViewModel with an existing data value
|
||||
LLViewModel::LLViewModel(const LLSD& value)
|
||||
: mDirty(false)
|
||||
{
|
||||
setValue(value);
|
||||
}
|
||||
|
||||
/// Update the stored value
|
||||
void LLViewModel::setValue(const LLSD& value)
|
||||
{
|
||||
mValue = value;
|
||||
mDirty = true;
|
||||
}
|
||||
|
||||
LLSD LLViewModel::getValue() const
|
||||
{
|
||||
return mValue;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
///
|
||||
LLTextViewModel::LLTextViewModel()
|
||||
: LLViewModel(false),
|
||||
mUpdateFromDisplay(false)
|
||||
{
|
||||
}
|
||||
|
||||
/// Instantiate an LLViewModel with an existing data value
|
||||
LLTextViewModel::LLTextViewModel(const LLSD& value)
|
||||
: LLViewModel(value),
|
||||
mUpdateFromDisplay(false)
|
||||
{
|
||||
}
|
||||
|
||||
/// Update the stored value
|
||||
void LLTextViewModel::setValue(const LLSD& value)
|
||||
{
|
||||
LLViewModel::setValue(value);
|
||||
mDisplay = utf8str_to_wstring(value.asString());
|
||||
// mDisplay and mValue agree
|
||||
mUpdateFromDisplay = false;
|
||||
}
|
||||
|
||||
void LLTextViewModel::setDisplay(const LLWString& value)
|
||||
{
|
||||
// This is the strange way to alter the value. Normally we'd setValue()
|
||||
// and do the utf8str_to_wstring() to get the corresponding mDisplay
|
||||
// value. But a text editor might want to edit the display string
|
||||
// directly, then convert back to UTF8 on commit.
|
||||
mDisplay = value;
|
||||
mDirty = true;
|
||||
// Don't immediately convert to UTF8 -- do it lazily -- we expect many
|
||||
// more setDisplay() calls than getValue() calls. Just flag that it needs
|
||||
// doing.
|
||||
mUpdateFromDisplay = true;
|
||||
}
|
||||
|
||||
LLSD LLTextViewModel::getValue() const
|
||||
{
|
||||
// Has anyone called setDisplay() since the last setValue()? If so, have
|
||||
// to convert mDisplay back to UTF8.
|
||||
if (mUpdateFromDisplay)
|
||||
{
|
||||
// The fact that we're lazily updating fields in this object should be
|
||||
// transparent to clients, which is why this method is left
|
||||
// conventionally const. Nor do we particularly want to make these
|
||||
// members mutable. Just cast away constness in this one place.
|
||||
LLTextViewModel* nthis = const_cast<LLTextViewModel*>(this);
|
||||
nthis->mUpdateFromDisplay = false;
|
||||
nthis->mValue = wstring_to_utf8str(mDisplay);
|
||||
}
|
||||
return LLViewModel::getValue();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
LLListViewModel::LLListViewModel(const LLSD& values)
|
||||
: LLViewModel()
|
||||
{
|
||||
}
|
||||
|
||||
void LLListViewModel::addColumn(const LLSD& column, EAddPosition pos)
|
||||
{
|
||||
}
|
||||
|
||||
void LLListViewModel::clearColumns()
|
||||
{
|
||||
}
|
||||
|
||||
void LLListViewModel::setColumnLabel(const std::string& column, const std::string& label)
|
||||
{
|
||||
}
|
||||
|
||||
LLScrollListItem* LLListViewModel::addElement(const LLSD& value, EAddPosition pos,
|
||||
void* userdata)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LLScrollListItem* LLListViewModel::addSimpleElement(const std::string& value, EAddPosition pos,
|
||||
const LLSD& id)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void LLListViewModel::clearRows()
|
||||
{
|
||||
}
|
||||
|
||||
void LLListViewModel::sortByColumn(const std::string& name, bool ascending)
|
||||
{
|
||||
}
|
||||
214
indra/llui/llviewmodel.h
Normal file
214
indra/llui/llviewmodel.h
Normal file
@@ -0,0 +1,214 @@
|
||||
/**
|
||||
* @file llviewmodel.h
|
||||
* @author Nat Goodspeed
|
||||
* @date 2008-08-08
|
||||
* @brief Define "View Model" classes intended to store data values for use
|
||||
* by LLUICtrl subclasses. The phrase is borrowed from Microsoft
|
||||
* terminology, in which "View Model" means the storage object
|
||||
* underlying a specific widget object -- as in our case -- rather
|
||||
* than the business "model" object underlying the overall "view"
|
||||
* presented by the collection of widgets.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2008&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#if ! defined(LL_LLVIEWMODEL_H)
|
||||
#define LL_LLVIEWMODEL_H
|
||||
|
||||
#include "llpointer.h"
|
||||
#include "llsd.h"
|
||||
#include "llrefcount.h"
|
||||
#include "stdenums.h"
|
||||
#include "llstring.h"
|
||||
#include <string>
|
||||
|
||||
class LLScrollListItem;
|
||||
|
||||
class LLViewModel;
|
||||
class LLTextViewModel;
|
||||
class LLListViewModel;
|
||||
// Because LLViewModel is derived from LLRefCount, always pass, store
|
||||
// and return LLViewModelPtr rather than plain LLViewModel*.
|
||||
typedef LLPointer<LLViewModel> LLViewModelPtr;
|
||||
typedef LLPointer<LLTextViewModel> LLTextViewModelPtr;
|
||||
typedef LLPointer<LLListViewModel> LLListViewModelPtr;
|
||||
|
||||
/**
|
||||
* LLViewModel stores a scalar LLSD data item, the current display value of a
|
||||
* scalar LLUICtrl widget. LLViewModel subclasses are used to store data
|
||||
* collections used for aggregate widgets. LLViewModel is ref-counted because
|
||||
* -- for multiple skins -- we may have distinct widgets sharing the same
|
||||
* LLViewModel data. This way, the LLViewModel is quietly deleted when the
|
||||
* last referencing widget is destroyed.
|
||||
*/
|
||||
class LLViewModel: public LLRefCount
|
||||
{
|
||||
public:
|
||||
LLViewModel();
|
||||
/// Instantiate an LLViewModel with an existing data value
|
||||
LLViewModel(const LLSD& value);
|
||||
|
||||
/// Update the stored value
|
||||
virtual void setValue(const LLSD& value);
|
||||
/// Get the stored value, in appropriate type.
|
||||
virtual LLSD getValue() const;
|
||||
|
||||
/// Has the value been changed since last time we checked?
|
||||
bool isDirty() const { return mDirty; }
|
||||
/// Once the value has been saved to a file, or otherwise consumed by the
|
||||
/// app, we no longer need to enable the Save button
|
||||
void resetDirty() { mDirty = false; }
|
||||
//
|
||||
void setDirty() { mDirty = true; }
|
||||
|
||||
protected:
|
||||
LLSD mValue;
|
||||
bool mDirty;
|
||||
};
|
||||
|
||||
/**
|
||||
* LLTextViewModel stores a value displayed as text.
|
||||
*/
|
||||
class LLTextViewModel: public LLViewModel
|
||||
{
|
||||
public:
|
||||
LLTextViewModel();
|
||||
/// Instantiate an LLViewModel with an existing data value
|
||||
LLTextViewModel(const LLSD& value);
|
||||
|
||||
// LLViewModel functions
|
||||
virtual void setValue(const LLSD& value);
|
||||
virtual LLSD getValue() const;
|
||||
|
||||
// New functions
|
||||
/// Get the stored value in string form
|
||||
const LLWString& getDisplay() const { return mDisplay; }
|
||||
|
||||
/**
|
||||
* Set the display string directly (see LLTextEditor). What the user is
|
||||
* editing is actually the LLWString value rather than the underlying
|
||||
* UTF-8 value.
|
||||
*/
|
||||
void setDisplay(const LLWString& value);
|
||||
|
||||
private:
|
||||
/// To avoid converting every widget's stored value from LLSD to LLWString
|
||||
/// every frame, cache the converted value
|
||||
LLWString mDisplay;
|
||||
/// As the user edits individual characters (setDisplay()), defer
|
||||
/// LLWString-to-UTF8 conversions until s/he's done.
|
||||
bool mUpdateFromDisplay;
|
||||
};
|
||||
|
||||
/**
|
||||
* LLListViewModel stores a list of data items. The semantics are borrowed
|
||||
* from LLScrollListCtrl.
|
||||
*/
|
||||
class LLListViewModel: public LLViewModel
|
||||
{
|
||||
public:
|
||||
LLListViewModel() {}
|
||||
LLListViewModel(const LLSD& values);
|
||||
|
||||
virtual void addColumn(const LLSD& column, EAddPosition pos = ADD_BOTTOM);
|
||||
virtual void clearColumns();
|
||||
virtual void setColumnLabel(const std::string& column, const std::string& label);
|
||||
virtual LLScrollListItem* addElement(const LLSD& value, EAddPosition pos = ADD_BOTTOM,
|
||||
void* userdata = NULL);
|
||||
virtual LLScrollListItem* addSimpleElement(const std::string& value, EAddPosition pos,
|
||||
const LLSD& id);
|
||||
virtual void clearRows();
|
||||
virtual void sortByColumn(const std::string& name, bool ascending);
|
||||
};
|
||||
|
||||
//namespace LLViewModel
|
||||
//{
|
||||
// class Value
|
||||
// {
|
||||
// public:
|
||||
// Value(const LLSD& value = LLSD());
|
||||
//
|
||||
// LLSD getValue() const { return mValue; }
|
||||
// void setValue(const LLSD& value) { mValue = value; }
|
||||
//
|
||||
// bool isAvailable() const { return false; }
|
||||
// bool isReadOnly() const { return false; }
|
||||
//
|
||||
// bool undo() { return false; }
|
||||
// bool redo() { return false; }
|
||||
//
|
||||
// /// Has the value been changed since last time we checked?
|
||||
// bool isDirty() const { return mDirty; }
|
||||
// /// Once the value has been saved to a file, or otherwise consumed by the
|
||||
// /// app, we no longer need to enable the Save button
|
||||
// void resetDirty() { mDirty = false; }
|
||||
// //
|
||||
// void setDirty() { mDirty = true; }
|
||||
//
|
||||
// protected:
|
||||
// LLSD mValue;
|
||||
// bool mDirty;
|
||||
// };
|
||||
//
|
||||
// class Numeric : public Value
|
||||
// {
|
||||
// public:
|
||||
// Numeric(S32 value = 0);
|
||||
// Numeric(F32 value);
|
||||
//
|
||||
// F32 getPrecision();
|
||||
// F32 getMin();
|
||||
// F32 getMax();
|
||||
//
|
||||
// void increment();
|
||||
// void decrement();
|
||||
// };
|
||||
//
|
||||
// class MultipleValues : public Value
|
||||
// {
|
||||
// class Selector
|
||||
// {};
|
||||
//
|
||||
// MultipleValues();
|
||||
// virtual S32 numElements();
|
||||
// };
|
||||
//
|
||||
// class Tuple : public MultipleValues
|
||||
// {
|
||||
// Tuple(S32 size);
|
||||
// LLSD getValue(S32 which) const;
|
||||
// void setValue(S32 which, const LLSD& value);
|
||||
// };
|
||||
//
|
||||
// class List : public MultipleValues
|
||||
// {
|
||||
// List();
|
||||
//
|
||||
// void add(const ValueModel& value);
|
||||
// bool remove(const Selector& item);
|
||||
//
|
||||
// void setSortElement(const Selector& element);
|
||||
// void sort();
|
||||
// };
|
||||
//
|
||||
//};
|
||||
#endif /* ! defined(LL_LLVIEWMODEL_H) */
|
||||
@@ -65,6 +65,11 @@ class HippoFloaterXmlImpl : public LLFloater
|
||||
private:
|
||||
std::string mName;
|
||||
bool mIsNotifyOnClose;
|
||||
//Must retain handles to unregister notices.
|
||||
typedef boost::signals2::scoped_connection notice_connection_t;
|
||||
typedef boost::shared_ptr<notice_connection_t> notice_ptr_t;
|
||||
|
||||
std::map<LLUICtrl*, notice_ptr_t > mNotices;
|
||||
};
|
||||
|
||||
|
||||
@@ -260,7 +265,7 @@ void HippoFloaterXml::execute(const std::string &cmds)
|
||||
// ********************************************************************
|
||||
// generic notification callbacks
|
||||
|
||||
static void notify(LLUICtrl *ctrl, void *data)
|
||||
static void notifyCallback(LLUICtrl *ctrl)
|
||||
{
|
||||
std::string msg = "NOTIFY:";
|
||||
msg += ctrl->getName();
|
||||
@@ -269,11 +274,6 @@ static void notify(LLUICtrl *ctrl, void *data)
|
||||
send_chat_from_viewer(msg, CHAT_TYPE_WHISPER, CHANNEL);
|
||||
}
|
||||
|
||||
static void notify(void *data)
|
||||
{
|
||||
notify(static_cast<LLUICtrl*>(data), 0);
|
||||
}
|
||||
|
||||
void HippoFloaterXmlImpl::onClose(bool quitting)
|
||||
{
|
||||
if (mIsNotifyOnClose)
|
||||
@@ -324,16 +324,19 @@ bool HippoFloaterXmlImpl::execute(LLUICtrl *ctrl,
|
||||
bool set = (value != "0");
|
||||
if (HippoFloaterXmlImpl *floater = dynamic_cast<HippoFloaterXmlImpl*>(ctrl)) {
|
||||
floater->mIsNotifyOnClose = set;
|
||||
} else if (LLButton *button = dynamic_cast<LLButton*>(ctrl)) {
|
||||
} else if (LLButton *button = dynamic_cast<LLButton*>(ctrl))
|
||||
{
|
||||
if (set)
|
||||
button->setClickedCallback(notify, ctrl);
|
||||
floater->mNotices[button] = notice_ptr_t(new notice_connection_t(button->setClickedCallback(boost::bind(¬ifyCallback, ctrl))));
|
||||
else
|
||||
button->setClickedCallback(0, 0);
|
||||
} else {
|
||||
floater->mNotices.erase(button);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (set)
|
||||
ctrl->setCommitCallback(notify);
|
||||
floater->mNotices[ctrl] = notice_ptr_t(new notice_connection_t(ctrl->setCommitCallback(boost::bind(¬ifyCallback, ctrl))));
|
||||
else
|
||||
ctrl->setCommitCallback(0);
|
||||
floater->mNotices.erase(ctrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,12 +267,13 @@ BOOL LLFloaterAnimPreview::postBuild()
|
||||
{
|
||||
mPlayButton = new LLButton(std::string("play_btn"), LLRect(0,0,0,0));
|
||||
}
|
||||
mPlayButton->setClickedCallback(onBtnPlay);
|
||||
mPlayButton->setCallbackUserData(this);
|
||||
mPlayButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnPlay,this));
|
||||
|
||||
mPlayButton->setImages(std::string("button_anim_play.tga"),
|
||||
std::string("button_anim_play_selected.tga"));
|
||||
mPlayButton->setDisabledImages(LLStringUtil::null,LLStringUtil::null);
|
||||
|
||||
mPlayButton->setImageDisabled(NULL);
|
||||
mPlayButton->setImageDisabledSelected(NULL);
|
||||
|
||||
mPlayButton->setScaleImage(TRUE);
|
||||
|
||||
@@ -281,12 +282,13 @@ BOOL LLFloaterAnimPreview::postBuild()
|
||||
{
|
||||
mStopButton = new LLButton(std::string("stop_btn"), LLRect(0,0,0,0));
|
||||
}
|
||||
mStopButton->setClickedCallback(onBtnStop);
|
||||
mStopButton->setCallbackUserData(this);
|
||||
mStopButton->setClickedCallback(boost::bind(&LLFloaterAnimPreview::onBtnStop, this));
|
||||
|
||||
mStopButton->setImages(std::string("button_anim_stop.tga"),
|
||||
std::string("button_anim_stop_selected.tga"));
|
||||
mStopButton->setDisabledImages(LLStringUtil::null,LLStringUtil::null);
|
||||
|
||||
mStopButton->setImageDisabled(NULL);
|
||||
mStopButton->setImageDisabledSelected(NULL);
|
||||
|
||||
mStopButton->setScaleImage(TRUE);
|
||||
|
||||
|
||||
@@ -224,20 +224,17 @@ LLFloaterColorPicker::
|
||||
postBuild()
|
||||
{
|
||||
mCancelBtn = getChild<LLButton>( "cancel_btn" );
|
||||
mCancelBtn->setClickedCallback ( onClickCancel );
|
||||
mCancelBtn->setCallbackUserData ( this );
|
||||
mCancelBtn->setClickedCallback ( boost::bind(&LLFloaterColorPicker::onClickCancel,this) );
|
||||
|
||||
mSelectBtn = getChild<LLButton>( "select_btn");
|
||||
mSelectBtn->setClickedCallback ( onClickSelect );
|
||||
mSelectBtn->setCallbackUserData ( this );
|
||||
mSelectBtn->setClickedCallback ( boost::bind(&LLFloaterColorPicker::onClickSelect,this) );
|
||||
mSelectBtn->setFocus ( TRUE );
|
||||
|
||||
mPipetteBtn = getChild<LLButton>("color_pipette" );
|
||||
|
||||
mPipetteBtn->setImages(std::string("eye_button_inactive.tga"), std::string("eye_button_active.tga"));
|
||||
|
||||
mPipetteBtn->setClickedCallback( onClickPipette );
|
||||
mPipetteBtn->setCallbackUserData ( this );
|
||||
mPipetteBtn->setClickedCallback( boost::bind(&LLFloaterColorPicker::onClickPipette,this) );
|
||||
|
||||
mApplyImmediateCheck = getChild<LLCheckBoxCtrl>("apply_immediate");
|
||||
mApplyImmediateCheck->set(gSavedSettings.getBOOL("ApplyColorImmediately"));
|
||||
|
||||
@@ -1419,15 +1419,15 @@ LLScrollingPanelParam::LLScrollingPanelParam( const std::string& name,
|
||||
childSetValue("min param text", min_name);
|
||||
childSetValue("max param text", max_name);
|
||||
mLess = getChild<LLButton>("less");
|
||||
mLess->setMouseDownCallback( LLScrollingPanelParam::onHintMinMouseDown );
|
||||
mLess->setMouseUpCallback( LLScrollingPanelParam::onHintMinMouseUp );
|
||||
mLess->setHeldDownCallback( LLScrollingPanelParam::onHintMinHeldDown );
|
||||
mLess->setMouseDownCallback( boost::bind(&LLScrollingPanelParam::onHintMinMouseDown, this) );
|
||||
mLess->setMouseUpCallback( boost::bind(LLScrollingPanelParam::onHintMinMouseUp, this) );
|
||||
mLess->setHeldDownCallback( boost::bind(LLScrollingPanelParam::onHintMinHeldDown, this) );
|
||||
mLess->setHeldDownDelay( PARAM_STEP_TIME_THRESHOLD );
|
||||
|
||||
mMore = getChild<LLButton>("more");
|
||||
mMore->setMouseDownCallback( LLScrollingPanelParam::onHintMaxMouseDown );
|
||||
mMore->setMouseUpCallback( LLScrollingPanelParam::onHintMaxMouseUp );
|
||||
mMore->setHeldDownCallback( LLScrollingPanelParam::onHintMaxHeldDown );
|
||||
mMore->setMouseDownCallback( boost::bind(LLScrollingPanelParam::onHintMaxMouseDown, this) );
|
||||
mMore->setMouseUpCallback( boost::bind(LLScrollingPanelParam::onHintMaxMouseUp, this) );
|
||||
mMore->setHeldDownCallback( boost::bind(LLScrollingPanelParam::onHintMaxHeldDown, this) );
|
||||
mMore->setHeldDownDelay( PARAM_STEP_TIME_THRESHOLD );
|
||||
}
|
||||
else
|
||||
|
||||
@@ -147,25 +147,25 @@ void LLFloaterLagMeter::determineClient()
|
||||
|
||||
if (!gFocusMgr.getAppHasFocus())
|
||||
{
|
||||
mClientButton->setImageUnselected(LAG_GOOD_IMAGE_NAME);
|
||||
mClientButton->setImageUnselected(LLUI::getUIImage(LAG_GOOD_IMAGE_NAME));
|
||||
mClientText->setText( getString("client_frame_time_window_bg_msg", mStringArgs) );
|
||||
mClientCause->setText( LLStringUtil::null );
|
||||
}
|
||||
else if(client_frame_time >= mClientFrameTimeCritical)
|
||||
{
|
||||
mClientButton->setImageUnselected(LAG_CRITICAL_IMAGE_NAME);
|
||||
mClientButton->setImageUnselected(LLUI::getUIImage(LAG_CRITICAL_IMAGE_NAME));
|
||||
mClientText->setText( getString("client_frame_time_critical_msg", mStringArgs) );
|
||||
find_cause = true;
|
||||
}
|
||||
else if(client_frame_time >= mClientFrameTimeWarning)
|
||||
{
|
||||
mClientButton->setImageUnselected(LAG_WARNING_IMAGE_NAME);
|
||||
mClientButton->setImageUnselected(LLUI::getUIImage(LAG_WARNING_IMAGE_NAME));
|
||||
mClientText->setText( getString("client_frame_time_warning_msg", mStringArgs) );
|
||||
find_cause = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
mClientButton->setImageUnselected(LAG_GOOD_IMAGE_NAME);
|
||||
mClientButton->setImageUnselected(LLUI::getUIImage(LAG_GOOD_IMAGE_NAME));
|
||||
mClientText->setText( getString("client_frame_time_normal_msg", mStringArgs) );
|
||||
mClientCause->setText( LLStringUtil::null );
|
||||
}
|
||||
@@ -206,13 +206,13 @@ void LLFloaterLagMeter::determineNetwork()
|
||||
|
||||
if(packet_loss >= mNetworkPacketLossCritical)
|
||||
{
|
||||
mNetworkButton->setImageUnselected(LAG_CRITICAL_IMAGE_NAME);
|
||||
mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_CRITICAL_IMAGE_NAME));
|
||||
mNetworkText->setText( getString("network_packet_loss_critical_msg", mStringArgs) );
|
||||
find_cause_loss = true;
|
||||
}
|
||||
else if(ping_time >= mNetworkPingCritical)
|
||||
{
|
||||
mNetworkButton->setImageUnselected(LAG_CRITICAL_IMAGE_NAME);
|
||||
mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_CRITICAL_IMAGE_NAME));
|
||||
if (client_frame_time_ms < mNetworkPingCritical)
|
||||
{
|
||||
mNetworkText->setText( getString("network_ping_critical_msg", mStringArgs) );
|
||||
@@ -221,13 +221,13 @@ void LLFloaterLagMeter::determineNetwork()
|
||||
}
|
||||
else if(packet_loss >= mNetworkPacketLossWarning)
|
||||
{
|
||||
mNetworkButton->setImageUnselected(LAG_WARNING_IMAGE_NAME);
|
||||
mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_WARNING_IMAGE_NAME));
|
||||
mNetworkText->setText( getString("network_packet_loss_warning_msg", mStringArgs) );
|
||||
find_cause_loss = true;
|
||||
}
|
||||
else if(ping_time >= mNetworkPingWarning)
|
||||
{
|
||||
mNetworkButton->setImageUnselected(LAG_WARNING_IMAGE_NAME);
|
||||
mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_WARNING_IMAGE_NAME));
|
||||
if (client_frame_time_ms < mNetworkPingWarning)
|
||||
{
|
||||
mNetworkText->setText( getString("network_ping_warning_msg", mStringArgs) );
|
||||
@@ -236,7 +236,7 @@ void LLFloaterLagMeter::determineNetwork()
|
||||
}
|
||||
else
|
||||
{
|
||||
mNetworkButton->setImageUnselected(LAG_GOOD_IMAGE_NAME);
|
||||
mNetworkButton->setImageUnselected(LLUI::getUIImage(LAG_GOOD_IMAGE_NAME));
|
||||
mNetworkText->setText( getString("network_performance_normal_msg", mStringArgs) );
|
||||
}
|
||||
|
||||
@@ -261,19 +261,19 @@ void LLFloaterLagMeter::determineServer()
|
||||
|
||||
if(sim_frame_time >= mServerFrameTimeCritical)
|
||||
{
|
||||
mServerButton->setImageUnselected(LAG_CRITICAL_IMAGE_NAME);
|
||||
mServerButton->setImageUnselected(LLUI::getUIImage(LAG_CRITICAL_IMAGE_NAME));
|
||||
mServerText->setText( getString("server_frame_time_critical_msg", mStringArgs) );
|
||||
find_cause = true;
|
||||
}
|
||||
else if(sim_frame_time >= mServerFrameTimeWarning)
|
||||
{
|
||||
mServerButton->setImageUnselected(LAG_WARNING_IMAGE_NAME);
|
||||
mServerButton->setImageUnselected(LLUI::getUIImage(LAG_WARNING_IMAGE_NAME));
|
||||
mServerText->setText( getString("server_frame_time_warning_msg", mStringArgs) );
|
||||
find_cause = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
mServerButton->setImageUnselected(LAG_GOOD_IMAGE_NAME);
|
||||
mServerButton->setImageUnselected(LLUI::getUIImage(LAG_GOOD_IMAGE_NAME));
|
||||
mServerText->setText( getString("server_frame_time_normal_msg", mStringArgs) );
|
||||
mServerCause->setText( LLStringUtil::null );
|
||||
}
|
||||
|
||||
@@ -180,8 +180,41 @@ void* LLFloaterTools::createPanelLandInfo(void* data)
|
||||
return floater->mPanelLandInfo;
|
||||
}
|
||||
|
||||
static const std::string toolNames[]={
|
||||
"ToolCube",
|
||||
"ToolPrism",
|
||||
"ToolPyramid",
|
||||
"ToolTetrahedron",
|
||||
"ToolCylinder",
|
||||
"ToolHemiCylinder",
|
||||
"ToolCone",
|
||||
"ToolHemiCone",
|
||||
"ToolSphere",
|
||||
"ToolHemiSphere",
|
||||
"ToolTorus",
|
||||
"ToolTube",
|
||||
"ToolRing",
|
||||
"ToolTree",
|
||||
"ToolGrass"};
|
||||
LLPCode toolData[]={
|
||||
LL_PCODE_CUBE,
|
||||
LL_PCODE_PRISM,
|
||||
LL_PCODE_PYRAMID,
|
||||
LL_PCODE_TETRAHEDRON,
|
||||
LL_PCODE_CYLINDER,
|
||||
LL_PCODE_CYLINDER_HEMI,
|
||||
LL_PCODE_CONE,
|
||||
LL_PCODE_CONE_HEMI,
|
||||
LL_PCODE_SPHERE,
|
||||
LL_PCODE_SPHERE_HEMI,
|
||||
LL_PCODE_TORUS,
|
||||
LLViewerObject::LL_VO_SQUARE_TORUS,
|
||||
LLViewerObject::LL_VO_TRIANGLE_TORUS,
|
||||
LL_PCODE_LEGACY_TREE,
|
||||
LL_PCODE_LEGACY_GRASS};
|
||||
|
||||
BOOL LLFloaterTools::postBuild()
|
||||
{
|
||||
{
|
||||
|
||||
// Hide until tool selected
|
||||
setVisible(FALSE);
|
||||
@@ -250,44 +283,12 @@ BOOL LLFloaterTools::postBuild()
|
||||
// Create Buttons
|
||||
//
|
||||
|
||||
static const std::string toolNames[]={
|
||||
"ToolCube",
|
||||
"ToolPrism",
|
||||
"ToolPyramid",
|
||||
"ToolTetrahedron",
|
||||
"ToolCylinder",
|
||||
"ToolHemiCylinder",
|
||||
"ToolCone",
|
||||
"ToolHemiCone",
|
||||
"ToolSphere",
|
||||
"ToolHemiSphere",
|
||||
"ToolTorus",
|
||||
"ToolTube",
|
||||
"ToolRing",
|
||||
"ToolTree",
|
||||
"ToolGrass"};
|
||||
void* toolData[]={
|
||||
&LLToolPlacerPanel::sCube,
|
||||
&LLToolPlacerPanel::sPrism,
|
||||
&LLToolPlacerPanel::sPyramid,
|
||||
&LLToolPlacerPanel::sTetrahedron,
|
||||
&LLToolPlacerPanel::sCylinder,
|
||||
&LLToolPlacerPanel::sCylinderHemi,
|
||||
&LLToolPlacerPanel::sCone,
|
||||
&LLToolPlacerPanel::sConeHemi,
|
||||
&LLToolPlacerPanel::sSphere,
|
||||
&LLToolPlacerPanel::sSphereHemi,
|
||||
&LLToolPlacerPanel::sTorus,
|
||||
&LLToolPlacerPanel::sSquareTorus,
|
||||
&LLToolPlacerPanel::sTriangleTorus,
|
||||
&LLToolPlacerPanel::sTree,
|
||||
&LLToolPlacerPanel::sGrass};
|
||||
for(size_t t=0; t<LL_ARRAY_SIZE(toolNames); ++t)
|
||||
{
|
||||
LLButton *found = getChild<LLButton>(toolNames[t]);
|
||||
if(found)
|
||||
{
|
||||
found->setClickedCallback(setObjectType,toolData[t]);
|
||||
found->setClickedCallback(boost::bind(&LLFloaterTools::setObjectType, toolData[t]));
|
||||
mButtons.push_back( found );
|
||||
}
|
||||
else
|
||||
@@ -737,15 +738,13 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
|
||||
else
|
||||
{
|
||||
// Highlight the correct placer button
|
||||
for( std::vector<LLButton*>::size_type i = 0; i < mButtons.size(); i++ )
|
||||
for( S32 t = 0; t < (S32)mButtons.size(); t++ )
|
||||
{
|
||||
LLPCode pcode = LLToolPlacer::getObjectType();
|
||||
void *userdata = mButtons[i]->getCallbackUserData();
|
||||
LLPCode *cur = (LLPCode*) userdata;
|
||||
|
||||
BOOL state = (pcode == *cur);
|
||||
mButtons[i]->setToggleState( state );
|
||||
mButtons[i]->setVisible( create_visible );
|
||||
LLPCode button_pcode = toolData[t];
|
||||
BOOL state = (pcode == button_pcode);
|
||||
mButtons[t]->setToggleState( state );
|
||||
mButtons[t]->setVisible( create_visible );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1034,9 +1033,8 @@ void commit_grid_mode(LLUICtrl *ctrl, void *data)
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterTools::setObjectType( void* data )
|
||||
void LLFloaterTools::setObjectType( LLPCode pcode )
|
||||
{
|
||||
LLPCode pcode = *(LLPCode*) data;
|
||||
LLToolPlacer::setObjectType( pcode );
|
||||
gSavedSettings.setBOOL("CreateToolCopySelection", FALSE);
|
||||
gFocusMgr.setMouseCapture(NULL);
|
||||
@@ -1067,11 +1065,11 @@ void LLFloaterTools::onSelectTreesGrass(LLUICtrl*, void*)
|
||||
{
|
||||
const std::string &selected = gFloaterTools->mComboTreesGrass->getValue();
|
||||
LLPCode pcode = LLToolPlacer::getObjectType();
|
||||
if (pcode == LLToolPlacerPanel::sTree)
|
||||
if (pcode == LL_PCODE_LEGACY_TREE)
|
||||
{
|
||||
gSavedSettings.setString("LastTree", selected);
|
||||
}
|
||||
else if (pcode == LLToolPlacerPanel::sGrass)
|
||||
else if (pcode == LL_PCODE_LEGACY_GRASS)
|
||||
{
|
||||
gSavedSettings.setString("LastGrass", selected);
|
||||
}
|
||||
@@ -1085,7 +1083,7 @@ void LLFloaterTools::updateTreeGrassCombo(bool visible)
|
||||
LLPCode pcode = LLToolPlacer::getObjectType();
|
||||
std::map<std::string, S32>::iterator it, end;
|
||||
std::string selected;
|
||||
if (pcode == LLToolPlacerPanel::sTree)
|
||||
if (pcode == LL_PCODE_LEGACY_TREE)
|
||||
{
|
||||
tree_grass_label->setVisible(visible);
|
||||
LLButton* button = getChild<LLButton>("ToolTree");
|
||||
@@ -1095,7 +1093,7 @@ void LLFloaterTools::updateTreeGrassCombo(bool visible)
|
||||
it = LLVOTree::sSpeciesNames.begin();
|
||||
end = LLVOTree::sSpeciesNames.end();
|
||||
}
|
||||
else if (pcode == LLToolPlacerPanel::sGrass)
|
||||
else if (pcode == LL_PCODE_LEGACY_GRASS)
|
||||
{
|
||||
tree_grass_label->setVisible(visible);
|
||||
LLButton* button = getChild<LLButton>("ToolGrass");
|
||||
|
||||
@@ -103,10 +103,10 @@ public:
|
||||
static void setEditTool(void* data);
|
||||
void saveLastTool();
|
||||
private:
|
||||
static void setObjectType( void* data );
|
||||
|
||||
|
||||
void refresh();
|
||||
|
||||
static void setObjectType( LLPCode pcode );
|
||||
static void onClickGridOptions(void* data);
|
||||
|
||||
public:
|
||||
|
||||
@@ -78,8 +78,7 @@ LLJoystick::LLJoystick(
|
||||
mHeldDown(FALSE),
|
||||
mHeldDownTimer()
|
||||
{
|
||||
setHeldDownCallback(&LLJoystick::onHeldDown);
|
||||
setCallbackUserData(this);
|
||||
setHeldDownCallback(boost::bind(&LLJoystick::onHeldDownCallback,this));
|
||||
}
|
||||
|
||||
|
||||
@@ -178,7 +177,7 @@ F32 LLJoystick::getElapsedHeldDownTime()
|
||||
}
|
||||
|
||||
// static
|
||||
void LLJoystick::onHeldDown(void *userdata)
|
||||
void LLJoystick::onHeldDownCallback(void *userdata)
|
||||
{
|
||||
LLJoystick *self = (LLJoystick *)userdata;
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
virtual void onHeldDown() = 0;
|
||||
F32 getElapsedHeldDownTime();
|
||||
|
||||
static void onHeldDown(void *userdata); // called by llbutton callback handler
|
||||
static void onHeldDownCallback(void *userdata); // called by llbutton callback handler
|
||||
void setInitialQuadrant(EJoystickQuadrant initial) { mInitialQuadrant = initial; };
|
||||
|
||||
virtual LLXMLNodePtr getXML(bool save_children = true) const;
|
||||
|
||||
@@ -81,21 +81,21 @@ LLFloaterMove::LLFloaterMove(const LLSD& key)
|
||||
|
||||
mTurnLeftButton = getChild<LLButton>("turn left btn");
|
||||
mTurnLeftButton->setHeldDownDelay(MOVE_BUTTON_DELAY);
|
||||
mTurnLeftButton->setHeldDownCallback( turnLeft );
|
||||
mTurnLeftButton->setHeldDownCallback( boost::bind(&LLFloaterMove::turnLeft, this) );
|
||||
|
||||
mTurnRightButton = getChild<LLButton>("turn right btn");
|
||||
mTurnRightButton->setHeldDownDelay(MOVE_BUTTON_DELAY);
|
||||
mTurnRightButton->setHeldDownCallback( turnRight );
|
||||
mTurnRightButton->setHeldDownCallback( boost::bind(&LLFloaterMove::turnRight, this) );
|
||||
|
||||
mMoveUpButton = getChild<LLButton>("move up btn");
|
||||
childSetAction("move up btn",moveUp,NULL);
|
||||
mMoveUpButton->setHeldDownDelay(MOVE_BUTTON_DELAY);
|
||||
mMoveUpButton->setHeldDownCallback( moveUp );
|
||||
mMoveUpButton->setHeldDownCallback( boost::bind(&LLFloaterMove::moveUp, this) );
|
||||
|
||||
mMoveDownButton = getChild<LLButton>("move down btn");
|
||||
childSetAction("move down btn",moveDown,NULL);
|
||||
mMoveDownButton->setHeldDownDelay(MOVE_BUTTON_DELAY);
|
||||
mMoveDownButton->setHeldDownCallback( moveDown );
|
||||
mMoveDownButton->setHeldDownCallback( boost::bind(&LLFloaterMove::moveDown, this) );
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
||||
@@ -270,22 +270,18 @@ BOOL LLPanelClassified::postBuild()
|
||||
mLocationEditor = getChild<LLLineEditor>("location_editor");
|
||||
|
||||
mSetBtn = getChild<LLButton>( "set_location_btn");
|
||||
mSetBtn->setClickedCallback(onClickSet);
|
||||
mSetBtn->setCallbackUserData(this);
|
||||
mSetBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickSet, this));
|
||||
|
||||
mTeleportBtn = getChild<LLButton>( "classified_teleport_btn");
|
||||
mTeleportBtn->setClickedCallback(onClickTeleport);
|
||||
mTeleportBtn->setCallbackUserData(this);
|
||||
mTeleportBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickTeleport, this));
|
||||
|
||||
mMapBtn = getChild<LLButton>( "classified_map_btn");
|
||||
mMapBtn->setClickedCallback(onClickMap);
|
||||
mMapBtn->setCallbackUserData(this);
|
||||
mMapBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickMap, this));
|
||||
|
||||
if(mInFinder)
|
||||
{
|
||||
mProfileBtn = getChild<LLButton>( "classified_profile_btn");
|
||||
mProfileBtn->setClickedCallback(onClickProfile);
|
||||
mProfileBtn->setCallbackUserData(this);
|
||||
mProfileBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickProfile, this));
|
||||
}
|
||||
|
||||
mCategoryCombo = getChild<LLComboBox>( "classified_category_combo");
|
||||
@@ -319,7 +315,7 @@ BOOL LLPanelClassified::postBuild()
|
||||
}
|
||||
|
||||
mUpdateBtn = getChild<LLButton>("classified_update_btn");
|
||||
mUpdateBtn->setClickedCallback(onClickUpdate);
|
||||
mUpdateBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickUpdate, this));
|
||||
mUpdateBtn->setCallbackUserData(this);
|
||||
|
||||
if (!mInFinder)
|
||||
|
||||
@@ -89,20 +89,16 @@ BOOL LLPanelEvent::postBuild()
|
||||
mTBCover = getChild<LLTextBox>("event_cover");
|
||||
|
||||
mTeleportBtn = getChild<LLButton>( "teleport_btn");
|
||||
mTeleportBtn->setClickedCallback(onClickTeleport);
|
||||
mTeleportBtn->setCallbackUserData(this);
|
||||
mTeleportBtn->setClickedCallback(boost::bind(&LLPanelEvent::onClickTeleport,this));
|
||||
|
||||
mMapBtn = getChild<LLButton>( "map_btn");
|
||||
mMapBtn->setClickedCallback(onClickMap);
|
||||
mMapBtn->setCallbackUserData(this);
|
||||
mMapBtn->setClickedCallback(boost::bind(&LLPanelEvent::onClickMap,this));
|
||||
|
||||
mNotifyBtn = getChild<LLButton>( "notify_btn");
|
||||
mNotifyBtn->setClickedCallback(onClickNotify);
|
||||
mNotifyBtn->setCallbackUserData(this);
|
||||
mNotifyBtn->setClickedCallback(boost::bind(&LLPanelEvent::onClickNotify,this));
|
||||
|
||||
mCreateEventBtn = getChild<LLButton>( "create_event_btn");
|
||||
mCreateEventBtn->setClickedCallback(onClickCreateEvent);
|
||||
mCreateEventBtn->setCallbackUserData(this);
|
||||
mCreateEventBtn->setClickedCallback(boost::bind(&LLPanelEvent::onClickCreateEvent,this));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -72,8 +72,7 @@ BOOL LLPanelGroupTab::postBuild()
|
||||
LLButton* button = getChild<LLButton>("help_button");
|
||||
if (button)
|
||||
{
|
||||
button->setClickedCallback(onClickHelp);
|
||||
button->setCallbackUserData(this);
|
||||
button->setClickedCallback(boost::bind(&LLPanelGroupTab::onClickHelp,this));
|
||||
}
|
||||
|
||||
mHelpText = getString("help_text");
|
||||
@@ -267,23 +266,21 @@ BOOL LLPanelGroup::postBuild()
|
||||
LLButton* button = getChild<LLButton>("btn_ok");
|
||||
if (button)
|
||||
{
|
||||
button->setClickedCallback(onBtnOK);
|
||||
button->setCallbackUserData(this);
|
||||
button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnOK,this));
|
||||
button->setVisible(mAllowEdit);
|
||||
}
|
||||
|
||||
button = getChild<LLButton>("btn_cancel");
|
||||
if (button)
|
||||
{
|
||||
button->setClickedCallback(onBtnCancel);
|
||||
button->setCallbackUserData(this);
|
||||
button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnCancel,this));
|
||||
button->setVisible(mAllowEdit);
|
||||
}
|
||||
|
||||
button = getChild<LLButton>("btn_apply");
|
||||
if (button)
|
||||
{
|
||||
button->setClickedCallback(onBtnApply);
|
||||
button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnApply,this));
|
||||
button->setVisible(mAllowEdit);
|
||||
button->setEnabled(FALSE);
|
||||
|
||||
@@ -293,8 +290,7 @@ BOOL LLPanelGroup::postBuild()
|
||||
button = getChild<LLButton>("btn_refresh");
|
||||
if (button)
|
||||
{
|
||||
button->setClickedCallback(onBtnRefresh);
|
||||
button->setCallbackUserData(this);
|
||||
button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnRefresh,this));
|
||||
button->setVisible(mAllowEdit);
|
||||
}
|
||||
|
||||
|
||||
@@ -135,15 +135,13 @@ BOOL LLPanelGroupGeneral::postBuild()
|
||||
mBtnJoinGroup = getChild<LLButton>("join_button", recurse);
|
||||
if ( mBtnJoinGroup )
|
||||
{
|
||||
mBtnJoinGroup->setClickedCallback(onClickJoin);
|
||||
mBtnJoinGroup->setCallbackUserData(this);
|
||||
mBtnJoinGroup->setClickedCallback(boost::bind(&LLPanelGroupGeneral::onClickJoin, this));
|
||||
}
|
||||
|
||||
mBtnInfo = getChild<LLButton>("info_button", recurse);
|
||||
if ( mBtnInfo )
|
||||
{
|
||||
mBtnInfo->setClickedCallback(onClickInfo);
|
||||
mBtnInfo->setCallbackUserData(this);
|
||||
mBtnInfo->setClickedCallback(boost::bind(&LLPanelGroupGeneral::onClickInfo, this));
|
||||
}
|
||||
|
||||
LLTextBox* founder = getChild<LLTextBox>("founder_name");
|
||||
@@ -158,7 +156,7 @@ BOOL LLPanelGroupGeneral::postBuild()
|
||||
mListVisibleMembers = getChild<LLNameListCtrl>("visible_members", recurse);
|
||||
if (mListVisibleMembers)
|
||||
{
|
||||
mListVisibleMembers->setDoubleClickCallback(openProfile);
|
||||
mListVisibleMembers->setDoubleClickCallback(&LLPanelGroupGeneral::openProfile);
|
||||
mListVisibleMembers->setCallbackUserData(this);
|
||||
}
|
||||
|
||||
@@ -166,7 +164,7 @@ BOOL LLPanelGroupGeneral::postBuild()
|
||||
mCtrlShowInGroupList = getChild<LLCheckBoxCtrl>("show_in_group_list", recurse);
|
||||
if (mCtrlShowInGroupList)
|
||||
{
|
||||
mCtrlShowInGroupList->setCommitCallback(onCommitAny);
|
||||
mCtrlShowInGroupList->setCommitCallback(&LLPanelGroupGeneral::onCommitAny);
|
||||
mCtrlShowInGroupList->setCallbackUserData(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -527,17 +527,14 @@ BOOL LLPanelGroupInvite::postBuild()
|
||||
{
|
||||
// default to opening avatarpicker automatically
|
||||
// (*impl::callbackClickAdd)((void*)this);
|
||||
button->setClickedCallback(impl::callbackClickAdd);
|
||||
button->setCallbackUserData(this);
|
||||
button->setClickedCallback(boost::bind(&impl::callbackClickAdd, this));
|
||||
}
|
||||
|
||||
mImplementation->mRemoveButton =
|
||||
getChild<LLButton>("remove_button", recurse);
|
||||
if ( mImplementation->mRemoveButton )
|
||||
{
|
||||
mImplementation->mRemoveButton->
|
||||
setClickedCallback(impl::callbackClickRemove);
|
||||
mImplementation->mRemoveButton->setCallbackUserData(mImplementation);
|
||||
mImplementation->mRemoveButton->setClickedCallback(boost::bind(&impl::callbackClickRemove, mImplementation));
|
||||
mImplementation->mRemoveButton->setEnabled(FALSE);
|
||||
}
|
||||
|
||||
@@ -545,17 +542,14 @@ BOOL LLPanelGroupInvite::postBuild()
|
||||
getChild<LLButton>("ok_button", recurse);
|
||||
if ( mImplementation->mOKButton )
|
||||
{
|
||||
mImplementation->mOKButton->
|
||||
setClickedCallback(impl::callbackClickOK);
|
||||
mImplementation->mOKButton->setCallbackUserData(mImplementation);
|
||||
mImplementation->mOKButton->setClickedCallback(boost::bind(&impl::callbackClickOK, mImplementation));
|
||||
mImplementation->mOKButton->setEnabled(FALSE);
|
||||
}
|
||||
|
||||
button = getChild<LLButton>("cancel_button", recurse);
|
||||
if ( button )
|
||||
{
|
||||
button->setClickedCallback(impl::callbackClickCancel);
|
||||
button->setCallbackUserData(mImplementation);
|
||||
button->setClickedCallback(boost::bind(&impl::callbackClickCancel,mImplementation));
|
||||
}
|
||||
|
||||
mImplementation->mOwnerWarning = getString("confirm_invite_owner_str");
|
||||
|
||||
@@ -654,7 +654,7 @@ BOOL LLPanelGroupLandMoney::postBuild()
|
||||
|
||||
if ( mImplementationp->mMapButtonp )
|
||||
{
|
||||
mImplementationp->mMapButtonp->setClickedCallback(LLPanelGroupLandMoney::impl::mapCallback, mImplementationp);
|
||||
mImplementationp->mMapButtonp->setClickedCallback(boost::bind(&LLPanelGroupLandMoney::impl::mapCallback, mImplementationp));
|
||||
}
|
||||
|
||||
if ( mImplementationp->mGroupOverLimitTextp )
|
||||
|
||||
@@ -220,13 +220,11 @@ BOOL LLPanelGroupNotices::postBuild()
|
||||
mNoticesList->setCallbackUserData(this);
|
||||
|
||||
mBtnNewMessage = getChild<LLButton>("create_new_notice",recurse);
|
||||
mBtnNewMessage->setClickedCallback(onClickNewMessage);
|
||||
mBtnNewMessage->setCallbackUserData(this);
|
||||
mBtnNewMessage->setClickedCallback(boost::bind(&LLPanelGroupNotices::onClickNewMessage,this));
|
||||
mBtnNewMessage->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_NOTICES_SEND));
|
||||
|
||||
mBtnGetPastNotices = getChild<LLButton>("refresh_notices",recurse);
|
||||
mBtnGetPastNotices->setClickedCallback(onClickRefreshNotices);
|
||||
mBtnGetPastNotices->setCallbackUserData(this);
|
||||
mBtnGetPastNotices->setClickedCallback(boost::bind(&LLPanelGroupNotices::onClickRefreshNotices,this));
|
||||
|
||||
// Create
|
||||
mCreateSubject = getChild<LLLineEditor>("create_subject",recurse);
|
||||
@@ -240,12 +238,10 @@ BOOL LLPanelGroupNotices::postBuild()
|
||||
mCreateInventoryIcon->setVisible(FALSE);
|
||||
|
||||
mBtnSendMessage = getChild<LLButton>("send_notice",recurse);
|
||||
mBtnSendMessage->setClickedCallback(onClickSendMessage);
|
||||
mBtnSendMessage->setCallbackUserData(this);
|
||||
mBtnSendMessage->setClickedCallback(boost::bind(&LLPanelGroupNotices::onClickSendMessage,this));
|
||||
|
||||
mBtnRemoveAttachment = getChild<LLButton>("remove_attachment",recurse);
|
||||
mBtnRemoveAttachment->setClickedCallback(onClickRemoveAttachment);
|
||||
mBtnRemoveAttachment->setCallbackUserData(this);
|
||||
mBtnRemoveAttachment->setClickedCallback(boost::bind(&LLPanelGroupNotices::onClickRemoveAttachment,this));
|
||||
mBtnRemoveAttachment->setEnabled(FALSE);
|
||||
|
||||
// View
|
||||
@@ -261,8 +257,7 @@ BOOL LLPanelGroupNotices::postBuild()
|
||||
mViewInventoryIcon->setVisible(FALSE);
|
||||
|
||||
mBtnOpenAttachment = getChild<LLButton>("open_attachment",recurse);
|
||||
mBtnOpenAttachment->setClickedCallback(onClickOpenAttachment);
|
||||
mBtnOpenAttachment->setCallbackUserData(this);
|
||||
mBtnOpenAttachment->setClickedCallback(boost::bind(&LLPanelGroupNotices::onClickOpenAttachment,this));
|
||||
|
||||
mNoNoticesStr = getString("no_notices_text");
|
||||
|
||||
|
||||
@@ -501,15 +501,13 @@ BOOL LLPanelGroupSubTab::postBuild()
|
||||
mSearchButton = getChild<LLButton>("search_button", recurse);
|
||||
|
||||
if (!mSearchButton) return FALSE;
|
||||
mSearchButton->setClickedCallback(onClickSearch);
|
||||
mSearchButton->setCallbackUserData(this);
|
||||
mSearchButton->setClickedCallback(boost::bind(&LLPanelGroupSubTab::onClickSearch,this));
|
||||
mSearchButton->setEnabled(FALSE);
|
||||
|
||||
mShowAllButton = getChild<LLButton>("show_all_button", recurse);
|
||||
|
||||
if (!mShowAllButton) return FALSE;
|
||||
mShowAllButton->setClickedCallback(onClickShowAll);
|
||||
mShowAllButton->setCallbackUserData(this);
|
||||
mShowAllButton->setClickedCallback(boost::bind(&LLPanelGroupSubTab::onClickShowAll,this));
|
||||
mShowAllButton->setEnabled(FALSE);
|
||||
|
||||
// Get icons for later use.
|
||||
@@ -665,8 +663,7 @@ bool LLPanelGroupSubTab::matchesActionSearchFilter(std::string action)
|
||||
void LLPanelGroupSubTab::buildActionsList(LLScrollListCtrl* ctrl,
|
||||
U64 allowed_by_some,
|
||||
U64 allowed_by_all,
|
||||
icon_map_t& icons,
|
||||
void (*commit_callback)(LLUICtrl*,void*),
|
||||
LLUICtrl::commit_callback_t commit_callback,
|
||||
BOOL show_all,
|
||||
BOOL filter,
|
||||
BOOL is_owner_role)
|
||||
@@ -686,7 +683,6 @@ void LLPanelGroupSubTab::buildActionsList(LLScrollListCtrl* ctrl,
|
||||
allowed_by_some,
|
||||
allowed_by_all,
|
||||
(*ras_it),
|
||||
icons,
|
||||
commit_callback,
|
||||
show_all,
|
||||
filter,
|
||||
@@ -698,8 +694,7 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl,
|
||||
U64 allowed_by_some,
|
||||
U64 allowed_by_all,
|
||||
LLRoleActionSet* action_set,
|
||||
icon_map_t& icons,
|
||||
void (*commit_callback)(LLUICtrl*,void*),
|
||||
LLUICtrl::commit_callback_t commit_callback,
|
||||
BOOL show_all,
|
||||
BOOL filter,
|
||||
BOOL is_owner_role)
|
||||
@@ -712,10 +707,11 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl,
|
||||
LLSD row;
|
||||
|
||||
row["columns"][0]["column"] = "icon";
|
||||
icon_map_t::iterator iter = icons.find("folder");
|
||||
if (iter != icons.end())
|
||||
row["columns"][0]["type"] = "icon";
|
||||
|
||||
icon_map_t::iterator iter = mActionIcons.find("folder");
|
||||
if (iter != mActionIcons.end())
|
||||
{
|
||||
row["columns"][0]["type"] = "icon";
|
||||
row["columns"][0]["value"] = (*iter).second;
|
||||
}
|
||||
|
||||
@@ -777,8 +773,8 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl,
|
||||
{
|
||||
if (show_full_strength)
|
||||
{
|
||||
icon_map_t::iterator iter = icons.find("full");
|
||||
if (iter != icons.end())
|
||||
icon_map_t::iterator iter = mActionIcons.find("full");
|
||||
if (iter != mActionIcons.end())
|
||||
{
|
||||
row["columns"][column_index]["column"] = "checkbox";
|
||||
row["columns"][column_index]["type"] = "icon";
|
||||
@@ -788,8 +784,8 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl,
|
||||
}
|
||||
else
|
||||
{
|
||||
icon_map_t::iterator iter = icons.find("partial");
|
||||
if (iter != icons.end())
|
||||
icon_map_t::iterator iter = mActionIcons.find("partial");
|
||||
if (iter != mActionIcons.end())
|
||||
{
|
||||
row["columns"][column_index]["column"] = "checkbox";
|
||||
row["columns"][column_index]["type"] = "icon";
|
||||
@@ -813,7 +809,6 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl,
|
||||
LLCheckBoxCtrl* check = check_cell->getCheckBox();
|
||||
check->setEnabled(can_change_actions);
|
||||
check->setCommitCallback(commit_callback);
|
||||
check->setCallbackUserData(ctrl->getCallbackUserData());
|
||||
check->setToolTip( check->getLabel() );
|
||||
|
||||
if (show_all)
|
||||
@@ -912,16 +907,14 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root)
|
||||
LLButton* button = parent->getChild<LLButton>("member_invite", recurse);
|
||||
if ( button )
|
||||
{
|
||||
button->setClickedCallback(onInviteMember);
|
||||
button->setCallbackUserData(this);
|
||||
button->setClickedCallback(boost::bind(&LLPanelGroupMembersSubTab::onInviteMember,this));
|
||||
button->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_INVITE));
|
||||
}
|
||||
|
||||
mEjectBtn = parent->getChild<LLButton>("member_eject", recurse);
|
||||
if ( mEjectBtn )
|
||||
{
|
||||
mEjectBtn->setClickedCallback(onEjectMembers);
|
||||
mEjectBtn->setCallbackUserData(this);
|
||||
mEjectBtn->setClickedCallback(boost::bind(&LLPanelGroupMembersSubTab::onEjectMembers,this));
|
||||
mEjectBtn->setEnabled(FALSE);
|
||||
}
|
||||
|
||||
@@ -956,7 +949,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
|
||||
if (selection.empty()) return;
|
||||
|
||||
// Build a vector of all selected members, and gather allowed actions.
|
||||
std::vector<LLUUID> selected_members;
|
||||
uuid_vec_t selected_members;
|
||||
U64 allowed_by_all = 0xffffffffffffLL;
|
||||
U64 allowed_by_some = 0;
|
||||
|
||||
@@ -964,10 +957,12 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
|
||||
for (itor = selection.begin();
|
||||
itor != selection.end(); ++itor)
|
||||
{
|
||||
selected_members.push_back( (*itor)->getUUID() );
|
||||
LLUUID member_id = (*itor)->getUUID();
|
||||
|
||||
selected_members.push_back( member_id );
|
||||
// Get this member's power mask including any unsaved changes
|
||||
|
||||
U64 powers = getAgentPowersBasedOnRoleChanges((*itor)->getUUID());
|
||||
U64 powers = getAgentPowersBasedOnRoleChanges( member_id );
|
||||
|
||||
allowed_by_all &= powers;
|
||||
allowed_by_some |= powers;
|
||||
@@ -980,7 +975,6 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
|
||||
buildActionsList(mAllowedActionsList,
|
||||
allowed_by_some,
|
||||
allowed_by_all,
|
||||
mActionIcons,
|
||||
NULL,
|
||||
FALSE,
|
||||
FALSE,
|
||||
@@ -1021,8 +1015,8 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
|
||||
if (cb_enable && (count > 0) && role_id == gdatap->mOwnerRole)
|
||||
{
|
||||
// Check if any owners besides this agent are selected.
|
||||
std::vector<LLUUID>::const_iterator member_iter;
|
||||
std::vector<LLUUID>::const_iterator member_end =
|
||||
uuid_vec_t::const_iterator member_iter;
|
||||
uuid_vec_t::const_iterator member_end =
|
||||
selected_members.end();
|
||||
for (member_iter = selected_members.begin();
|
||||
member_iter != member_end;
|
||||
@@ -1048,7 +1042,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
|
||||
|
||||
//now see if there are any role changes for the selected
|
||||
//members and remember to include them
|
||||
std::vector<LLUUID>::iterator sel_mem_iter = selected_members.begin();
|
||||
uuid_vec_t::iterator sel_mem_iter = selected_members.begin();
|
||||
for (; sel_mem_iter != selected_members.end(); sel_mem_iter++)
|
||||
{
|
||||
LLRoleMemberChangeType type;
|
||||
@@ -1106,7 +1100,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
|
||||
check->setTentative(
|
||||
(0 != count)
|
||||
&& (selected_members.size() !=
|
||||
(std::vector<LLUUID>::size_type)count));
|
||||
(uuid_vec_t::size_type)count));
|
||||
|
||||
//NOTE: as of right now a user can break the group
|
||||
//by removing himself from a role if he is the
|
||||
@@ -1281,7 +1275,6 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id,
|
||||
buildActionsList(mAllowedActionsList,
|
||||
powers_some_have,
|
||||
powers_all_have,
|
||||
mActionIcons,
|
||||
NULL,
|
||||
FALSE,
|
||||
FALSE,
|
||||
@@ -1778,8 +1771,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root)
|
||||
parent->getChild<LLButton>("role_create", recurse);
|
||||
if ( mCreateRoleButton )
|
||||
{
|
||||
mCreateRoleButton->setCallbackUserData(this);
|
||||
mCreateRoleButton->setClickedCallback(onCreateRole);
|
||||
mCreateRoleButton->setClickedCallback(boost::bind(&LLPanelGroupRolesSubTab::onCreateRole,this));
|
||||
mCreateRoleButton->setEnabled(FALSE);
|
||||
}
|
||||
|
||||
@@ -1787,8 +1779,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root)
|
||||
parent->getChild<LLButton>("role_delete", recurse);
|
||||
if ( mDeleteRoleButton )
|
||||
{
|
||||
mDeleteRoleButton->setCallbackUserData(this);
|
||||
mDeleteRoleButton->setClickedCallback(onDeleteRole);
|
||||
mDeleteRoleButton->setClickedCallback(boost::bind(&LLPanelGroupRolesSubTab::onDeleteRole,this));
|
||||
mDeleteRoleButton->setEnabled(FALSE);
|
||||
}
|
||||
|
||||
@@ -2062,8 +2053,7 @@ void LLPanelGroupRolesSubTab::handleRoleSelect()
|
||||
buildActionsList(mAllowedActionsList,
|
||||
rd.mRolePowers,
|
||||
0LL,
|
||||
mActionIcons,
|
||||
onActionCheck,
|
||||
boost::bind(&LLPanelGroupRolesSubTab::handleActionCheck, this, _1, false),
|
||||
TRUE,
|
||||
FALSE,
|
||||
is_owner_role);
|
||||
@@ -2160,24 +2150,18 @@ void LLPanelGroupRolesSubTab::buildMembersList()
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelGroupRolesSubTab::onActionCheck(LLUICtrl* ctrl, void* user_data)
|
||||
{
|
||||
LLPanelGroupRolesSubTab* self = static_cast<LLPanelGroupRolesSubTab*>(user_data);
|
||||
LLCheckBoxCtrl* check = static_cast<LLCheckBoxCtrl*>(ctrl);
|
||||
if (!check || !self) return;
|
||||
|
||||
self->handleActionCheck(check);
|
||||
}
|
||||
|
||||
struct ActionCBData
|
||||
{
|
||||
LLPanelGroupRolesSubTab* mSelf;
|
||||
LLCheckBoxCtrl* mCheck;
|
||||
};
|
||||
|
||||
void LLPanelGroupRolesSubTab::handleActionCheck(LLCheckBoxCtrl* check, bool force)
|
||||
void LLPanelGroupRolesSubTab::handleActionCheck(LLUICtrl* ctrl, bool force)
|
||||
{
|
||||
LLCheckBoxCtrl* check = dynamic_cast<LLCheckBoxCtrl*>(ctrl);
|
||||
if (!check)
|
||||
return;
|
||||
|
||||
lldebugs << "LLPanelGroupRolesSubTab::handleActionSelect()" << llendl;
|
||||
|
||||
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
|
||||
@@ -2473,7 +2457,7 @@ BOOL LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root)
|
||||
|
||||
mActionList->setCallbackUserData(this);
|
||||
mActionList->setCommitOnSelectionChange(TRUE);
|
||||
mActionList->setCommitCallback(onActionSelect);
|
||||
mActionList->setCommitCallback(boost::bind(&LLPanelGroupActionsSubTab::handleActionSelect, this));
|
||||
|
||||
mActionMembers->setCallbackUserData(this);
|
||||
mActionRoles->setCallbackUserData(this);
|
||||
@@ -2529,20 +2513,12 @@ void LLPanelGroupActionsSubTab::update(LLGroupChange gc)
|
||||
buildActionsList(mActionList,
|
||||
GP_ALL_POWERS,
|
||||
GP_ALL_POWERS,
|
||||
mActionIcons,
|
||||
NULL,
|
||||
FALSE,
|
||||
TRUE,
|
||||
FALSE);
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelGroupActionsSubTab::onActionSelect(LLUICtrl* scroll, void* data)
|
||||
{
|
||||
LLPanelGroupActionsSubTab* self = static_cast<LLPanelGroupActionsSubTab*>(data);
|
||||
self->handleActionSelect();
|
||||
}
|
||||
|
||||
void LLPanelGroupActionsSubTab::handleActionSelect()
|
||||
{
|
||||
mActionMembers->deleteAllItems();
|
||||
|
||||
@@ -130,8 +130,7 @@ public:
|
||||
void buildActionsList(LLScrollListCtrl* ctrl,
|
||||
U64 allowed_by_some,
|
||||
U64 allowed_by_all,
|
||||
icon_map_t& icons,
|
||||
void (*commit_callback)(LLUICtrl*,void*),
|
||||
LLUICtrl::commit_callback_t commit_callback,
|
||||
BOOL show_all,
|
||||
BOOL filter,
|
||||
BOOL is_owner_role);
|
||||
@@ -139,8 +138,7 @@ public:
|
||||
U64 allowed_by_some,
|
||||
U64 allowed_by_all,
|
||||
LLRoleActionSet* action_set,
|
||||
icon_map_t& icons,
|
||||
void (*commit_callback)(LLUICtrl*,void*),
|
||||
LLUICtrl::commit_callback_t commit_callback,
|
||||
BOOL show_all,
|
||||
BOOL filter,
|
||||
BOOL is_owner_role);
|
||||
@@ -248,8 +246,6 @@ public:
|
||||
void handleRoleSelect();
|
||||
void buildMembersList();
|
||||
|
||||
static void onActionCheck(LLUICtrl*, void*);
|
||||
void handleActionCheck(LLCheckBoxCtrl*, bool force=false);
|
||||
bool addActionCB(const LLSD& notification, const LLSD& response, LLCheckBoxCtrl* check);
|
||||
|
||||
static void onPropertiesKey(LLLineEditor*, void*);
|
||||
@@ -268,10 +264,8 @@ public:
|
||||
|
||||
void saveRoleChanges();
|
||||
protected:
|
||||
LLSD createRoleItem(const LLUUID& role_id,
|
||||
std::string name,
|
||||
std::string title,
|
||||
S32 members);
|
||||
void handleActionCheck(LLUICtrl* ctrl, bool force);
|
||||
LLSD createRoleItem(const LLUUID& role_id, std::string name, std::string title, S32 members);
|
||||
|
||||
LLScrollListCtrl* mRolesList;
|
||||
LLNameListCtrl* mAssignedMembersList;
|
||||
@@ -306,7 +300,6 @@ public:
|
||||
virtual bool apply(std::string& mesg);
|
||||
virtual void update(LLGroupChange gc);
|
||||
|
||||
static void onActionSelect(LLUICtrl*, void*);
|
||||
void handleActionSelect();
|
||||
protected:
|
||||
LLScrollListCtrl* mActionList;
|
||||
|
||||
@@ -1575,35 +1575,25 @@ BOOL LLPanelGroupVoting::postBuild()
|
||||
mImpl->mVotesHistory->setDoubleClickCallback(impl::onDoubleClickHistoryItem);
|
||||
mImpl->mVotesHistory->setCallbackUserData(mImpl);
|
||||
|
||||
mImpl->mBtnAbstain->setClickedCallback(impl::onClickAbstain);
|
||||
mImpl->mBtnAbstain->setCallbackUserData(mImpl);
|
||||
mImpl->mBtnAbstain->setClickedCallback(boost::bind(&impl::onClickAbstain,mImpl));
|
||||
|
||||
mImpl->mBtnNo->setClickedCallback(impl::onClickNo);
|
||||
mImpl->mBtnNo->setCallbackUserData(mImpl);
|
||||
mImpl->mBtnNo->setClickedCallback(boost::bind(&impl::onClickNo,mImpl));
|
||||
|
||||
mImpl->mBtnYes->setClickedCallback(impl::onClickYes);
|
||||
mImpl->mBtnYes->setCallbackUserData(mImpl);
|
||||
mImpl->mBtnYes->setClickedCallback(boost::bind(&impl::onClickYes,mImpl));
|
||||
|
||||
mImpl->mBtnCreateProposal->setClickedCallback(impl::onClickCreateProposal);
|
||||
mImpl->mBtnCreateProposal->setCallbackUserData(mImpl);
|
||||
mImpl->mBtnCreateProposal->setClickedCallback(boost::bind(&impl::onClickCreateProposal,mImpl));
|
||||
|
||||
mImpl->mBtnSubmitProposal->setClickedCallback(impl::onClickSubmitProposal);
|
||||
mImpl->mBtnSubmitProposal->setCallbackUserData(mImpl);
|
||||
mImpl->mBtnSubmitProposal->setClickedCallback(boost::bind(&impl::onClickSubmitProposal,mImpl));
|
||||
|
||||
mImpl->mBtnCancelProposal->setClickedCallback(impl::onClickCancelProposal);
|
||||
mImpl->mBtnCancelProposal->setCallbackUserData(mImpl);
|
||||
mImpl->mBtnCancelProposal->setClickedCallback(boost::bind(&impl::onClickCancelProposal,mImpl));
|
||||
|
||||
mImpl->mBtnViewProposalList->setClickedCallback(impl::onClickViewProposalList);
|
||||
mImpl->mBtnViewProposalList->setCallbackUserData(mImpl);
|
||||
mImpl->mBtnViewProposalList->setClickedCallback(boost::bind(&impl::onClickViewProposalList,mImpl));
|
||||
|
||||
mImpl->mBtnViewProposalItem->setClickedCallback(impl::onClickViewProposalItem);
|
||||
mImpl->mBtnViewProposalItem->setCallbackUserData(mImpl);
|
||||
mImpl->mBtnViewProposalItem->setClickedCallback(boost::bind(&impl::onClickViewProposalItem,mImpl));
|
||||
|
||||
mImpl->mBtnViewHistoryList->setClickedCallback(impl::onClickViewHistoryList);
|
||||
mImpl->mBtnViewHistoryList->setCallbackUserData(mImpl);
|
||||
mImpl->mBtnViewHistoryList->setClickedCallback(boost::bind(&impl::onClickViewHistoryList,mImpl));
|
||||
|
||||
mImpl->mBtnViewHistoryItem->setClickedCallback(impl::onClickViewHistoryItem);
|
||||
mImpl->mBtnViewHistoryItem->setCallbackUserData(mImpl);
|
||||
mImpl->mBtnViewHistoryItem->setClickedCallback(boost::bind(&impl::onClickViewHistoryItem,mImpl));
|
||||
|
||||
gMessageSystem->setHandlerFuncFast(_PREHASH_GroupActiveProposalItemReply,
|
||||
impl::processGroupActiveProposalItemReply);
|
||||
|
||||
@@ -129,20 +129,20 @@ BOOL LLPanelMediaHUD::postBuild()
|
||||
|
||||
LLButton* scroll_up_btn = getChild<LLButton>("scrollup");
|
||||
scroll_up_btn->setClickedCallback(onScrollUp, this);
|
||||
scroll_up_btn->setHeldDownCallback(onScrollUpHeld);
|
||||
scroll_up_btn->setMouseUpCallback(onScrollStop);
|
||||
scroll_up_btn->setHeldDownCallback(onScrollUpHeld, this);
|
||||
scroll_up_btn->setMouseUpCallback(onScrollStop, this);
|
||||
LLButton* scroll_left_btn = getChild<LLButton>("scrollleft");
|
||||
scroll_left_btn->setClickedCallback(onScrollLeft, this);
|
||||
scroll_left_btn->setHeldDownCallback(onScrollLeftHeld);
|
||||
scroll_left_btn->setMouseUpCallback(onScrollStop);
|
||||
scroll_left_btn->setHeldDownCallback(onScrollLeftHeld, this);
|
||||
scroll_left_btn->setMouseUpCallback(onScrollStop, this);
|
||||
LLButton* scroll_right_btn = getChild<LLButton>("scrollright");
|
||||
scroll_right_btn->setClickedCallback(onScrollRight, this);
|
||||
scroll_right_btn->setHeldDownCallback(onScrollLeftHeld);
|
||||
scroll_right_btn->setMouseUpCallback(onScrollStop);
|
||||
scroll_right_btn->setHeldDownCallback(onScrollLeftHeld, this);
|
||||
scroll_right_btn->setMouseUpCallback(onScrollStop, this);
|
||||
LLButton* scroll_down_btn = getChild<LLButton>("scrolldown");
|
||||
scroll_down_btn->setClickedCallback(onScrollDown, this);
|
||||
scroll_down_btn->setHeldDownCallback(onScrollDownHeld);
|
||||
scroll_down_btn->setMouseUpCallback(onScrollStop);
|
||||
scroll_down_btn->setHeldDownCallback(onScrollDownHeld, this);
|
||||
scroll_down_btn->setMouseUpCallback(onScrollStop, this);
|
||||
|
||||
mMouseInactiveTime = gSavedSettings.getF32("MediaControlTimeout");
|
||||
mControlFadeTime = gSavedSettings.getF32("MediaControlFadeTime");
|
||||
|
||||
@@ -160,16 +160,13 @@ BOOL LLPanelPick::postBuild()
|
||||
mLocationEditor = getChild<LLLineEditor>("location_editor");
|
||||
|
||||
mSetBtn = getChild<LLButton>( "set_location_btn");
|
||||
mSetBtn->setClickedCallback(onClickSet);
|
||||
mSetBtn->setCallbackUserData(this);
|
||||
mSetBtn->setClickedCallback(boost::bind(&LLPanelPick::onClickSet,this));
|
||||
|
||||
mTeleportBtn = getChild<LLButton>( "pick_teleport_btn");
|
||||
mTeleportBtn->setClickedCallback(onClickTeleport);
|
||||
mTeleportBtn->setCallbackUserData(this);
|
||||
mTeleportBtn->setClickedCallback(boost::bind(&LLPanelPick::onClickTeleport,this));
|
||||
|
||||
mMapBtn = getChild<LLButton>( "pick_map_btn");
|
||||
mMapBtn->setClickedCallback(onClickMap);
|
||||
mMapBtn->setCallbackUserData(this);
|
||||
mMapBtn->setClickedCallback(boost::bind(&LLPanelPick::onClickMap,this));
|
||||
|
||||
mSortOrderText = getChild<LLTextBox>("sort_order_text");
|
||||
|
||||
|
||||
@@ -106,20 +106,16 @@ BOOL LLPanelPlace::postBuild()
|
||||
mLocationDisplay = getChild<LLTextBox>("location_editor");
|
||||
|
||||
mTeleportBtn = getChild<LLButton>( "teleport_btn");
|
||||
mTeleportBtn->setClickedCallback(onClickTeleport);
|
||||
mTeleportBtn->setCallbackUserData(this);
|
||||
mTeleportBtn->setClickedCallback(boost::bind(&LLPanelPlace::onClickTeleport,this));
|
||||
|
||||
mMapBtn = getChild<LLButton>( "map_btn");
|
||||
mMapBtn->setClickedCallback(onClickMap);
|
||||
mMapBtn->setCallbackUserData(this);
|
||||
mMapBtn->setClickedCallback(boost::bind(&LLPanelPlace::onClickMap,this));
|
||||
|
||||
//mLandmarkBtn = getChild<LLButton>( "landmark_btn");
|
||||
//mLandmarkBtn->setClickedCallback(onClickLandmark);
|
||||
//mLandmarkBtn->setCallbackUserData(this);
|
||||
//mLandmarkBtn->setClickedCallback(boost::bind(&LLPanelPlace::onClickLandmark,this));
|
||||
|
||||
mAuctionBtn = getChild<LLButton>( "auction_btn");
|
||||
mAuctionBtn->setClickedCallback(onClickAuction);
|
||||
mAuctionBtn->setCallbackUserData(this);
|
||||
mAuctionBtn->setClickedCallback(boost::bind(&LLPanelPlace::onClickAuction,this));
|
||||
|
||||
// Default to no auction button. We'll show it if we get an auction id
|
||||
mAuctionBtn->setVisible(FALSE);
|
||||
|
||||
@@ -126,9 +126,9 @@ void LLPanelSkins::refresh()
|
||||
"textures"+gDirUtilp->getDirDelimiter()+
|
||||
imagename);
|
||||
b->setImages(imageprev,imageprev);
|
||||
b->setHoverImages(imageprev,imageprev);
|
||||
b->setScaleImage(TRUE);
|
||||
|
||||
b->setImageHoverSelected(LLUI::getUIImage(imageprev));
|
||||
b->setImageHoverUnselected(LLUI::getUIImage(imageprev));
|
||||
|
||||
//<button scale_image="true" image_selected="skin_thumbnail_default.png"
|
||||
//image_unselected="skin_thumbnail_default.png"
|
||||
// image_hover_selected="skin_thumbnail_default.png"
|
||||
|
||||
@@ -438,26 +438,22 @@ BOOL LLPreviewGesture::postBuild()
|
||||
mLibraryList = list;
|
||||
|
||||
btn = getChild<LLButton>( "add_btn");
|
||||
btn->setClickedCallback(onClickAdd);
|
||||
btn->setCallbackUserData(this);
|
||||
btn->setClickedCallback(boost::bind(&LLPreviewGesture::onClickAdd,this));
|
||||
btn->setEnabled(FALSE);
|
||||
mAddBtn = btn;
|
||||
|
||||
btn = getChild<LLButton>( "up_btn");
|
||||
btn->setClickedCallback(onClickUp);
|
||||
btn->setCallbackUserData(this);
|
||||
btn->setClickedCallback(boost::bind(&LLPreviewGesture::onClickUp,this));
|
||||
btn->setEnabled(FALSE);
|
||||
mUpBtn = btn;
|
||||
|
||||
btn = getChild<LLButton>( "down_btn");
|
||||
btn->setClickedCallback(onClickDown);
|
||||
btn->setCallbackUserData(this);
|
||||
btn->setClickedCallback(boost::bind(&LLPreviewGesture::onClickDown,this));
|
||||
btn->setEnabled(FALSE);
|
||||
mDownBtn = btn;
|
||||
|
||||
btn = getChild<LLButton>( "delete_btn");
|
||||
btn->setClickedCallback(onClickDelete);
|
||||
btn->setCallbackUserData(this);
|
||||
btn->setClickedCallback(boost::bind(&LLPreviewGesture::onClickDelete,this));
|
||||
btn->setEnabled(FALSE);
|
||||
mDeleteBtn = btn;
|
||||
|
||||
@@ -529,12 +525,12 @@ BOOL LLPreviewGesture::postBuild()
|
||||
mActiveCheck = check;
|
||||
|
||||
btn = getChild<LLButton>( "save_btn");
|
||||
btn->setClickedCallback(onClickSave);
|
||||
btn->setClickedCallback(boost::bind(&LLPreviewGesture::onClickSave,this));
|
||||
btn->setCallbackUserData(this);
|
||||
mSaveBtn = btn;
|
||||
|
||||
btn = getChild<LLButton>( "preview_btn");
|
||||
btn->setClickedCallback(onClickPreview);
|
||||
btn->setClickedCallback(boost::bind(&LLPreviewGesture::onClickPreview,this));
|
||||
btn->setCallbackUserData(this);
|
||||
mPreviewBtn = btn;
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ BOOL LLProgressView::postBuild()
|
||||
mProgressBar = getChild<LLProgressBar>("login_progress_bar");
|
||||
|
||||
mCancelBtn = getChild<LLButton>("cancel_btn");
|
||||
mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked );
|
||||
mCancelBtn->setClickedCallback( boost::bind(&LLProgressView::onCancelButtonClicked) );
|
||||
mFadeTimer.stop();
|
||||
|
||||
getChild<LLTextBox>("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle()));
|
||||
@@ -224,7 +224,7 @@ void LLProgressView::setCancelButtonVisible(BOOL b, const std::string& label)
|
||||
}
|
||||
|
||||
// static
|
||||
void LLProgressView::onCancelButtonClicked(void*)
|
||||
void LLProgressView::onCancelButtonClicked()
|
||||
{
|
||||
if (gAgent.getTeleportState() == LLAgent::TELEPORT_NONE)
|
||||
{
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
|
||||
void setCancelButtonVisible(BOOL b, const std::string& label);
|
||||
|
||||
static void onCancelButtonClicked( void* );
|
||||
static void onCancelButtonClicked();
|
||||
static void onClickMessage(void*);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -588,23 +588,6 @@ void LLToolPlacer::handleDeselect()
|
||||
//////////////////////////////////////////////////////
|
||||
// LLToolPlacerPanel
|
||||
|
||||
// static
|
||||
LLPCode LLToolPlacerPanel::sCube = LL_PCODE_CUBE;
|
||||
LLPCode LLToolPlacerPanel::sPrism = LL_PCODE_PRISM;
|
||||
LLPCode LLToolPlacerPanel::sPyramid = LL_PCODE_PYRAMID;
|
||||
LLPCode LLToolPlacerPanel::sTetrahedron = LL_PCODE_TETRAHEDRON;
|
||||
LLPCode LLToolPlacerPanel::sCylinder = LL_PCODE_CYLINDER;
|
||||
LLPCode LLToolPlacerPanel::sCylinderHemi= LL_PCODE_CYLINDER_HEMI;
|
||||
LLPCode LLToolPlacerPanel::sCone = LL_PCODE_CONE;
|
||||
LLPCode LLToolPlacerPanel::sConeHemi = LL_PCODE_CONE_HEMI;
|
||||
LLPCode LLToolPlacerPanel::sTorus = LL_PCODE_TORUS;
|
||||
LLPCode LLToolPlacerPanel::sSquareTorus = LLViewerObject::LL_VO_SQUARE_TORUS;
|
||||
LLPCode LLToolPlacerPanel::sTriangleTorus = LLViewerObject::LL_VO_TRIANGLE_TORUS;
|
||||
LLPCode LLToolPlacerPanel::sSphere = LL_PCODE_SPHERE;
|
||||
LLPCode LLToolPlacerPanel::sSphereHemi = LL_PCODE_SPHERE_HEMI;
|
||||
LLPCode LLToolPlacerPanel::sTree = LL_PCODE_LEGACY_TREE;
|
||||
LLPCode LLToolPlacerPanel::sGrass = LL_PCODE_LEGACY_GRASS;
|
||||
|
||||
S32 LLToolPlacerPanel::sButtonsAdded = 0;
|
||||
LLButton* LLToolPlacerPanel::sButtons[ TOOL_PLACER_NUM_BUTTONS ];
|
||||
|
||||
@@ -612,22 +595,6 @@ LLToolPlacerPanel::LLToolPlacerPanel(const std::string& name, const LLRect& rect
|
||||
:
|
||||
LLPanel( name, rect )
|
||||
{
|
||||
/* DEPRECATED - JC
|
||||
addButton( "UIImgCubeUUID", "UIImgCubeSelectedUUID", &LLToolPlacerPanel::sCube );
|
||||
addButton( "UIImgPrismUUID", "UIImgPrismSelectedUUID", &LLToolPlacerPanel::sPrism );
|
||||
addButton( "UIImgPyramidUUID", "UIImgPyramidSelectedUUID", &LLToolPlacerPanel::sPyramid );
|
||||
addButton( "UIImgTetrahedronUUID", "UIImgTetrahedronSelectedUUID", &LLToolPlacerPanel::sTetrahedron );
|
||||
addButton( "UIImgCylinderUUID", "UIImgCylinderSelectedUUID", &LLToolPlacerPanel::sCylinder );
|
||||
addButton( "UIImgHalfCylinderUUID", "UIImgHalfCylinderSelectedUUID",&LLToolPlacerPanel::sCylinderHemi );
|
||||
addButton( "UIImgConeUUID", "UIImgConeSelectedUUID", &LLToolPlacerPanel::sCone );
|
||||
addButton( "UIImgHalfConeUUID", "UIImgHalfConeSelectedUUID", &LLToolPlacerPanel::sConeHemi );
|
||||
addButton( "UIImgSphereUUID", "UIImgSphereSelectedUUID", &LLToolPlacerPanel::sSphere );
|
||||
addButton( "UIImgHalfSphereUUID", "UIImgHalfSphereSelectedUUID", &LLToolPlacerPanel::sSphereHemi );
|
||||
addButton( "UIImgTreeUUID", "UIImgTreeSelectedUUID", &LLToolPlacerPanel::sTree );
|
||||
addButton( "UIImgGrassUUID", "UIImgGrassSelectedUUID", &LLToolPlacerPanel::sGrass );
|
||||
addButton( "ObjectTorusImageID", "ObjectTorusActiveImageID", &LLToolPlacerPanel::sTorus );
|
||||
addButton( "ObjectTubeImageID", "ObjectTubeActiveImageID", &LLToolPlacerPanel::sSquareTorus );
|
||||
*/
|
||||
}
|
||||
|
||||
void LLToolPlacerPanel::addButton( const std::string& up_state, const std::string& down_state, LLPCode* pcode )
|
||||
|
||||
@@ -83,22 +83,6 @@ public:
|
||||
|
||||
static void setObjectType( void* data );
|
||||
|
||||
static LLPCode sCube;
|
||||
static LLPCode sPrism;
|
||||
static LLPCode sPyramid;
|
||||
static LLPCode sTetrahedron;
|
||||
static LLPCode sCylinder;
|
||||
static LLPCode sCylinderHemi;
|
||||
static LLPCode sCone;
|
||||
static LLPCode sConeHemi;
|
||||
static LLPCode sTorus;
|
||||
static LLPCode sSquareTorus;
|
||||
static LLPCode sTriangleTorus;
|
||||
static LLPCode sSphere;
|
||||
static LLPCode sSphereHemi;
|
||||
static LLPCode sTree;
|
||||
static LLPCode sGrass;
|
||||
|
||||
private:
|
||||
void addButton( const std::string& up_state, const std::string& down_state, LLPCode* pcode );
|
||||
|
||||
|
||||
@@ -69,17 +69,15 @@ LLVoiceRemoteCtrl::~LLVoiceRemoteCtrl()
|
||||
BOOL LLVoiceRemoteCtrl::postBuild()
|
||||
{
|
||||
mTalkBtn = getChild<LLButton>("push_to_talk");
|
||||
mTalkBtn->setClickedCallback(onBtnTalkClicked);
|
||||
mTalkBtn->setHeldDownCallback(onBtnTalkHeld);
|
||||
mTalkBtn->setMouseUpCallback(onBtnTalkReleased);
|
||||
mTalkBtn->setClickedCallback(boost::bind(&LLVoiceRemoteCtrl::onBtnTalkClicked));
|
||||
mTalkBtn->setHeldDownCallback(boost::bind(&LLVoiceRemoteCtrl::onBtnTalkHeld));
|
||||
mTalkBtn->setMouseUpCallback(boost::bind(&LLVoiceRemoteCtrl::onBtnTalkReleased));
|
||||
|
||||
mTalkLockBtn = getChild<LLButton>("ptt_lock");
|
||||
mTalkLockBtn->setClickedCallback(onBtnLock);
|
||||
mTalkLockBtn->setCallbackUserData(this);
|
||||
mTalkLockBtn->setClickedCallback(boost::bind(&LLVoiceRemoteCtrl::onBtnLock,this));
|
||||
|
||||
mSpeakersBtn = getChild<LLButton>("speakers_btn");
|
||||
mSpeakersBtn->setClickedCallback(onClickSpeakers);
|
||||
mSpeakersBtn->setCallbackUserData(this);
|
||||
mSpeakersBtn->setClickedCallback(boost::bind(&LLVoiceRemoteCtrl::onClickSpeakers));
|
||||
|
||||
childSetAction("show_channel", onClickPopupBtn, this);
|
||||
childSetAction("end_call_btn", onClickEndCall, this);
|
||||
@@ -216,7 +214,7 @@ void LLVoiceRemoteCtrl::draw()
|
||||
LLPanel::draw();
|
||||
}
|
||||
|
||||
void LLVoiceRemoteCtrl::onBtnTalkClicked(void *user_data)
|
||||
void LLVoiceRemoteCtrl::onBtnTalkClicked()
|
||||
{
|
||||
// when in toggle mode, clicking talk button turns mic on/off
|
||||
if (gSavedSettings.getBOOL("PushToTalkToggle"))
|
||||
@@ -225,7 +223,7 @@ void LLVoiceRemoteCtrl::onBtnTalkClicked(void *user_data)
|
||||
}
|
||||
}
|
||||
|
||||
void LLVoiceRemoteCtrl::onBtnTalkHeld(void *user_data)
|
||||
void LLVoiceRemoteCtrl::onBtnTalkHeld()
|
||||
{
|
||||
// when not in toggle mode, holding down talk button turns on mic
|
||||
if (!gSavedSettings.getBOOL("PushToTalkToggle"))
|
||||
@@ -234,7 +232,7 @@ void LLVoiceRemoteCtrl::onBtnTalkHeld(void *user_data)
|
||||
}
|
||||
}
|
||||
|
||||
void LLVoiceRemoteCtrl::onBtnTalkReleased(void* user_data)
|
||||
void LLVoiceRemoteCtrl::onBtnTalkReleased()
|
||||
{
|
||||
// when not in toggle mode, releasing talk button turns off mic
|
||||
if (!gSavedSettings.getBOOL("PushToTalkToggle"))
|
||||
@@ -279,7 +277,7 @@ void LLVoiceRemoteCtrl::onClickEndCall(void* user_data)
|
||||
}
|
||||
|
||||
|
||||
void LLVoiceRemoteCtrl::onClickSpeakers(void *user_data)
|
||||
void LLVoiceRemoteCtrl::onClickSpeakers()
|
||||
{
|
||||
LLFloaterActiveSpeakers::toggleInstance(LLSD());
|
||||
}
|
||||
|
||||
@@ -47,10 +47,10 @@ public:
|
||||
/*virtual*/ void draw();
|
||||
|
||||
static void onBtnLock(void* user_data);
|
||||
static void onBtnTalkHeld(void *user_data);
|
||||
static void onBtnTalkReleased(void* user_data);
|
||||
static void onBtnTalkClicked(void* user_data);
|
||||
static void onClickSpeakers(void *user_data);
|
||||
static void onBtnTalkHeld();
|
||||
static void onBtnTalkReleased();
|
||||
static void onBtnTalkClicked();
|
||||
static void onClickSpeakers();
|
||||
static void onClickPopupBtn(void* user_data);
|
||||
static void onClickVoiceChannel(void* user_data);
|
||||
static void onClickEndCall(void* user_data);
|
||||
|
||||
Reference in New Issue
Block a user