UIChannelDialog::UIChannelDialog(QWidget *parent, const char *name )
                :UIChannelDialogBase(parent,name,true)
{
        // this must be called to create the listview items
        slot_ChanToggled( false );
        toggleEnabled( false );
}
示例#2
0
void QMainWidget::createTrayIcon()
{
    QSystemTrayIcon *trayIcon = new QSystemTrayIcon(this);
    QMenu *menu = new QMenu(this);
    QAction *windowAction = new QAction("Controller Window", this);
    QAction *quitAction = new QAction("Shutdown xboxToVJoy", this);
    
    enableAction = new QAction("Disable", this);
    connect(enableAction, SIGNAL(triggered()), this, SLOT(toggleEnabled()));
    
    connect(windowAction, SIGNAL(triggered()), this, SLOT(showControllerWindow()));
    connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
    
    menu->addAction(windowAction);
    menu->addSeparator();
    menu->addAction(enableAction);
    menu->addSeparator();
    menu->addAction(quitAction);
    trayIcon->setContextMenu(menu);
    
    QIcon icon(":/icons/icon.png");
    trayIcon->setIcon(icon);
    
    trayIcon->show();
}
示例#3
0
void BreakpointList::keydownEvent(wxKeyEvent& evt)
{
	int sel = GetFirstSelected();
	switch (evt.GetKeyCode())
	{
	case WXK_DELETE:
		if (sel+1 == GetItemCount())
			Select(sel-1);
		removeBreakpoint(sel);
		break;
	case WXK_UP:
		if (sel > 0)
			Select(sel-1);
		break;
	case WXK_DOWN:
		if (sel+1 < GetItemCount())
			Select(sel+1);
		break;
	case WXK_RETURN:
		editBreakpoint(sel);
		break;
	case WXK_SPACE:
		toggleEnabled(sel);
		break;
	}
}
示例#4
0
QMenu *
ViewLightGL::createToolsMenu(QWidget * parent)
{
	QMenu * menu = new QMenu(parent);
    QPixmap home(ViewerIcon::getPixmap(ViewerIcon::home));
    QPixmap _light(ViewerIcon::getPixmap(ViewerIcon::light));
	menu->addAction(home,tr("&Home"),this,SLOT(home()),Qt::CTRL+Qt::SHIFT+Qt::Key_H);
    menu->addAction(tr("on X axis"),this,SLOT(XAxis()),Qt::CTRL+Qt::SHIFT+Qt::Key_X);
    menu->addAction(tr("on Y axis"),this,SLOT(YAxis()),Qt::CTRL+Qt::SHIFT+Qt::Key_Y);
    menu->addAction(tr("on Z axis"),this,SLOT(ZAxis()),Qt::CTRL+Qt::SHIFT+Qt::Key_Z);
    menu->addSeparator();
    QAction * idVisibility = menu->addAction(_light,tr("Visible"),this,SLOT(changeVisibility()),Qt::CTRL+Qt::SHIFT+Qt::Key_S);
    idVisibility->setCheckable( TRUE );
    idVisibility->setChecked( isVisible() );
    QObject::connect(this,SIGNAL(visibilityChanged( bool)),idVisibility,SLOT(setChecked(bool)));
    menu->addSeparator();
    QAction * idLight = menu->addAction(_light,     tr("&Enabled"),     this, SLOT(toggleEnabled()));
	idLight->setCheckable(true);
	idLight->setChecked(isEnabled());
    idLight->setWhatsThis(tr("<b>Light Rendering</b><br><br>"
	"Set <b>Light Rendering</b> enable/disable.<br><br>"
	"The Rendering will (not) take into account ligth source.<br><br>"
	"You can also use Menu <br><b>Tools > Renderer > Light</b><br>"));
	return menu;
}
示例#5
0
void 
ViewLightGL::fillToolBar(QToolBar * toolBar)
{
    QPixmap _light(ViewerIcon::getPixmap(ViewerIcon::light));
    QAction * idLight = toolBar->addAction(_light,     tr("&Light"),     this, SLOT(toggleEnabled()));
	idLight->setCheckable(true);
	idLight->setChecked(isEnabled());
    idLight->setWhatsThis(tr("<b>Light Rendering</b><br><br>"
	"Set <b>Light Rendering</b> enable/disable.<br><br>"
	"The Rendering will (not) take into account ligth source.<br><br>"
	"You can also use Menu <br><b>Tools > Renderer > Light</b><br>"));
}
示例#6
0
LRESULT TrayIcon::windowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
	switch (msg) {
		case TRAYICON_MESSAGE:
			switch (lParam) { // that contains the "real" message
				case WM_RBUTTONUP:
				case WM_CONTEXTMENU:
				{
					// Using GetMessagePos() would be way better, but it gives me 0.
					POINT mousePos;
					GetCursorPos(&mousePos);
					showMenu(mousePos);
					return 0;
				}
				case WM_LBUTTONDOWN:
				case NIN_SELECT:
				case NIN_KEYSELECT:
					toggleEnabled();
					return 0;
				case WM_LBUTTONDBLCLK:
					toggleEnabled(); // second click does not register as WM_LBUTTONDOWN
					showConfigDlg();
					return 0;
			}
			break;
		case WM_COMMAND:
			switch (LOWORD(wParam)) { // contains the menu item identifier
				case IDM_ENABLE:
					toggleEnabled();
					return 0;
				case IDM_CONFIGURE:
					showConfigDlg();
					return 0;
				case IDM_EXIT:
					exitProgram();
					return 0;
			}
			break;
	}
	return DefWindowProc(hwnd, msg, wParam, lParam);
}
示例#7
0
StatCrewScanner::StatCrewScanner(HockeyGame* game, QString fileName)
{
    statCrew = new GameXmlUpdater(game, game->getAwayTeam(), game->getHomeTeam());
    inGame = new QTimer();
    breakTime = new QTimer();
    breakTime->setInterval(1000 * 10);
    statFile = "http://sidearmstats.com/miamiohio/mhockey/1.xml";
    inGame->setInterval(1000 * 5);
    isActive = false;
    connect(inGame, SIGNAL(timeout()), this, SLOT(start()));
    connect(breakTime, SIGNAL(timeout()), this, SLOT(start()));
    connect(game, SIGNAL(periodChanged(int)), this, SLOT(toggleScanner(int)));
    connect(game, SIGNAL(clockIsRunning(bool)), this, SLOT(toggleScanner(bool)));
    connect(game, SIGNAL(toggleStatCrew()), this, SLOT(toggleEnabled()));
    connect(this, SIGNAL(statCrewStatus(bool)), game, SIGNAL(statusOfStatCrew(bool)));
    manager = new QNetworkAccessManager(this);
    connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(fileIsReady(QNetworkReply*)) );
    enabled = false;
}
示例#8
0
bool CtrlBreakpointList::WindowMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT& returnValue)
{
	switch(msg)
	{
	case WM_KEYDOWN:
		returnValue = 0;
		if(wParam == VK_RETURN)
		{
			int index = GetSelectedIndex();
			editBreakpoint(index);
			return true;
		} else if (wParam == VK_DELETE)
		{
			int index = GetSelectedIndex();
			removeBreakpoint(index);
			return true;
		} else if (wParam == VK_TAB)
		{
			SendMessage(GetParent(GetHandle()),WM_DEB_TABPRESSED,0,0);
			return true;
		} else if (wParam == VK_SPACE)
		{
			int index = GetSelectedIndex();
			toggleEnabled(index);
			return true;
		}
		break;
	case WM_GETDLGCODE:
		if (lParam && ((MSG*)lParam)->message == WM_KEYDOWN)
		{
			if (wParam == VK_TAB || wParam == VK_RETURN)
			{
				returnValue = DLGC_WANTMESSAGE;
				return true;
			}
		}
		break;
	}

	return false;
}
void UIChannelDialog::slot_ChanToggled( bool all_chans )
{
        m_view->clear();

        m_itemNapster = new QListViewItem( m_view );
        m_itemNapster->setText( Col_Chan, tr( "Napster channels" ) );
        m_itemNapster->setOpen( true );

        m_itemOther = new QListViewItem( m_view );
        m_itemOther->setText( Col_Chan, tr( "Other channels" ) );
        m_itemOther->setOpen( true );

        IOMessage * io = new IOMessage( 0 );

        if ( all_chans == true )
                io->setMessageType( IONapsterCodes::ListAllChansRequest );
        else
                io->setMessageType( IONapsterCodes::ListChansRequest );

        emit sendIO( io );
        delete io;

        toggleEnabled( false );
}
示例#10
0
void UIChannelDialog::recvIO_ListAllChansDone( IOMessage * )
{
        toggleEnabled( true );
}
示例#11
0
void CtrlBreakpointList::OnToggle(int item, bool newValue)
{
	toggleEnabled(item);
}