*
* LyX, The Document Processor
*
- * Copyright 2000 The LyX Team.
+ * Copyright 2000-2001 The LyX Team.
*
* ======================================================
*
- * Author: Angus Leeming <a.leeming@ic.ac.uk>
+ * \author Angus Leeming <a.leeming@ic.ac.uk>
*/
#ifndef FORMBASE_H
{
public:
///
- FormBase(ControlBase &, string const &);
+ FormBase(ControlButtons &, string const &, bool allowResize);
///
virtual ~FormBase() {}
private:
/// Pointer to the actual instantiation of xform's form
virtual FL_FORM * form() const = 0;
- /** Filter the inputs on callback from xforms
- Return true if inputs are valid. */
- virtual ButtonPolicy::SMInput input(FL_OBJECT *, long) = 0;
+ /// Filter the inputs on callback from xforms
+ virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
/** Redraw the form (on receipt of a Signal indicating, for example,
that the xform colors have been re-mapped). */
virtual void redraw();
-protected:
- /// Overcome a dumb xforms sizing bug
- mutable int minw_;
+ /// The dialog's minimum allowable dimensions.
+ int minw_;
///
- mutable int minh_;
-
-private:
+ int minh_;
+ /// Can the dialog be resized after it has been created?
+ bool allow_resize_;
/// dialog title, displayed by WM.
string title_;
};
-template <class Controller, class Dialog>
-class FormBase2: public FormBase
+template <class Dialog>
+class FormDB: public FormBase
{
protected:
///
- FormBase2(ControlBase &, string const &);
- /// The parent controller
- Controller & controller() const;
+ FormDB(ControlButtons &, string const &, bool allowResize=true);
/// Pointer to the actual instantiation of xform's form
virtual FL_FORM * form() const;
/// Real GUI implementation.
};
-template <class Controller, class Dialog>
-FormBase2<Controller, Dialog>::FormBase2(ControlBase & c, string const & t)
- : FormBase(c, t)
+template <class Dialog>
+FormDB<Dialog>::FormDB(ControlButtons & c, string const & t, bool allowResize)
+ : FormBase(c, t, allowResize)
{}
-template <class Controller, class Dialog>
-Controller & FormBase2<Controller, Dialog>::controller() const
+template <class Dialog>
+FL_FORM * FormDB<Dialog>::form() const
{
- return static_cast<Controller &>(controller_);
- //return dynamic_cast<Controller &>(controller_);
+ if (dialog_.get()) return dialog_->form;
+ return 0;
}
-template <class Controller, class Dialog>
-FL_FORM * FormBase2<Controller, Dialog>::form() const
+template <class Controller, class Base>
+class FormCB: public Base
{
- if (dialog_.get()) return dialog_->form;
- return 0;
+protected:
+ ///
+ FormCB(ControlButtons &, string const &, bool allowResize=true);
+ /// The parent controller
+ Controller & controller() const;
+};
+
+
+template <class Controller, class Base>
+FormCB<Controller, Base>::FormCB(ControlButtons & c, string const & t,
+ bool allowResize)
+ : Base(c, t, allowResize)
+{}
+
+
+template <class Controller, class Base>
+Controller & FormCB<Controller, Base>::controller() const
+{
+ return static_cast<Controller &>(controller_);
+ //return dynamic_cast<Controller &>(controller_);
}