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

Method CRControlsMenu

cr3gui/src/settings.cpp:99–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {
102 _menu = baseMenu;
103 _props = props;
104 _baseAccs = _wm->getAccTables().get( accelTableId );
105 if (_baseAccs.isNull()) {
106 CRLog::error("CRControlsMenu: No accelerators %s", LCSTR(_accelTableId) );
107 }
108 _accelTableId = accelTableId;
109 CRGUIAcceleratorTableRef _overrideKeys = _wm->getAccTables().get( accelTableId + L"-override-keys" );
110 if ( _overrideKeys.isNull() ) {
111 CRLog::error("CRControlsMenu: No table of allowed keys for override accelerators %s", LCSTR(_accelTableId) );
112 return;
113 }
114 _overrideCommands = _wm->getAccTables().get( accelTableId + L"-override-commands" );
115 if ( _overrideCommands.isNull() ) {
116 CRLog::error("CRControlsMenu: No table of allowed commands to override accelerators %s", LCSTR(_accelTableId) );
117 return;
118 }
119 _settingKey = lString16("keymap.") + _accelTableId;
120 for ( int i=0; i<_overrideKeys->length(); i++ ) {
121 const CRGUIAccelerator * acc = _overrideKeys->get(i);
122 CRControlsMenuItem * item = new CRControlsMenuItem(this, i, acc->keyCode, acc->keyFlags,
123 _baseAccs->findKeyAccelerator( acc->keyCode, acc->keyFlags ) );
124 addItem(item);
125 }
126 }
127
128 virtual bool onCommand( int command, int params )
129 {

Callers

nothing calls this directly

Calls 7

lString16Class · 0.85
addItemFunction · 0.85
getWindowManagerMethod · 0.80
findKeyAcceleratorMethod · 0.80
getMethod · 0.45
isNullMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected