Пример #1
0
int CUIManager::UIBid(int iAtLeast)
{
   CBox box(200, 260, 225, 32, 80, 50, 200, 128, false);
   CButton btn1(1, 205, 265, 50, 22, 250, 70, 250);
   CButton btn2(2, 260, 265, 50, 22, 250, 70, 250);
   CButton btn3(3, 315, 265, 50, 22, 250, 70, 250);
   CButton btn4(0, 370, 265, 50, 22, 250, 70, 250);

   gpGeneral->DrawImage(iAtLeast > 1 ? IMG_1PD : IMG_1P, 210, 267);
   gpGeneral->DrawImage(iAtLeast > 2 ? IMG_2PD : IMG_2P, 265, 267);
   gpGeneral->DrawImage(IMG_3P, 320, 267);
   gpGeneral->DrawImage(IMG_NOTCALL, 375, 267);

   time_t t;
   time(&t);

   while (time(NULL) - t < 30) {
      DrawTime(30 - (time(NULL) - t));
      int key = gpGeneral->ReadKey(false) - SDLK_LAST;
      if ((key >= iAtLeast && key <= 3) || !key) {
         return key;
      }
      // allow using the keyboard as well
      key += SDLK_LAST - '0';
      if ((key >= iAtLeast && key <= 3) || !key) {
         return key;
      }
   }

   return 0;
}
Пример #2
0
void button_key::on_pushButton_3_clicked()//3
{
    emit btn3();
}