--- guiModernTextListCtrl.cpp	Thu Jan 15 03:14:12 1970
+++ guiModernTextListCtrl.cpp	Thu Jan 15 03:14:12 1970
@@ -5,6 +5,22 @@
 //-----------------------------------------------------------------------------
 #include <algorithm>
 
+// this is a small hack to prevent including in tAlgorithm.h's swap template function
+// that would have broken STL's existing swap template causing compiling errors upon
+// usage of std::sort() within this source file. --Nathan Martin
+#define _TALGORITHM_H_
+
+// simSet needs this from tAlgorithm.h so we will have a copy of it here.
+/// Finds the first matching value within the container
+/// returning the the element or last if its not found.
+template <class Iterator, class Value>
+Iterator find(Iterator first, Iterator last, Value value)
+{
+   while (first != last && *first != value)
+      ++first;
+   return first;
+}
+
 #include "platform/platform.h"
 #include "gui/controls/guiModernTextListCtrl.h"
 
@@ -408,7 +424,7 @@
 
 		case KEY_DELETE:
 			if(mSelectedCell.y >= 0 && mSelectedCell.y < mRows.size())
-				onDeleteKey_callback((U32)mSelectedCell.y, mRows[mSelectedCell.y].key);
+				onDeleteKey_callback((U32)mSelectedCell.y, mSortedRows[mSelectedCell.y]->key);
 			break;
 
 		default:
@@ -432,7 +448,7 @@
 		isOK = true;
 
 	// Do not allow selection of inactive cells
-	if(cell.y >= 0 && cell.y < mSize.y && !(mRows[cell.y].flags & Column_Flags_Active))
+	if(cell.y >= 0 && cell.y < mSize.y && (mSortedRows[cell.y]->flags & Row_Flags_Selectable))
 		isOK = true;
 
 	if(!isOK)
@@ -524,6 +540,10 @@
 		cFont		= profile->mFontColorNA;
 		texIndex	= 4;
 
+		// workaround for row selection highlight to work as expected even on inactive rows
+		if(selected || (profile->mMouseOverSelected && mouseOver))
+			cFill	= profile->mFillColorSEL;
+
 	} else if(selected || (profile->mMouseOverSelected && mouseOver))
 	{
 		// cell is selected
@@ -697,7 +717,7 @@
 	dstText = textStrip;
 }
 
-void GuiModernTextListCtrl::drawMarkupText(GuiControlProfile *profile, Point2I &textPos, const char *text)
+void GuiModernTextListCtrl::drawMarkupText(GuiControlProfile *profile, RectI &rectCell, Point2I &textPos, const char *text)
 {
 	/****
 
@@ -902,8 +922,11 @@
 				// clear color modulation
 				GFX->getDrawUtil()->clearBitmapModulation();
 
+				Point2I bmPos = Point2I(textPos.x, rectCell.point.y);
+				bmPos.y += (rectCell.extent.y / 2) - (bitmap->extent.y / 2);
+
 				// draw bitmap
-				GFX->getDrawUtil()->drawBitmap(bitmap->texture, textPos);
+				GFX->getDrawUtil()->drawBitmap(bitmap->texture, bmPos);
 				textPos.x += bitmap->extent.x;
 
 				// restore color modulation
@@ -1068,7 +1091,7 @@
 	}
 
 	// restore clip rectangle
-	GFX->setClipRect(rectClipSave);
+//	GFX->setClipRect(rectClipSave);
 
 	// done
 }
@@ -1082,7 +1105,8 @@
 	Point2I				drawPos(0, 0), textPos(0, 0);
 	RectI				rectClipSave, rectCell, rectClip;
 	static char			storeText[MAXTEXTLEN], cleanText[MAXTEXTLEN];
-	S32					bitmapSize;
+	S32					bitmapSize = 0;
+	bool				active;
 
 
 	// save current clip rectangle
@@ -1119,9 +1143,6 @@
 		{
 			bitmapSize	= stripMarkupText(cleanText, storeText, false);
 			colText		= cleanText;
-		} else
-		{
-			bitmapSize	= 0;
 		}
 
 		// get text alignment position
@@ -1131,9 +1152,10 @@
 		textPos += drawPos + offset;
 
 		// draw background and then text
-		prepCellDraw(profile, rectCell, mRowGlowOffset, true, selected, mouseOver, mThemedRowCell);
+		active = !!(row->flags & Row_Flags_Active);
+		prepCellDraw(profile, rectCell, mRowGlowOffset, active, selected, mouseOver, mThemedRowCell);
 		if(mUseMarkup)
-			drawMarkupText(profile, textPos, storeText);
+			drawMarkupText(profile, rectCell, textPos, storeText);
 		else
 			GFX->getDrawUtil()->drawTextN(profile->mFont, textPos, colText, dStrlen(colText), profile->mFontColors);
 
@@ -1145,7 +1167,7 @@
 	}
 
 	// restore clip rectangle
-	GFX->setClipRect(rectClipSave);
+//	GFX->setClipRect(rectClipSave);
 
 	// done
 }
@@ -1772,10 +1794,10 @@
 
 bool GuiModernTextListCtrl::getRowByIndex(U32 index, tRowItem *&row)
 {
-	if(index >= (U32)mRows.size())
+	if(index >= (U32)mSortedRows.size())
 		return false;
 
-	row = &mRows[index];
+	row = mSortedRows[index];
 	return true;
 }
 
@@ -1789,7 +1811,7 @@
 	{
 		if(it->key == key)
 		{
-			row = &it[0];
+			row = &*it;
 			return true;
 		}
 
@@ -1975,6 +1997,112 @@
 	// done
 }
 
+void GuiModernTextListCtrl::parseRowTextFlags(tRowItem &row, const char *flags, bool init)
+{
+	enum
+	{
+		RowFlagText_Active = 1,
+		RowFlagText_Selectable,
+
+		RowFlagText_End
+	};
+	struct tRowFlags
+	{
+		S32				id;
+		const char		*flag;
+	};
+	static tRowFlags textFlags[] =
+	{
+		{ RowFlagText_Active,			"active" },
+		{ RowFlagText_Selectable,		"selectable" }
+	};
+	U32 len, pos, i;
+	const char *word;
+	bool enabler;
+
+
+	if(init)
+	{
+		// initially set the default row flags
+		row.flags	= Column_Flags_Active | Row_Flags_Selectable;
+	}
+
+	// parse the text flag words
+	while(flags && *flags)
+	{
+		// find whitespace char after word
+		pos = dStrcspn(flags, " \t");
+
+		// skip over empty word
+		if(pos == 0)
+		{
+			flags++;
+			continue;
+		}
+
+		// save word length, position, and bump up flags string
+		len   =  pos;
+		word  =  flags;
+		flags += pos;
+
+		// detect not symbol for disabler
+		enabler = true;
+		if(*word == '!')
+		{
+			word++;
+			len--;
+			enabler = false;
+		}
+
+		// iterate through the registered flag text words to find a match
+		for(pos=0, i=0; i<(RowFlagText_End -1); i++)
+		{
+			// make sure string lengths match
+			if(len != dStrlen(textFlags[i].flag))
+				continue;
+
+			// case-insensitive string comparison
+			if(dStrnicmp(word, textFlags[i].flag, len))
+				continue;
+
+			// flag word match found
+			pos = textFlags[i].id;
+			break;
+		}
+
+		// skip text flag word when not recognized
+		if(pos == 0)
+		{
+			// could possibly report unrecognized flag words here
+			continue;
+		}
+
+		// process the flag
+		switch (pos)
+		{
+			case RowFlagText_Active:
+			{
+				if(enabler)
+					row.flags |= Row_Flags_Active;
+				else
+					row.flags &= ~Row_Flags_Active;
+				break;
+			}
+
+			case RowFlagText_Selectable:
+			{
+				if(enabler)
+					row.flags |= Row_Flags_Selectable;
+				else
+					row.flags &= ~Row_Flags_Selectable;
+				break;
+			}
+		}
+	}
+
+	// done
+}
+
 bool GuiModernTextListCtrl::hitTestColumn(Point2I pt, tColItem *&column, U32 &indexPos)
 {
 	tviColumns	it;
@@ -2137,9 +2265,9 @@
 	return col.column;
 }
 
-U32 GuiModernTextListCtrl::addRow(S32 key, const char *text, U32 index)
+U32 GuiModernTextListCtrl::addRow(S32 key, const char *text, U32 index, const char *flags)
 {
-	tRowItem row;
+	tRowItem row, *pRow;
 
 	// create a new row
 	index			= mRows.size();
@@ -2158,11 +2286,22 @@
 	row.sortText	= dStrdup(stripped);
 #endif // MODERNLIST_SORT_STRIPONCE
 
+	// parse and process the provided row flags
+	parseRowTextFlags(row, flags);
+
 	// store the new row
-	if(index < mRows.size())
-		mRows.insert(mRows.begin() + index, row);
-	else
 		mRows.push_back(row);
+	pRow = &*mRows.rbegin();
+
+	// store the new sorted row pointer
+	if(index < mSortedRows.size())
+	{
+		mSortedRows.insert(mSortedRows.begin() + index, pRow);
+	} else
+	{
+		mSortedRows.push_back(pRow);
+		index = mSortedRows.size() -1;
+	}
 
 	// update control size
 	if(mResizeOnChange)
@@ -2173,15 +2312,16 @@
 
 void GuiModernTextListCtrl::removeRow(U32 index)
 {
+	tviRows		it;
 	tRowItem	*row;
 
 
 	// ignore invalid index position
-	if(index >= mRows.size())
+	if(index >= mSortedRows.size())
 		return;
 
 	// free any allocated memory for the row
-	row = &mRows[index];
+	row = mSortedRows[index];
 	dFree(row->text);
 #if defined(MODERNLIST_SORT_STRIPONCE)
 	dFree(row->sortText);
@@ -2191,8 +2331,26 @@
 	if(mDeferred.row == row)
 		mDeferred.row = NULL;
 
-	// delete the row
-	mRows.erase(mRows.begin() + index);
+	// delete the row pointer
+	mSortedRows.erase(mSortedRows.begin() + index);
+
+	// locate the real row item and delete it too
+	it = mRows.begin();
+	while(it != mRows.end())
+	{
+		if(&*it == row)
+		{
+			mRows.erase(it);
+			break;
+		}
+	}
+
+	// make sure row selection is valid
+	if(mSelectedCell.y >= mSortedRows.size())
+		mSelectedCell.y = mSortedRows.size() -1;
+
+	// update control size
+	updateSize();
 
 	// done
 }
@@ -2245,8 +2403,9 @@
 		it++;
 	}
 
-	// erase the vector
+	// erase the list and pointer vector
 	mRows.clear();
+	mSortedRows.clear();
 
 	// clear cached bitmaps
 	clearBitmaps();
@@ -2264,6 +2423,38 @@
 	sortColumns();
 }
 
+void GuiModernTextListCtrl::getColumnFlags(U32 index, char *flags)
+{
+	tColItem *col;
+
+	// default to empty string
+	*flags = 0;
+
+	if(!getColumnByIndex(index, col))
+		return;
+
+	switch (col->align)
+	{
+		default:
+		case Column_Align_Left:		dStrcat(flags, "left "); break;
+		case Column_Align_Right:	dStrcat(flags, "right "); break;
+		case Column_Align_Center:	dStrcat(flags, "center "); break;
+	}
+
+	if(col->type == Column_Type_Image)
+		dStrcat(flags, "headericon ");
+	else
+		dStrcat(flags, "headertext ");
+
+	if(!(col->flags & Column_Flags_Active))
+		dStrcat(flags, "!");
+	dStrcat(flags, "active ");
+
+	if(!(col->flags & Column_Flags_Visible))
+		dStrcat(flags, "!");
+	dStrcat(flags, "show");
+
+}
 
 const char* GuiModernTextListCtrl::getColumnName(U32 index)
 {
@@ -2348,6 +2539,24 @@
 	return mRows.size();
 }
 
+void GuiModernTextListCtrl::getRowFlags(U32 index, char *flags)
+{
+	tRowItem *row;
+
+	// default to empty string
+	*flags = 0;
+
+	if(!getRowByIndex(index, row))
+		return;
+
+	if(!(row->flags & Row_Flags_Active)) dStrcat(flags, "!");
+	dStrcat(flags, "active ");
+
+	if(!(row->flags & Row_Flags_Selectable)) dStrcat(flags, "!");
+	dStrcat(flags, "selectable");
+
+}
+
 const char* GuiModernTextListCtrl::getRowText(U32 index)
 {
 	tRowItem *row;
@@ -2370,14 +2579,14 @@
 
 U32 GuiModernTextListCtrl::getRowIndex(S32 key)
 {
-	tviRows		it;
+	tviSortedRows	it;
 	U32			index = 0;
 
 	// find column associated with key
-	it = mRows.begin();
-	while(it != mRows.end())
+	it = mSortedRows.begin();
+	while(it != mSortedRows.end())
 	{
-		if(it->key == key)
+		if((*it)->key == key)
 		{
 			// return index position
 			return index;
@@ -2494,6 +2703,18 @@
 		updateSize();
 }
 
+void GuiModernTextListCtrl::setRowFlags(U32 index, const char *flags)
+{
+	tRowItem *row;
+	
+	if(!getRowByIndex(index, row))
+		return;
+
+	// parse and process the provided row flags
+	parseRowTextFlags(*row, flags, false);
+
+}
+
 void GuiModernTextListCtrl::setRowText(U32 index, const char *text)
 {
 	tRowItem *row;
@@ -2528,7 +2749,7 @@
 
 		// sort rows based on current column sort order rules
 		mSortManager->setMarkupEnable(mUseMarkup);
-		std::sort(mRows.begin(), mRows.end(), *mSortManager);
+		std::sort(mSortedRows.begin(), mSortedRows.end(), *mSortManager);
 		
 		// update each column's sort indicator
 		it = mSortRules.begin();
@@ -2597,19 +2818,19 @@
 
 void GuiModernTextListCtrl::moveRow(S32 key, U32 index)
 {
-	tviRows		it;
-	tRowItem	row;
+	tviSortedRows	it;
+	tRowItem		*row;
 
 
 	// check to see if the row index position is even possible
-	if(index >= mRows.size())
+	if(index >= mSortedRows.size())
 		return; // not possible
 
 	// find row associated with key
-	it = mRows.begin();
-	while(it != mRows.end())
+	it = mSortedRows.begin();
+	while(it != mSortedRows.end())
 	{
-		if(it->key != key)
+		if((*it)->key != key)
 		{
 			// next
 			it++;
@@ -2617,13 +2838,13 @@
 		}
 
 		// keep a copy
-		row = it[0];
+		row = *it;
 
 		// delete the row
-		mRows.erase(it);
+		mSortedRows.erase(it);
 
 		// re-insert row at requested index position
-		mRows.insert(mRows.begin() + index, row);
+		mSortedRows.insert(mSortedRows.begin() + index, row);
 		break;
 	}
 
@@ -2677,7 +2898,7 @@
 	return object->addColumn(key, name, width, minWidth, maxWidth, flags);
 }
 
-DefineEngineMethod( GuiModernTextListCtrl, addRow, S32, (S32 key, const char* text, U32 index), (0, "", -1) ,
+DefineEngineMethod( GuiModernTextListCtrl, addRow, S32, (S32 key, const char *text, U32 index, const char *flags), (0, "", -1, "") ,
 	"@brief Adds a new row at end of the list with the defined id and text.\n"
 	"If index is used, then the new row is inserted at the row location of 'index'.\n\n"
 	"@param Key The key to be associated with the new row.\n"
@@ -2696,7 +2917,7 @@
 	"@return Returns the row index of the new row.\n\n"
 	"@see References")
 {
-	return object->addRow(key, text, index);
+	return object->addRow(key, text, index, flags);
 }
 
 DefineEngineMethod( GuiModernTextListCtrl, removeRow, void, (U32 index), ,
@@ -2723,6 +2944,17 @@
 	object->clearSortOrders();
 }
 
+DefineEngineMethod( GuiModernTextListCtrl, getColumnFlags, const char*, (U32 index), ,
+   "\n")
+{
+	U32 buffSize = MAXFLAGSTEXTLEN;
+	char *str = Con::getReturnBuffer(buffSize);
+	*str = 0;
+
+	object->getColumnFlags(index, str);
+	return str;
+}
+
 DefineEngineMethod( GuiModernTextListCtrl, getColumnName, const char*, (U32 index), ,
    "\n")
 {
@@ -2787,6 +3019,17 @@
 	return object->getRowCount();
 }
 
+DefineEngineMethod( GuiModernTextListCtrl, getRowFlags, const char*, (U32 index), ,
+   "\n")
+{
+	U32 buffSize = MAXFLAGSTEXTLEN;
+	char *str = Con::getReturnBuffer(buffSize);
+	*str = 0;
+
+	object->getRowFlags(index, str);
+	return str;
+}
+
 DefineEngineMethod( GuiModernTextListCtrl, getRowText, const char*, (U32 index),,
    "\n")
 {
@@ -2849,6 +3092,12 @@
 	object->setColumnWidth(index, width);
 }
 
+DefineEngineMethod( GuiModernTextListCtrl, setRowFlags, void, (U32 index, const char *flags),,
+   "\n")
+{
+	object->setRowFlags(index, flags);
+}
+
 DefineEngineMethod( GuiModernTextListCtrl, setRowText, void, (U32 index, const char *text),,
    "\n")
 {
@@ -2921,7 +3170,7 @@
 // GuiModernTextListCtrl's Sort Comparer handling Class
 //=============================================================================
 
-bool GuiModernSort::operator()(GuiModernTextListCtrl::tRowItem &a, GuiModernTextListCtrl::tRowItem &b)
+bool GuiModernSort::operator()(const GuiModernTextListCtrl::tRowItem *a, const GuiModernTextListCtrl::tRowItem *b)
 {
 	GuiModernTextListCtrl::tColItem		*col;
 	GuiModernTextListCtrl::tviSortRules	it;
@@ -2935,27 +3184,33 @@
 			break; // abort
 
 #if !defined(MODERNLIST_SORT_STRIPONCE)
-		// get row A's column specific content and strip the content of markup
-		getColumnContent(a.text, mTextT, sizeof(mTextT), col->column);
 		if(mMarkup)
+		{
+			// get row A's column specific content and strip the content of markup
+			getColumnContent(a->text, mTextT, sizeof(mTextT), col->column);
 			mOwner->stripMarkupText(mTextA, mTextT, true);
 
 		// get row B's column specific content and strip the content of markup
-		getColumnContent(b.text, mTextT, sizeof(mTextT), col->column);
-		if(mMarkup)
+			getColumnContent(b->text, mTextT, sizeof(mTextT), col->column);
 			mOwner->stripMarkupText(mTextB, mTextT, true);
+		} else
+		{
+			// get row A and B's column specific content
+			getColumnContent(a->text, mTextA, sizeof(mTextA), col->column);
+			getColumnContent(b->text, mTextB, sizeof(mTextB), col->column);
+		}
 
 #else // MODERNLIST_SORT_STRIPONCE
 
 		// get A and B's column specific content that has been pre-stripped of markup
 		if(mMarkup)
 		{
-			getColumnContent(a.sortText, mTextA, sizeof(mTextA), col->column);
-			getColumnContent(b.sortText, mTextB, sizeof(mTextB), col->column);
+			getColumnContent(a->sortText, mTextA, sizeof(mTextA), col->column);
+			getColumnContent(b->sortText, mTextB, sizeof(mTextB), col->column);
 		} else
 		{
-			getColumnContent(a.text, mTextA, sizeof(mTextA), col->column);
-			getColumnContent(b.text, mTextB, sizeof(mTextB), col->column);
+			getColumnContent(a->text, mTextA, sizeof(mTextA), col->column);
+			getColumnContent(b->text, mTextB, sizeof(mTextB), col->column);
 		}
 
 #endif // MODERNLIST_SORT_STRIPONCE
--- guiModernTextListCtrl.h	Thu Jan 15 03:14:12 1970
+++ guiModernTextListCtrl.h	Thu Jan 15 03:14:12 1970
@@ -12,6 +12,7 @@
 #endif
 
 #include <vector>
+#include <list>
 
 
 // Use the define below to use code that keeps a dedicated text string buffer of
@@ -26,6 +27,10 @@
 // manipulate as per row column content limit.
 #define MAXTEXTLEN	4096
 
+// Declares the maximum text size minus one byte for NULL of string buffers that
+// will be used to store column header or row flags in textual format.
+#define MAXFLAGSTEXTLEN	64
+
 
 class GuiModernSort;
 
@@ -47,7 +52,7 @@
 		Column_Type_Image,					// column header will display a bitmap icon in the name label
 
 		// column flags
-		Column_Flags_Active		= 0x01,		// column header is in an active/enabled state, else in a deactive/disabled state
+		Column_Flags_Active		= 0x01,		// column header is in an active/enabled state, else in a inactive/disabled state
 		Column_Flags_Visible	= 0x02,		// column header is in a invisible state, else in a hidden state
 		Column_Flags_Deferred	= 0x04,		// column header draw state is deferred and will be drawn last (move, glow effects, etc..)
 		Column_Flags_Highlight	= 0x10,		// column header is in highlight state, mouse is hovering over it
@@ -57,7 +62,10 @@
 		Column_Flags_ClearSoft	= Column_Flags_Deferred | Column_Flags_Highlight | Column_Flags_Select,
 
 
-		Column_END__
+		// row flags
+		Row_Flags_Active		= 0x01,		// row is in an active/enabled state, else in a inactive/disabled state for visual representation
+		Row_Flags_Selectable	= 0x02,		// row is user selectable, else it isn't. Note setSelectedRow() ignores this flag bit.
+
 	};
 	// header column item data
 	struct tColItem
@@ -89,13 +97,6 @@
 #if defined(MODERNLIST_SORT_STRIPONCE)
 		char				*sortText;		// row content preprocessed for column sorting use
 #endif // MODERNLIST_SORT_STRIPONCE
-
-		friend void swap(tRowItem &a, tRowItem &b)
-		{
-			tRowItem temp = a;
-			a = b;
-			b = temp;
-		}
 	};
 	struct tBitmap
 	{
@@ -108,14 +109,16 @@
 
 	std::vector<tColItem>	mColumns;			// header columns
 	std::vector<tSortRule>	mSortRules;			// header column sort order rules
-	std::vector<tRowItem>	mRows;				// row items
+	std::list<tRowItem>		mRows;				// row items
+	std::vector<tRowItem*>	mSortedRows;		// sorted row items
 	std::vector<tBitmap>	mBitmaps;			// bitmaps
 	GuiModernSort			*mSortManager;		// pointer to the modern sort instance
 
 
 	typedef std::vector<tColItem>::iterator		tviColumns;
 	typedef std::vector<tSortRule>::iterator	tviSortRules;
-	typedef std::vector<tRowItem>::iterator		tviRows;
+	typedef std::list<tRowItem>::iterator		tviRows;
+	typedef std::vector<tRowItem*>::iterator	tviSortedRows;
 	typedef std::vector<tBitmap>::iterator		tviBitmaps;
 
 protected:
@@ -138,6 +141,7 @@
 	bool getSortRuleByIndex(U32 index, tSortRule *&rule);
 	bool getSortRuleByKey(S32 key, tSortRule *&rule);
 	void parseColumnTextFlags(tColItem &col, const char *flags, bool init = true);
+	void parseRowTextFlags(tRowItem &row, const char *flags, bool init = true);
 	bool hitTestColumn(Point2I pt, tColItem *&column, U32 &indexPos);
 	S32  calcRowsWidth(void);
 	S32  calcRowsHeight(void);
@@ -148,7 +152,7 @@
 	void prepCellDraw(GuiControlProfile *profile, RectI &rectCell, Point2I &glowOffset, bool active, bool selected, bool mouseOver, bool texture);
 	S32  stripMarkupText(char *dstText, const char *srcText, bool keepPrimitives = false, bool preservDest = false);
 	void stripMarkupTextFields(char *&dstText, const char *srcText, bool keepPrimitives);
-	void drawMarkupText(GuiControlProfile *profile, Point2I &textPos, const char *text);
+	void drawMarkupText(GuiControlProfile *profile, RectI &rectCell, Point2I &textPos, const char *text);
 	void drawColumnSortArrow(tColItem *col, RectI &drawRect, RectI &rectText);
 
 
@@ -239,7 +243,7 @@
 
 	// console exposed control methods
 	U32 addColumn(S32 key, const char *name, U32 width, U32 minWidth, U32 maxWidth, const char *flags);
-	U32 addRow(S32 key, const char *text, U32 index = -1);
+	U32 addRow(S32 key, const char *text, U32 index = -1, const char *flags = "");
 
 	void removeRow(U32 index);
 
@@ -247,6 +251,7 @@
 	void clearRows(void);
 	void clearSortOrders(void);
 
+	void getColumnFlags(U32 index, char *flags);
 	const char *getColumnName(U32 index);
 	S32 getColumnKey(U32 index);
 	U32 getColumnWidth(U32 index);
@@ -258,6 +263,7 @@
 
 	U32 getSelectedRow(void);
 	U32 getRowCount(void);
+	void getRowFlags(U32 index, char *flags);
 	const char *getRowText(U32 index);
 	S32 getRowKey(U32 index);
 	U32 getRowIndex(S32 key);
@@ -269,6 +275,7 @@
 	void setColumnFlags(U32 index, const char *flags);
 	void setColumnSortOrder(S32 key, S32 order, bool pushToFirst = false);
 	void setColumnWidth(U32 index, U32 width);
+	void setRowFlags(U32 index, const char *flags);
 	void setRowText(U32 index, const char *text);
 
 	void sortColumns(void);
@@ -315,7 +322,15 @@
 
 	void setMarkupEnable(bool enable) { mMarkup = enable; }
 
-	bool operator()(GuiModernTextListCtrl::tRowItem &a, GuiModernTextListCtrl::tRowItem &b);
+	bool operator()(const GuiModernTextListCtrl::tRowItem *a, const GuiModernTextListCtrl::tRowItem *b);
+/*	friend void swap(GuiModernTextListCtrl::tRowItem *&a, GuiModernTextListCtrl::tRowItem *&b)
+	{
+		GuiModernTextListCtrl::tRowItem *c;
+		c = a;
+		a = b;
+		b = c;
+	}
+*/
 };
 
 
