Ejemplo n.º 1
0
SMActionVideoVLC::SMActionVideoVLC(QWidget *parent):
    SMAction(parent)
{
    poller = new QTimer(0);
    connect(poller, SIGNAL(timeout()), SLOT(slotTimeout()));

    //preparation of the vlc command
    const char * const vlc_args[] = {
              "--verbose=2", //be much more verbose then normal for debugging purpose
    };
    _vlcinstance=libvlc_new(sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args);

    // Create a media player playing environement
    _mp = libvlc_media_player_new (_vlcinstance);
    _m = NULL;

    setRepeat(0);
    setVolume(1.0);

    getContextMenu()->addSeparator();
    QAction* setRepeatAction = getContextMenu()->addAction("set repeat");
    connect(setRepeatAction, SIGNAL(triggered(bool)), SLOT(slotSetRepeat()));

    QAction* setVolumeAction = getContextMenu()->addAction("set volume");
    connect(setVolumeAction, SIGNAL(triggered(bool)), SLOT(slotSetVolume()));
}
Ejemplo n.º 2
0
bool CTaskType::eventFilter(QObject *object, QEvent *event)
{
    if (object == qobject_cast<CTreeViewCppsst*>(treeCppsst)) {
        if (event->type() == QEvent::FocusIn){

            for (QAction *action : getContextMenu()->actions()){
                disconnect(action, SIGNAL(triggered()), 0, 0);
            }

            connect(getContextMenu()->actions().at(0), SIGNAL(triggered()), SLOT(slotCreateEditDialog()));
            connect(getContextMenu()->actions().at(2), SIGNAL(triggered()), SLOT(slotCopyRecords()));
            connect(getContextMenu()->actions().at(3), SIGNAL(triggered()), SLOT(slotDeleteRecords()));
            connect(getContextMenu()->actions().at(5), SIGNAL(triggered()), SLOT(slotRefreshRecords()));

            return false;
        }
    }
    return QWidget::eventFilter(object, event);
}
Ejemplo n.º 3
0
SMActionVideoNative::SMActionVideoNative(QWidget *parent):
    SMAction(parent)
{
    mediaDuration = 0;
    _repeated     = 0;

    mediaPlayer = new QMediaPlayer(0, QMediaPlayer::VideoSurface);
    videoItem = new QGraphicsVideoItem;
    mediaPlayer->setVideoOutput(videoItem);
    mediaPlayer->setNotifyInterval(250); //interval 250 ms

    setRepeat(0);
    setVolume(1.0);

    getContextMenu()->addSeparator();
    QAction* setRepeatAction = getContextMenu()->addAction("set repeat");
    connect(setRepeatAction, SIGNAL(triggered(bool)), SLOT(slotSetRepeat()));

    QAction* setVolumeAction = getContextMenu()->addAction("set volume");
    connect(setVolumeAction, SIGNAL(triggered(bool)), SLOT(slotSetVolume()));
}
Ejemplo n.º 4
0
/*****************************************************
**
**   BasicView   ---   OnContextMenuEvent
**
******************************************************/
void BasicView::OnContextMenuEvent( wxMouseEvent& event)
{
	int x, y;
	x = event.m_x;
	y = event.m_y;
	wxWindow *window = (wxWindow*)event.GetEventObject();
	window->ClientToScreen( &x, &y );
	this->ScreenToClient( &x, &y );
	wxMenu *menu = getContextMenu();
	PopupMenu( menu, x, y );
	delete menu;
}
void
SuperelevationSectionPolynomialItem::init()
{
    // Color & Path //
    //
    updateColor();
    createPath();

    // ContextMenu //
    //
    splitAction_ = getContextMenu()->addAction("Cut in half");
    connect(splitAction_, SIGNAL(triggered()), this, SLOT(splitSection()));
}
Ejemplo n.º 6
0
void HistoryDlg::OnContextMenu(CWnd *aWnd, CPoint aPoint)
{
    if (aWnd == XPR_NULL)
        return;

    if (aWnd->m_hWnd == mTreeCtrl.m_hWnd)
    {
        CRect sWindowRect;
        GetWindowRect(&sWindowRect);

        if (sWindowRect.PtInRect(aPoint) == XPR_FALSE)
        {
            getContextMenu(XPR_FALSE);
        }
    }
}
Ejemplo n.º 7
0
void TabsCtrl::processPopupMenu( bool cmdBar, int posX, int posY ) {

    HMENU hmenu = getContextMenu();
    menuUserCmds(hmenu);

    if (hmenu==NULL) return;

    if (!cmdBar && activeTab>0) {
        BOOL result=InsertMenu(hmenu, 0, MF_STRING | MF_BYPOSITION, TabsCtrl::CLOSETAB, TEXT("Close"));
        result=InsertMenu(hmenu, 1, MF_SEPARATOR | MF_BYPOSITION, 0, NULL);
    }

    HWND hWnd=getHWnd();

    POINT pt={posX, posY };
    if (!cmdBar) ClientToScreen(hWnd, &pt);
    int cmd=TrackPopupMenuEx(hmenu,
        (cmdBar)? (TPM_BOTTOMALIGN | TPM_RETURNCMD) : (TPM_TOPALIGN | TPM_RETURNCMD),
        pt.x, pt.y,
        hWnd,
        NULL);

    if (cmd!=0) {
        MENUITEMINFO mi;
        mi.cbSize=sizeof(mi);
        mi.fMask=MIIM_DATA;
        GetMenuItemInfo(hmenu, cmd, FALSE, &mi);

        if (cmd>=TabsCtrl::SWITCH_TAB && cmd<TabsCtrl::USERCMD) {
            ODR *wt=(ODR*)((void *) mi.dwItemData);
            //switch to the selected tab
            switchByODR(wt);
        }

        if (cmd>=TabsCtrl::USERCMD) {
            menuUserActions(cmd, mi.dwItemData);
        }

        if (cmd==TabsCtrl::CLOSETAB) {
            PostMessage(hWnd, WM_COMMAND, cmd, mi.dwItemData);
        }
    }
    DestroyMenu(hmenu);
}
Ejemplo n.º 8
0
void
JunctionElementItem::init()
{
    // Selection/Highlighting //
    //
    setAcceptHoverEvents(true);

    if (getParentJunctionComponentItem())
    {
        setFlag(QGraphicsItem::ItemIsMovable, false); // move the whole group
    }
    else
    {
        setFlag(QGraphicsItem::ItemIsMovable, true);
    }

    // Color & Path //
    //
    updateColor();
    createPath();

    // ContextMenu //
    //
    QAction *hideAction = getHideMenu()->addAction(tr("Track"));
    connect(hideAction, SIGNAL(triggered()), this, SLOT(hideGraphElement()));

    if (getParentJunctionComponentItem())
    {
        QAction *hideParentTrackComponentAction = getHideMenu()->addAction(tr("Group"));
        connect(hideParentTrackComponentAction, SIGNAL(triggered()), this, SLOT(hideParentTrackComponent()));

        QAction *ungroupAction = getContextMenu()->addAction("Ungroup");
        connect(ungroupAction, SIGNAL(triggered()), getParentJunctionComponentItem(), SLOT(ungroupComposite()));
    }

    QAction *hideRoadAction = getHideMenu()->addAction(tr("Road"));
    connect(hideRoadAction, SIGNAL(triggered()), this, SLOT(hideParentRoad()));

    QAction *removeSectionAction = getRemoveMenu()->addAction(tr("Track(s)"));
    connect(removeSectionAction, SIGNAL(triggered()), this, SLOT(removeSection()));

    QAction *removeRoadAction = getRemoveMenu()->addAction(tr("Road"));
    connect(removeRoadAction, SIGNAL(triggered()), this, SLOT(removeParentRoad()));
}
Ejemplo n.º 9
0
void HistoryDlg::OnRclickTree(NMHDR *pNMHDR, LRESULT *pResult)
{
    getContextMenu(XPR_TRUE);

    *pResult = 0;
}
void KCHMViewWindow_KHTMLPart::onPopupMenu ( const QString &url, const QPoint & point )
{
	QMenu * menu = getContextMenu( url, view() );
	menu->exec( point );
}