23 #if defined (HAVE_CONFIG_H)
34 #include <QColorDialog>
35 #include <QPushButton>
57 restoreGeometry (settings->value(
"annotation/geometry").toByteArray ());
60 connect (
ui->
button_box, SIGNAL (clicked (QAbstractButton *)),
63 connect (
ui->
edit_string, SIGNAL (textChanged (
const QString&)),
94 QDialogButtonBox::ButtonRole button_role
101 settings->setValue (
"annotation/geometry",saveGeometry ());
103 if (button_role == QDialogButtonBox::ApplyRole
104 || button_role == QDialogButtonBox::AcceptRole)
109 if (button_role == QDialogButtonBox::RejectRole
110 || button_role == QDialogButtonBox::AcceptRole)
127 position(0) =
ui->
sb_x->value ();
128 position(1) =
ui->
sb_y->value ();
159 color (QPalette::Button))));
172 for (
int i=0;
i<len/2;
i++)
176 if (name ==
"textbox")
179 int nels = position.
numel();
182 ui->
sb_x->setValue (position(0));
183 ui->
sb_y->setValue (position(1));
201 else if (name ==
"string")
206 else if (name ==
"fitboxtotext")
210 else if (name ==
"units")
213 1*
i +1).string_value ().c_str ()));
215 else if (name ==
"horizontalalignment")
218 1*
i +1).string_value ().c_str ()));
220 else if (name ==
"verticalalignment")
223 1*
i +1).string_value ().c_str ()));
225 else if (name ==
"fontname")
228 1*
i +1).string_value ().c_str ()));
230 else if (name ==
"fontsize")
234 else if (name ==
"fontweight")
238 else if (name ==
"fontangle")
242 else if (name ==
"color")
245 if (
props(1*
i +1).is_matrix_type ())
248 color.setNamedColor (
props(2*
i +1).string_value ().c_str ());
250 if (color.isValid ())
262 ui->
button_box->button (QDialogButtonBox::Ok)->setEnabled (str.length () > 0);
271 QColor color = widg->palette ().color (QPalette::Button);
273 color = QColorDialog::getColor(color,
this);
275 if (color.isValid ())
277 widg->setPalette (QPalette (color));
279 QString css = QString (
"background-color: %1; border: 1px solid %2;")
283 widg->setStyleSheet (css);
void edit_string_changed(const QString &str)
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).is_integer_type())
void setupUi(QDialog *annotation_dialog)
octave_idx_type numel(void) const
Number of elements in the array.
octave_idx_type length(void) const
octave_value_list & append(const octave_value &val)
QPushButton * cb_font_bold
QDoubleSpinBox * sb_width
QComboBox * cb_horz_align
void button_clicked(QAbstractButton *button)
QDialogButtonBox * button_box
QColor fromRgb(const Matrix &rgb)
QPushButton * cb_font_italic
Matrix toRgb(const QColor &c)
static QSettings * get_settings(void)
QComboBox * cb_vert_align
QPushButton * btn_edge_color
=val(i)}if ode{val(i)}occurs in table i
QFontComboBox * cb_font_name
QCheckBox * cb_fit_box_to_text
octave_value_list get_properties() const
Ui::annotation_dialog * ui
QDoubleSpinBox * sb_height
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
QPushButton * btn_background_color
annotation_dialog(QWidget *parent, const octave_value_list &pr)