72 QComboBox*
box = qWidget<QComboBox> ();
79 int oldCurrent = box->currentIndex ();
86 && oldCurrent < box->count ())
88 box->setCurrentIndex (oldCurrent);
106 if (value.
numel () > 0)
108 if (value(0) !=
static_cast<int>(value(0)))
110 warning (
"popupmenu value should be integer");
114 int newIndex =
int (value(0)) - 1;
116 if (newIndex >= 0 && newIndex < box->count ())
118 if (newIndex != box->currentIndex ())
119 box->setCurrentIndex (newIndex);
122 warning (
"popupmenu value not within valid display range");
static PopupMenuControl * create(const graphics_object &go)
static void post_callback(const graphics_handle &h, const std::string &name, const octave_value &data=Matrix())
octave_idx_type numel(void) const
Number of elements in the array.
OCTINTERP_API octave_value box(JNIEnv *jni_env, jobject jobj, jclass jcls=0)
QString fromStdString(const std::string &s)
static Object * parentObject(const graphics_object &go)
virtual Container * innerContainer(void)=0
std::string get_string_string(void) const
Matrix matrix_value(bool frc_str_conv=false) const
void currentIndexChanged(int index)
PopupMenuControl(const graphics_object &go, QComboBox *box)
void warning(const char *fmt,...)
octave_value get_value(void) const
static void post_set(const graphics_handle &h, const std::string &name, const octave_value &value, bool notify_toolkit=true)