// check if setting a first header is allowed
// additionally check firstheaderNoContentsCB because when this is
// the case a first header makes no sense
- firstheaderStatusCB->setEnabled(getStatus(FuncRequest(LFUN_INSET_MODIFY, "tabular set-ltfirsthead")).enabled()
+ firstheaderStatusCB->setEnabled(funcEnabled(Tabular::SET_LTFIRSTHEAD)
&& longtabular && !firstheaderNoContentsCB->isChecked());
firstheaderBorderAboveCB->setEnabled(longtabular
&& firstheaderStatusCB->isChecked());
// check if setting a last footer is allowed
// additionally check lastfooterNoContentsCB because when this is
// the case a last footer makes no sense
- lastfooterStatusCB->setEnabled(getStatus(FuncRequest(LFUN_INSET_MODIFY, "tabular set-ltlastfoot")).enabled()
+ lastfooterStatusCB->setEnabled(funcEnabled(Tabular::SET_LTLASTFOOT)
&& longtabular && !lastfooterNoContentsCB->isChecked());
lastfooterBorderAboveCB->setEnabled(longtabular
&& lastfooterBorderAboveCB->isChecked());
lastfooterBorderBelowCB->setEnabled(longtabular
&& lastfooterBorderAboveCB->isChecked());
- captionStatusCB->setEnabled(getStatus(FuncRequest(LFUN_INSET_MODIFY, "tabular toggle-ltcaption")).enabled());
+ captionStatusCB->setEnabled(funcEnabled(Tabular::TOGGLE_LTCAPTION));
- multicolumnCB->setEnabled(getStatus(FuncRequest(LFUN_INSET_MODIFY, "tabular multicolumn")).enabled());
- multirowCB->setEnabled(getStatus(FuncRequest(LFUN_INSET_MODIFY, "tabular multirow")).enabled());
+ multicolumnCB->setEnabled(funcEnabled(Tabular::MULTICOLUMN));
+ multirowCB->setEnabled(funcEnabled(Tabular::MULTICOLUMN));
changed();
}
}
+bool GuiTabular::funcEnabled(Tabular::Feature f) const
+{
+ string cmd = "tabular " + featureAsString(f);
+ return getStatus(FuncRequest(LFUN_INSET_MODIFY, cmd)).enabled();
+}
+
+
} // namespace frontend
} // namespace lyx
#include "InsetParamsWidget.h"
#include "ui_TabularUi.h"
+#include "insets/InsetTabular.h"
namespace lyx {
namespace frontend {
void setTableAlignment(std::string & param_str) const;
///
void setWidthAndAlignment();
+ ///
+ bool funcEnabled(Tabular::Feature f) const;
};
} // namespace frontend