Пример #1
0
void cbSplashScreen::DoPaint(wxDC &dc)
{
  static const wxString release(wxT("svn"));
  static const wxString revision( wxT("3.0.47") );

  #ifdef __WXMSW__
  //dc.SetClippingRegion(r);
  #endif

  dc.DrawBitmap(m_label, 0, 0, false);

  wxFont largeFont(16, wxSWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD);
  wxFont smallFont(9, wxSWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD);

  wxCoord a, b, c, d;

  dc.GetTextExtent(release,  &a, &b, 0, 0, &largeFont);
  dc.GetTextExtent(revision, &c, &d, 0, 0, &smallFont);

  a >>= 1; c >>=1;
//  int y = 180 - ((b + d + 8)>>1);

  dc.SetFont(largeFont);
  //dc.DrawText(release,  92 - a, y);
  dc.SetFont(smallFont);
  //dc.DrawText(revision, 92 - c, y + b);
}
Пример #2
0
void QuizFrame::updateFonts() {
    QFont largeFont( controller->getPreferences().getLargeFont() );
    QFont mediumFont( controller->getPreferences().getMediumFont() );
    QFont labelsFont( controller->getPreferences().getLabelsFont() );
    QString firstLang( controller->getQuizFirstLanguage() );
    QString testLang( controller->getQuizTestLanguage() );

    firstLangTermLabel->setFont( labelsFont );
    firstLangTermLineEdit->setFont( controller->getPreferences().getMediumFont( firstLang ) );
    firstLangTermButton->setFont( labelsFont );
    firstLangPanel->setFont( labelsFont );

    testLangTermAltLabel->setFont( labelsFont );
    testLangTermAltLineEdit->setFont( controller->getPreferences().getMediumFont( testLang ) );
    testLangTermLabel->setFont( labelsFont );

    testLangTermLineEdit->setFont( controller->getPreferences().getLargeFont( testLang ) );

    testLangPanel->setFont( labelsFont );

    commentLabel->setFont( labelsFont );
    commentMultiLineEdit->setFont( controller->getPreferences().getBestFont( firstLang, testLang ) );

    firstLangTermPanel->updateGeometry();
    firstLangTermPanel->layout()->invalidate();

    firstLangTermStack->updateGeometry();
   
    testLangLabelsPanel->updateGeometry();
    testLangLabelsPanel->layout()->invalidate();

    testLangFieldsPanel->updateGeometry();
    testLangFieldsPanel->layout()->invalidate();

    revealAllDataButton->setFont( labelsFont );
    rightAnswerButton->setFont( labelsFont );
    wrongAnswerButton->setFont( labelsFont );
    editionButton->setFont( labelsFont );

    update();
    updateGeometry();
}
Пример #3
0
void MapEdit::polishWidgets()
{
	////////STAGE 3: Polish Widgets
	//
	//titleBox
	copyButton->setMaximumWidth( 28 ); copyButton->setMaximumHeight( 28 );
	copyButton->setToolTip( "Copy from input info editor." );
	lockButton->setMaximumWidth( 28 ); lockButton->setMaximumHeight( 28 );
	lockButton->setCheckable( true );
	lockButton->setToolTip( "Use to allow editing of .xml file.<br><br>"
		"<b>Note</b>: Locking this info editor automatically saves to the .xml file." );
	QFont largeFont(  mapLabel->font() );
	largeFont.setPointSize( 12 );
	mapLabel->setFont( largeFont );
	mapLabel->setAlignment(Qt::AlignCenter);
	frameButton->setMaximumWidth( 28 ); frameButton->setMaximumHeight( 28 );
	frameButton->setToolTip( "Calculate rows, columns, and upper left coordinates." );

	//fileBox
	fileEdit->setReadOnly( true );
	fileEdit->setToolTip( "File name of the loaded .xml file" );

	//rowcolBox
	rowSpin->setToolTip( "Height of the map in pixels" );
	colSpin->setToolTip( "Width of the map in pixels" );

	//comboBox
	unitCombo->addItem( "" );
	unitCombo->addItems( unitNames );
	unitCombo->setCurrentIndex( 3 );	//displays Meters
	unitCombo->setDisabled( true );
	unitCombo->setToolTip( "Units for all measurements<br><br>"
		"<b>Note</b>: Currently only \"Meters\" are supported." );
	spheroidCombo->addItem( "" );
	spheroidCombo->addItems( spheroidNames );
	spheroidCombo->setCurrentIndex( 20 ); //Sphere of Radius 6370997 meters
	spheroidCombo->setDisabled( true );
	spheroidCombo->setToolTip( "Name of the spheroid used in projection<br><br>"
		"<b>Note</b>: Currently only \"Sphere of Radius 6370997 meters\" is supported." );
	pixelCombo->addItem( "" );
	pixelCombo->addItems( pixelSizes );
	pixelCombo->setToolTip( "Size of each pixel in the raster image" );
	pixelEdit->setToolTip( "Pixel size<br>"
		"<b>Meters:</b> Entered value must be from 0 to 10000000." );
	pixelEdit->setValidator( new MapimgValidator( 0, 10000000, 12, pixelEdit ) );
	pixelEdit->hide();

	//ulBox
	ulLonEdit->setValidator( new MapimgValidator( -100000000, 100000000, 12, ulLonEdit ) );
	ulLonEdit->setToolTip( "Longitude of upper left corner of map<br>"
		"<b>Meters:</b> Entered value must be from -100000000 to 100000000." );
	ulLatEdit->setValidator( new MapimgValidator( -100000000, 100000000, 12, ulLatEdit ) );
	ulLatEdit->setToolTip( "Latitude of upper left corner of map<br>"
		"<b>Meters:</b> Entered value must be from -100000000 to 100000000." );

	//dataBox
	dataCombo->addItem( "" );
	dataCombo->addItems( dataTypes );
	dataCombo->setToolTip( "Data type of each pixel in the raster image" );
	fillEdit->setValidator( new MapimgValidator( -100000000, 100000000, INFO_PRECISION, fillEdit ) );
	hasFillCheck->setToolTip( "Toggle whether fill value is defined.<br>"
		"<b>Note</b>: The fill value is optional for input parameters only, "
		"but if it is defined in the input then it is forced in the output." );
	fillEdit->setToolTip( "Fill value to represent a pixel outside the map frame<br>"
		"Entered value must be from -100000000 to 100000000." );
	fillButton->setMaximumSize( 20, 20 );
	hasNoDataCheck->setToolTip( "Toggle whether No Data Value is defined.<br>"
		"<b>Note</b>: The no data value is optional for both input and output parameters, "
		"but if it is defined in the input then it is forced in the output." );
	fillButton->setToolTip( "Recommend fill value by reading file and "
		"solving for the maximum value + 2" );
	noDataEdit->setValidator( new MapimgValidator( -100000000, 100000000, INFO_PRECISION, noDataEdit ) );
	noDataEdit->setToolTip( "\"No Data\" value to represent a pixel inside the map frame"
		" with no value<br>"
		"Entered value must be from -100000000 to 100000000." );

	//This connection is for keeping the pixelEdit hidden until it is needed
	connect(pixelCombo, SIGNAL(activated(int)), this, SLOT(pixelChange(int)));
	connect(dataCombo, SIGNAL(activated(const QString&)), this, SLOT(dataChange(const QString&)));
	connect(hasFillCheck, SIGNAL(toggled(bool)), this, SLOT(fillCheckToggled(bool)));
	connect(hasNoDataCheck, SIGNAL(toggled(bool)), this, SLOT(noDataCheckToggled(bool)));

	setWidget( contents );	//Allows the contents top be moved by scrollbar
}