FormTabular::FormTabular(LyXView * lv, Dialogs * d)
- : FormInset( lv, d, _("Tabular Layout") ),
+ : FormInset(lv, d, _("Tabular Layout"), new OkCancelReadOnlyPolicy),
dialog_(0), tabular_options_(0), column_options_(0),
cell_options_(0), longtable_options_(0),
inset_(0), actCell_(-1)
}
+void FormTabular::redraw()
+{
+ if(form() && form()->visible)
+ fl_redraw_form(form());
+ else
+ return;
+
+ FL_FORM * outer_form = fl_get_active_folder(dialog_->tabFolder);
+ if (outer_form && outer_form->visible)
+ fl_redraw_form(outer_form);
+}
+
+
FL_FORM * FormTabular::form() const
{
- if (dialog_ ) return dialog_->form;
+ if (dialog_) return dialog_->form;
return 0;
}
}
-void FormTabular::showInset( InsetTabular * inset )
+void FormTabular::showInset(InsetTabular * inset)
{
if (inset == 0) return;
}
-void FormTabular::updateInset( InsetTabular * inset )
+void FormTabular::updateInset(InsetTabular * inset)
{
if (inset == 0 || inset_ == 0) return;
fl_set_input_return(column_options_->input_column_width,
FL_RETURN_END);
fl_set_input_return(column_options_->input_special_alignment,
- FL_RETURN_CHANGED);
+ FL_RETURN_END);
fl_set_input_return(cell_options_->input_mcolumn_width,
- FL_RETURN_CHANGED);
+ FL_RETURN_END);
fl_set_input_return(cell_options_->input_special_multialign,
- FL_RETURN_CHANGED);
+ FL_RETURN_END);
fl_addto_tabfolder(dialog_->tabFolder, _("Tabular"),
tabular_options_->form);
if (!inset_ || !inset_->tabular)
return;
- LyXTabular
- * tabular = inset_->tabular;
+ LyXTabular * tabular = inset_->tabular;
int
align,
- cell,
- column,row;
+ cell;
char
buf[12];
string
pwidth, special;
actCell_ = cell = inset_->GetActCell();
- column = tabular->column_of_cell(cell)+1;
+ int column = tabular->column_of_cell(cell)+1;
fl_set_object_label(dialog_->text_warning,"");
fl_activate_object(column_options_->input_special_alignment);
fl_activate_object(cell_options_->input_special_multialign);
sprintf(buf,"%d",column);
fl_set_input(dialog_->input_tabular_column, buf);
fl_deactivate_object(dialog_->input_tabular_column);
- row = tabular->row_of_cell(cell)+1;
+ int row = tabular->row_of_cell(cell)+1;
sprintf(buf,"%d",row);
fl_set_input(dialog_->input_tabular_row, buf);
fl_deactivate_object(dialog_->input_tabular_row);
if (!inset_)
return false;
- LyXTabular
- * tabular = inset_->tabular;
- int
- cell,
- s;
- LyXTabular::Feature
- num = LyXTabular::LAST_ACTION;
- string
- special,
- str;
-
- cell = inset_->GetActCell();
+ LyXTabular * tabular = inset_->tabular;
+ int s;
+ LyXTabular::Feature num = LyXTabular::LAST_ACTION;
+ string special;;
+
+ int cell = inset_->GetActCell();
if (actCell_ != cell) {
update();
fl_set_object_label(dialog_->text_warning,
return false;
}
if (ob == column_options_->input_column_width) {
- string
- str;
- str = fl_get_input(ob);
+ string str = fl_get_input(ob);
if (!str.empty() && !isValidLength(str)) {
fl_set_object_label(dialog_->text_warning,
_("Warning: Invalid Length (valid example: 10mm)"));
return true;
}
if (ob == cell_options_->input_mcolumn_width) {
- string
- str;
- str = fl_get_input(ob);
+ string str = fl_get_input(ob);
if (!str.empty() && !isValidLength(str)) {
fl_set_object_label(dialog_->text_warning,
_("Warning: Invalid Length (valid example: 10mm)"));
update(); // update for alignment
return true;
}
- str = fl_get_input(column_options_->input_column_width);
+ string str = fl_get_input(column_options_->input_column_width);
if (!str.empty() && !isValidLength(str)) {
fl_set_object_label(
dialog_->text_warning,
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);
+ s = fl_get_button(tabular_options_->radio_longtable);
if (s) {
num = LyXTabular::SET_LONGTABULAR;
fl_activate_object(longtable_options_->radio_lt_firsthead);
FL_INACTIVE);
}
} else if (ob == tabular_options_->radio_rotate_tabular) {
- s=fl_get_button(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);
+ s = fl_get_button(cell_options_->radio_rotate_cell);
if (s)
num = LyXTabular::SET_ROTATE_CELL;
else