MCPcopy Create free account
hub / github.com/buggins/coolreader / toggleSubmenuValue

Method toggleSubmenuValue

crengine/src/crgui.cpp:1212–1227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1210}
1211
1212void CRMenu::toggleSubmenuValue()
1213{
1214 if ( !isSubmenu() || _propName.empty() || _props.isNull() )
1215 return;
1216 lString16 value = getProps()->getStringDef(
1217 UnicodeToUtf8(getPropName()).c_str(), "");
1218 for ( int i=0; i<_items.length(); i++ ) {
1219 if ( !_items[i]->getPropValue().empty() &&
1220 value==(_items[i]->getPropValue()) ) {
1221 int n = (i + 1) % _items.length();
1222 getProps()->setString(UnicodeToUtf8(getPropName()).c_str(), _items[n]->getPropValue() );
1223 //return _items[i]->getLabel();
1224 return;
1225 }
1226 }
1227}
1228
1229#if 0
1230static void DrawArrow( LVDrawBuf & buf, int x, int y, int dx, int dy, lvColor cl, int direction )

Callers 1

onItemSelectMethod · 0.80

Calls 9

getPropsFunction · 0.85
UnicodeToUtf8Function · 0.85
getPropValueMethod · 0.80
emptyMethod · 0.45
isNullMethod · 0.45
getStringDefMethod · 0.45
c_strMethod · 0.45
lengthMethod · 0.45
setStringMethod · 0.45

Tested by

no test coverage detected