added message logger / builder floaters

This commit is contained in:
Hazim Gazov
2010-05-05 17:08:05 -03:00
parent 97359b901f
commit 25fe391f07
20 changed files with 2276 additions and 13 deletions

View File

@@ -53,6 +53,9 @@
#include "llcontrol.h"
#include "llkeyboard.h"
#include "llresizebar.h"
// <edit>
#include "lllineeditor.h"
// </edit>
const S32 MIN_COLUMN_WIDTH = 20;
const S32 LIST_SNAP_PADDING = 5;
@@ -103,6 +106,10 @@ struct SortScrollListItem
LLScrollListIcon::LLScrollListIcon(LLUIImagePtr icon, S32 width)
: LLScrollListCell(width),
mIcon(icon),
// <edit>
mCallback(NULL),
mUserData(NULL),
// </edit>
mColor(LLColor4::white)
{
}
@@ -161,6 +168,19 @@ S32 LLScrollListIcon::getWidth() const
return LLScrollListCell::getWidth();
}
// <edit>
void LLScrollListIcon::setClickCallback(BOOL (*callback)(void*), void* user_data)
{
mCallback = callback;
mUserData = user_data;
}
BOOL LLScrollListIcon::handleClick()
{
if(mCallback) return mCallback(mUserData);
return FALSE;
}
// </edit>
void LLScrollListIcon::draw(const LLColor4& color, const LLColor4& highlight_color) const
{
@@ -210,6 +230,59 @@ BOOL LLScrollListCheck::handleClick()
return TRUE;
}
// <edit>
//
// LLScrollListLineEditor
//
LLScrollListLineEditor::LLScrollListLineEditor(LLLineEditor* line_editor, S32 width)
{
mLineEditor = line_editor;
LLRect rect(mLineEditor->getRect());
if (width)
{
rect.mRight = rect.mLeft + width;
mLineEditor->setRect(rect);
setWidth(width);
}
else
{
setWidth(rect.getWidth()); //line_editor->getWidth();
}
}
LLScrollListLineEditor::~LLScrollListLineEditor()
{
delete mLineEditor;
}
void LLScrollListLineEditor::draw(const LLColor4& color, const LLColor4& highlight_color) const
{
mLineEditor->draw();
}
BOOL LLScrollListLineEditor::handleClick()
{
if (mLineEditor->getEnabled())
{
mLineEditor->setFocus(TRUE);
mLineEditor->selectAll();
}
// return value changes selection?
return FALSE; //TRUE;
}
BOOL LLScrollListLineEditor::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent)
{
return TRUE;
}
BOOL LLScrollListLineEditor::handleUnicodeCharHere(llwchar uni_char )
{
return TRUE;
}
// </edit>
//
// LLScrollListSeparator
//
@@ -3410,6 +3483,21 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p
columnp->mHeader->setHasResizableElement(TRUE);
}
}
// <edit>
else if(type == "line_editor")
{
LLLineEditor* ctrl = new LLLineEditor(std::string("line_editor"),
LLRect(0, width, width, 0), std::string(""));
ctrl->setEnabled(enabled);
ctrl->setValue(value);
LLScrollListLineEditor* cell = new LLScrollListLineEditor(ctrl,width);
if (has_color)
{
cell->setColor(color);
}
new_item->setColumn(index, cell);
}
// </edit>
else
{
LLScrollListText* cell = new LLScrollListText(value.asString(), font, width, font_style, font_alignment, fcolor, TRUE);

View File

@@ -49,6 +49,9 @@
#include "llscrollbar.h"
#include "llresizebar.h"
#include "lldate.h"
// <edit>
#include "lllineeditor.h"
// </edit>
/*
* Represents a cell in a scrollable table.
@@ -163,10 +166,18 @@ public:
virtual void setColor(const LLColor4&);
virtual BOOL isText()const { return FALSE; }
virtual void setValue(const LLSD& value);
// <edit>
void setClickCallback(BOOL (*callback)(void*), void* user_data);
virtual BOOL handleClick();
// </edit>
private:
LLUIImagePtr mIcon;
LLColor4 mColor;
// <edit>
BOOL (*mCallback)(void*);
void* mUserData;
// </edit>
};
/*
@@ -193,6 +204,30 @@ private:
LLCheckBoxCtrl* mCheckBox;
};
// <edit>
class LLScrollListLineEditor : public LLScrollListCell
{
public:
LLScrollListLineEditor( LLLineEditor* line_editor, S32 width = 0);
/*virtual*/ ~LLScrollListLineEditor();
virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const;
virtual S32 getHeight() const { return 0; }
virtual const LLSD getValue() const { return mLineEditor->getValue(); }
virtual void setValue(const LLSD& value) { mLineEditor->setValue(value); }
virtual void onCommit() { mLineEditor->onCommit(); }
virtual BOOL handleClick();
virtual BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent);
virtual BOOL handleUnicodeCharHere(llwchar uni_char );
virtual void setEnabled(BOOL enable) { mLineEditor->setEnabled(enable); }
LLLineEditor* getLineEditor() { return mLineEditor; }
virtual BOOL isText() const { return FALSE; }
private:
LLLineEditor* mLineEditor;
};
// </edit>
/*
* A simple data class describing a column within a scroll list.
*/
@@ -497,6 +532,11 @@ public:
virtual S32 getScrollPos() const;
virtual void setScrollPos( S32 pos );
// <edit>
S32 getPageLines() { return mPageLines; }
// </edit>
S32 getSearchColumn();
void setSearchColumn(S32 column) { mSearchColumn = column; }
S32 getColumnIndexFromOffset(S32 x);

View File

@@ -301,7 +301,13 @@ protected:
BOOL handleControlKey(const KEY key, const MASK mask);
BOOL handleEditKey(const KEY key, const MASK mask);
// <edit>
public:
// </edit>
BOOL hasSelection() const { return (mSelectionStart !=mSelectionEnd); }
// <edit>
protected:
// </edit>
BOOL selectionContainsLineBreaks();
void startSelection();
void endSelection();