26#if defined (HAVE_CONFIG_H)
44 octave::interpreter& interp,
45 const graphics_object& go)
55 new QComboBox (container));
62 octave::interpreter& interp,
63 const graphics_object& go,
71 update (uicontrol::properties::ID_VALUE);
83 QComboBox *
box = qWidget<QComboBox> ();
87 case uicontrol::properties::ID_STRING:
90 int oldCurrent =
box->currentIndex ();
94 (up.get_string_string ()).split (
'|'));
97 && oldCurrent < box->count ())
99 box->setCurrentIndex (oldCurrent);
111 case uicontrol::properties::ID_VALUE:
114 Matrix value = up.get_value ().matrix_value ();
116 if (value.
numel () > 0)
118 if (value(0) !=
static_cast<int> (value(0)))
119 warning (
"popupmenu value should be integer");
122 int newIndex =
int (value(0)) - 1;
124 if (newIndex >= 0 && newIndex < box->count ())
126 if (newIndex !=
box->currentIndex ())
127 box->setCurrentIndex (newIndex);
130 warning (
"popupmenu value not within valid display range");
octave_idx_type numel(void) const
Number of elements in the array.
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)
Base class for Octave interfaces that use Qt.
void warning(const char *fmt,...)
QString fromStdString(const std::string &s)
T::properties & properties(graphics_object obj)
static octave_value box(JNIEnv *jni_env, void *jobj, void *jcls_arg=nullptr)
Convert the Java object pointed to by jobj_arg with class jcls_arg to an Octave value.