26#if defined (HAVE_CONFIG_H)
44 octave::interpreter& interp,
const graphics_object& go)
56 if ((up.get_max () - up.get_min ()) > 1)
69 octave::interpreter& interp,
70 const graphics_object& go,
QLineEdit *edit)
71 :
BaseControl (oct_qobj, interp, go, edit), m_multiLine (false),
88 if (up.enable_is (
"inactive"))
89 edit->setReadOnly (
true);
91 edit->setEnabled (up.enable_is (
"on"));
94 up.get_verticalalignment ()));
96 connect (edit, &QLineEdit::textEdited,
98 connect (edit, &QLineEdit::editingFinished,
100 connect (edit, &QLineEdit::returnPressed,
105 octave::interpreter& interp,
106 const graphics_object& go,
TextEdit *edit)
107 :
BaseControl (oct_qobj, interp, go, edit), m_multiLine (true),
108 m_textChanged (false)
124 if (up.enable_is (
"inactive"))
125 edit->setReadOnly (
true);
127 edit->setEnabled (up.enable_is (
"on"));
128 edit->setAcceptRichText (
false);
130 (up.get_string_vector ()).join (
"\n"));
132 up.get_verticalalignment ()));
134 connect (edit, &TextEdit::textChanged,
154 bool handled =
false;
180 case uicontrol::properties::ID_STRING:
184 case uicontrol::properties::ID_HORIZONTALALIGNMENT:
185 case uicontrol::properties::ID_VERTICALALIGNMENT:
187 up.get_verticalalignment ()));
190 case uicontrol::properties::ID_ENABLE:
191 if (up.enable_is (
"inactive"))
192 edit->setReadOnly (
true);
195 edit->setReadOnly (
false);
196 edit->setEnabled (up.enable_is (
"on"));
200 case uicontrol::properties::ID_MIN:
201 case uicontrol::properties::ID_MAX:
202 if ((up.get_max () - up.get_min ()) > 1)
204 QWidget *container = edit->parentWidget ();
222 TextEdit *edit = qWidget<TextEdit> ();
226 case uicontrol::properties::ID_STRING:
228 (up.get_string_vector ()).join (
"\n"));
231 case uicontrol::properties::ID_HORIZONTALALIGNMENT:
232 case uicontrol::properties::ID_VERTICALALIGNMENT:
234 up.get_verticalalignment ()));
237 case uicontrol::properties::ID_ENABLE:
238 if (up.enable_is (
"inactive"))
239 edit->setReadOnly (
true);
242 edit->setReadOnly (
false);
243 edit->setEnabled (up.enable_is (
"on"));
247 case uicontrol::properties::ID_MIN:
248 case uicontrol::properties::ID_MAX:
249 if ((up.get_max () - up.get_min ()) <= 1)
251 QWidget *container = edit->parentWidget ();
275 ? qWidget<TextEdit> ()->toPlainText ()
276 : qWidget<QLineEdit> ()->text ());
290 if (txt.length () > 0)
300 ? qWidget<TextEdit> ()->toPlainText ()
301 : qWidget<QLineEdit> ()->text ());
void init(QWidget *w, bool callBase=false)
bool updateMultiLine(int pId)
EditControl(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go, QLineEdit *edit)
void editingFinished(void)
static EditControl * create(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go)
void initCommon(QWidget *widget)
void init(QLineEdit *edit, bool callBase=false)
bool updateSingleLine(int pId)
virtual Container * innerContainer(void)=0
void gh_callback_event(const graphics_handle &h, const std::string &name)
void gh_set_event(const graphics_handle &h, const std::string &name, const octave_value &value)
static Object * parentObject(octave::interpreter &interp, const graphics_object &go)
void editingFinished(void)
Base class for Octave interfaces that use Qt.
QStringList fromStringVector(const string_vector &v)
QString fromStdString(const std::string &s)
Qt::Alignment fromHVAlign(const std::string &halign, const std::string &valign)
T::properties & properties(graphics_object obj)
Cell toCellString(const QStringList &l)
std::string toStdString(const QString &s)