+void FormTabular::SetTabularOptions(FL_OBJECT * ob, long)
+{
+ if (!inset_)
+ return;
+
+ LyXTabular
+ * tabular = inset_->tabular;
+ int
+ cell,
+ s,
+ num = 0;
+ string
+ special,
+ str;
+
+ cell = inset_->GetActCell();
+ if (actCell_ != cell) {
+ local_update(false);
+ fl_set_object_label(dialog_->text_warning,
+ _("Warning: Wrong Cursor position, updated window"));
+ fl_show_object(dialog_->text_warning);
+ return;
+ }
+ // No point in processing directives that you can't do anything with
+ // anyhow, so exit now if the buffer is read-only.
+ if (lv_->buffer()->isReadonly()) {
+ local_update(false);
+ return;
+ }
+ if (ob == column_options_->input_column_width) {
+ string
+ str;
+ str = fl_get_input(ob);
+ if (!str.empty() && !isValidLength(str)) {
+ fl_set_object_label(dialog_->text_warning,
+ _("Warning: Invalid Length (valid example: 10mm)"));
+ fl_show_object(dialog_->text_warning);
+ return;
+ }
+ inset_->TabularFeatures(lv_->view(), LyXTabular::SET_PWIDTH,str);
+ local_update(false); // update for alignment
+ return;
+ }
+ str = fl_get_input(column_options_->input_column_width);
+ if (!str.empty() && !isValidLength(str)) {
+ fl_set_object_label(
+ dialog_->text_warning,
+ _("Warning: Invalid Length (valid example: 10mm)"));
+ fl_show_object(dialog_->text_warning);
+ return;
+ }
+ if (ob == tabular_options_->button_append_row)
+ num = LyXTabular::APPEND_ROW;
+ else if (ob == tabular_options_->button_append_column)
+ num = LyXTabular::APPEND_COLUMN;
+ else if (ob == tabular_options_->button_delete_row)
+ num = LyXTabular::DELETE_ROW;
+ else if (ob == tabular_options_->button_delete_column)
+ num = LyXTabular::DELETE_COLUMN;
+ else if (ob == tabular_options_->button_set_borders)
+ num = LyXTabular::SET_ALL_LINES;
+ else if (ob == tabular_options_->button_unset_borders)
+ num = LyXTabular::UNSET_ALL_LINES;
+ else if (ob == column_options_->radio_border_top)
+ num = LyXTabular::TOGGLE_LINE_TOP;
+ else if (ob == column_options_->radio_border_bottom)
+ num = LyXTabular::TOGGLE_LINE_BOTTOM;
+ else if (ob == column_options_->radio_border_left)
+ num = LyXTabular::TOGGLE_LINE_LEFT;
+ else if (ob == column_options_->radio_border_right)
+ num = LyXTabular::TOGGLE_LINE_RIGHT;
+ else if (ob == column_options_->radio_align_left)
+ num = LyXTabular::ALIGN_LEFT;
+ else if (ob == column_options_->radio_align_right)
+ num = LyXTabular::ALIGN_RIGHT;
+ else if (ob == column_options_->radio_align_center)
+ num = LyXTabular::ALIGN_CENTER;
+ else if (ob == cell_options_->radio_multicolumn)
+ num = LyXTabular::MULTICOLUMN;
+ else if (ob == tabular_options_->radio_longtable) {
+ s=fl_get_button(tabular_options_->radio_longtable);
+ if (s) {
+ num = LyXTabular::SET_LONGTABULAR;
+ fl_activate_object(longtable_options_->radio_lt_firsthead);
+ fl_activate_object(longtable_options_->radio_lt_head);
+ fl_activate_object(longtable_options_->radio_lt_foot);
+ fl_activate_object(longtable_options_->radio_lt_lastfoot);
+ fl_activate_object(longtable_options_->radio_lt_newpage);
+ fl_set_button(longtable_options_->radio_lt_firsthead,
+ tabular->GetRowOfLTFirstHead(cell));
+ fl_set_button(longtable_options_->radio_lt_head,
+ tabular->GetRowOfLTHead(cell));
+ fl_set_button(longtable_options_->radio_lt_foot,
+ tabular->GetRowOfLTFoot(cell));
+ fl_set_button(longtable_options_->radio_lt_lastfoot,
+ tabular->GetRowOfLTLastFoot(cell));
+ fl_set_button(longtable_options_->radio_lt_firsthead,
+ tabular->GetLTNewPage(cell));
+ } else {
+ num = LyXTabular::UNSET_LONGTABULAR;
+ fl_deactivate_object(longtable_options_->radio_lt_firsthead);
+ fl_deactivate_object(longtable_options_->radio_lt_head);
+ fl_deactivate_object(longtable_options_->radio_lt_foot);
+ fl_deactivate_object(longtable_options_->radio_lt_lastfoot);
+ fl_deactivate_object(longtable_options_->radio_lt_newpage);
+ fl_set_button(longtable_options_->radio_lt_firsthead,0);
+ fl_set_button(longtable_options_->radio_lt_head,0);
+ fl_set_button(longtable_options_->radio_lt_foot,0);
+ fl_set_button(longtable_options_->radio_lt_lastfoot,0);
+ fl_set_button(longtable_options_->radio_lt_newpage,0);
+ fl_set_object_lcol(longtable_options_->radio_lt_firsthead,
+ FL_INACTIVE);
+ fl_set_object_lcol(longtable_options_->radio_lt_head, FL_INACTIVE);
+ fl_set_object_lcol(longtable_options_->radio_lt_foot, FL_INACTIVE);
+ fl_set_object_lcol(longtable_options_->radio_lt_lastfoot,
+ FL_INACTIVE);
+ fl_set_object_lcol(longtable_options_->radio_lt_newpage,
+ FL_INACTIVE);
+ }
+ } else if (ob == tabular_options_->radio_rotate_tabular) {
+ s=fl_get_button(tabular_options_->radio_rotate_tabular);
+ if (s)
+ num = LyXTabular::SET_ROTATE_TABULAR;
+ else
+ num = LyXTabular::UNSET_ROTATE_TABULAR;
+ } else if (ob == cell_options_->radio_rotate_cell) {
+ s=fl_get_button(cell_options_->radio_rotate_cell);
+ if (s)
+ num = LyXTabular::SET_ROTATE_CELL;
+ else
+ num = LyXTabular::UNSET_ROTATE_CELL;
+ } else if (ob == cell_options_->radio_linebreak_cell) {
+ num = LyXTabular::SET_LINEBREAKS;
+ } else if (ob == longtable_options_->radio_lt_firsthead) {
+ num = LyXTabular::SET_LTFIRSTHEAD;
+ } else if (ob == longtable_options_->radio_lt_head) {
+ num = LyXTabular::SET_LTHEAD;
+ } else if (ob == longtable_options_->radio_lt_foot) {
+ num = LyXTabular::SET_LTFOOT;
+ } else if (ob == longtable_options_->radio_lt_lastfoot) {
+ num = LyXTabular::SET_LTLASTFOOT;
+ } else if (ob == longtable_options_->radio_lt_newpage) {
+ num = LyXTabular::SET_LTNEWPAGE;
+ } else if (ob == column_options_->input_special_alignment) {
+ special = fl_get_input(column_options_->input_special_alignment);
+ num = LyXTabular::SET_SPECIAL_COLUMN;
+ } else if (ob == cell_options_->input_special_multialign) {
+ special = fl_get_input(cell_options_->input_special_multialign);
+ num = LyXTabular::SET_SPECIAL_MULTI;
+ } else
+ return;
+
+ inset_->TabularFeatures(lv_->view(), num, special);
+ local_update(false);
+}
+