Beispiel #1
0
void WindowButton::updateTip()
{
	if ( m_HotKey != 0 )
		updateTip( CharString().format("%s  '%s'", m_Tip, keyText( Keyboard::unmap( m_HotKey ) ) ) );
	else
		updateTip( m_Tip );
}
Beispiel #2
0
Menu::Menu(TeamHolder *t) :
    ui(new Ui::Menu), team(t)
{
    ui->setupUi(this);
    ui->appLogo->setPixmap(Theme::Sprite("logo"));
    ui->updateContainer->hide();
    ui->stackedWidget->setCurrentIndex(1);

    setWindowTitle(tr("Menu"));

    connect (ui->teamBuilder, SIGNAL(clicked()), SIGNAL(goToTeambuilder()));
    connect (ui->goOnline, SIGNAL(clicked()), SIGNAL(goToOnline()));
    connect (ui->credits, SIGNAL(clicked()), SIGNAL(goToCredits()));
    connect (ui->exit, SIGNAL(clicked()), SIGNAL(goToExit()));
    connect (ui->updateButton, SIGNAL(clicked()), SIGNAL(downloadUpdateRequested()));
    connect (ui->prevTip, SIGNAL(clicked()), SLOT(prevTip()));
    connect (ui->nextTip, SIGNAL(clicked()), SLOT(nextTip()));

    srand(time(NULL));

    msgs = QString::fromUtf8(getFileContent("db/tips.txt")).trimmed().split("\n");

    currentTip = rand()%(msgs.size());
    updateTip();

    if (!menuLoaded) {
        loadSettings(this);
    }
}
Beispiel #3
0
bool WindowButton::onCursorMove( const RectInt & window, const PointInt & position, const PointInt & delta )
{
	bool bInRect = false;
	if ( !m_HotKeyDown )
	{
		if ( visible() && window.inRect( position ) )
			bInRect = true;
	}

	if ( bInRect )
	{
		if ( !m_bGreyed )
		{
			// display the press button
			context()->setCursorState( SELECT );

			if ( m_HotKey != 0 )
			{
				updateTip( CharString().format("%s  '%s'", m_Tip, 
					keyText( Keyboard::unmap( m_HotKey ) ) ) );
			}
			else
				updateTip( m_Tip );
		}

		if ( !m_CursorOver )
		{
			if ( !m_bGreyed )
			{
				postMessage( WB_OVERBUTTON, (dword)this, 0 );
				hoverSound();
			}

			m_CursorOver = true;
			return false;			// return false on the first time a cursor is over a button, so that the other button can set m_CursorOver to false
		}

		return true;
	}
	else if ( m_CursorOver )
		m_CursorOver = false;

	return NodeWindow::onCursorMove( window, position, delta );
}
Beispiel #4
0
void PageMain::connectSignals()
{
#ifndef QT_DEBUG
    connect(this, SIGNAL(pageEnter()), this, SLOT(updateTip()));
#endif
    connect(BtnNet, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
    //connect(BtnNetLocal, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
    //connect(BtnNetOfficial, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
    // TODO: add signal-forwarding required by (currently missing) encapsulation
}
bool Notification::trayHandler(const MSG& msg) {
	switch(LOWORD(msg.lParam)) {

	case WM_LBUTTONUP:
		{
			if(iconClicked) {
				iconClicked();
			}
			break;
		}

	case WM_RBUTTONUP:
		{
			if(contextMenu) {
				// Work-around for windows bug (KB135788)
				::SetForegroundWindow(parent->handle());
				contextMenu();
				parent->postMessage(WM_NULL);
			}
			break;
		}

	case WM_MOUSEMOVE:
		{
			if(updateTip) {
				DWORD now = ::GetTickCount();
				if(now - 1000 > lastTick) {
					updateTip();
					lastTick = now;
				}
			}
			break;
		}

	case NIN_BALLOONUSERCLICK:
		{
			balloons.front().first();
		} // fall through
	case NIN_BALLOONHIDE: // fall through
	case NIN_BALLOONTIMEOUT:
		{
			balloons.pop_front();
			if(onlyBalloons && balloons.empty()) {
				setVisible(false);
			}
			break;
		}
	}

	return true;
}
Beispiel #6
0
void LiteEditor::setCompleter(LiteApi::ICompleter *complter)
{
    if (m_completer) {
        QObject::disconnect(m_completer, 0, m_editorWidget, 0);
        delete m_completer;
        m_completer = 0;
    }
    m_completer = complter;
    if (!m_completer) {
        return;
    }
    m_completer->setEditor(m_editorWidget);
    m_editorWidget->setCompleter(m_completer);

    m_extension->addObject("LiteApi.ICompleter",m_completer);

    connect(m_editorWidget,SIGNAL(completionPrefixChanged(QString,bool)),m_completer,SLOT(completionPrefixChanged(QString,bool)));
    connect(m_completer,SIGNAL(wordCompleted(QString,QString,QString)),this,SLOT(updateTip(QString,QString,QString)));
}
Beispiel #7
0
void WindowButton::setTip( const char * pTip )
{
	m_Tip = pTip;
	if ( m_CursorOver )
		updateTip();
}