void GUITextBox::checkKeyboardEvents(KeyEvent evt, int extraInfo)
{
  if (!focused || !active)
    return;
    
  if ((evt.getKeyID() >= 32 && evt.getKeyID() <= 127) ||
      (evt.getKeyID() == 8));
  else
    extraInfo = 0;
    
  if (extraInfo == KEY_PRESSED)
  {
    int length = label.getString().getLength();
    
    if (evt.displayable())
      setupText(INSERT_CHAR, evt.getKeyChar());
      
    if (length)
    {
      switch (evt.getKeyID())
      {
        case   8:
          setupText(BACKSPACE_DELETE);
          break;
        case 127:
          setupText(SIMPLE_DELETE);
          break;
      }
    }
  }
  
  label.forceUpdate(true);
  update = true;
}
示例#2
0
PersonEditorPane::PersonEditorPane (ObjectEditorWindowBase::Mode mode, Cache &cache, QWidget *parent, PersonEditorPaneData *paneData):
	ObjectEditorPane<Person> (mode, cache, parent),
	paneData (paneData)
{
	ui.setupUi (this);

	ui.medicalCheckDisabledLabel->setVisible (false);

	setupText ();
	loadData ();

	ui.clubInput->setEditText ("");
	ui.checkMedicalInput->setCurrentItemByItemData (false);

	ui.lastNameInput->setFocus ();

	if (paneData)
	{
		setMedicalValidityDisplayed (paneData->displayMedicalData);
	}
	else
	{
		// Set it to false because we don't want to open a loophole, but we can
		// accept that we have to click the button, or even not be able to view
		// the medical data if the window has been opened in a specific way.
		setMedicalValidityDisplayed (false);
		std::cerr << notr ("No pane data in person editor pane") << std::endl;
	}
}
示例#3
0
void Button::construct(const Rect &rect, const TextLabelInfo &ti, const Color &color, const Color &colorHovered, const Color &colorPressed, const Color &borderColor, const Color &borderColorHovered, const Color &borderColorPressed)
{
    Rect realRect = setupText(rect, ti);
    m_pressedLook = new PlainRectItem(realRect, colorPressed, borderColorPressed);
    m_hoveredLook = new PlainRectItem(realRect, colorHovered, borderColorHovered);
    m_normalLook = new PlainRectItem(realRect, color, borderColor);
}
示例#4
0
bool TextObject::restoreState(SaveGame *state) {
	_fgColor = PoolColor::getPool().getObject(state->readLEUint32());

	_x            = state->readLESint32();
	_y            = state->readLESint32();
	_width        = state->readLESint32();
	_height       = state->readLESint32();
	_justify      = state->readLESint32();
	_numberLines  = state->readLESint32();
	_duration     = state->readLESint32();

	_disabled     = state->readLESint32();
	_blastDraw    = state->readLESint32();
	_isSpeech     = state->readLESint32();
	_elapsedTime  = state->readLESint32();

	_font = Font::getPool().getObject(state->readLEUint32());

	_textID = state->readString();

	setupText();
	_created = false;
	_userData = NULL;

	return true;
}
示例#5
0
void StatisticsWindow::languageChanged ()
{
	SkDialog<Ui::StatisticsWindowClass>::languageChanged ();
	setupText ();

	ui.table->resizeColumnsToContents ();
	ui.table->resizeRowsToContents ();
}
示例#6
0
void PersonEditorPane::changeEvent (QEvent *event)
{
	if (event->type () == QEvent::LanguageChange)
	{
		ui.retranslateUi (this);
		setupText ();
	}
	else
		ObjectEditorPane<Person>::changeEvent (event);
}
void InfoPluginSelectionDialog::setup ()
{
	ui.pluginList->clear ();

	for (int i=0, n=plugins.size (); i<n; ++i)
		new QTreeWidgetItem (ui.pluginList);

	setupText ();

	ui.buttonBox->button (QDialogButtonBox::Ok)->setEnabled (!plugins.isEmpty ());
}
const Tuple4i &GUITextBox::getWindowBounds()
{
  if (parent && update)
  {
    label.computeDimensions();
    dimensions.y    = label.getHeight() ? label.getHeight() + padding.y : dimensions.y;
    
    GUIRectangle::computeWindowBounds();
    blinkerPosition = !blinkerPosition ? windowBounds.x + padding.x : blinkerPosition;
    setupText(PARSE_VISIBLE);
  }
  return windowBounds;
}
示例#9
0
LaunchMethodEditorPane::LaunchMethodEditorPane (ObjectEditorWindowBase::Mode mode, Cache &cache, QWidget *parent):
	ObjectEditorPane<LaunchMethod> (mode, cache, parent)
{
	ui.setupUi(this);

	setupText ();
	loadData ();

	ui.typeInput->setCurrentItemByItemData (LaunchMethod::typeOther);
	ui.personRequiredInput->setCurrentItemByItemData (true);
	ui.towplaneRegistrationInput->setEnabled (ui.specificTowplaneInput->isChecked ());

	ui.nameInput->setFocus ();
}
示例#10
0
Button::Button(const Rect &rect, const TextLabelInfo &ti, const std::string &texIdNormal, const std::string &texIdPressed, const std::string &texIdHovered)
    : m_pressed(false),
    m_hovered(false),
    m_switchable(false),
    m_switched(false),
    m_ti(ti),
    RectItem(rect)
{
     Rect realRect = setupText(rect, ti);
     m_pressedLook = new Sprite(realRect, texIdPressed);
     m_normalLook = new Sprite(realRect, texIdNormal);
     m_hoveredLook = new Sprite(realRect, texIdHovered);

}
示例#11
0
StatisticsWindow::StatisticsWindow (QAbstractTableModel *model, bool modelOwned, const char *ntr_title, QWidget *parent):
	SkDialog<Ui::StatisticsWindowClass> (parent),
	model (model), modelOwned (modelOwned), ntr_title (ntr_title)
{
	ui.setupUi(this);


	setupText ();

	ui.table->setModel (model);

	ui.table->resizeColumnsToContents ();
	ui.table->resizeRowsToContents ();
}
示例#12
0
void TextObject::reset() {
	destroy();
	setupText();
}
示例#13
0
void TextObject::setText(const Common::String &text) {
	destroy();
	_textID = text;
	setupText();
}
void InfoPluginSelectionDialog::languageChanged ()
{
	SkDialog<Ui::InfoPluginSelectionDialogClass>::languageChanged ();
	setupText ();
}