本文整理汇总了C++中SpinBox::setMinValue方法的典型用法代码示例。如果您正苦于以下问题:C++ SpinBox::setMinValue方法的具体用法?C++ SpinBox::setMinValue怎么用?C++ SpinBox::setMinValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpinBox
的用法示例。
在下文中一共展示了SpinBox::setMinValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: openExchangeWindow
void GameEngine::openExchangeWindow()
{
if (exchangeWindow == NULL)
{
exchangeWindow = new ModalWindow("ExchangeMW", "Exchange", 400, 300);
//offer block
Label* tmpLbl = new Label("You offer:", "OfferLbl", 0, 0, 50, 15);
exchangeWindow->addUIElement(tmpLbl, 0.45, 0.01);
for (int i = 0; i < CT_DEVELOPMENT; ++i)
{
int resNumber = currentPlayer->getCardsOnHandCount(static_cast<eCardType> (i));
QString str = GameCard::cardTypeToStr(static_cast<eCardType> (i));
tmpLbl = new Label(str + " (" + QString::number(resNumber) + ")", "OfferLbl"+str, 0, 0, 50, 15);
exchangeWindow->addUIElement(tmpLbl, 0.05+0.2*i, 0.07);
SpinBox* tmpSB = new SpinBox("OfferSB"+str, 0, 0, 25, 50);
tmpSB->setMinValue(0);
tmpSB->setMaxValue(resNumber);
//tmpSB->setStep(currentPlayer->getExchangeRate(static_cast<eCardType> (i)));
exchangeWindow->addUIElement(tmpSB, 0.05+0.2*i, 0.15);
}
//offer for who - players or game bank
tmpLbl = new Label("Exchange whith:", "ExchangeWhithLbl", 0, 0, 50, 15);
exchangeWindow->addUIElement(tmpLbl, 0.45, 0.33);
RadioButtonBox* tmprbb = new RadioButtonBox("ExchangeTarget", 0, 0, 300, 15, RadioButtonBox::HORIZONTAL);
tmprbb->addRadioButton("Player", "Players", 75, 15);
tmprbb->addRadioButton("PC", "PC", 75, 15);
exchangeWindow->addUIElement(tmprbb, 0.25, 0.40);
//taking block
tmpLbl = new Label("You taking:", "OfferLbl", 0, 0, 50, 15);
exchangeWindow->addUIElement(tmpLbl, 0.45, 0.43);
for (int i = 0; i < CT_DEVELOPMENT; ++i)
{
QString str = GameCard::cardTypeToStr(static_cast<eCardType> (i));
tmpLbl = new Label(str, "TakingLbl"+str, 0, 0, 50, 15);
exchangeWindow->addUIElement(tmpLbl, 0.05+0.2*i, 0.50);
SpinBox* tmpSB = new SpinBox("TakingSB"+str, 0, 0, 25, 50);
tmpSB->setMinValue(0);
tmpSB->setMaxValue(MAX_CARD_COUNT);
exchangeWindow->addUIElement(tmpSB, 0.05+0.2*i, 0.60);
}
//bottom buttons
Command* mousePress = new GECcloseEW(this);
Button* tmpBtn = new Button("Cancel", "CancelBtn", 0, 0, 75, 25, mousePress);
exchangeWindow->addUIElement(tmpBtn, 0.55, 0.85);
mousePress = new GECsendExchangeOfferBtn(this);
tmpBtn = new Button("Exchange", "ExchangeBtn", 0, 0, 75, 25, mousePress);
exchangeWindow->addUIElement(tmpBtn, 0.30, 0.85);
mousePress = new GECcloseEW(this);
exchangeWindow->addKeyCommand(Qt::Key_Escape, mousePress);
exchangeWindow->show(true);
exchangeWindow->active(true);
}
}