コード例 #1
0
void scheduler()
{

	/* 更新等待队列中的作业 */
	updateall();
	
	handlecmd();

	/* 选择高优先级作业 */
	next=jobselect();
	/* 作业切换 */
	jobswitch();
}
コード例 #2
0
ファイル: itemtable.cpp プロジェクト: gabfou/Save
void itemtable::update()
{
	headertableitem *arg = dynamic_cast<headertableitem*>(this->tableWidget()->verticalHeaderItem(this->row()));
	headertableitem *head = dynamic_cast<headertableitem*>(this->tableWidget()->horizontalHeaderItem(this->column()));
	QString actform = "";

	if (form.compare(actform))
		actform = form;
	else if (head && form.compare(head->formule))
		actform = head->formule;

    int itmax;
    int itmin;
    if (p->ref == 1)
    {
        itmax = 0;
        itmin = 0;
    }
    else
    {
        itmax = p->iterationmax;
        itmin = p->iterationmin;
    }
    if (this->itmaxprep != -1)
        itmax = this->itmaxprep;
    if (this->itminprep != -1)
        itmin = this->itminprep;
    //le choix de la methode de calcul (update) depent des header de la cellule
    if (!head || !arg)
	{
		this->setBackgroundColor(Qt::white);
        return ;
    }
    else if (arg->type == 1 && head->type == 2)
        update(&(arg->argg), &(head->argq), itmin, itmax);
    else if (arg->type == 2 && head->type == 1)
        updateall(&(head->argg), &(arg->argq), itmin, itmax);
    else if (arg->type == 3 && head->type == 2)
        update(&(arg->argp), &(head->argq), itmin, itmax);
    else if (arg->type == 1  && head->type == 4)
        update(&(arg->argg), &(head->argstr), itmin, itmax);
    else if (arg->type == 1  && head->type == 5)
        update(&(arg->argg), (head->arglistq), itmin, itmax);
	else
	{
		this->setBackgroundColor(Qt::white);
	}
}
コード例 #3
0
ファイル: benchmark.c プロジェクト: harp37/icebreaker
void setupbenchmark()
{
	int x,y;

	setcursor(CURSORARROW);
	SDL_FillRect(screen,NULL,color.background);

	for (x=0;x<WIDTH;x++)
		for (y=0;y<HEIGHT;y++)
		{
			if (x<BORDERLEFT || x>=BORDERRIGHT || y <BORDERTOP || y>=BORDERBOTTOM) 	
				grid[x][y]='X';
			else
				grid[x][y]=' ';
		}
	
	drawgridblocks();

	updateall();
}
コード例 #4
0
ファイル: TMOGUIAdjust.cpp プロジェクト: cadik/TMS
TMOGUIAdjust::TMOGUIAdjust(QWidget* parent, const char * name):
	QFrame(parent, name)
{
	iMode = 0;
	pValues = 0;
	bLog = true;
	bUpdate = false;

	setFrameStyle( QFrame::Panel | QFrame::Sunken );
	QGridLayout *pLayout = new QGridLayout(this, 8, 4);
	pLayout->setColStretch(0,0);
	pLayout->setColStretch(1,1);
	pLayout->setColStretch(2,0);
	pLayout->setColStretch(3,0);
	pLayout->addColSpacing(2,20);
	
	QSlider *pSlider = new QSlider(this, "HistoSlider");
	pSlider->setFixedSize(16,64);
	pSlider->setRange(-50, 50);
	pSlider->setValue(0);
	pSlider->setOrientation(Vertical);
	pSlider->setTickmarks(QSlider::Right);
	pSlider->setTickInterval(10);
	pLayout->addMultiCellWidget(pSlider, 0, 3, 0, 0);

	pHisto = new TMOGUIHisto(this, "Histogram");
	pLayout->addMultiCellWidget(pHisto, 0, 3, 1, 1, AlignBottom);

	pLayout->addRowSpacing(4, 2);

	pToneSlider = new TMOGUIToneSlider(this, "ToneSlider");
	pLayout->addWidget(pToneSlider, 5, 1);

	pRed = new QPushButton(this, "RedButton");
	pRed->setFlat(true);
	pRed->setFixedSize(16,16);
	pRed->setPixmap(*TMOResource::pResource->IconRed->pixmap());
	QToolTip::add(pRed, "Select Red Channel");
	pLayout->addWidget(pRed, 0, 2, AlignCenter);
	
	pGreen = new QPushButton(this, "GreenButton");
	pGreen->setFlat(true);
	pGreen->setFixedSize(16,16);
	pGreen->setPixmap(*TMOResource::pResource->IconGreen->pixmap());
	QToolTip::add(pGreen, "Select Green Channel");
	pLayout->addWidget(pGreen, 1, 2, AlignCenter);

	pBlue = new QPushButton(this, "BlueButton");
	pBlue->setFlat(true);
	pBlue->setFixedSize(16,16);
	pBlue->setPixmap(*TMOResource::pResource->IconBlue->pixmap());
	QToolTip::add(pBlue, "Select Blue Channel");
	pLayout->addWidget(pBlue, 2, 2, AlignCenter);

	pLum = new QPushButton(this, "LumButton");
	pLum->setFlat(true);
	pLum->setFixedSize(16,16);
	pLum->setPixmap(*TMOResource::pResource->IconLumDown->pixmap());	
	QToolTip::add(pLum, "Select Luminance");
	pLayout->addWidget(pLum, 3, 2, AlignCenter);
	
	pLinear = new QPushButton(this, "LinearButton");
	pLinear->setFlat(true);
	pLinear->setFixedSize(32,32);
	pLinear->setPixmap(*TMOResource::pResource->IconLin->pixmap());
	QToolTip::add(pLinear, "View In Linear Distribution");
	pLayout->addMultiCellWidget(pLinear, 0, 1, 3, 3, AlignCenter);

	pLog = new QPushButton(this, "LogarithmicButton");
	pLog->setFlat(true);
	pLog->setFixedSize(32,32);
	pLog->setPixmap(*TMOResource::pResource->IconLogDown->pixmap());
	QToolTip::add(pLog, "View In Logarithmic Distribution");
	pLayout->addMultiCellWidget(pLog, 2, 3, 3, 3, AlignCenter);
	
	pLayout->addRowSpacing(6, 2);

	QHBoxLayout* hbox = new QHBoxLayout();
	QLabel* pLabel = new QLabel(this, "BlackLabel");
	pLabel->setPixmap(*TMOResource::pResource->IconBlack->pixmap());
	pLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken );
	hbox->addWidget(pLabel);
	pBlack = new QLineEdit(this, "EditBlack");
	pBlack->setAlignment(Qt::AlignRight);
	pBlack->setFixedWidth(72);
	hbox->addWidget(pBlack);
	hbox->insertStretch(-1,1);
	pLabel = new QLabel(this, "GammaLabel");
	pLabel->setPixmap(*TMOResource::pResource->IconGamma->pixmap());
	pLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken );
	hbox->addWidget(pLabel);
	pGamma = new QLineEdit(this, "EditGamma");
	pGamma->setAlignment(Qt::AlignRight);
	pGamma->setFixedWidth(72);
	hbox->addWidget(pGamma);
	hbox->insertStretch(-1,1);
	pLabel = new QLabel(this, "WhiteLabel");
	pLabel->setPixmap(*TMOResource::pResource->IconWhite->pixmap());
	pLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken );
	hbox->addWidget(pLabel);
	pWhite = new QLineEdit(this, "EditWhite");
	pWhite->setAlignment(Qt::AlignRight);
	pWhite->setFixedWidth(72);
	hbox->addWidget(pWhite);
	pLayout->addLayout(hbox, 7, 1);


	connect (pSlider, SIGNAL(sliderMoved(int)), this, SLOT(scalechanged(int)));
	connect (pLinear, SIGNAL(clicked()), pHisto, SLOT(setlinear()));
	connect (pLog, SIGNAL(clicked()), pHisto, SLOT(setlog()));
	connect (pRed, SIGNAL(clicked()), pHisto, SLOT(setr()));
	connect (pGreen, SIGNAL(clicked()), pHisto, SLOT(setg()));
	connect (pBlue, SIGNAL(clicked()), pHisto, SLOT(setb()));
	connect (pLum, SIGNAL(clicked()), pHisto, SLOT(setl()));
	connect (pLinear, SIGNAL(clicked()), pToneSlider, SLOT(setlinear()));
	connect (pLog, SIGNAL(clicked()), pToneSlider, SLOT(setlog()));
	connect (pRed, SIGNAL(clicked()), pToneSlider, SLOT(setr()));
	connect (pGreen, SIGNAL(clicked()), pToneSlider, SLOT(setg()));
	connect (pBlue, SIGNAL(clicked()), pToneSlider, SLOT(setb()));
	connect (pLum, SIGNAL(clicked()), pToneSlider, SLOT(setl()));
	connect (pRed, SIGNAL(clicked()), this, SLOT(setr()));
	connect (pGreen, SIGNAL(clicked()), this, SLOT(setg()));
	connect (pBlue, SIGNAL(clicked()), this, SLOT(setb()));
	connect (pLum, SIGNAL(clicked()), this, SLOT(setl()));
	connect (pBlack, SIGNAL(textChanged(const QString &)), this, SLOT(setblack(const QString &)));
	connect (pWhite, SIGNAL(textChanged(const QString &)), this, SLOT(setwhite(const QString &)));
	connect (pGamma, SIGNAL(textChanged(const QString &)), this, SLOT(setgamma(const QString &)));
	connect (pBlack, SIGNAL(returnPressed()), this, SLOT(updateall()));
	connect (pWhite, SIGNAL(returnPressed()), this, SLOT(updateall()));
	connect (pGamma, SIGNAL(returnPressed()), this, SLOT(updateall()));
	connect (pLinear, SIGNAL(clicked()), this, SLOT(setlinear()));
	connect (pLog, SIGNAL(clicked()), this, SLOT(setlog()));
}
コード例 #5
0
ファイル: niii.c プロジェクト: c00kiemon5ter/niii
static void redrawall() {
    getmaxyx(stdscr, winrows, wincols);
    updateall();
    redrawwin(wout);
    redrawwin(winp);
}
コード例 #6
0
ファイル: UIStatsinfo.cpp プロジェクト: snopboy/JourneyClient
	UIStatsinfo::UIStatsinfo() :
		UIDragElement<PosSTATS>(Point<int16_t>(212, 20)), stats(Stage::get().getplayer().getstats()) {

		nl::node src = nl::nx::ui["UIWindow4.img"]["Stat"]["main"];
		nl::node detail = nl::nx::ui["UIWindow4.img"]["Stat"]["detail"];

		sprites.emplace_back(src["backgrnd"]);
		sprites.emplace_back(src["backgrnd2"]);
		sprites.emplace_back(src["backgrnd3"]);

		detailtextures.emplace_back(detail["backgrnd"]);
		detailtextures.emplace_back(detail["backgrnd2"]);
		detailtextures.emplace_back(detail["backgrnd3"]);

		abilities["rare"] = detail["abilityTitle"]["rare"]["0"];
		abilities["epic"] = detail["abilityTitle"]["epic"]["0"];
		abilities["unique"] = detail["abilityTitle"]["unique"]["0"];
		abilities["legendary"] = detail["abilityTitle"]["legendary"]["0"];
		abilities["none"] = detail["abilityTitle"]["normal"]["0"];

		buttons[BT_HP] = std::make_unique<MapleButton>(src["BtHpUp"]);
		buttons[BT_MP] = std::make_unique<MapleButton>(src["BtMpUp"]);
		buttons[BT_STR] = std::make_unique<MapleButton>(src["BtStrUp"]);
		buttons[BT_DEX] = std::make_unique<MapleButton>(src["BtDexUp"]);
		buttons[BT_LUK] = std::make_unique<MapleButton>(src["BtLukUp"]);
		buttons[BT_INT] = std::make_unique<MapleButton>(src["BtIntUp"]);

		buttons[BT_DETAILOPEN] = std::make_unique<MapleButton>(src["BtDetailOpen"]);
		buttons[BT_DETAILCLOSE] = std::make_unique<MapleButton>(src["BtDetailClose"]);
		buttons[BT_DETAILCLOSE]->setactive(false);

		updateap();

		for (size_t i = 0; i < NUMLABELS; i++)
		{
			statlabels[i] = Text(Text::A11M, Text::LEFT, Text::LIGHTGREY);
		}
		statoffsets[NAME] = Point<int16_t>(73, 27);
		statoffsets[JOB] = Point<int16_t>(73, 45);
		statoffsets[GUILD] = Point<int16_t>(73, 63);
		statoffsets[FAME] = Point<int16_t>(73, 81);
		statoffsets[DAMAGE] = Point<int16_t>(73, 99);
		statoffsets[HP] = Point<int16_t>(73, 117);
		statoffsets[MP] = Point<int16_t>(73, 135);
		statoffsets[AP] = Point<int16_t>(70, 177);
		statoffsets[STR] = Point<int16_t>(73, 204);
		statoffsets[DEX] = Point<int16_t>(73, 222);
		statoffsets[INT] = Point<int16_t>(73, 240);
		statoffsets[LUK] = Point<int16_t>(73, 258);
		statoffsets[ATTACK] = Point<int16_t>(73, 37);
		statoffsets[CRIT] = Point<int16_t>(73, 55);
		statoffsets[MINCRIT] = Point<int16_t>(73, 73);
		statoffsets[MAXCRIT] = Point<int16_t>(168, 73);
		statoffsets[BDM] = Point<int16_t>(73, 91);
		statoffsets[IGNOREDEF] = Point<int16_t>(168, 91);
		statoffsets[RESIST] = Point<int16_t>(73, 109);
		statoffsets[STANCE] = Point<int16_t>(168, 109);
		statoffsets[WDEF] = Point<int16_t>(73, 127);
		statoffsets[MDEF] = Point<int16_t>(73, 145);
		statoffsets[ACCURACY] = Point<int16_t>(73, 163);
		statoffsets[AVOID] = Point<int16_t>(73, 199);
		statoffsets[SPEED] = Point<int16_t>(73, 235);
		statoffsets[JUMP] = Point<int16_t>(168, 235);
		statoffsets[HONOR] = Point<int16_t>(73, 353);

		updateall();
		updatestat(Maplestat::JOB);
		updatestat(Maplestat::FAME);

		dimension = Point<int16_t>(212, 318);
		showdetail = false;
	}