*
* \author Jürgen Vigna
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
-#include "ControlTabular.h"
-#include "xformsBC.h"
-#include "ButtonController.h"
-#include "insets/insettabular.h"
-
#include "FormTabular.h"
#include "forms/form_tabular.h"
-#include "debug.h"
+
#include "xforms_helpers.h"
-#include "gettext.h"
-#include "lyxrc.h"
-#include "helper_funcs.h"
-#include "input_validators.h"
+#include "xformsBC.h"
+
+#include "controllers/ButtonController.h"
+#include "controllers/ControlTabular.h"
+#include "controllers/helper_funcs.h"
+
+#include "support/convert.h"
#include "support/lstrings.h"
#include "lyx_forms.h"
-#include <vector>
-#include <algorithm>
+#include <boost/bind.hpp>
-using namespace lyx::support;
+using boost::bind;
+using std::string;
using std::vector;
-using std::bind2nd;
+namespace lyx {
+
+using support::contains;
+using support::getStringFromVector;
+using support::isStrDbl;
+
+namespace frontend {
namespace {
FormTabular::FormTabular(Dialog & parent)
: base_class(parent, _("Table Settings"), scalableTabfolders),
- closing_(false), actCell_(-1)
+ closing_(false), actCell_(LyXTabular::npos)
{
}
vector<string> units_vec = getLatexUnits();
vector<string>::iterator ret =
remove_if(units_vec.begin(), units_vec.end(),
- bind2nd(contains_functor(), "%"));
+ bind(contains<char>, _1, '%'));
units_vec.erase(ret, units_vec.end());
string const units = getStringFromVector(units_vec, "|");
LyXTabular const & tabular = controller().tabular();
int align;
- char buf[12];
LyXLength pwidth;
string special;
- int const cell = controller().getActiveCell();
+ LyXTabular::idx_type const cell = controller().getActiveCell();
actCell_ = cell;
- int column = tabular.column_of_cell(cell) + 1;
+ LyXTabular::col_type column = tabular.column_of_cell(cell) + 1;
clearMessage();
fl_activate_object(column_options_->input_special_alignment);
fl_activate_object(cell_options_->input_special_multialign);
fl_activate_object(column_options_->input_column_width);
fl_activate_object(column_options_->choice_value_column_width);
- sprintf(buf, "%d", column);
- fl_set_input(dialog_->input_tabular_column, buf);
+ fl_set_input(dialog_->input_tabular_column,
+ convert<string>(column).c_str());
fl_deactivate_object(dialog_->input_tabular_column);
- int row = tabular.row_of_cell(cell);
- sprintf(buf, "%d", row + 1);
- fl_set_input(dialog_->input_tabular_row, buf);
+ LyXTabular::row_type row = tabular.row_of_cell(cell);
+ fl_set_input(dialog_->input_tabular_row,
+ convert<string>(row + 1).c_str());
fl_deactivate_object(dialog_->input_tabular_row);
if (tabular.isMultiColumn(cell)) {
fl_set_button(cell_options_->check_multicolumn, 1);
align = tabular.getVAlignment(cell);
fl_set_button(cell_options_->radio_valign_top, 0);
fl_set_button(cell_options_->radio_valign_bottom, 0);
- fl_set_button(cell_options_->radio_valign_center, 0);
- if (pwidth.zero() || (align == LyXTabular::LYX_VALIGN_CENTER))
- fl_set_button(cell_options_->radio_valign_center, 1);
+ fl_set_button(cell_options_->radio_valign_middle, 0);
+ if (pwidth.zero() || (align == LyXTabular::LYX_VALIGN_MIDDLE))
+ fl_set_button(cell_options_->radio_valign_middle, 1);
else if (align == LyXTabular::LYX_VALIGN_BOTTOM)
fl_set_button(cell_options_->radio_valign_bottom, 1);
else
setEnabled(cell_options_->radio_valign_top, !pwidth.zero());
setEnabled(cell_options_->radio_valign_bottom, !pwidth.zero());
- setEnabled(cell_options_->radio_valign_center, !pwidth.zero());
+ setEnabled(cell_options_->radio_valign_middle, !pwidth.zero());
setEnabled(cell_options_->radio_align_left, true);
setEnabled(cell_options_->radio_align_right, true);
fl_set_button(cell_options_->radio_valign_bottom, 0);
setEnabled(cell_options_->radio_valign_bottom, false);
- fl_set_button(cell_options_->radio_valign_center, 0);
- setEnabled(cell_options_->radio_valign_center, false);
+ fl_set_button(cell_options_->radio_valign_middle, 0);
+ setEnabled(cell_options_->radio_valign_middle, false);
fl_set_input(cell_options_->input_special_multialign, "");
setEnabled(cell_options_->input_special_multialign, false);
align = tabular.getVAlignment(cell, true);
fl_set_button(column_options_->radio_valign_top, 0);
fl_set_button(column_options_->radio_valign_bottom, 0);
- fl_set_button(column_options_->radio_valign_center, 0);
- if (pwidth.zero() || (align == LyXTabular::LYX_VALIGN_CENTER))
- fl_set_button(column_options_->radio_valign_center, 1);
+ fl_set_button(column_options_->radio_valign_middle, 0);
+ if (pwidth.zero() || (align == LyXTabular::LYX_VALIGN_MIDDLE))
+ fl_set_button(column_options_->radio_valign_middle, 1);
else if (align == LyXTabular::LYX_VALIGN_BOTTOM)
fl_set_button(column_options_->radio_valign_bottom, 1);
else
setEnabled(column_options_->radio_align_block, !pwidth.zero());
setEnabled(column_options_->radio_valign_top, !pwidth.zero());
setEnabled(column_options_->radio_valign_bottom, !pwidth.zero());
- setEnabled(column_options_->radio_valign_center, !pwidth.zero());
+ setEnabled(column_options_->radio_valign_middle, !pwidth.zero());
fl_set_button(tabular_options_->check_longtable,
tabular.isLongTabular());
LyXTabular const & tabular = controller().tabular();
- int const cell = controller().getActiveCell();
+ LyXTabular::idx_type const cell = controller().getActiveCell();
// ugly hack to auto-apply the stuff that hasn't been
// yet. don't let this continue to exist ...
num = LyXTabular::VALIGN_TOP;
else if (ob == column_options_->radio_valign_bottom)
num = LyXTabular::VALIGN_BOTTOM;
- else if (ob == column_options_->radio_valign_center)
- num = LyXTabular::VALIGN_CENTER;
+ else if (ob == column_options_->radio_valign_middle)
+ num = LyXTabular::VALIGN_MIDDLE;
else if (ob == cell_options_->check_multicolumn)
num = LyXTabular::MULTICOLUMN;
else if (ob == tabular_options_->check_longtable) {
num = LyXTabular::M_VALIGN_TOP;
else if (ob == cell_options_->radio_valign_bottom)
num = LyXTabular::M_VALIGN_BOTTOM;
- else if (ob == cell_options_->radio_valign_center)
- num = LyXTabular::M_VALIGN_CENTER;
+ else if (ob == cell_options_->radio_valign_middle)
+ num = LyXTabular::M_VALIGN_MIDDLE;
else
return ButtonPolicy::SMI_VALID;
return LyXTabular::LAST_ACTION;
}
+
+} // namespace frontend
+} // namespace lyx