Skip to content
Snippets Groups Projects
Commit 3f8c129a authored by James Cook's avatar James Cook
Browse files

merge

parents b368f466 d220211b
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,9 @@ LLTextBox::LLTextBox(const LLTextBox::Params& p) ...@@ -45,6 +45,9 @@ LLTextBox::LLTextBox(const LLTextBox::Params& p)
mClickedCallback(NULL) mClickedCallback(NULL)
{} {}
LLTextBox::~LLTextBox()
{}
BOOL LLTextBox::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLTextBox::handleMouseDown(S32 x, S32 y, MASK mask)
{ {
BOOL handled = LLTextBase::handleMouseDown(x, y, mask); BOOL handled = LLTextBase::handleMouseDown(x, y, mask);
...@@ -97,6 +100,18 @@ BOOL LLTextBox::handleMouseUp(S32 x, S32 y, MASK mask) ...@@ -97,6 +100,18 @@ BOOL LLTextBox::handleMouseUp(S32 x, S32 y, MASK mask)
return handled; return handled;
} }
BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask)
{
BOOL handled = LLTextBase::handleHover(x, y, mask);
if (!handled && mClickedCallback)
{
// Clickable text boxes change the cursor to a hand
LLUI::getWindow()->setCursor(UI_CURSOR_HAND);
return TRUE;
}
return handled;
}
void LLTextBox::setText(const LLStringExplicit& text) void LLTextBox::setText(const LLStringExplicit& text)
{ {
// does string argument insertion // does string argument insertion
...@@ -105,6 +120,11 @@ void LLTextBox::setText(const LLStringExplicit& text) ...@@ -105,6 +120,11 @@ void LLTextBox::setText(const LLStringExplicit& text)
LLTextBase::setText(mText.getString()); LLTextBase::setText(mText.getString());
} }
void LLTextBox::setClickedCallback( boost::function<void (void*)> cb, void* userdata /*= NULL */ )
{
mClickedCallback = boost::bind(cb, userdata);
}
S32 LLTextBox::getTextPixelWidth() S32 LLTextBox::getTextPixelWidth()
{ {
return getContentsRect().getWidth(); return getContentsRect().getWidth();
...@@ -115,6 +135,12 @@ S32 LLTextBox::getTextPixelHeight() ...@@ -115,6 +135,12 @@ S32 LLTextBox::getTextPixelHeight()
return getContentsRect().getHeight(); return getContentsRect().getHeight();
} }
LLSD LLTextBox::getValue() const
{
return LLSD(getText());
}
BOOL LLTextBox::setTextArg( const std::string& key, const LLStringExplicit& text ) BOOL LLTextBox::setTextArg( const std::string& key, const LLStringExplicit& text )
{ {
mText.setArg(key, text); mText.setArg(key, text);
......
...@@ -33,8 +33,6 @@ ...@@ -33,8 +33,6 @@
#ifndef LL_LLTEXTBOX_H #ifndef LL_LLTEXTBOX_H
#define LL_LLTEXTBOX_H #define LL_LLTEXTBOX_H
#include "v4color.h"
#include "llstring.h"
#include "lluistring.h" #include "lluistring.h"
#include "lltextbase.h" #include "lltextbase.h"
...@@ -54,28 +52,25 @@ class LLTextBox : ...@@ -54,28 +52,25 @@ class LLTextBox :
friend class LLUICtrlFactory; friend class LLUICtrlFactory;
public: public:
virtual ~LLTextBox() {} virtual ~LLTextBox();
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleMouseUp(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*/ void setText( const LLStringExplicit& text ); /*virtual*/ void setText( const LLStringExplicit& text );
void setRightAlign() { mHAlign = LLFontGL::RIGHT; } void setRightAlign() { mHAlign = LLFontGL::RIGHT; }
void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; } void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; }
void setClickedCallback( boost::function<void (void*)> cb, void* userdata = NULL ){ mClickedCallback = boost::bind(cb, userdata); } // mouse down and up within button void setClickedCallback( boost::function<void (void*)> cb, void* userdata = NULL );
//const LLFontGL* getFont() const { return mDefaultFont; }
//void setFont(const LLFontGL* font) { mDefaultFont = font; }
void reshapeToFitText(); void reshapeToFitText();
//const std::string& getText() const { return mText.getString(); }
S32 getTextPixelWidth(); S32 getTextPixelWidth();
S32 getTextPixelHeight(); S32 getTextPixelHeight();
virtual LLSD getValue() const { return LLSD(getText()); } /*virtual*/ LLSD getValue() const;
virtual BOOL setTextArg( const std::string& key, const LLStringExplicit& text ); /*virtual*/ BOOL setTextArg( const std::string& key, const LLStringExplicit& text );
protected: protected:
void onUrlLabelUpdated(const std::string &url, const std::string &label); void onUrlLabelUpdated(const std::string &url, const std::string &label);
......
...@@ -73,6 +73,8 @@ L$123 to join ...@@ -73,6 +73,8 @@ L$123 to join
name="group_icon" name="group_icon"
top="24" top="24"
width="38" /> width="38" />
<!-- Must be tab_stop="true" so something can hold focus even when the
other buttons are disabled or invisible, otherwise inspector closes -->
<button <button
follows="top|left" follows="top|left"
height="18" height="18"
...@@ -84,7 +86,7 @@ L$123 to join ...@@ -84,7 +86,7 @@ L$123 to join
right="-8" right="-8"
top="35" top="35"
left_delta="110" left_delta="110"
tab_stop="false" tab_stop="true"
width="18" width="18"
commit_callback.function="InspectGroup.ViewProfile" /> commit_callback.function="InspectGroup.ViewProfile" />
<button <button
......
...@@ -23,19 +23,15 @@ ...@@ -23,19 +23,15 @@
border_visible="false" border_visible="false"
bottom="600" bottom="600"
follows="all" follows="all"
layout="topleft"
left="0" left="0"
name="login_html" name="login_html"
right="-1" right="-1"
start_url="" start_url=""
top="1" /> top="1" />
<text <text
type="string"
length="1"
follows="left|bottom" follows="left|bottom"
font="SansSerif" font="SansSerif"
height="16" height="16"
layout="topleft"
left="32" left="32"
name="first_name_text" name="first_name_text"
top="530" top="530"
...@@ -46,7 +42,6 @@ ...@@ -46,7 +42,6 @@
follows="left|bottom" follows="left|bottom"
handle_edit_keys_directly="true" handle_edit_keys_directly="true"
height="20" height="20"
layout="topleft"
left_delta="0" left_delta="0"
max_length="31" max_length="31"
name="first_name_edit" name="first_name_edit"
...@@ -55,12 +50,9 @@ ...@@ -55,12 +50,9 @@
top_pad="2" top_pad="2"
width="120" /> width="120" />
<text <text
type="string"
length="1"
follows="left|bottom" follows="left|bottom"
font="SansSerif" font="SansSerif"
height="16" height="16"
layout="topleft"
left="164" left="164"
name="last_name_text" name="last_name_text"
top="530" top="530"
...@@ -72,7 +64,6 @@ ...@@ -72,7 +64,6 @@
font="SansSerif" font="SansSerif"
handle_edit_keys_directly="true" handle_edit_keys_directly="true"
height="20" height="20"
layout="topleft"
left_delta="0" left_delta="0"
max_length="31" max_length="31"
name="last_name_edit" name="last_name_edit"
...@@ -81,12 +72,9 @@ ...@@ -81,12 +72,9 @@
top_pad="2" top_pad="2"
width="120" /> width="120" />
<text <text
type="string"
length="1"
follows="left|bottom" follows="left|bottom"
font="SansSerif" font="SansSerif"
height="16" height="16"
layout="topleft"
left="296" left="296"
name="password_text" name="password_text"
top="530" top="530"
...@@ -98,7 +86,6 @@ ...@@ -98,7 +86,6 @@
font="SansSerif" font="SansSerif"
handle_edit_keys_directly="true" handle_edit_keys_directly="true"
height="20" height="20"
layout="topleft"
left_delta="0" left_delta="0"
max_length="16" max_length="16"
name="password_edit" name="password_edit"
...@@ -124,12 +111,9 @@ ...@@ -124,12 +111,9 @@
name="server_combo" name="server_combo"
width="100" /> width="100" />
<text <text
type="string"
length="1"
follows="left|bottom" follows="left|bottom"
font="SansSerif" font="SansSerif"
height="16" height="16"
layout="topleft"
left="32" left="32"
name="start_location_text" name="start_location_text"
top="576" top="576"
...@@ -141,7 +125,6 @@ ...@@ -141,7 +125,6 @@
control_name="LoginLocation" control_name="LoginLocation"
follows="left|bottom" follows="left|bottom"
height="23" height="23"
layout="topleft"
left_pad="0" left_pad="0"
max_chars="128" max_chars="128"
name="start_location_combo" name="start_location_combo"
...@@ -165,20 +148,14 @@ ...@@ -165,20 +148,14 @@
follows="left|bottom" follows="left|bottom"
height="16" height="16"
label="Remember password" label="Remember password"
layout="topleft"
left_pad="10" left_pad="10"
name="remember_check" name="remember_check"
top_delta="3" top_delta="3"
width="138" /> width="138" />
<text <text
type="string"
length="1"
follows="right|bottom" follows="right|bottom"
halign="right" halign="right"
height="16" height="16"
hover="true"
hover_color="0.2 0.45 0.72 1"
layout="topleft"
left="-210" left="-210"
name="create_new_account_text" name="create_new_account_text"
top="539" top="539"
...@@ -186,14 +163,9 @@ ...@@ -186,14 +163,9 @@
Create a new account Create a new account
</text> </text>
<text <text
type="string"
length="1"
follows="right|bottom" follows="right|bottom"
halign="right" halign="right"
height="16" height="16"
hover="true"
hover_color="0.2 0.45 0.72 1"
layout="topleft"
left_delta="0" left_delta="0"
name="forgot_password_text" name="forgot_password_text"
top_pad="4" top_pad="4"
...@@ -201,14 +173,9 @@ ...@@ -201,14 +173,9 @@
Forgot your name or password? Forgot your name or password?
</text> </text>
<text <text
type="string"
length="1"
follows="right|bottom" follows="right|bottom"
halign="right" halign="right"
height="16" height="16"
hover="true"
hover_color="0.2 0.45 0.72 1"
layout="topleft"
left="-310" left="-310"
name="channel_text" name="channel_text"
top="579" top="579"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment