コード例 #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()));
}
コード例 #2
0
ファイル: dct_task.cpp プロジェクト: dekalo64/RLine
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);
}
コード例 #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()));
}
コード例 #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;
}
コード例 #5
0
void
SuperelevationSectionPolynomialItem::init()
{
    // Color & Path //
    //
    updateColor();
    createPath();

    // ContextMenu //
    //
    splitAction_ = getContextMenu()->addAction("Cut in half");
    connect(splitAction_, SIGNAL(triggered()), this, SLOT(splitSection()));
}
コード例 #6
0
ファイル: history_dlg.cpp プロジェクト: 3rdexp/fxfile
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);
        }
    }
}
コード例 #7
0
ファイル: TabCtrl.cpp プロジェクト: Tallefer/bombusng-md
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);
}
コード例 #8
0
ファイル: junctionelementitem.cpp プロジェクト: xyuan/covise
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()));
}
コード例 #9
0
ファイル: history_dlg.cpp プロジェクト: 3rdexp/fxfile
void HistoryDlg::OnRclickTree(NMHDR *pNMHDR, LRESULT *pResult)
{
    getContextMenu(XPR_TRUE);

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