Beispiel #1
0
void CRBookmarkMenu::showContextMenu()
{
	CRBookmarkMenuItem *item = static_cast<CRBookmarkMenuItem *>(_items[_selectedItem]);
	CRMenuSkinRef skin = getSkin();
	CRRectSkinRef separatorSkin = skin->getSeparatorSkin();
    int separatorHeight = 0;
    if ( !separatorSkin.isNull() )
        separatorHeight = separatorSkin->getMinSize().y;

    lvRect clientRect;
    getClientRect(clientRect);
    lvPoint itemSize = getMaxItemSize();
	_contextMenu[2].type = item->getBookmark() ? ITEM_ACTIVE : ITEM_INACTIVE;
        int y = clientRect.top + (itemSize.y + separatorHeight) * (_selectedItem - _topItem) +
			((itemSize.y + separatorHeight)/4);
	if (_contextMenu[0].text == NULL) {
		_contextMenu[0].text = (char *)_("Set bookmark");
		_contextMenu[1].text = (char *)_("Go to bookmark");
		_contextMenu[2].text = (char *)_("Delete bookmark");
	}
	OpenMenu(_contextMenu, 
		_goToMode ? DCMD_BOOKMARK_GO_N : DCMD_BOOKMARK_SAVE_N,
		ScreenWidth()/4, 
		y, 
		handle_contextMenu);
}
Beispiel #2
0
void CRCitesMenu::showContextMenu()
{
    CRBookmarkMenuItem *item = static_cast<CRBookmarkMenuItem *>(_items[_selectedItem]);
    if (item->getBookmark() == NULL)
        return;
    CRMenuSkinRef skin = getSkin();
    CRRectSkinRef separatorSkin = skin->getSeparatorSkin();
    int separatorHeight = 0;
    if ( !separatorSkin.isNull() )
        separatorHeight = separatorSkin->getMinSize().y;
    lvRect clientRect;
    getClientRect(clientRect);
    lvPoint itemSize = getMaxItemSize();
    int y = clientRect.top + (itemSize.y + separatorHeight) * (_selectedItem - _topItem) +
                        ((itemSize.y + separatorHeight)/4);
    if (_cites_contextMenu[0].text == NULL) {
        _cites_contextMenu[0].text = (char *)_("Go to citation");
        _cites_contextMenu[1].text = (char *)_("Delete citation");
    }
    OpenMenu(_cites_contextMenu, DCMD_BOOKMARK_GO_N, ScreenWidth()/4, y,
                handle_citesContextMenu);
}
Beispiel #3
0
void CRRecentBooksMenu::showContextMenu()
{
	CRRecentBookMenuItem *item = static_cast<CRRecentBookMenuItem *>(getItems()[_selectedItem]);
	CRMenuSkinRef skin = getSkin();
	CRRectSkinRef separatorSkin = skin->getSeparatorSkin();
    int separatorHeight = 0;
    if ( !separatorSkin.isNull() )
        separatorHeight = separatorSkin->getMinSize().y;

    lvRect clientRect;
    getClientRect(clientRect);
    lvPoint itemSize = getMaxItemSize();
        int y = clientRect.top + (itemSize.y + separatorHeight) * (_selectedItem - _topItem) +
			((itemSize.y + separatorHeight)/4);
	if (_contextMenu[0].text == NULL) {
		_contextMenu[0].text = (char *)_("Open book");
		_contextMenu[1].text = (char *)_("Delete record");
	}
	OpenMenu(_contextMenu, MCMD_OPEN_RECENT_BOOK,
		ScreenWidth()/4, 
		y, 
		handle_contextMenu);
}