const Text
Locale::GetDisplayName() const
{
	Text result;
	if (*language) {
		for (int i = 0; i < 14; i += 2) {
			if (!_stricmp(language, languages[i])) {
				result = languages[i+1];
				break;
			}
		}

		if (*country) {
			for (int i = 0; i < 18; i += 2) {
				if (!_stricmp(country, countries[i])) {
					result.append(" - ");
					result.append(countries[i+1]);
					break;
				}
			}
		}

	}
	return result;
}
示例#2
0
void DocumentFixture::SetUpTestCase() {
  // set up logging
  logFile = FileLogSink(toPath("./DocumentFixture.log"));
  logFile->setLogLevel(Info);

  // set up doc
  doc.setTitle("Excerpt from 2009 Grocery TSD");
  doc.addAuthor("Matthew Leach");
  doc.addAuthor("Elaine Hale");
  doc.addAuthor("Adam Hirsch");
  doc.addAuthor("Paul Torcellini");
  doc.setTopHeadingLevel(1u);
  Section section = doc.appendSection("Building Economic Parameters");
  Text txt;
  std::stringstream ss;
  ss << "Our statement of work mandates that the design recommendations be analyzed for cost "
     << "effectiveness based on a five-year analysis period, which is assumed acceptable to a "
     << "majority of developers and owners. The other basic economic parameters required for the "
     << "5-TLCC calculation were taken from RSMeans and the Office of Management and Budget "
     << "(OMB) (CITATIONS).";
  txt.append(ss.str()); ss.str("");
  ss << "This analysis uses the real discount rate, which accounts for the projected rate of "
     << "general inflation found in the Report of the President's Economic Advisors, Analytical "
     << "Perpectives, and is equal to 2.3% for a five-year analysis period (CITATION). By using "
     << "this rate, we do not have to explicitly account for energy and product inflation rates.";
  txt.append(ss.str()); ss.str("");
  ss << "Regional capital cost modifiers are used to convert national averages to regional "
     << "values. These are available from the RSMeans data sets and are applied before any of the "
     << "additional fees listed in TABLE REF, three of which are also provided by RSMeans "
     << "(CITATION).";
  txt.append(ss.str()); ss.str("");
  Table tbl;
  tbl.setTitle("Economic Parameter Values");
  std::vector<std::string> row;
  row.push_back("Economic Parameter");
  row.push_back("Value");
  row.push_back("Data Source");
  tbl.appendRow(row);
  tbl.setNHead(1);
  row[0] = "Analysis Period";            row[1] = "5 Years"; row[2] = "DOE";        tbl.appendRow(row);
  row[0] = "Discount Rate";              row[1] = "2.3%";    row[2] = "OMB";        tbl.appendRow(row);
  row[0] = "O&M Cost Inflation";         row[1] = "0%";      row[2] = "OMB";        tbl.appendRow(row);
  row[0] = "Gas Cost Inflation";         row[1] = "0%";      row[2] = "OMB";        tbl.appendRow(row);
  row[0] = "Electricity Cost Inflation"; row[1] = "0%";      row[2] = "OMB";        tbl.appendRow(row);
  row[0] = "Bond Fee";                   row[1] = "10%";     row[2] = "RSMeans";    tbl.appendRow(row);
  row[0] = "Contractor Fee";             row[1] = "10%";     row[2] = "RSMeans";    tbl.appendRow(row);
  row[0] = "Contingency Fee";            row[1] = "12%";     row[2] = "RSMeans";    tbl.appendRow(row);
  row[0] = "Commissioning Fee";          row[1] = "0.5%";    row[2] = "Assumption"; tbl.appendRow(row);
  section.append(txt);
  section.append(tbl);
}
const Text
Locale::GetFullCode() const
{
	Text result = language;
	if (*country) {
		result.append("_");
		result.append(country);

		if (*variant) {
			result.append("_");
			result.append(variant);
		}
	}
	return result;
}
示例#4
0
void Preedit::draw()
{
 
  int border = 0;

  Text t;
  if( buf.size() > 0 )
  {
    t.append( buf );
    border = 3;
  }
  t.bgColor( bg_color );
  t.fgColor( fg_color );

  Rect r;
  r.w( t.x_max() + 1*border );
  r.h( t.y_max() + 1*border );
  r.c( BLACK_color );
  r.toFill(true);
  
  Rect r2;
  r2.w( t.x_max() + 1*border );
  r2.h( t.y_max() + 1*border );
  r2.toFill(false);
  r2.c( border_color );
  
  gp->draw( 0, 0, &r);
  gp->draw( 0, 0, &r2);
  gp->draw( border , border , &t );

}
示例#5
0
void Status::draw()
{
 
  int border = 3;

  Text t;
  t.append( imf_name );
  t.bgColor( bg_color );
  t.fgColor( fg_color );
  
  Text t2;
  t2.append( im_name );
  t2.bgColor( bg_color );
  t2.fgColor( fg_color );

  Rect r;
  r.w( t.x_max() + t2.x_max() + 2*border );
  r.h( max( t.y_max(), t2.y_max() ) + 1*border );
  r.c( BLACK_color );
  r.toFill(true);
  
  Rect r1;
  r1.w( t.x_max() + 1*border );
  r1.h( max( t.y_max(), t2.y_max() ) + 1*border );
  r1.c( border_color );
  r1.toFill(false);
  
  Rect r2;
  r2.w( t2.x_max() + 1*border );
  r2.h( max( t.y_max(), t2.y_max() ) + 1*border );
  r2.c( border_color );
  r2.toFill(false);
  
  gp->draw( 0, 0, &r);
  gp->draw( 0, 0, &r1);
  gp->draw( border + t.x_max() , 0, &r2);

  gp->draw( border , border , &t );
  gp->draw( border + t.x_max() + border, border, &t2 );
}
void
MusicDirector::ScanTracks()
{
	DataLoader* loader = DataLoader::GetLoader();

	bool old_file_system = loader->IsFileSystemEnabled();
	loader->UseFileSystem(true);
	loader->SetDataPath("Music/");

	List<Text> files;
	loader->ListFiles("*.ogg", files, true);

	if (files.size() == 0) {
		loader->UseFileSystem(old_file_system);
		no_music = true;
		return;
	}

	no_music = false;

	ListIter<Text> iter = files;
	while (++iter) {
		Text* name = iter.value();
		Text* file = new(__FILE__,__LINE__) Text("Music/");

		name->setSensitive(false);
		file->append(*name);

		if (name->indexOf("Menu") == 0) {
			menu_tracks.append(file);
		}

		else if (name->indexOf("Intro") == 0) {
			intro_tracks.append(file);
		}

		else if (name->indexOf("Brief") == 0) {
			brief_tracks.append(file);
		}

		else if (name->indexOf("Debrief") == 0) {
			debrief_tracks.append(file);
		}

		else if (name->indexOf("Promot") == 0) {
			promote_tracks.append(file);
		}

		else if (name->indexOf("Flight") == 0) {
			flight_tracks.append(file);
		}

		else if (name->indexOf("Combat") == 0) {
			combat_tracks.append(file);
		}

		else if (name->indexOf("Launch") == 0) {
			launch_tracks.append(file);
		}

		else if (name->indexOf("Recovery") == 0) {
			recovery_tracks.append(file);
		}

		else if (name->indexOf("Victory") == 0) {
			victory_tracks.append(file);
		}

		else if (name->indexOf("Defeat") == 0) {
			defeat_tracks.append(file);
		}

		else if (name->indexOf("Credit") == 0) {
			credit_tracks.append(file);
		}

		else {
			menu_tracks.append(file);
		}

		delete iter.removeItem();
	}

	loader->UseFileSystem(old_file_system);

	menu_tracks.sort();
	intro_tracks.sort();
	brief_tracks.sort();
	debrief_tracks.sort();
	promote_tracks.sort();
	flight_tracks.sort();
	combat_tracks.sort();
	launch_tracks.sort();
	recovery_tracks.sort();
	victory_tracks.sort();
	defeat_tracks.sort();
	credit_tracks.sort();
}