コード例 #1
0
ファイル: kasgroupitem.cpp プロジェクト: serghei/kde3-kdebase
KasPopup *KasGroupItem::createPopup()
{
    KasPopup *pop = new KasPopup(this);
    bar = kasbar()->createChildBar((kasbar()->orientation() == Horizontal) ? Vertical : Horizontal, pop);

    connect(pop, SIGNAL(shown()), SLOT(updatePopup()));

    return pop;

    //     // Test code
    //     //
    //     // This generates cool looking fractal-like patterns if you keep unfolding the
    //     // groups!
    //     int pos = (int) this;
    //     if ( pos % 2 )
    //        bar->append( new KasItem( bar ) );
    //     if ( pos % 5 )
    //        bar->append( new KasItem( bar ) );
    //     bar->append( new KasGroupItem( bar ) );
    //     if ( pos % 3 )
    //        bar->append( new KasItem( bar ) );
    //     if ( pos % 7 )
    //        bar->append( new KasItem( bar ) );
    //     ////////////
}
コード例 #2
0
ファイル: Gamebuino.cpp プロジェクト: satblip/Gamebuino
boolean Gamebuino::update() {
    if (((nextFrameMillis - millis()) > timePerFrame) && frameEndMicros) { //if time to render a new frame is reached and the frame end has ran once
        nextFrameMillis = millis() + timePerFrame;
        frameCount++;

        frameEndMicros = 0;
        frameStartMicros = micros();

        backlight.update();
        buttons.update();
        battery.update();

        return true;

    } else {
        if (!frameEndMicros) { //runs once at the end of the frame

            sound.update();
            updatePopup();
			displayBattery();
            display.update(); //send the buffer to the screen
			if(!display.persistance)
				display.clear(); //clear the buffer

            frameEndMicros = micros(); //measure the frame's end time
            frameDurationMicros = frameEndMicros - frameStartMicros;

            //            display.setTextColor(BLACK);
            //            display.setCursor(0, 40);
            //            display.print(frameDurationMicros / timePerFrame);
            //            display.print(" ");
            //            display.print(2048 - freeRam());

            //            display.setCursor(0, 32);
            //            display.print("CPU:");
            //            display.print(frameDurationMicros / timePerFrame);
            //            display.println("/1000");
            //            display.print("RAM:");
            //            display.print(2048 - freeRam());
            //            display.println("/2048");
        }
        return false;
    }
}
コード例 #3
0
void KNCollectionView::readConfig()
{
    KConfig *conf = knGlobals.config();
    conf->setGroup("GroupView");

    // execute the listview layout stuff only once
    static bool initDone = false;
    if(!initDone)
    {
        initDone = true;
        const int unreadColumn = conf->readNumEntry("UnreadColumn", 1);
        const int totalColumn = conf->readNumEntry("TotalColumn", 2);

        // we need to _activate_ them in the correct order
        // this is ugly because we can't use header()->moveSection
        // but otherwise the restoreLayout doesn't know that to do
        if(unreadColumn != -1 && unreadColumn < totalColumn)
            addUnreadColumn(i18n("Unread"), 48);
        if(totalColumn != -1)
            addTotalColumn(i18n("Total"), 36);
        if(unreadColumn != -1 && unreadColumn > totalColumn)
            addUnreadColumn(i18n("Unread"), 48);
        updatePopup();

        restoreLayout(knGlobals.config(), "GroupView");
    }

    // font & color settings
    KNConfig::Appearance *app = knGlobals.configManager()->appearance();
    setFont(app->groupListFont());

    QPalette p = palette();
    p.setColor(QColorGroup::Base, app->backgroundColor());
    p.setColor(QColorGroup::Text, app->textColor());
    setPalette(p);
    setAlternateBackground(app->backgroundColor());
    // FIXME: make this configurable
    mPaintInfo.colUnread = QColor("blue");
    mPaintInfo.colFore = app->textColor();
    mPaintInfo.colBack = app->backgroundColor();
}
コード例 #4
0
void UndoRedoToolButton::undoRedoChange( bool ua, bool ra )
{
	setEnabled( mIsUndo ? ua : ra );
	updatePopup();
}
コード例 #5
0
ファイル: fightInterface.c プロジェクト: hassenc/Game
value drawFightInterface()
{
	if (game.popupClock)
		if (sfClock_GetTime(game.popupClock) > game.popupTime)
		{
			sfClock_Destroy(game.popupClock);
			game.popupClock = NULL;
			game.popupTime = 0.0f;
			sfString_Destroy(game.popupMessage);
			game.popupMessage = NULL;
			sfSprite_Destroy(game.popupBackground);
			game.popupBackground = NULL;
			game.popupMessageCount--;
			if (game.popupMessageCount > 0)
				updatePopup();
		}

	sfRenderWindow_Clear(game.renderWindow, sfWhite);


	if (fi.background)
		sfRenderWindow_DrawSprite(game.renderWindow, fi.background);
	if (fi.headerBackground)
		sfRenderWindow_DrawSprite(game.renderWindow, fi.headerBackground);
	if (fi.leftLifeBarContainer)
		sfRenderWindow_DrawSprite(game.renderWindow, fi.leftLifeBarContainer);
	if (fi.leftManaBarContainer)
		sfRenderWindow_DrawSprite(game.renderWindow, fi.leftManaBarContainer);
	if (fi.rightLifeBarContainer)
		sfRenderWindow_DrawSprite(game.renderWindow, fi.rightLifeBarContainer);
	if (fi.rightManaBarContainer)
		sfRenderWindow_DrawSprite(game.renderWindow, fi.rightManaBarContainer);
	if (fi.leftManaBar && fi.leftMana > 0)
		sfRenderWindow_DrawSprite(game.renderWindow, fi.leftManaBar);
	if (fi.rightManaBar && fi.rightMana > 0)
		sfRenderWindow_DrawSprite(game.renderWindow, fi.rightManaBar);
	if (fi.leftLifeBar && fi.leftLife > 0)
		sfRenderWindow_DrawSprite(game.renderWindow, fi.leftLifeBar);
	if (fi.rightLifeBar && fi.rightLife > 0)
		sfRenderWindow_DrawSprite(game.renderWindow, fi.rightLifeBar);
	if (fi.leftCreature)
		sfRenderWindow_DrawSprite(game.renderWindow, fi.leftCreature);
	if (fi.rightCreature)
		sfRenderWindow_DrawSprite(game.renderWindow, fi.rightCreature);

	if (fi.rightCreatureName)
		sfRenderWindow_DrawString(game.renderWindow, fi.rightCreatureName);
	if (fi.leftCreatureName)
		sfRenderWindow_DrawString(game.renderWindow, fi.leftCreatureName);
	if (fi.rightCreatureLevel)
		sfRenderWindow_DrawString(game.renderWindow, fi.rightCreatureLevel);
	if (fi.leftCreatureLevel)
		sfRenderWindow_DrawString(game.renderWindow, fi.leftCreatureLevel);

	if (fi.leftLifeBarText)
		sfRenderWindow_DrawString(game.renderWindow, fi.leftLifeBarText);
	if (fi.leftManaBarText)
		sfRenderWindow_DrawString(game.renderWindow, fi.leftManaBarText);
	if (fi.rightLifeBarText)
		sfRenderWindow_DrawString(game.renderWindow, fi.rightLifeBarText);
	if (fi.rightManaBarText)
		sfRenderWindow_DrawString(game.renderWindow, fi.rightManaBarText);
	
	DialogPanel_draw(game.dialogPanel, game.renderWindow);

	if (anythingSelection.running == 1)
		drawAnythingSelection();
	
	if (game.trophyBackground)
		sfRenderWindow_DrawSprite(game.renderWindow, game.trophyBackground);
	if (game.trophy)
		sfRenderWindow_DrawSprite(game.renderWindow, game.trophy);
	if (game.text)
		sfRenderWindow_DrawString(game.renderWindow, game.text);

	if (game.popupBackground != NULL)
		sfRenderWindow_DrawSprite(game.renderWindow, game.popupBackground);
	if (game.popupMessage != NULL)
		sfRenderWindow_DrawString(game.renderWindow, game.popupMessage);
	
	
	sfRenderWindow_Display(game.renderWindow);
	return Val_unit;
	
}