#include "layout.h"
#include "insets/lyxinset.h"
-
// Prototypes
extern FD_form_table_options * fd_form_table_options;
extern FD_form_table_extra * fd_form_table_extra;
extern BufferView * current_view;
-extern bool UpdateLayoutTabular(int);
-extern void TabularOptionsCB(FL_OBJECT * ob, long l);
-extern void SetPWidthTabularCB(FL_OBJECT * ob, long l);
-
-
+#ifndef NEW_TABULAR
static int Confirmed = false;
static int ActCell;
// in 1.1 anyway)
static int extra_col_cursor_x; // need no y's, one-line input fields
static int extra_multicol_cursor_x;
+#endif
// Joacim
-#define IS_TABULAR (current_view->the_locking_inset && \
- current_view->the_locking_inset->GetFirstLockingInsetOfType(Inset::TABULAR_CODE))
bool UpdateLayoutTable(int flag)
{
bool update = true;
if (!current_view->available())
update = false;
-
+
+#ifndef NEW_TABULAR
if (update && current_view->text->cursor.par()->table) {
char buf[12];
string pwidth, special;
table->RotateTable());
fl_set_focus_object(fd_form_table_options->form_table_options,
fd_form_table_options->button_table_delete);
- } else if (fd_form_table_options->form_table_options->visible) {
+ } else
+#endif
+ if (fd_form_table_options->form_table_options->visible) {
fl_set_focus_object(fd_form_table_options->form_table_options,
fd_form_table_options->button_table_delete);
fl_hide_form(fd_form_table_options->form_table_options);
}
-void TableOptionsCB(FL_OBJECT * ob, long l)
+void TableOptionsCB(FL_OBJECT * ob, long)
{
- if (IS_TABULAR) {
- TabularOptionsCB(ob, l);
- return;
- }
-
+#ifndef NEW_TABULAR
LyXTable * table = 0;
int s, num = 0;
string special, str;
current_view->hideCursor();
if (!current_view->text->selection){
current_view->beforeChange();
- current_view->update(-2);
+ current_view->update(BufferView::SELECT|BufferView::FITCUR);
}
if ((num == LyXTable::SET_SPECIAL_COLUMN) ||
(num == LyXTable::SET_SPECIAL_MULTI))
- current_view->text->TableFeatures(num, special);
+ current_view->text->TableFeatures(current_view, num, special);
else
- current_view->text->TableFeatures(num);
- current_view->update(1);
+ current_view->text->TableFeatures(current_view, num);
+ current_view->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
}
if (num == LyXTable::DELETE_TABLE) {
fl_set_focus_object(fd_form_table_options->form_table_options,
} else
UpdateLayoutTable(true);
return;
+#endif
}
return;
}
-void SetPWidthCB(FL_OBJECT * ob, long l)
+void SetPWidthCB(FL_OBJECT * ob, long)
{
- if (IS_TABULAR) {
- SetPWidthTabularCB(ob, l);
- return;
- }
-
+#ifndef NEW_TABULAR
fl_set_object_label(fd_form_table_options->text_warning, "");
Confirmed = false;
if (ob == fd_form_table_options->input_column_width) {
current_view->hideCursor();
if (!current_view->text->selection) {
current_view->beforeChange();
- current_view->update(-2);
+ current_view->update(BufferView::SELECT|BufferView::FITCUR);
}
- current_view->text->TableFeatures(LyXTable::SET_PWIDTH, str);
- current_view->update(1);
+ current_view->text->TableFeatures(current_view, LyXTable::SET_PWIDTH, str);
+ current_view->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
}
MenuLayoutTable(0); // update for alignment
}
+#endif
}