26 #if defined (HAVE_CONFIG_H)
43 octave::interpreter& interp,
const graphics_object& go)
55 if ((up.get_max () - up.get_min ()) > 1)
68 octave::interpreter& interp,
69 const graphics_object& go,
QLineEdit *edit)
70 :
BaseControl (oct_qobj, interp, go, edit), m_multiLine (false),
87 if (up.enable_is (
"inactive"))
88 edit->setReadOnly (
true);
90 edit->setEnabled (up.enable_is (
"on"));
93 up.get_verticalalignment ()));
95 connect (edit, &QLineEdit::textEdited,
97 connect (edit, &QLineEdit::editingFinished,
99 connect (edit, &QLineEdit::returnPressed,
104 octave::interpreter& interp,
105 const graphics_object& go,
TextEdit *edit)
106 :
BaseControl (oct_qobj, interp, go, edit), m_multiLine (true),
107 m_textChanged (false)
123 if (up.enable_is (
"inactive"))
124 edit->setReadOnly (
true);
126 edit->setEnabled (up.enable_is (
"on"));
127 edit->setAcceptRichText (
false);
129 (up.get_string_vector ()).join (
"\n"));
131 up.get_verticalalignment ()));
133 connect (edit, &TextEdit::textChanged,
153 bool handled =
false;
179 case uicontrol::properties::ID_STRING:
183 case uicontrol::properties::ID_HORIZONTALALIGNMENT:
184 case uicontrol::properties::ID_VERTICALALIGNMENT:
186 up.get_verticalalignment ()));
189 case uicontrol::properties::ID_ENABLE:
190 if (up.enable_is (
"inactive"))
191 edit->setReadOnly (
true);
194 edit->setReadOnly (
false);
195 edit->setEnabled (up.enable_is (
"on"));
199 case uicontrol::properties::ID_MIN:
200 case uicontrol::properties::ID_MAX:
201 if ((up.get_max () - up.get_min ()) > 1)
203 QWidget *container = edit->parentWidget ();
221 TextEdit *edit = qWidget<TextEdit> ();
225 case uicontrol::properties::ID_STRING:
227 (up.get_string_vector ()).join (
"\n"));
230 case uicontrol::properties::ID_HORIZONTALALIGNMENT:
231 case uicontrol::properties::ID_VERTICALALIGNMENT:
233 up.get_verticalalignment ()));
236 case uicontrol::properties::ID_ENABLE:
237 if (up.enable_is (
"inactive"))
238 edit->setReadOnly (
true);
241 edit->setReadOnly (
false);
242 edit->setEnabled (up.enable_is (
"on"));
246 case uicontrol::properties::ID_MIN:
247 case uicontrol::properties::ID_MAX:
248 if ((up.get_max () - up.get_min ()) <= 1)
250 QWidget *container = edit->parentWidget ();
274 ? qWidget<TextEdit> ()->toPlainText ()
275 : qWidget<QLineEdit> ()->text ());
289 if (txt.length () > 0)
299 ? qWidget<TextEdit> ()->toPlainText ()
300 : 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 initCommon(QWidget *widget)
void init(QLineEdit *edit, bool callBase=false)
bool updateSingleLine(int pId)
static EditControl * create(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go)
void editingFinished(void)
void gh_callback_event(const graphics_handle &h, const std::string &name)
static Object * parentObject(octave::interpreter &interp, const graphics_object &go)
void gh_set_event(const graphics_handle &h, const std::string &name, const octave_value &value)
virtual Container * innerContainer(void)=0
void editingFinished(void)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
std::string toStdString(const QString &s)
Qt::Alignment fromHVAlign(const std::string &halign, const std::string &valign)
Cell toCellString(const QStringList &l)
QString fromStdString(const std::string &s)
QStringList fromStringVector(const string_vector &v)
T::properties & properties(graphics_object obj)