예제 #1
0
파일: main.c 프로젝트: rp-/wii-mahjong
static void initMain()
{

    // try to load a saved config, if none then get Wii language menu
    if(!loadConfig(FILE_CFG)) {
        // get the language of the Wii menu and map this to the Mahjongg Wii languages
        if(CONF_GetLanguage()<7) opt_lang = languages[CONF_GetLanguage()];

        // dirty hack to force English if not German as default
        if (opt_lang != 2) {
            opt_lang = 1;
        }
    }
    GRRLIB_Widescreen(opt_widescreen);

    // setup the layouts array for use in menu and game
    setupLayouts();

    //init scores with 0
    int i;
    for( i = 0; i < LAYOUTS * 2; ++i) {
        g_scores[i] = 0;
    }
    //load scores
    loadHighscores( FILE_HIGHSCORE, g_scores);
}
예제 #2
0
void LayoutApp::setup(){
    ofSetWindowTitle("Map");
    ofSeedRandom();
    ofEnableSmoothing();
    ofSetFrameRate(30);

    fontVerd10.loadFont("verdana.ttf", 10);
    fontVerd14.loadFont("verdana.ttf", 14);

    if (!visConfig.loadFile(getMainAppDataDirectory() + "VisConfig.txt")) {
        printf("ERR: (fatal) config load failed\n");
        exitApp();
    }

    if (visConfig.fake_data) gelink.ensureFakeData();

    setupLayouts();
    setupUI();

    mainRenderMode.structure    = true;
    mainRenderMode.locations    = true;
    mainRenderMode.texture      = false;
    mainRenderMode.presence     = true;
    mainRenderMode.userLocation = true;
    mainRenderMode.skeletons    = true;
}
// Группа -----------------------------------------------------------------------------------
S_PROD_GR_DBTable::S_PROD_GR_DBTable(QWidget *parent)
    : PAbstractDBTable(parent)
{
  captionViewLabel->setText( tr("Справочник продукции - главная группа"));

  ptrView = view;

  selectSQL = "SELECT KOD,NAME,K,ED FROM S_PROD_GR ORDER BY KOD";

  model->setQuery( selectSQL , db );

  model->setHeaderData(0, Qt::Horizontal, tr("Код"));
  model->setHeaderData(1, Qt::Horizontal, tr("Наименование"));
  model->setHeaderData(2, Qt::Horizontal, tr("Коэфф.:"));
  model->setHeaderData(3, Qt::Horizontal, tr("Ед.изм.:"));

  view->setColumnWidth( 0, widthKOD );
  view->setColumnWidth( 1, widthNAME );
  view->setColumnWidth( 2, widthK );
  view->setColumnWidth( 3, widthK );
  
  POne_Field* ptrPRD;

  ptrPRD = precdialog->addInputObject( tr("Код:") , 
				       POne_Field::Type(POne_Field::SpinBox) , 70 );
  iobj_KOD = (QSpinBox*)ptrPRD->inputObject();
  iobj_KOD->setRange(0, 1000000);
  iobj_KOD->setValue(0);
  iobj_KOD->setAlignment(Qt::AlignRight);

  ptrPRD = precdialog->addInputObject( tr("Наименование") , 
				       POne_Field::Type(POne_Field::LineEdit) , 200 );
  iobj_NAME = (QLineEdit*)ptrPRD->inputObject();
  iobj_NAME->setMaxLength( 30 );

  ptrPRD = precdialog->addInputObject( tr("Коэфф.:") , 
				       POne_Field::Type(POne_Field::DoubleSpinBox) , 70 );
  iobj_K = (QDoubleSpinBox*)ptrPRD->inputObject();
  iobj_K->setRange(0.0, 100000.0);
  iobj_K->setSingleStep(0.01);
  iobj_K->setValue(0.0);
  iobj_K->setAlignment(Qt::AlignRight);
  
  ptrPRD = precdialog->addInputObject( tr("Ед.изм.:") , 
				       POne_Field::Type(POne_Field::ComboBox) , 50 );
  iobj_ED_MASS = (QComboBox*)ptrPRD->inputObject();
  iobj_ED_MASS->setEditable( false );
  //  iobj_ED_MASS->lineEdit()->setMaxLength( 3 );
  
  model_in_ComboBox = new QSqlQueryModel;
  iobj_ED_MASS->setModel( model_in_ComboBox );

  setupLayouts();
}
예제 #4
0
        MainWindow::MainWindow(QWidget *parent)
            : QMainWindow(parent)
        {
            setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);

            setupLayouts();
            setupMenus();
            setupToolbars();
            setupContent();
            setupMainWidget();

            setStyleSheet(GeneralStyles::windowStyle);
        }
S_PROD_PGR_DBTable::S_PROD_PGR_DBTable(QWidget *parent)
    : PAbstractDBTable(parent)
{
  captionViewLabel->setText( tr("Справочник продукции - подгруппа"));
  
  model->setQuery( "SELECT NAME,K,KOD_DEP FROM S_PROD_PGR WHERE KOD = -1" , db );

  model->setHeaderData(0, Qt::Horizontal, tr("Наименование"));
  model->setHeaderData(1, Qt::Horizontal, tr("Коэфф.:"));
  model->setHeaderData(2, Qt::Horizontal, tr("Цех:"));
  
  view->setColumnWidth( 0, widthNAME );  
  view->setColumnWidth( 1, widthK );
  view->setColumnWidth( 2, widthK );
  
  POne_Field* ptrPRD;

  ptrPRD = precdialog->addInputObject( tr("Наименование") , 
				       POne_Field::Type(POne_Field::LineEdit) , 200 );
  iobj_NAME = (QLineEdit*)ptrPRD->inputObject();
  iobj_NAME->setMaxLength( 30 );

  ptrPRD = precdialog->addInputObject( tr("Коэфф.:") , 
				       POne_Field::Type(POne_Field::DoubleSpinBox) , 70 );
  iobj_K = (QDoubleSpinBox*)ptrPRD->inputObject();
  iobj_K->setRange(0.0, 100000.0);
  iobj_K->setSingleStep(0.01);
  iobj_K->setValue(0.0);
  iobj_K->setAlignment(Qt::AlignRight);
  
  ptrPRD = precdialog->addInputObject( tr("Цех:") , 
				       POne_Field::Type(POne_Field::ComboBox) , 50 );
  iobj_KOD_DEP = (QComboBox*)ptrPRD->inputObject();
  iobj_KOD_DEP->setEditable( false );
  //iobj_KOD_DEP->lineEdit()->setMaxLength( 3 );

  model_in_ComboBox_KOD_DEP = new QSqlQueryModel;
  iobj_KOD_DEP->setModel( model_in_ComboBox_KOD_DEP );  

  setupLayouts();
}
// Группа -----------------------------------------------------------------------------------
S_SYR_GR_DBTable::S_SYR_GR_DBTable(QWidget *parent)
    : PAbstractDBTable(parent)
{
  captionViewLabel->setText( tr("Справочник сырья - главная группа"));

  ptrView = view;

  selectSQL = "SELECT KOD,NAME,K FROM S_SYR_GR ORDER BY KOD";

  model->setQuery( selectSQL , db );

  model->setHeaderData(0, Qt::Horizontal, tr("Код"));
  model->setHeaderData(1, Qt::Horizontal, tr("Наименование"));
  model->setHeaderData(2, Qt::Horizontal, tr("Коэфф.:"));

  view->setColumnWidth( 0, widthKOD );
  view->setColumnWidth( 1, widthNAME );
  view->setColumnWidth( 2, widthK );
  
  POne_Field* ptrPRD;

  ptrPRD = precdialog->addInputObject( tr("Код:") , 
				       POne_Field::Type(POne_Field::LineEdit) , 50 );
  iobj_KOD = (QLineEdit*)ptrPRD->inputObject();
  iobj_KOD->setValidator( new QIntValidator( iobj_KOD ));
  iobj_KOD->setFocus();

  ptrPRD = precdialog->addInputObject( tr("Наименование") , 
				       POne_Field::Type(POne_Field::LineEdit) , 200 );
  iobj_NAME = (QLineEdit*)ptrPRD->inputObject();
  iobj_NAME->setMaxLength( 30 );

  ptrPRD = precdialog->addInputObject( tr("Коэфф.:") , 
				       POne_Field::Type(POne_Field::LineEdit) , 50 );
  iobj_K = (QLineEdit*)ptrPRD->inputObject();
  iobj_K->setValidator( new QDoubleValidator( iobj_K ));

  setupLayouts();
}