#include "lyxfunc.h"
#include "support/lstrings.h"
+// The current code uses the apply() for handling the Update button and the
+// type-of-table selection and cancel() for the close button. This is a little
+// confusing to the button controller so I've made an IgnorantPolicy to cover
+// this situation since the dialog doesn't care about buttons. ARRae 20001013
FormToc::FormToc(LyXView * lv, Dialogs * d)
- : FormCommand(lv, d, _("Table of Contents")), dialog_(0)
+ : FormCommand(lv, d, _("Table of Contents"), new IgnorantPolicy),
+ dialog_(0)
{
// let the dialog be shown
// These are permanent connections so we won't bother
}
-void FormToc::clearStore()
+void FormToc::disconnect()
{
toclist.clear();
+ FormCommand::disconnect();
}
void FormToc::build()
{
dialog_ = build_toc();
+
fl_addto_choice(dialog_->type,
_(" TOC | LOF | LOT | LOA "));
// Don't need to limit size of this dialog
+ // (but fixing min size is a GOOD thing).
+ // Workaround dumb xforms sizing bug
+ minw_ = form()->w;
+ minh_ = form()->h;
}
if (!lv_->view()->available()) {
toclist.clear();
fl_clear_browser( dialog_->browser );
- fl_add_browser_line( dialog_->browser, _("*** No Document ***"));
+ fl_add_browser_line( dialog_->browser,
+ _("*** No Document ***"));
return;
}
for (vector<Buffer::TocItem>::const_iterator it = toclist.begin();
it != toclist.end(); ++it)
fl_add_browser_line( dialog_->browser,
- (string(4*(*it).depth,' ')+(*it).str).c_str());
+ (string(4 * (*it).depth, ' ')
+ + (*it).str).c_str());
fl_set_browser_topline( dialog_->browser, topline );
fl_select_browser_line( dialog_->browser, line );