1 //
2 // C++ Implementation: fullscreen menu dialog
3 //
4 // Description:
5 // Allows to set or go to bookmarks
6 //
7 // Author: Vadim Lopatin <vadim.lopatin@coolreader.org>, (C) 2008
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 // bmkdlg.cpp
12
13 #include <cri18n.h>
14 #include "mainwnd.h"
15 #include "fsmenu.h"
16
17
CRFullScreenMenu(CRGUIWindowManager * wm,int id,const lString16 & caption,int numItems,lvRect & rc)18 CRFullScreenMenu::CRFullScreenMenu(CRGUIWindowManager * wm, int id, const lString16 & caption, int numItems, lvRect & rc)
19 : CRMenu( wm, NULL, id, caption, LVImageSourceRef(), LVFontRef(), LVFontRef() )
20 {
21 _rect = rc;
22 _pageItems = numItems;
23 _fullscreen = true;
24 }
25
getCommandKeyName(int cmd,int param)26 lString16 CRFullScreenMenu::getCommandKeyName( int cmd, int param )
27 {
28 int k, f;
29 bool found = _acceleratorTable->findCommandKey( cmd, param, k, f );
30 if ( !found )
31 return lString16::empty_str;
32 return lString16(getKeyName( k, f ));
33 }
34
getItemNumberKeysName()35 lString16 CRFullScreenMenu::getItemNumberKeysName()
36 {
37 int k9, f9;
38 lString16 selKeyName;
39 bool hasKey9 = _acceleratorTable->findCommandKey( MCMD_SELECT_9, 0, k9, f9 );
40 if ( hasKey9 )
41 selKeyName = lString16(_("1..9"));
42 else
43 selKeyName = lString16(_("1..8"));
44 return selKeyName;
45 }
46
getRect()47 const lvRect & CRFullScreenMenu::getRect()
48 {
49 return _rect;
50 }
51
getMaxItemSize()52 lvPoint CRFullScreenMenu::getMaxItemSize()
53 {
54 return lvPoint( _rect.width(), getItemHeight() );
55 }
56
getSize()57 lvPoint CRFullScreenMenu::getSize()
58 {
59 return lvPoint( _rect.width(), _rect.height() );
60 }
61
62 /*
63 void CRFullScreenMenu::Draw( LVDrawBuf & buf, int x, int y )
64 {
65 CRGUIWindow::draw();
66 CRMenu::Draw( buf, x, y );
67 CRMenuSkinRef skin = getSkin();
68 lvRect rc = skin->getClientRect( _rect );
69 int ih = getItemHeight();
70 rc.top += _pageItems * ih + 4;
71 int scrollHeight = 0;
72 if ( _items.length() > _pageItems )
73 scrollHeight = 34;
74 rc.bottom -= scrollHeight;
75 //skin->getItemSkin()->draw( buf, rc );
76 if ( !_helpText.empty() )
77 skin->getItemSkin()->drawText( buf, rc, _helpText );
78 }
79 */
80