Exemple #1
0
int QmaxLineEdit::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QLineEdit::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: focussed((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 1: focussed((*reinterpret_cast< int(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 2;
    }
    return _id;
}
Exemple #2
0
void AuthorEditor::focusInEvent(QFocusEvent *e)
{
  QLineEdit::focusInEvent(e);
  setStyleSheet(activeColor);
  this->setCursor(Qt::ArrowCursor);
  emit(focussed(true));
}
Exemple #3
0
void WFormWidget::setEmptyText(const WString& emptyText) 
{
  emptyText_ = emptyText;

  WApplication* app = WApplication::instance();
  const WEnvironment& env = app->environment();

  if (env.ajax()) {
    if (!emptyText_.empty()) {
      if (!flags_.test(BIT_JS_OBJECT))
	defineJavaScript();
      else
	updateEmptyText();

      if (!removeEmptyText_) {
	removeEmptyText_ = new JSlot(this);
      
	focussed().connect(*removeEmptyText_);
	blurred().connect(*removeEmptyText_);
	keyWentDown().connect(*removeEmptyText_);

	std::string jsFunction = 
	  "function(obj, event) {"
	  """jQuery.data(" + jsRef() + ", 'obj').applyEmptyText();"
	  "}";
	removeEmptyText_->setJavaScript(jsFunction);
      }
    } else {
      delete removeEmptyText_;
      removeEmptyText_ = 0;
    }
  } else {
    setToolTip(emptyText);
  }
}
Exemple #4
0
void WLineEdit::defineJavaScript()
{
  if (javaScriptDefined_)
    return;
  javaScriptDefined_ = true;
  WApplication *app = WApplication::instance();

  LOAD_JAVASCRIPT(app, "js/WLineEdit.js", "WLineEdit", wtjs1);

  std::u32string space;
  space += spaceChar_;
  std::string jsObj = "new " WT_CLASS ".WLineEdit("
    + app->javaScriptClass() + "," + jsRef() + "," +
      WWebWidget::jsStringLiteral(mask_) + "," +
      WWebWidget::jsStringLiteral(raw_) +  "," +
      WWebWidget::jsStringLiteral(displayContent_) +  "," +
      WWebWidget::jsStringLiteral(case_) + "," +
      WWebWidget::jsStringLiteral(space) + "," +
    (inputMaskFlags_.test(InputMaskFlag::KeepMaskWhileBlurred) ? "0x1" : "0x0")
    + ");";

  setJavaScriptMember(" WLineEdit", jsObj);

#ifdef WT_CNOR
  EventSignalBase& b = mouseMoved();
  EventSignalBase& c = keyWentDown();
#endif

  connectJavaScript(keyWentDown(), "keyDown");
  connectJavaScript(keyPressed(), "keyPressed");
  connectJavaScript(focussed(), "focussed");
  connectJavaScript(blurred(), "blurred");
  connectJavaScript(clicked(), "clicked");
}
Exemple #5
0
//*******************************************************
//* Focus event.  The editor has lost focus
//*******************************************************
void TagEditorNewTag::focusOutEvent(QFocusEvent *e)
{
  this->setCursor(Qt::PointingHandCursor);
  QLineEdit::focusOutEvent(e);
  setStyleSheet(inactiveColor);
  emit(focussed(false));
}
Exemple #6
0
//*******************************************************
//* Focus event.  The editor has gained focus
//*******************************************************
void TagEditorNewTag::focusInEvent(QFocusEvent *e)
{
  this->setCursor(Qt::ArrowCursor);
  QLineEdit::focusInEvent(e);
  setStyleSheet(activeColor);
  emit(focussed(true));
}
Exemple #7
0
// Focus is lost.  Set the colors back and check for text changed
void NTitleEditor::focusOutEvent(QFocusEvent *e)
{
  QLineEdit::focusOutEvent(e);
  setStyleSheet(inactiveColor);
  titleChanged(cleanupTitle(text()));
  emit(focussed(false));
}
// Intercepts focus events
void GraphicsCanvas::focusInEvent(QFocusEvent *pEvent)
{
	QWidget::focusInEvent(pEvent);

	if (this->hasFocus())
		Q_EMIT focussed(this);
}
Exemple #9
0
void AuthorEditor::focusOutEvent(QFocusEvent *e)
{
  QLineEdit::focusOutEvent(e);
  this->setCursor(Qt::PointingHandCursor);
  setStyleSheet(inactiveColor);
  textModified(text());
  emit(focussed(false));
}
Exemple #10
0
//*******************************************************
//* Focus event.  The editor has lost focus
//*******************************************************
void TagEditorNewTag::focusOutEvent(QFocusEvent *e)
{
    QLOG_TRACE_IN() << typeid(*this).name();
    this->setCursor(Qt::PointingHandCursor);
    QLineEdit::focusOutEvent(e);
    setStyleSheet(inactiveColor);
    emit(focussed(false));
    QLOG_TRACE_OUT() << typeid(*this).name();
}
Exemple #11
0
//*******************************************************
//* Focus event.  The editor has gained focus
//*******************************************************
void TagEditorNewTag::focusInEvent(QFocusEvent *e)
{
    QLOG_TRACE_IN() << typeid(*this).name();
    this->setCursor(Qt::ArrowCursor);
    QLineEdit::focusInEvent(e);
    setStyleSheet(activeColor);
    emit(focussed(true));
    QLOG_TRACE_OUT() << typeid(*this).name();
}
void masterPanelCell::focusOutEvent(QFocusEvent *e)
{
    QLineEdit::focusOutEvent(e);
    if(myType==0)
        emit(focussed(false));
}
void masterPanelCell::focusInEvent(QFocusEvent *e)
{
    QLineEdit::focusInEvent(e);
    if(myType==0)
        emit(focussed(true));
}
Exemple #14
0
// We now have focus.  Change the appearance
void NTitleEditor::focusInEvent(QFocusEvent *e)
{
  QLineEdit::focusInEvent(e);
  setStyleSheet(activeColor);
  emit(focussed(true));
}