-void FormDocument::free()
-{
- if (dialog_) {
- hide();
- if (class_) {
-#ifdef USE_CLASS_COMBO
- delete combo_doc_class;
-#endif
- fl_free_form(class_->form);
- delete class_;
- class_ = 0;
- }
- if (paper_) {
- fl_free_form(paper_->form);
- delete paper_;
- paper_ = 0;
- }
- if (language_) {
- delete combo_language;
- fl_free_form(language_->form);
- delete language_;
- language_ = 0;
- }
- if (options_) {
- fl_free_form(options_->form);
- delete options_;
- options_ = 0;
- }
- if (bullets_) {
- fl_free_form(bullets_->form);
- delete bullets_;
- bullets_ = 0;
- }
- fl_free_form(dialog_->form);
- delete dialog_;
- dialog_ = 0;
- }
-}
-
-int FormDocument::WMHideCB(FL_FORM * form, void *)
-{
- // Ensure that the signals (u and h) are disconnected even if the
- // window manager is used to close the popup.
- FormDocument * pre = (FormDocument*)form->u_vdata;
- pre->hide();
- pre->bc_->hide();
- return FL_CANCEL;
-}
-
-void FormDocument::OKCB(FL_OBJECT * ob, long)
-{
- FormDocument * pre = (FormDocument*)ob->form->u_vdata;
- pre->apply();
- pre->hide();
- pre->bc_->ok();
-}
-
-void FormDocument::ApplyCB(FL_OBJECT * ob, long)
-{
- FormDocument * pre = (FormDocument*)ob->form->u_vdata;
- pre->apply();
- pre->bc_->apply();
-}
-
-void FormDocument::CancelCB(FL_OBJECT * ob, long)
-{
- FormDocument * pre = (FormDocument*)ob->form->u_vdata;
- pre->cancel();
- pre->hide();
- pre->bc_->cancel();
-}
-
-void FormDocument::RestoreCB(FL_OBJECT * ob, long)
-{
- FormDocument * pre = static_cast<FormDocument*>(ob->form->u_vdata);
- pre->update();
- pre->bc_->undoAll();
-}
-
-void FormDocument::InputCB(FL_OBJECT * ob, long)
-{
- FormDocument * pre = (FormDocument*)ob->form->u_vdata;
- pre->bc_->valid(pre->CheckDocumentInput(ob,0));
-}
-
-void FormDocument::ComboInputCB(int, void * v)
-{
- FormDocument * pre = static_cast<FormDocument*>(v);
-// pre->CheckChoiceClass(0, 0);
- pre->bc_->valid(pre->CheckDocumentInput(0,0));
-}
-
-void FormDocument::ChoiceClassCB(FL_OBJECT * ob, long)
-{
- FormDocument * pre = (FormDocument*)ob->form->u_vdata;
- pre->CheckChoiceClass(ob,0);
- pre->bc_->valid(pre->CheckDocumentInput(ob,0));
-}