Ejemplo n.º 1
0
void Dialog::askRocket(){
    if( !desktop ) {
        std::cerr << "No desktop found.\n";
        return;
    }
    try {
        myDialogComponent = loadGUIFile( "gui/launch_rocket_yn.xml" );
        assert( myDialogComponent != 0);
        registerDialog();
        blockingDialogIsOpen = true;
        iAmBlocking = true;
    } catch(std::exception& e) {
        std::cerr << "Couldn't display message 'launch_rocket_yn': "
            << e.what() << "\n";
        return;
    }
    Paragraph* p = getParagraph( *myDialogComponent, "DialogTitle" );
    std::stringstream title;
	title << _("Launchsite") << " ( " << pointX <<" , " << pointY << " )";
    p->setText( title.str() );
    // connect signals
    Button* yesButton = getButton( *myDialogComponent, "Yes" );
    yesButton->clicked.connect( makeCallback(*this, &Dialog::okayLaunchRocketButtonClicked ) );
    Button* noButton = getButton( *myDialogComponent, "No" );
    noButton->clicked.connect( makeCallback( *this, &Dialog::closeDialogButtonClicked ) );
    Button* gotoButton = getButton( *myDialogComponent, "goto" );
    gotoButton->clicked.connect( makeCallback( *this, &Dialog::gotoButtonClicked ) );
}
Ejemplo n.º 2
0
void Dialog::editMarket(){
    if( !desktop ) {
        std::cerr << "No desktop found.\n";
        return;
    }
    try {
        myDialogComponent = loadGUIFile( "gui/tradedialog.xml" );
        assert( myDialogComponent != 0);
        registerDialog();
        blockingDialogIsOpen = true;
        iAmBlocking = true;
    } catch(std::exception& e) {
        std::cerr << "Couldn't display dialog 'tradedialog.xml': "
            << e.what() << "\n";
        return;
    }
    // set Dialog to Market-Data
    Paragraph* p = getParagraph( *myDialogComponent, "DialogTitle" );
    std::stringstream title;
    title << _("Market") << " ( " << pointX <<" , " << pointY << " )";
    p->setText( title.str() );
    Market * market = static_cast <Market *> (world(pointX, pointY)->reportingConstruction);
    CheckButton* cb;
    cb = getCheckButton( *myDialogComponent, "BuyJobs" );
    if( market->commodityRuleCount[Construction::STUFF_JOBS].take ) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellJobs" );
    if( market->commodityRuleCount[Construction::STUFF_JOBS].give ) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "BuyFood" );
    if( market->commodityRuleCount[Construction::STUFF_FOOD].take ) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellFood" );
    if( market->commodityRuleCount[Construction::STUFF_FOOD].give ) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "BuyCoal" );
    if( market->commodityRuleCount[Construction::STUFF_COAL].take ) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellCoal" );
    if( market->commodityRuleCount[Construction::STUFF_COAL].give ) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "BuyOre" );
    if( market->commodityRuleCount[Construction::STUFF_ORE].take ) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellOre" );
    if( market->commodityRuleCount[Construction::STUFF_ORE].give ) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "BuyGoods" );
    if( market->commodityRuleCount[Construction::STUFF_GOODS].take ) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellGoods" );
    if( market->commodityRuleCount[Construction::STUFF_GOODS].give ) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "BuySteel" );
    if( market->commodityRuleCount[Construction::STUFF_STEEL].take ) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellSteel" );
    if( market->commodityRuleCount[Construction::STUFF_STEEL].give) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "BuyWaste" );
    if( market->commodityRuleCount[Construction::STUFF_WASTE].take ) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellWaste" );
    if( market->commodityRuleCount[Construction::STUFF_WASTE].give) cb->check(); else cb->uncheck();

    // connect signals
    Button* applyButton = getButton( *myDialogComponent, "Apply" );
    applyButton->clicked.connect( makeCallback(*this, &Dialog::applyMarketButtonClicked ) );
    Button* gotoButton = getButton( *myDialogComponent, "goto" );
    gotoButton->clicked.connect( makeCallback( *this, &Dialog::gotoButtonClicked ) );
}
Ejemplo n.º 3
0
void Dialog::editMarket(){
    if( !desktop ) {
        std::cerr << "No desktop found.\n";
        return;
    }
    try {
        myDialogComponent = loadGUIFile( "gui/tradedialog.xml" );
        assert( myDialogComponent != 0);
        registerDialog();
        blockingDialogIsOpen = true;
        iAmBlocking = true;
    } catch(std::exception& e) {
        std::cerr << "Couldn't display dialog 'tradedialog.xml': "
            << e.what() << "\n";
        return;
    }
    // set Dialog to Market-Data
    Paragraph* p = getParagraph( *myDialogComponent, "DialogTitle" );
    std::stringstream title;
	title << _("Market") << " ( " << pointX <<" , " << pointY << " )";
    p->setText( title.str() );

    CheckButton* cb;
    cb = getCheckButton( *myDialogComponent, "BuyJobs" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MB_JOBS ) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellJobs" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MS_JOBS ) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "BuyFood" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MB_FOOD) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellFood" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MS_FOOD) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "BuyCoal" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MB_COAL) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellCoal" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MS_COAL) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "BuyOre" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MB_ORE) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellOre" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MS_ORE) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "BuyGoods" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MB_GOODS) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellGoods" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MS_GOODS) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "BuySteel" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MB_STEEL) cb->check(); else cb->uncheck();
    cb = getCheckButton( *myDialogComponent, "SellSteel" );
    if( MP_INFO( pointX,pointY ).flags & FLAG_MS_STEEL) cb->check(); else cb->uncheck();
    // connect signals
    Button* applyButton = getButton( *myDialogComponent, "Apply" );
    applyButton->clicked.connect( makeCallback(*this, &Dialog::applyMarketButtonClicked ) );
    Button* gotoButton = getButton( *myDialogComponent, "goto" );
    gotoButton->clicked.connect( makeCallback( *this, &Dialog::gotoButtonClicked ) );
}
Ejemplo n.º 4
0
void Dialog::coalSurvey(){
    if( !desktop ) {
        std::cerr << "No desktop found.\n";
        return;
    }
    try {
        myDialogComponent = loadGUIFile( "gui/coal_survey_yn.xml" );
        assert( myDialogComponent != 0);
        registerDialog();
        blockingDialogIsOpen = true;
        iAmBlocking = true;
    } catch(std::exception& e) {
        std::cerr << "Couldn't display message 'coal_survey_yn': "
            << e.what() << "\n";
        return;
    }
    // connect signals
    Button* yesButton = getButton( *myDialogComponent, "Yes" );
    yesButton->clicked.connect( makeCallback(*this, &Dialog::okayCoalSurveyButtonClicked ) );
    Button* noButton = getButton( *myDialogComponent, "No" );
    noButton->clicked.connect( makeCallback( *this, &Dialog::closeDialogButtonClicked ) );
}
Ejemplo n.º 5
0
//no Signals caught here, so ScreenInterface has to catch them.
void Dialog::msgDialog( std::string message, std::string extraString){
    if( !desktop ) {
        std::cerr << "No desktop found.\n";
        return;
    }
    //generate filename. foo.mes => gui/foo.xml
    std::string filename = "gui/";
    filename += message;
    std::string::size_type pos = filename.rfind( ".mes" );
    if( pos != std::string::npos ){
        filename.replace( pos, 4 ,".xml");
    }
    std::auto_ptr<Component> myDialogComponent (loadGUIFile( filename ));

    //set Extra-String
    getParagraph( *myDialogComponent, "ExtraText" )->setText( extraString );

    // connect signals
    Button* noButton = getButton( *myDialogComponent, "Ok" );
    noButton->clicked.connect( makeCallback( *this, &Dialog::closeDialogButtonClicked ) );

    this->myDialogComponent = myDialogComponent.release();
    registerDialog();
}
Ejemplo n.º 6
0
/* 
 * Show game statistics in dialog and write them to RESULTS_FILENAME.
 *
 * gamestats.xml has 11 lines 
 * statistic_text1 
 * [...]
 * statistic_text11
 * and 15 lines in a Table with 6 columns
 * statistic_text_1_1  statistic_number_1_1  statistic_text_1_2  statistic_number_1_2  statistic_text_1_3  statistic_number_1_3
 * [...]
//  * statistic_text_15_1 statistic_number_15_1 statistic_text_15_2 statistic_number_15_2 statistic_text_15_3 statistic_number_15_3
 */
void Dialog::gameStats(){
     saveGameStats();
     if( !desktop ) {
        std::cerr << "No desktop found.\n";
        return;
    }
    bool useExisting = false;
    myDialogComponent = desktop->findComponent("GameStats");
    if( myDialogComponent == 0){
        try {
            myDialogComponent = loadGUIFile( "gui/gamestats.xml" );
            assert( myDialogComponent != 0);
            registerDialog();
        } catch(std::exception& e) {
            std::cerr << "Couldn't display message 'gamestats': "
                << e.what() << "\n";
            return;
        }
    } else {
        useExisting = true;
    }
    
    // Fill in Fields.
    int line = 1;
    int maxlength = 567;
    char* outf = (char *) malloc ( maxlength );
    int group_count[NUM_OF_GROUPS];
    count_all_groups (group_count);
    if (cheat_flag){
        setParagraphN( "statistic_text", line++, _("----- IN TEST MODE -------") );
    }
    snprintf (outf, maxlength, _("Game statistics from LinCity-NG Version %s"), PACKAGE_VERSION);
    setParagraphN( "statistic_text", line++, outf );
    if (strlen (given_scene) > 3){
	    snprintf (outf, maxlength, _("Initial loaded scene - %s"), given_scene);
        setParagraphN( "statistic_text", line++, outf );
    }
    if (sustain_flag){
	    snprintf (outf, maxlength, _("Economy is sustainable"));
        setParagraphN( "statistic_text", line++, outf );
    }
    snprintf (outf, maxlength, _("Population  %d  of which  %d  are not housed.")
	     ,housed_population + people_pool, people_pool);
    setParagraphN( "statistic_text", line++, outf );
    snprintf (outf, maxlength,
	     _("Max population %d  Number evacuated %d Total births %d")
	     ,max_pop_ever, total_evacuated, total_births);
    setParagraphN( "statistic_text", line++, outf );
    snprintf (outf, maxlength,
	     _("Date %s %04d  Money %8d   Tech-level %5.1f (%5.1f)"),
	     current_month(total_time), current_year(total_time), total_money,
	     (float) tech_level * 100.0 / MAX_TECH_LEVEL,
	     (float) highest_tech_level * 100.0 / MAX_TECH_LEVEL);
    setParagraphN( "statistic_text", line++, outf );
    snprintf (outf, maxlength,
	     _("Deaths by starvation %7d   History %8.3f"),
	     total_starve_deaths, starve_deaths_history);
    setParagraphN( "statistic_text", line++, outf );
    snprintf (outf, maxlength,
	     _("Deaths from pollution %7d   History %8.3f"),
	     total_pollution_deaths, pollution_deaths_history);
    setParagraphN( "statistic_text", line++, outf );
    snprintf (outf, maxlength, _("Years of unemployment %7d   History %8.3f"),
	     total_unemployed_years, unemployed_history);
    setParagraphN( "statistic_text", line++, outf );
    snprintf (outf, maxlength, _("Rockets launched %2d  Successful launches %2d"),
	     rockets_launched, rockets_launched_success);
    setParagraphN( "statistic_text", line++, outf );

    while( line <= 11 ){ //clear remaining lines
        setParagraphN( "statistic_text", line++, "" );
    }
    free( outf );

    setTableRC("statistic", 1, 1, _("Residences"),
	     group_count[GROUP_RESIDENCE_LL] + 
	     group_count[GROUP_RESIDENCE_ML] + 
	     group_count[GROUP_RESIDENCE_HL] + 
	     group_count[GROUP_RESIDENCE_LH] + 
	     group_count[GROUP_RESIDENCE_MH] + 
	     group_count[GROUP_RESIDENCE_HH]);
    setTableRC("statistic", 1, 2, _("Markets"), group_count[GROUP_MARKET] );
    setTableRC("statistic", 1, 3, _("Farms"), group_count[GROUP_ORGANIC_FARM]);
    
    setTableRC("statistic", 2, 1, _("Water wells"), group_count[GROUP_WATERWELL]);
    setTableRC("statistic", 2, 2, "", "");
    setTableRC("statistic", 2, 3, "", "");

    setTableRC("statistic", 3, 1, "", "");
    setTableRC("statistic", 3, 2, "", "");
    setTableRC("statistic", 3, 3, "", "");

    setTableRC("statistic", 4, 1, _("Monuments"), group_count[GROUP_MONUMENT]); 
    setTableRC("statistic", 4, 2, _("Schools"),  group_count[GROUP_SCHOOL]);
    setTableRC("statistic", 4, 3, _("Universities"), group_count[GROUP_UNIVERSITY]);

    setTableRC("statistic", 5, 1, _("Fire stations"), group_count[GROUP_FIRESTATION]);
    setTableRC("statistic", 5, 2, _("Parks"), group_count[GROUP_PARKLAND]);
    setTableRC("statistic", 5, 3, _("Sports fields"), group_count[GROUP_CRICKET]);

    setTableRC("statistic", 6, 1, _("Health centres"), group_count[GROUP_HEALTH]);
    setTableRC("statistic", 6, 2, _("Tips"), group_count[GROUP_TIP]);
    setTableRC("statistic", 6, 3, _("Shanties"), group_count[GROUP_SHANTY]);

    setTableRC("statistic", 7, 1, "", "");
    setTableRC("statistic", 7, 2, "", "");
    setTableRC("statistic", 7, 3, "", "");

    setTableRC("statistic", 8, 1, _("Windmills"), group_count[GROUP_WINDMILL]);
    setTableRC("statistic", 8, 2, _("Coal powers"), group_count[GROUP_COAL_POWER]);
    setTableRC("statistic", 8, 3, _("Solar powers"), group_count[GROUP_SOLAR_POWER]);

    setTableRC("statistic", 9, 1, _("Substations"), group_count[GROUP_SUBSTATION]);
    setTableRC("statistic", 9, 2, _("Power lines"), group_count[GROUP_POWER_LINE]);
    setTableRC("statistic", 9, 3, _("Ports"), group_count[GROUP_PORT]);

    setTableRC("statistic", 10, 1, _("Tracks"), group_count[GROUP_TRACK]);
    setTableRC("statistic", 10, 2, _("Roads"), group_count[GROUP_ROAD]);
    setTableRC("statistic", 10, 3, _("Rail"), group_count[GROUP_RAIL]);

    setTableRC("statistic", 11, 1, "", "");
    setTableRC("statistic", 11, 2, "", "");
    setTableRC("statistic", 11, 3, "", "");

    setTableRC("statistic", 12, 1, _("Potteries"), group_count[GROUP_POTTERY]);
    setTableRC("statistic", 12, 2, _("Blacksmiths"), group_count[GROUP_BLACKSMITH]);
    setTableRC("statistic", 12, 3, _("Mills"), group_count[GROUP_MILL]);

    setTableRC("statistic", 13, 1, _("Light inds"), group_count[GROUP_INDUSTRY_L]);
    setTableRC("statistic", 13, 2, _("Heavy inds"), group_count[GROUP_INDUSTRY_H]);
    setTableRC("statistic", 13, 3, _("Recyclers"), group_count[GROUP_RECYCLE]);

    setTableRC("statistic", 14, 1, _("Coal mines"), group_count[GROUP_COALMINE]);
    setTableRC("statistic", 14, 2, _("Ore mines"), group_count[GROUP_OREMINE]);
    setTableRC("statistic", 14, 3, _("Communes"), group_count[GROUP_COMMUNE]);

    setTableRC("statistic", 15, 1, "", "");
    setTableRC("statistic", 15, 2, "", "");
    setTableRC("statistic", 15, 3, "", "");
   
    if( !useExisting ){
        // connect signals
        Button* noButton = getButton( *myDialogComponent, "Okay" );
        noButton->clicked.connect( makeCallback( *this, &Dialog::closeDialogButtonClicked ) );
    }
}
Ejemplo n.º 7
0
/*
 * Show game statistics in dialog and write them to RESULTS_FILENAME.
 *
 * gamestats.xml has 11 lines
 * statistic_text1
 * [...]
 * statistic_text11
 * and 15 lines in a Table with 6 columns
 * statistic_text_1_1  statistic_number_1_1  statistic_text_1_2  statistic_number_1_2  statistic_text_1_3  statistic_number_1_3
 * [...]
//  * statistic_text_15_1 statistic_number_15_1 statistic_text_15_2 statistic_number_15_2 statistic_text_15_3 statistic_number_15_3
 */
void Dialog::gameStats(){
     saveGameStats();
     if( !desktop ) {
        std::cerr << "No desktop found.\n";
        return;
    }
    bool useExisting = false;
    myDialogComponent = desktop->findComponent("GameStats");
    if( myDialogComponent == 0){
        try {
            myDialogComponent = loadGUIFile( "gui/gamestats.xml" );
            assert( myDialogComponent != 0);
            registerDialog();
        } catch(std::exception& e) {
            std::cerr << "Couldn't display message 'gamestats': "
                << e.what() << "\n";
            return;
        }
    } else {
        useExisting = true;
    }

    // Fill in Fields.
    int line = 1;
    int maxlength = 567;
    char* outf = (char *) malloc ( maxlength );
    if (cheat_flag){
        setParagraphN( "statistic_text", line++, _("----- IN TEST MODE -------") );
    }
    snprintf (outf, maxlength,"%s %s", _("Game statistics from LinCity-NG Version"), PACKAGE_VERSION);
    setParagraphN( "statistic_text", line++, outf );
    if (strlen (given_scene) > 3){
        snprintf (outf, maxlength,"%s - %s", _("Initial loaded scene"), given_scene);
        setParagraphN( "statistic_text", line++, outf );
    }
    if (sustain_flag){
        snprintf (outf, maxlength, "%s", _("Economy is sustainable"));
        setParagraphN( "statistic_text", line++, outf );
    }
    snprintf (outf, maxlength, "%s %d %s %d %s.",
        _("Population"), population + people_pool, _("of which"),  people_pool, _("are not housed"));
    setParagraphN( "statistic_text", line++, outf );
    snprintf (outf, maxlength, "%s %d %s %d %s %d",
        _("Max population"), max_pop_ever,  _("Number evacuated"), total_evacuated, _("Total births"), total_births);
    setParagraphN( "statistic_text", line++, outf );
    snprintf (outf, maxlength, "%s %s %04d %s %8d %s %5.1f (%5.1f)",
        _("Date"),  current_month(total_time), current_year(total_time),
        _("Money"), total_money, _("Tech-level"),
        (float) tech_level * 100.0 / MAX_TECH_LEVEL,
        (float) highest_tech_level * 100.0 / MAX_TECH_LEVEL);
    setParagraphN( "statistic_text", line++, outf );
    snprintf (outf, maxlength, "%s %7d %s %8.3f",
        _("Deaths by starvation"), total_starve_deaths,
        _("History"), starve_deaths_history);
    setParagraphN( "statistic_text", line++, outf );
    snprintf (outf, maxlength, "%s %7d   %s %8.3f",
        _("Deaths from pollution"), total_pollution_deaths,
        _("History"), pollution_deaths_history);
    setParagraphN( "statistic_text", line++, outf );
    snprintf (outf, maxlength, "%s %7d   %s %8.3f",
        _("Years of unemployment"), total_unemployed_years,
        _("History"), unemployed_history);
    setParagraphN( "statistic_text", line++, outf );
    snprintf (outf, maxlength, "%s %2d  %s %2d",
        _("Rockets launched"), rockets_launched,
        _("Successful launches"), rockets_launched_success);
    setParagraphN( "statistic_text", line++, outf );

    while( line <= 11 ){ //clear remaining lines
        setParagraphN( "statistic_text", line++, "" );
    }
    free( outf );

    setTableRC("statistic", 1, 1, _("Residences"),
        Counted<Residence>::getInstanceCount());
    setTableRC("statistic", 1, 2, _("Markets"), Counted<Market>::getInstanceCount());
    setTableRC("statistic", 1, 3, _("Farms"), Counted<Organic_farm>::getInstanceCount());

    setTableRC("statistic", 2, 1, _("Water wells"), Counted<Waterwell>::getInstanceCount());
    setTableRC("statistic", 2, 2, _("Wind powers"), Counted<Windpower>::getInstanceCount());
    setTableRC("statistic", 2, 3, "", "");

    setTableRC("statistic", 3, 1, "", "");
    setTableRC("statistic", 3, 2, "", "");
    setTableRC("statistic", 3, 3, "", "");

    setTableRC("statistic", 4, 1, _("Monuments"), Counted<Monument>::getInstanceCount());
    setTableRC("statistic", 4, 2, _("Schools"),  Counted<School>::getInstanceCount());
    setTableRC("statistic", 4, 3, _("Universities"), Counted<University>::getInstanceCount());

    setTableRC("statistic", 5, 1, _("Fire stations"), Counted<FireStation>::getInstanceCount());
    setTableRC("statistic", 5, 2, _("Parks"), Counted<Parkland>::getInstanceCount());
    setTableRC("statistic", 5, 3, _("Sports fields"), Counted<Cricket>::getInstanceCount());

    setTableRC("statistic", 6, 1, _("Health centres"), Counted<HealthCentre>::getInstanceCount());
    setTableRC("statistic", 6, 2, _("Tips"), Counted<Tip>::getInstanceCount());
    setTableRC("statistic", 6, 3, _("Shanties"), Counted<Shanty>::getInstanceCount());

    setTableRC("statistic", 7, 1, "", "");
    setTableRC("statistic", 7, 2, "", "");
    setTableRC("statistic", 7, 3, "", "");

    setTableRC("statistic", 8, 1, _("Windmills"),  Counted<Windmill>::getInstanceCount());
    setTableRC("statistic", 8, 2, _("Coal powers"), Counted<Coal_power>::getInstanceCount());
    setTableRC("statistic", 8, 3, _("Solar powers"), Counted<SolarPower>::getInstanceCount());

    setTableRC("statistic", 9, 1, _("Substations"), Counted<Substation>::getInstanceCount());
    setTableRC("statistic", 9, 2, _("Power lines"), Counted<Powerline>::getInstanceCount());
    setTableRC("statistic", 9, 3, _("Ports"), Counted<Port>::getInstanceCount());

    setTableRC("statistic", 10, 1, _("Tracks"), Counted<Track>::getInstanceCount());
    setTableRC("statistic", 10, 2, _("Roads"), Counted<Road>::getInstanceCount());
    setTableRC("statistic", 10, 3, _("Rail"), Counted<Rail>::getInstanceCount());

    setTableRC("statistic", 11, 1, "", "");
    setTableRC("statistic", 11, 2, "", "");
    setTableRC("statistic", 11, 3, "", "");

    setTableRC("statistic", 12, 1, _("Potteries"), Counted<Pottery>::getInstanceCount());
    setTableRC("statistic", 12, 2, _("Blacksmiths"), Counted<Blacksmith>::getInstanceCount());
    setTableRC("statistic", 12, 3, _("Mills"), Counted<Mill>::getInstanceCount());

    setTableRC("statistic", 13, 1, _("Light inds"), Counted<IndustryLight>::getInstanceCount());
    setTableRC("statistic", 13, 2, _("Heavy inds"), Counted<IndustryHeavy>::getInstanceCount());
    setTableRC("statistic", 13, 3, _("Recyclers"), Counted<Recycle>::getInstanceCount());

    setTableRC("statistic", 14, 1, _("Coal mines"), Counted<Coalmine>::getInstanceCount());
    setTableRC("statistic", 14, 2, _("Ore mines"), Counted<Oremine>::getInstanceCount());
    setTableRC("statistic", 14, 3, _("Forests"), Counted<Commune>::getInstanceCount());

    setTableRC("statistic", 15, 1, "", "");
    setTableRC("statistic", 15, 2, "", "");
    setTableRC("statistic", 15, 3, "", "");

    if( !useExisting ){
        // connect signals
        Button* noButton = getButton( *myDialogComponent, "Okay" );
        noButton->clicked.connect( makeCallback( *this, &Dialog::closeDialogButtonClicked ) );
    }
}
Ejemplo n.º 8
0
void MainWindow::on_RegisterButton_clicked() {
    RegisterDialog registerDialog(this);

    registerDialog.exec();
}
Ejemplo n.º 9
0
QtWidgetModule::QtWidgetModule() : InviwoModule() {
    setIdentifier("QtWidget");
    registerPropertyWidget(BoolPropertyWidgetQt, BoolProperty, "Default");
    registerPropertyWidget(ButtonPropertyWidgetQt, ButtonProperty, "Default");
    registerPropertyWidget(BoolCompositePropertyWidgetQt, BoolCompositeProperty, "Default");

    registerPropertyWidget(ColorPropertyWidgetQt, IntVec3Property, "Color");
    registerPropertyWidget(ColorPropertyWidgetQt, IntVec4Property, "Color");
    registerPropertyWidget(ColorPropertyWidgetQt, FloatVec3Property, "Color");
    registerPropertyWidget(ColorPropertyWidgetQt, FloatVec4Property, "Color");
    registerPropertyWidget(CompositePropertyWidgetQt, CompositeProperty, "Default");
    registerPropertyWidget(EventPropertyWidgetQt, EventProperty, "Default");
    registerPropertyWidget(FilePropertyWidgetQt, FileProperty, "Default");

    registerPropertyWidget(FloatMat2PropertyWidgetQt, FloatMat2Property, "Default");
    registerPropertyWidget(FloatMat3PropertyWidgetQt, FloatMat3Property, "Default");
    registerPropertyWidget(FloatMat4PropertyWidgetQt, FloatMat4Property, "Default");
    registerPropertyWidget(FloatMinMaxPropertyWidgetQt, FloatMinMaxProperty, "Default");
    registerPropertyWidget(FloatMinMaxTextPropertyWidgetQt, FloatMinMaxProperty, "Text");
    registerPropertyWidget(FloatPropertyWidgetQt, FloatProperty, "Default");
    registerPropertyWidget(FloatAnglePropertyWidgetQt, FloatProperty, "Angle");
    registerPropertyWidget(FloatPropertyWidgetQt, FloatProperty, "Text");
    registerPropertyWidget(FloatVec2PropertyWidgetQt, FloatVec2Property, "Default");
    registerPropertyWidget(FloatVec2PropertyWidgetQt, FloatVec2Property, "Text");
    registerPropertyWidget(FloatVec3PropertyWidgetQt, FloatVec3Property, "Default");
    registerPropertyWidget(FloatVec3PropertyWidgetQt, FloatVec3Property, "Text");
    registerPropertyWidget(FloatVec3PropertyWidgetQt, FloatVec3Property, "Spherical");
    registerPropertyWidget(FloatVec4PropertyWidgetQt, FloatVec4Property, "Default");
    registerPropertyWidget(FloatVec4PropertyWidgetQt, FloatVec4Property, "Text");

    registerPropertyWidget(DoubleMat2PropertyWidgetQt, DoubleMat2Property, "Default");
    registerPropertyWidget(DoubleMat3PropertyWidgetQt, DoubleMat3Property, "Default");
    registerPropertyWidget(DoubleMat4PropertyWidgetQt, DoubleMat4Property, "Default");
    registerPropertyWidget(DoubleMinMaxPropertyWidgetQt, DoubleMinMaxProperty, "Default");
    registerPropertyWidget(DoubleMinMaxTextPropertyWidgetQt, DoubleMinMaxProperty, "Text");
    registerPropertyWidget(DoublePropertyWidgetQt, DoubleProperty, "Default");
    registerPropertyWidget(DoubleAnglePropertyWidgetQt, DoubleProperty, "Angle");
    registerPropertyWidget(DoublePropertyWidgetQt, DoubleProperty, "Text");
    registerPropertyWidget(DoubleVec2PropertyWidgetQt, DoubleVec2Property, "Default");
    registerPropertyWidget(DoubleVec2PropertyWidgetQt, DoubleVec2Property, "Text");
    registerPropertyWidget(DoubleVec3PropertyWidgetQt, DoubleVec3Property, "Default");
    registerPropertyWidget(DoubleVec3PropertyWidgetQt, DoubleVec3Property, "Text");
    registerPropertyWidget(DoubleVec3PropertyWidgetQt, DoubleVec3Property, "Spherical");
    registerPropertyWidget(DoubleVec4PropertyWidgetQt, DoubleVec4Property, "Default");
    registerPropertyWidget(DoubleVec4PropertyWidgetQt, DoubleVec4Property, "Text");
    
    registerPropertyWidget(ImageEditorWidgetQt, FileProperty, "ImageEditor");
    registerPropertyWidget(ImageEditorWidgetQt, ImageEditorProperty, "Default");
    registerPropertyWidget(ImageEditorWidgetQt, ImageEditorProperty, "ImageEditor");
    
    registerPropertyWidget(IntMinMaxPropertyWidgetQt, IntMinMaxProperty, "Default");
    registerPropertyWidget(IntMinMaxTextPropertyWidgetQt, IntMinMaxProperty, "Text");
    registerPropertyWidget(IntPropertyWidgetQt, IntProperty, "Default");
    registerPropertyWidget(IntPropertyWidgetQt, IntProperty, "Text");
    registerPropertyWidget(IntVec2PropertyWidgetQt, IntVec2Property, "Default");
    registerPropertyWidget(IntVec2PropertyWidgetQt, IntVec2Property, "Text");
    registerPropertyWidget(IntVec3PropertyWidgetQt, IntVec3Property, "Default");
    registerPropertyWidget(IntVec3PropertyWidgetQt, IntVec3Property, "Text");
    registerPropertyWidget(IntVec4PropertyWidgetQt, IntVec4Property, "Default");
    registerPropertyWidget(IntVec4PropertyWidgetQt, IntVec4Property, "Text");
    registerPropertyWidget(IntSize2PropertyWidgetQt, IntSize2Property, "Default");
    registerPropertyWidget(IntSize2PropertyWidgetQt, IntSize2Property, "Text");
    registerPropertyWidget(IntSize3PropertyWidgetQt, IntSize3Property, "Default");
    registerPropertyWidget(IntSize3PropertyWidgetQt, IntSize3Property, "Text");
    registerPropertyWidget(IntSize4PropertyWidgetQt, IntSize4Property, "Default");
    registerPropertyWidget(IntSize4PropertyWidgetQt, IntSize4Property, "Text");
    registerPropertyWidget(Int64PropertyWidgetQt, Int64Property, "Default");
    registerPropertyWidget(Int64PropertyWidgetQt, Int64Property, "Text");
    
    registerPropertyWidget(LightPropertyWidgetQt, FloatVec3Property, "LightPosition");
    registerPropertyWidget(OptionPropertyWidgetQt, OptionPropertyInt, "Default");
    registerPropertyWidget(OptionPropertyWidgetQt, OptionPropertySize_t, "Default");
    registerPropertyWidget(OptionPropertyWidgetQt, OptionPropertyFloat, "Default");
    registerPropertyWidget(OptionPropertyWidgetQt, OptionPropertyDouble, "Default");
    registerPropertyWidget(OptionPropertyWidgetQt, OptionPropertyString, "Default");
    registerPropertyWidget(StringPropertyWidgetQt, StringProperty, "Default");
    registerPropertyWidget(StringPropertyWidgetQt, StringProperty, "Password");
    registerPropertyWidget(TextEditorWidgetQt, FileProperty, "TextEditor");
    registerPropertyWidget(TextEditorWidgetQt, FileProperty, "ShaderEditor");
    registerPropertyWidget(TextEditorWidgetQt, StringProperty, "TextEditor");
    registerPropertyWidget(TextEditorWidgetQt, StringProperty, "ShaderEditor");
    registerPropertyWidget(TransferFunctionPropertyWidgetQt, TransferFunctionProperty, "Default");
    registerDialog("RawVolumeReader", RawDataReaderDialogQt);
}