7 #ifndef __MYGUI_MULTI_LIST_BOX_H__
8 #define __MYGUI_MULTI_LIST_BOX_H__
44 virtual
void setPosition(const
IntPoint& _value);
46 virtual
void setSize(const
IntSize& _value);
48 virtual
void setCoord(const
IntCoord& _value);
51 void setPosition(
int _left,
int _top);
53 void setSize(
int _width,
int _height);
55 void setCoord(
int _left,
int _top,
int _width,
int _height);
63 size_t getColumnCount() const;
71 void insertColumnAt(
size_t _column, const
UString& _name,
int _width = 0,
Any _data =
Any::Null);
78 void addColumn(const
UString& _name,
int _width = 0,
Any _data =
Any::Null);
81 void removeColumnAt(
size_t _column);
84 void removeAllColumns();
87 void swapColumnsAt(
size_t _index1,
size_t _index2);
96 void setColumnNameAt(
size_t _column, const
UString& _name);
108 void setColumnWidthAt(
size_t _column,
int _width);
117 const
UString& getColumnNameAt(
size_t _column);
123 int getColumnWidthAt(
size_t _column);
126 void sortByColumn(
size_t _column,
bool _backward = false);
140 void setColumnResizingPolicyAt(
size_t _index,
ResizingPolicy _value);
146 void setColumnDataAt(
size_t _index,
Any _data);
149 void clearColumnDataAt(
size_t _index);
152 template <typename ValueType>
153 ValueType* getColumnDataAt(
size_t _index,
bool _throw = true)
156 return mVectorColumnInfo[_index].data.castType<ValueType>(_throw);
170 size_t getItemCount()
const;
179 void removeItemAt(
size_t _index);
182 void removeAllItems();
185 void swapItemsAt(
size_t _index1,
size_t _index2);
192 void setItemNameAt(
size_t _index,
const UString& _name);
195 const UString& getItemNameAt(
size_t _index);
202 size_t getIndexSelected()
const;
205 void setIndexSelected(
size_t _index);
208 void clearIndexSelected();
215 void setItemDataAt(
size_t _index,
Any _data);
218 void clearItemDataAt(
size_t _index);
221 template <
typename ValueType>
222 ValueType* getItemDataAt(
size_t _index,
bool _throw =
true)
224 return getSubItemDataAt<ValueType>(0, _index, _throw);
238 void setSubItemNameAt(
size_t _column,
size_t _index,
const UString& _name);
241 const UString& getSubItemNameAt(
size_t _column,
size_t _index);
244 size_t findSubItemWith(
size_t _column,
const UString& _name);
250 void setSubItemDataAt(
size_t _column,
size_t _index,
Any _data);
253 void clearSubItemDataAt(
size_t _column,
size_t _index);
256 template <
typename ValueType>
257 ValueType* getSubItemDataAt(
size_t _column,
size_t _index,
bool _throw =
true)
259 MYGUI_ASSERT_RANGE(_index, mVectorColumnInfo.begin()->list->getItemCount(),
"MultiListBox::getSubItemDataAt");
262 return getSubItemAt(_column)->getItemDataAt<ValueType>(index, _throw);
292 virtual size_t _getItemCount();
294 virtual void _removeItemAt(
size_t _index);
295 virtual Widget* _getItemAt(
size_t _index);
296 virtual void _setItemNameAt(
size_t _index,
const UString& _name);
297 virtual const UString& _getItemNameAt(
size_t _index);
300 virtual void initialiseOverride();
301 virtual void shutdownOverride();
303 virtual void onWidgetCreated(
Widget* _widget);
304 virtual void onWidgetDestroy(
Widget* _widget);
307 void notifyListChangePosition(
ListBox* _sender,
size_t _position);
308 void notifyListChangeFocus(
ListBox* _sender,
size_t _position);
309 void notifyListChangeScrollPosition(
ListBox* _sender,
size_t _position);
310 void notifyButtonClick(
Widget* _sender);
311 void notifyListSelectAccept(
ListBox* _sender,
size_t _position);
313 void updateColumns();
314 void redrawButtons();
315 void updateOnlyEmpty();
317 bool compare(
ListBox* _list,
size_t _left,
size_t _right);
321 Widget* getSeparator(
size_t _index);
323 void updateBackSelected(
size_t _index);
337 typedef std::vector<ColumnInfo> VectorColumnInfo;
339 void frameEntered(
float _frame);
340 void frameAdvise(
bool _advise);
342 ListBox* getSubItemAt(
size_t _column);
343 int getButtonHeight()
const;
347 void _swapColumnsAt(
size_t _index1,
size_t _index2);
349 int getColumnWidth(
size_t _index,
int _freeSpace,
size_t _countStars,
size_t _lastIndexStar,
int _starWidth)
const;
350 bool getUpdateByResize();
351 int updateWidthColumns(
size_t& _countStars,
size_t& _lastIndexStar);
356 std::string mSkinButton;
357 std::string mSkinList;
360 VectorColumnInfo mVectorColumnInfo;
364 size_t mLastMouseFocusIndex;
367 size_t mSortColumnIndex;
370 std::string mSkinSeparator;
372 size_t mItemSelected;
381 #endif // __MYGUI_MULTI_LIST_BOX_H__