22 #ifndef __MYGUI_MULTI_LIST_BOX_H__
23 #define __MYGUI_MULTI_LIST_BOX_H__
56 virtual
void setPosition(const
IntPoint& _value);
58 virtual
void setSize(const
IntSize& _value);
60 virtual
void setCoord(const
IntCoord& _value);
63 void setPosition(
int _left,
int _top);
65 void setSize(
int _width,
int _height);
67 void setCoord(
int _left,
int _top,
int _width,
int _height);
75 size_t getColumnCount() const;
83 void insertColumnAt(
size_t _column, const
UString& _name,
int _width = 0,
Any _data =
Any::Null);
90 void addColumn(const
UString& _name,
int _width = 0,
Any _data =
Any::Null);
93 void removeColumnAt(
size_t _column);
96 void removeAllColumns();
99 void swapColumnsAt(
size_t _index1,
size_t _index2);
108 void setColumnNameAt(
size_t _column, const
UString& _name);
120 void setColumnWidthAt(
size_t _column,
int _width);
129 const
UString& getColumnNameAt(
size_t _column);
135 int getColumnWidthAt(
size_t _column);
138 void sortByColumn(
size_t _column,
bool _backward = false);
152 void setColumnResizingPolicyAt(
size_t _index,
ResizingPolicy _value);
158 void setColumnDataAt(
size_t _index,
Any _data);
161 void clearColumnDataAt(
size_t _index);
164 template <typename ValueType>
165 ValueType* getColumnDataAt(
size_t _index,
bool _throw = true)
168 return mVectorColumnInfo[_index].data.castType<ValueType>(_throw);
182 size_t getItemCount()
const;
191 void removeItemAt(
size_t _index);
194 void removeAllItems();
197 void swapItemsAt(
size_t _index1,
size_t _index2);
204 void setItemNameAt(
size_t _index,
const UString& _name);
207 const UString& getItemNameAt(
size_t _index);
214 size_t getIndexSelected()
const;
217 void setIndexSelected(
size_t _index);
220 void clearIndexSelected();
227 void setItemDataAt(
size_t _index,
Any _data);
230 void clearItemDataAt(
size_t _index);
233 template <
typename ValueType>
234 ValueType* getItemDataAt(
size_t _index,
bool _throw =
true)
236 return getSubItemDataAt<ValueType>(0, _index, _throw);
250 void setSubItemNameAt(
size_t _column,
size_t _index,
const UString& _name);
253 const UString& getSubItemNameAt(
size_t _column,
size_t _index);
256 size_t findSubItemWith(
size_t _column,
const UString& _name);
262 void setSubItemDataAt(
size_t _column,
size_t _index,
Any _data);
265 void clearSubItemDataAt(
size_t _column,
size_t _index);
268 template <
typename ValueType>
269 ValueType* getSubItemDataAt(
size_t _column,
size_t _index,
bool _throw =
true)
271 MYGUI_ASSERT_RANGE(_index, mVectorColumnInfo.begin()->list->getItemCount(),
"MultiListBox::getSubItemDataAt");
274 return getSubItemAt(_column)->getItemDataAt<ValueType>(index, _throw);
307 virtual size_t _getItemCount();
309 virtual void _removeItemAt(
size_t _index);
310 virtual Widget* _getItemAt(
size_t _index);
311 virtual void _setItemNameAt(
size_t _index,
const UString& _name);
312 virtual const UString& _getItemNameAt(
size_t _index);
315 virtual void initialiseOverride();
316 virtual void shutdownOverride();
318 virtual void onWidgetCreated(
Widget* _widget);
319 virtual void onWidgetDestroy(
Widget* _widget);
322 void notifyListChangePosition(
ListBox* _sender,
size_t _position);
323 void notifyListChangeFocus(
ListBox* _sender,
size_t _position);
324 void notifyListChangeScrollPosition(
ListBox* _sender,
size_t _position);
325 void notifyButtonClick(
Widget* _sender);
326 void notifyListSelectAccept(
ListBox* _sender,
size_t _position);
328 void updateColumns();
329 void redrawButtons();
330 void updateOnlyEmpty();
332 bool compare(
ListBox* _list,
size_t _left,
size_t _right);
336 Widget* getSeparator(
size_t _index);
338 void updateBackSelected(
size_t _index);
352 typedef std::vector<ColumnInfo> VectorColumnInfo;
354 void frameEntered(
float _frame);
355 void frameAdvise(
bool _advise);
357 ListBox* getSubItemAt(
size_t _column);
358 int getButtonHeight()
const;
362 void _swapColumnsAt(
size_t _index1,
size_t _index2);
364 int getColumnWidth(
size_t _index,
int _freeSpace,
size_t _countStars,
size_t _lastIndexStar,
int _starWidth)
const;
365 bool getUpdateByResize();
366 int updateWidthColumns(
size_t& _countStars,
size_t& _lastIndexStar);
371 std::string mSkinButton;
372 std::string mSkinList;
375 VectorColumnInfo mVectorColumnInfo;
379 size_t mLastMouseFocusIndex;
382 size_t mSortColumnIndex;
385 std::string mSkinSeparator;
386 int mOffsetButtonSeparator;
388 size_t mItemSelected;
397 #endif // __MYGUI_MULTI_LIST_BOX_H__