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

Method CRRecentBooksMenu

cr3gui/src/recentdlg.cpp:120–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118#endif
119
120CRRecentBooksMenu::CRRecentBooksMenu(CRGUIWindowManager * wm, LVDocView * docview, int numItems, lvRect & rc)
121 : CRFullScreenMenu( wm, MCMD_BOOKMARK_LIST, lString16(_("Open recent book")), numItems, rc )
122{
123 docview->savePosition(); // to move current file to top
124 LVPtrVector<CRFileHistRecord> & files = docview->getHistory()->getRecords();
125 _files = &files;
126 // skip Null
127 for ( int i=1; i<files.length(); i++ ) {
128 CRFileHistRecord * file = files.get( i );
129 CRRecentBookMenuItem * item = new CRRecentBookMenuItem( this, i, file );
130 addItem( item );
131 }
132 //_helpText = L"Long press 1..8 = set, short press = go to";
133 //_helpHeight = 36;
134 CRGUIAcceleratorTableRef acc = _wm->getAccTables().get("bookmarks");
135 if ( acc.isNull() )
136 acc = _wm->getAccTables().get("menu");
137 setAccelerators( acc );
138 setSkinName(lString16(L"#bookmarks"));
139 lString16 pattern(_("$1 - open book\n$2, $3 - close"));
140#ifdef CR_POCKETBOOK
141 pattern.replaceParam(1, getCommandKeyName( MCMD_SELECT ));
142#else
143 pattern.replaceParam(1, getItemNumberKeysName());
144#endif
145 pattern.replaceParam(2, getCommandKeyName(MCMD_OK) );
146 pattern.replaceParam(3, getCommandKeyName(MCMD_CANCEL) );
147 _statusText = pattern;
148#ifdef CR_POCKETBOOK
149 bmkDialog = this;
150#endif
151}
152
153/// returns true if command is processed
154bool CRRecentBooksMenu::onCommand( int command, int params )

Callers

nothing calls this directly

Calls 8

lString16Class · 0.85
addItemFunction · 0.85
replaceParamMethod · 0.80
savePositionMethod · 0.45
getHistoryMethod · 0.45
lengthMethod · 0.45
getMethod · 0.45
isNullMethod · 0.45

Tested by

no test coverage detected