MCPcopy Create free account
hub / github.com/SpartanJ/eepp / getPropertyString

Method getPropertyString

src/eepp/ui/uilistbox.cpp:1010–1036  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1008}
1009
1010std::string UIListBox::getPropertyString( const PropertyDefinition* propertyDef,
1011 const Uint32& propertyIndex ) const {
1012 if ( NULL == propertyDef )
1013 return "";
1014
1015 switch ( propertyDef->getPropertyId() ) {
1016 case PropertyId::RowHeight:
1017 return String::format( "%ddp", getRowHeight() );
1018 case PropertyId::VScrollMode:
1019 return getVerticalScrollMode() == ScrollBarMode::Auto
1020 ? "auto"
1021 : ( getVerticalScrollMode() == ScrollBarMode::AlwaysOn ? "on" : "off" );
1022 case PropertyId::HScrollMode:
1023 return getHorizontalScrollMode() == ScrollBarMode::Auto
1024 ? "auto"
1025 : ( getHorizontalScrollMode() == ScrollBarMode::AlwaysOn ? "on" : "off" );
1026 case PropertyId::SelectedIndex:
1027 return String::toString( getItemSelectedIndex() );
1028 case PropertyId::SelectedText:
1029 return getItemSelectedText();
1030 case PropertyId::ScrollBarStyle:
1031 return mVScrollBar->getScrollBarType() == UIScrollBar::NoButtons ? "no-buttons"
1032 : "two-buttons";
1033 default:
1034 return UITouchDraggableWidget::getPropertyString( propertyDef, propertyIndex );
1035 }
1036}
1037
1038std::vector<PropertyId> UIListBox::getPropertiesImplemented() const {
1039 auto props = UITouchDraggableWidget::getPropertiesImplemented();

Callers

nothing calls this directly

Calls 4

formatFunction · 0.85
getPropertyIdMethod · 0.80
getScrollBarTypeMethod · 0.80
toStringFunction · 0.50

Tested by

no test coverage detected