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

Method createCommandsMenu

cr3gui/src/settings.cpp:80–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78 return lString16(getKeyName(key, flags));
79 }
80 CRMenu * createCommandsMenu(int key, int flags)
81 {
82 lString16 label = getSettingLabel( key, flags ) + L" - " + lString16(_("choose command"));
83 lString16 keyid = getSettingKey( key, flags );
84 CRMenu * menu = new CRMenu(_wm, this, _id, label, LVImageSourceRef(), LVFontRef(), LVFontRef(), _props, LCSTR(keyid), 8);
85 for ( int i=0; i<_overrideCommands->length(); i++ ) {
86 const CRGUIAccelerator * acc = _overrideCommands->get(i);
87 lString16 cmdLabel = lString16( getCommandName(acc->commandId, acc->commandParam) );
88 lString16 cmdValue = lString16::itoa(acc->commandId) + L"," + lString16::itoa(acc->commandParam);
89 CRMenuItem * item = new CRMenuItem( menu, i, cmdLabel, LVImageSourceRef(), LVFontRef(), cmdValue.c_str());
90 menu->addItem(item);
91 }
92 menu->setAccelerators( getAccelerators() );
93 menu->setSkinName(lString16(L"#settings"));
94 menu->setValueFont(_valueFont);
95 menu->setFullscreen(true);
96 menu->reconfigure( 0 );
97 return menu;
98 }
99 CRControlsMenu(CRMenu * baseMenu, int id, CRPropRef props, lString16 accelTableId, int numItems, lvRect & rc)
100 : CRFullScreenMenu( baseMenu->getWindowManager(), id, lString16(_("Controls")), numItems, rc )
101 {

Callers 1

onSelectMethod · 0.80

Calls 11

lString16Class · 0.85
getCommandNameFunction · 0.85
setSkinNameMethod · 0.80
setValueFontMethod · 0.80
lengthMethod · 0.45
getMethod · 0.45
c_strMethod · 0.45
addItemMethod · 0.45
setAcceleratorsMethod · 0.45
setFullscreenMethod · 0.45
reconfigureMethod · 0.45

Tested by

no test coverage detected