20 #ifndef PAWS_LIST_BOX_HEADER 21 #define PAWS_LIST_BOX_HEADER 74 #define LISTBOX_HIGHLIGHTED 0x01 75 #define LISTBOX_SELECTED 0x02 96 return columns.GetSize();
100 void AddColumn(
int column,
ColumnDef* def);
103 void AddTitleColumn(
int column,
ColumnDef* def);
105 bool OnKeyDown(utf32_char keyCode, utf32_char keyChar,
int modifiers);
108 bool OnMouseDown(
int button,
int modifiers,
int x,
int y);
111 bool OnDoubleClick(
int button,
int modifiers,
int x,
int y);
114 void SetHeading(
bool flag);
117 void SetTitleRow(
bool flag);
150 csArray<pawsWidget*> columns;
160 #define LISTBOX_MOUSE_SCROLL_AMOUNT 3 207 bool Setup(iDocumentNode* node);
225 const char* GetSelectedText(
size_t columnId);
228 int GetSelectedRowNum();
242 size_t GetRowCount();
250 pawsListBoxRow* NewTextBoxRow(csList<csString> &rowEntry,
size_t position = (
size_t)-1);
255 void SendOnListAction(
int status);
261 bool SelectByIndex(
int index,
bool notify =
true);
264 void CreateTitleRow();
268 bool OnMouseDown(
int button,
int modifiers,
int x,
int y);
281 void SetTotalColumns(
int numCols);
293 void SetColumnDef(
int col,
int width,
int height,
const char* widgetDesc);
295 void UseTitleRow(
bool yes);
300 virtual bool SelfPopulate(iDocumentNode* node);
318 bool ConvertFromAutoID(
int id,
int &row,
int &col);
323 void MoveSelectBar(
bool direction);
325 void CalculateDrawPositions();
331 bool OnKeyDown(utf32_char keyCode, utf32_char keyChar,
int modifiers);
342 notifyTarget = target;
349 int GetSortedColumn();
350 void SetSortedColumn(
int colNum);
353 void SetSortOrder(
bool ascOrder);
376 csString GetTextCellValue(
int rowNum,
int colNum);
381 void SetTextCellValue(
int rowNum,
int colNum,
const csString &value);
385 autoUpdateScroll = v;
388 void SetScrollBarMaxValue();
389 void MoveRow(
int rownr,
int dest);
399 static const int BORDER_SIZE = 5;
401 void CreateSortingArrow(
int colNum);
402 void SetSortingArrow(
int colNum,
bool ascOrder);
403 void CheckSortingArrow(
int colNum,
bool ascOrder);
404 void DeleteSortingArrow(
int colNum);
413 int GetUnborderedHeight();
447 static int sort_cmp(
const void* rowA,
const void* rowB);
static int sort_sortColNum
int(* listBoxSortingFunc)(pawsWidget *a, pawsWidget *b)
Type of functions that are used to compare listbox rows during sorting:
void SetNotify(pawsWidget *target)
Sets the widget that will be notified when a row is selected.
static listBoxSortingFunc sort_sortFunc
int GetSelection()
Get the row that is currently selected.
Defines the structure of the list box table.
int textBoxSortFunc(pawsWidget *widgetA, pawsWidget *widgetB)
Compare function that works with listbox columns that are pawsTextBox widgets:
pawsWidget * notifyTarget
the widget that will be notified when a row is selected
pawsListBoxRow * titleRow
csRef< iDocumentNode > widgetNode
void AutoScrollUpdate(bool v)
size_t GetTotalColumns()
Get total columns.
pawsScrollBar * scrollBar
csArray< pawsListBoxRow * > rows
void SetLastIndex(int index)
Sets the last index of the row. Is used by pawsListBox to update lastIndex variable when sorting...
A simple list box widget.
static bool sort_ascOrder
int textBoxSortFunc_number(pawsWidget *widgetA, pawsWidget *widgetB)
Function that compares listbox rows which contain pawsTextBoxWidget with numbers inside.
pawsScrollBar * horzscrollBar
csString xmlbinding
Passed to new column widgets to create.
listBoxSortingFunc sortFunc
unsigned int highlightAlpha
bool IsAutoID()
Is this an autoID listbox.
CREATE_PAWS_FACTORY(pawsListBox)
int GetLastIndex() const
Returns the last index of the row.