26 #if defined (HAVE_CONFIG_H)
54 new QComboBox (container));
70 update (uicontrol::properties::ID_VALUE);
72 connect (
box, SIGNAL (activated (
int)),
82 QComboBox *
box = qWidget<QComboBox> ();
86 case uicontrol::properties::ID_STRING:
89 int oldCurrent =
box->currentIndex ();
93 (up.get_string_string ()).split (
'|'));
96 && oldCurrent < box->count ())
98 box->setCurrentIndex (oldCurrent);
110 case uicontrol::properties::ID_VALUE:
113 Matrix value = up.get_value ().matrix_value ();
115 if (value.
numel () > 0)
117 if (value(0) !=
static_cast<int> (value(0)))
118 warning (
"popupmenu value should be integer");
121 int newIndex = int (value(0)) - 1;
123 if (newIndex >= 0 && newIndex < box->count ())
125 if (newIndex !=
box->currentIndex ())
126 box->setCurrentIndex (newIndex);
129 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
static Object * parentObject(octave::interpreter &interp, const graphics_object &go)
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)
void currentIndexChanged(int index)
static PopupMenuControl * create(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go)
PopupMenuControl(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go, QComboBox *box)
Base class for Octave interfaces that use Qt.
void warning(const char *fmt,...)
QString fromStdString(const std::string &s)
static octave_value box(JNIEnv *jni_env, void *jobj, void *jcls_arg=nullptr)