Name Editors are Name UI too!

This commit is contained in:
Liru Færs
2019-10-09 17:30:27 -04:00
parent 513a4fd16c
commit f80e23ac5e
2 changed files with 47 additions and 98 deletions

View File

@@ -33,50 +33,31 @@
#ifndef LL_LLNAMEEDITOR_H
#define LL_LLNAMEEDITOR_H
#include <set>
#include "llview.h"
#include "v4color.h"
#include "llstring.h"
#include "llfontgl.h"
#include "lllineeditor.h"
#include "llnameui.h"
class LLNameEditor
: public LLLineEditor
, public LLNameUI
{
public:
LLNameEditor(const std::string& name, const LLRect& rect,
const LLUUID& name_id = LLUUID::null,
BOOL is_group = FALSE,
const LLFontGL* glfont = NULL,
bool is_group = false,
const std::string& loading = LLStringUtil::null,
const LLFontGL* glfont = nullptr,
S32 max_text_length = 254);
// By default, follows top and left and is mouse-opaque.
// If no text, text = name.
// If no font, uses default system font.
virtual ~LLNameEditor();
BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override final;
virtual LLXMLNodePtr getXML(bool save_children = true) const;
LLXMLNodePtr getXML(bool save_children = true) const override final;
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
void setNameID(const LLUUID& name_id, BOOL is_group);
void refresh(const LLUUID& id, const std::string& full_name, bool is_group);
static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group);
// Take/return agent UUIDs
virtual void setValue( const LLSD& value );
virtual LLSD getValue() const;
private:
static std::set<LLNameEditor*> sInstances;
private:
LLUUID mNameID;
void setValue(const LLSD& value) override final;
LLSD getValue() const override final;
void setText(const std::string& text) override final;
};
#endif