MCPcopy Create free account
hub / github.com/MyGUI/mygui / updateWidthColumns

Method updateWidthColumns

MyGUIEngine/src/MyGUI_MultiListBox.cpp:885–920  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

883 }
884
885 int MultiListBox::updateWidthColumns(size_t& _countStars, size_t& _lastIndexStar)
886 {
887 _countStars = 0;
888 _lastIndexStar = ITEM_NONE;
889
890 int width = 0;
891
892 for (size_t index = 0; index < mVectorColumnInfo.size(); ++index)
893 {
894 ColumnInfo& info = mVectorColumnInfo[index];
895
896 if (info.sizeType == ResizingPolicy::Auto)
897 {
898 info.realWidth =
899 info.button->getWidth() - info.button->getTextRegion().width + info.button->getTextSize().width;
900 }
901 else if (info.sizeType == ResizingPolicy::Fixed)
902 {
903 info.realWidth = info.width < 0 ? 0 : info.width;
904 }
905 else if (info.sizeType == ResizingPolicy::Fill)
906 {
907 info.realWidth = 0;
908 _countStars++;
909 _lastIndexStar = index;
910 }
911 else
912 {
913 info.realWidth = 0;
914 }
915
916 width += info.realWidth;
917 }
918
919 return width;
920 }
921
922 void MultiListBox::updateColumns()
923 {

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.45
getWidthMethod · 0.45
getTextRegionMethod · 0.45
getTextSizeMethod · 0.45

Tested by

no test coverage detected