7#ifndef MYGUI_MULTI_LIST_BOX_H_
8#define MYGUI_MULTI_LIST_BOX_H_
48 void setPosition(
const IntPoint& _point)
override;
50 void setSize(
const IntSize& _size)
override;
52 void setCoord(
const IntCoord& _coord)
override;
54 using Widget::setPosition;
55 using Widget::setSize;
56 using Widget::setCoord;
64 size_t getColumnCount()
const;
72 void insertColumnAt(
size_t _column,
const UString& _name,
int _width = 0,
Any _data = Any::Null);
79 void addColumn(
const UString& _name,
int _width = 0,
Any _data = Any::Null);
82 void removeColumnAt(
size_t _column);
85 void removeAllColumns();
88 void swapColumnsAt(
size_t _index1,
size_t _index2);
97 void setColumnNameAt(
size_t _column,
const UString& _name);
109 void setColumnWidthAt(
size_t _column,
int _width);
118 const UString& getColumnNameAt(
size_t _column)
const;
124 int getColumnWidthAt(
size_t _column)
const;
127 void sortByColumn(
size_t _column,
bool _backward =
false);
141 void setColumnResizingPolicyAt(
size_t _index,
ResizingPolicy _value);
147 void setColumnDataAt(
size_t _index,
Any _data);
150 void clearColumnDataAt(
size_t _index);
153 template<
typename ValueType>
157 return mVectorColumnInfo[_index].data.castType<ValueType>(_throw);
171 size_t getItemCount()
const;
174 void insertItemAt(
size_t _index,
const UString& _name,
Any _data = Any::Null);
177 void addItem(
const UString& _name,
Any _data = Any::Null);
180 void removeItemAt(
size_t _index);
183 void removeAllItems();
186 void swapItemsAt(
size_t _index1,
size_t _index2);
193 void setItemNameAt(
size_t _index,
const UString& _name);
196 const UString& getItemNameAt(
size_t _index)
const;
203 size_t getIndexSelected()
const;
206 void setIndexSelected(
size_t _index);
209 void clearIndexSelected();
216 void setItemDataAt(
size_t _index,
Any _data);
219 void clearItemDataAt(
size_t _index);
222 template<
typename ValueType>
225 return getSubItemDataAt<ValueType>(0, _index, _throw);
239 void setSubItemNameAt(
size_t _column,
size_t _index,
const UString& _name);
242 const UString& getSubItemNameAt(
size_t _column,
size_t _index)
const;
245 size_t findSubItemWith(
size_t _column,
const UString& _name);
251 void setSubItemDataAt(
size_t _column,
size_t _index,
Any _data);
254 void clearSubItemDataAt(
size_t _column,
size_t _index);
257 template<
typename ValueType>
262 mVectorColumnInfo.begin()->list->getItemCount(),
263 "MultiListBox::getSubItemDataAt");
265 size_t index = BiIndexBase::convertToBack(_index);
266 return getSubItemAt(_column)->getItemDataAt<ValueType>(index, _throw);
306 size_t _getItemCount()
const override;
308 void _removeItemAt(
size_t _index)
override;
309 Widget* _getItemAt(
size_t _index)
const override;
310 void _setItemNameAt(
size_t _index,
const UString& _name)
override;
311 const UString& _getItemNameAt(
size_t _index)
const override;
314 void initialiseOverride()
override;
315 void shutdownOverride()
override;
317 void onWidgetCreated(
Widget* _widget)
override;
318 void onWidgetDestroy(
Widget* _widget)
override;
321 void notifyListChangePosition(
ListBox* _sender,
size_t _position);
322 void notifyListChangeFocus(
ListBox* _sender,
size_t _position);
323 void notifyListChangeScrollPosition(
ListBox* _sender,
size_t _position);
324 void notifyButtonClick(
Widget* _sender);
325 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* getOrCreateSeparator(
size_t _index);
338 void updateBackSelected(
size_t _index);
352 using VectorColumnInfo = std::vector<ColumnInfo>;
354 void frameEntered(
float _frame);
355 void frameAdvise(
bool _advise);
357 ListBox* getSubItemAt(
size_t _column)
const;
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)
366 bool getUpdateByResize()
const;
367 int updateWidthColumns(
size_t& _countStars,
size_t& _lastIndexStar);
370 int mHeightButton{0};
372 std::string mSkinButton;
373 std::string mSkinList;
374 Widget* mWidgetEmpty{
nullptr};
376 VectorColumnInfo mVectorColumnInfo;
385 int mWidthSeparator{0};
386 std::string mSkinSeparator;
390 bool mFrameAdvise{
false};
391 Widget* mHeaderPlace{
nullptr};
#define MYGUI_ASSERT_RANGE(index, size, owner)
#define MYGUI_RTTI_DERIVED(DerivedType)
widget description should be here.
widget description should be here.
EventPair< EventHandle_MultiListPtrSizeTCUTFStringRefCUTFStringRefBoolRef, EventHandle_MultiListPtrSizeTSizeTSizeTBoolRef > requestOperatorLess
EventPair< EventHandle_WidgetSizeT, EventHandle_MultiListPtrSizeT > eventListChangePosition
EventPair< EventHandle_WidgetSizeT, EventHandle_MultiListPtrSizeT > eventListSelectAccept
ValueType * getSubItemDataAt(size_t _column, size_t _index, bool _throw=true)
Get item data from specified position.
EventHandle_MultiListPtrCIBNotifyCellDataRef eventNotifyItem
ValueType * getColumnDataAt(size_t _index, bool _throw=true)
Get item data from specified position.
ValueType * getItemDataAt(size_t _index, bool _throw=true)
Get item data from specified position.
widget description should be here.
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
constexpr size_t ITEM_NONE
std::vector< Widget * > VectorWidgetPtr