]> git.lyx.org Git - lyx.git/commitdiff
The forms resize patch, and small updates
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 20 Oct 2000 09:50:09 +0000 (09:50 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 20 Oct 2000 09:50:09 +0000 (09:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1142 a592a061-630c-0410-9148-cb99ea01b6c8

25 files changed:
ChangeLog
NEWS
lib/CREDITS
lib/ui/default.ui
src/frontends/xforms/FormBase.C
src/frontends/xforms/FormBase.h
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormCitation.h
src/frontends/xforms/FormCopyright.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormError.C
src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormIndex.h
src/frontends/xforms/FormInset.C
src/frontends/xforms/FormInset.h
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/FormPreferences.h
src/frontends/xforms/FormPrint.C
src/frontends/xforms/FormPrint.h
src/frontends/xforms/FormRef.C
src/frontends/xforms/FormRef.h
src/frontends/xforms/FormToc.C
src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormUrl.h

index f2593aa0efe137ca7cabafb2eb567b30dac8e61f..f0a9b7e52bbf240dc2debd6d4557383558d48d33 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
+2000-10-19  Angus Leeming <a.leeming@ic.ac.uk>
+
+       * src/frontends/xforms/FormBase.[Ch]:
+       * src/frontends/xforms/FormXXX.[Ch] where XXX is a FormBase daughter:
+       read the xforms manual to discover that fl_set_form_minsize()/maxsize()
+       work only for the next call to fl_show_form(). The correct place to set
+       them, therefore is in connect() immediately BEFORE fl_show_form(). Now
+       done. FormBase also stores minw_, minh_ itself. All dialogs derived
+       from FormBase have the minimum size set; no more stupid crashes with
+       tabbed folders etc.
+
+2000-10-20  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * lib/ui/default.ui: fix shortcut for Insert->Include File.
+
 2000-10-19  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
+       * lib/CREDITS: add Andre' Poenitz and Kornelia Pietsch
+
        * src/support/lyxlib.h: changed second argument of mkdir to
        unsigned long int (unsigned int would probably have been enough,
        but...). Removed <sys/types.h> header.
 2000-09-27  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * src/insets/insettext.C (Ascii): return numer of '\n' in the text
-       outputed to the ostream.
+       output to the ostream.
 
        * several files: fixed types based on warnings from cxx 
 
diff --git a/NEWS b/NEWS
index 496f01181a43d4bef0f80329707b1aa1466c9592..8d64d63a06dad5de243d7a1432a73ce7d063f892 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,7 @@
 What's new in LyX version 1.1.6?
 --------------------------------
 
-As for all of the 1.1.x versions of LyX, this release contains a lot
+As with all of the 1.1.x versions of LyX, this release contains a lot
 of new code: in particular, half of the changes described in the
 ChangeLog (which dates back to the 1.1.0 release) describe changes in
 LyX 1.1.6!
@@ -12,7 +12,7 @@ GUI-independent branch of development has been merged, as well as code
 from the older development version:
 
 - many popups have been rewritten to use the new GUI-I scheme. In the
-  process they have gotten a nice cleanup: the Document and Paragraph
+  process they have received a nice cleanup: the Document and Paragraph
   popups now contain in one single place what was previously scattered
   in many places. Similarly, the citation and cross reference popups
   have been overhauled.
@@ -20,26 +20,26 @@ from the older development version:
 - LyX now has a Preference popup where you can change most of your
   lyxrc settings [Allan, details?]
 
-- The menus can now be defined in a text file, and they automatically
+- the menus can now be defined in a text file, and they automatically
   display the keyboard bindings associated with commands.
 
 - it is now possible to provide your own icons for the toolbar.
 
 - last but not least, work has begun on a KDE and a Gnome frontend for
   LyX. They are not officially supported for this version, but this
-  can give you an idea of what is happening.
+  will give you an idea of what is happening.
 
 Other major changes in 1.1.6 include:
 
 - the table support has been completely rewritten. It is now a modular
-  object (inset) which owns for each cell a (also) newly written text
+  object (inset), each cell of which owns a (also) newly written text
   inset. This now permits automatic text-wrap inside a tabular
   cell (if you define a width), multiparagraph mode AND setting of
   layouts for the paragraphs (lists inside a tabular cell!). Last but
-  not least, a wide tabular now scroll automatically so that all of it
+  not least, a wide tabular now scrolls automatically so that all of it
   is visible without the need to enlarge the window!
 
-  While there are yet no other new features, they will be now MUCH
+  While there are as yet no other new features, they will be now MUCH
   easier to add. It may be that because of being "young" code some
   features may not work right now, but at least it is much
   better than before.
@@ -60,7 +60,7 @@ Other major changes in 1.1.6 include:
 
 - LyX can do command line exports without opening any GUI components.
 
-- The multilingual support was improved. It is now possible to use in a
+- The multilingual support has been improved. It is now possible to use in a
   document languages with different encodings, e.g. German (iso8859-1) and
   Czech (iso8859-2). Such a document can be viewed on screen using an
   iso10646-1 (Unicode) font. However, it is (currently) not possible to
index 45196a72471b12cfeeb7bd3d9a901f1fc01b681b..12061c50788989be83a040909c3dac038c09431a 100644 (file)
 @iE-mail: sp2joap1@ida.his.se
    po-file for Swedish, a tool for picking shortcuts,
    bug reports and hacking at random
+@bKornelia Pietsch
+@iE-mail: pietsch@mathematik.tu-chemnitz.de
+   provided siamltex document class
+@bAndré Poenitz 
+@iE-mail: poenitz@HTWM.De
+  --export and --import command line options
+  file io with streams
 @bAlkis Polyzotis
    Keymap work.
 @bBernhard Psaier
index 74ae9a6796c37f299d727fbab2c6e5f0cbd9728b..1da80926aaad9b1cdaae0c7f0069f9c793c1d040 100644 (file)
@@ -178,7 +178,7 @@ Menuset
        Item "Figure...|g" "figure-insert"
        Item "Tabular...|T" "dialog-tabular-insert"
        Separator
-       Item "Include File...|I" "buffer-child-insert"
+       Item "Include File...|c" "buffer-child-insert"
        Submenu "Import ascii file|a" "insert_ascii"
        Item "Insert LyX file...|X" "file-insert"
        Item "Insert external material...|e" "external-insert"
index b0ebbc3f18bdd5371dbcc8628438e63e81dc63fc..deb7168a0d68ab9685ae32094f321d35796bd88b 100644 (file)
@@ -32,7 +32,8 @@ C_GENERICCB(FormBase, RestoreCB)
 
 FormBase::FormBase(LyXView * lv, Dialogs * d, string const & t,
                   ButtonPolicy * bp, char const * close, char const * cancel)
-       : lv_(lv), bc_(bp, cancel, close), d_(d), h_(0), title(t), bp_(bp)
+       : lv_(lv), bc_(bp, cancel, close), d_(d), h_(0), title(t), bp_(bp),
+         minw_(0), minh_(0)
 {}
 
 
@@ -42,6 +43,12 @@ FormBase::~FormBase()
 }
 
 
+void FormBase::connect()
+{
+       fl_set_form_minsize( form(), minw_, minh_ );
+}
+
+
 void FormBase::show()
 {
        if (!form()) {
@@ -57,11 +64,13 @@ void FormBase::show()
        if (form()->visible) {
                fl_raise_form(form());
        } else {
+               // calls to fl_set_form_minsize/maxsize apply only to the next
+               // fl_show_form(), so connect() comes first.
+               connect();
                fl_show_form(form(),
                             FL_PLACE_MOUSE | FL_FREE_SIZE,
                             FL_TRANSIENT,
                             title.c_str());
-               connect();
        }
 }
 
@@ -137,6 +146,7 @@ FormBaseBI::FormBaseBI(LyXView * lv, Dialogs * d, string const & t,
 void FormBaseBI::connect()
 {
        h_ = d_->hideAll.connect(slot(this, &FormBaseBI::hide));
+       FormBase::connect();
 }
 
 
@@ -160,6 +170,7 @@ void FormBaseBD::connect()
                 connect(slot(this, &FormBaseBD::update));
        h_ = d_->hideBufferDependent.
                 connect(slot(this, &FormBaseBD::hide));
+       FormBase::connect();
 }
 
 
index 87f37fd1e586d60b763c2507a06b88a16d7146dd..26febe08f294a3aeab86b3fe46760c35ee403da0 100644 (file)
@@ -33,14 +33,6 @@ class LyXView;
  */
 class FormBase : public DialogBase, public noncopyable {
 public:
-       /** Constructor.
-           #FormBase(lv, d, _("DialogName"), BUFFER_DEPENDENT, new ButtonPolicy)#
-        */
-       FormBase(LyXView *, Dialogs *, string const &,
-                ButtonPolicy *, char const *, char const *);
-       ///
-       virtual ~FormBase();
-
        /// Callback functions
        static  int WMHideCB(FL_FORM *, void *);
        ///
@@ -55,6 +47,14 @@ public:
        static void RestoreCB(FL_OBJECT *, long);
 
 protected: // methods
+       /** Constructor.
+           #FormBase(lv, d, _("DialogName"), BUFFER_DEPENDENT, new ButtonPolicy)#
+        */
+       FormBase(LyXView *, Dialogs *, string const &,
+                ButtonPolicy *, char const *, char const *);
+       ///
+       virtual ~FormBase();
+
        /// Create the dialog if necessary, update it and display it.
        void show();
        /// Hide the dialog.
@@ -62,7 +62,7 @@ protected: // methods
        /// bool indicates if a buffer switch took place
        virtual void update(bool = false) {}
        /// Connect signals. Also perform any necessary initialisation.
-       virtual void connect() = 0;
+       virtual void connect();
        /// Disconnect signals. Also perform any necessary housekeeping.
        virtual void disconnect() = 0;
        /// Build the dialog
@@ -91,7 +91,6 @@ protected: // methods
        /// Pointer to the actual instantiation of xform's form
        virtual FL_FORM * form() const = 0;
 
-protected: // data
        /** Which LyXFunc do we use?
            We could modify Dialogs to have a visible LyXFunc* instead and
            save a couple of bytes per dialog.
@@ -107,6 +106,10 @@ protected: // data
        string title;
        ///
        ButtonPolicy * bp_;
+       /// Overcome a dumb xforms sizing bug
+       mutable int minw_;
+       ///
+       mutable int minh_;
 };
 
 
@@ -115,14 +118,13 @@ protected: // data
     an update() function which is also supported by restore().
  */
 class FormBaseBI : public FormBase {
-public:
+protected:
        /// Constructor
        FormBaseBI(LyXView *, Dialogs *, string const &,
                   ButtonPolicy * bp = new OkApplyCancelPolicy,
                   char const * close = N_("Close"),
                   char const * cancel = N_("Cancel"));
 
-protected:
        /// Connect signals
        virtual void connect();
        /// Disconnect signals
@@ -133,14 +135,13 @@ protected:
 /** This class is an XForms GUI base class for Buffer Dependent dialogs
  */
 class FormBaseBD : public FormBase {
-public:
+protected:
        /// Constructor
        FormBaseBD(LyXView *, Dialogs *, string const &,
                   ButtonPolicy * bp = new OkApplyCancelReadOnlyPolicy,
                   char const * close = N_("Close"),
                   char const * cancel = N_("Cancel"));
 
-protected:
        /// Connect signals
        virtual void connect();
        /// Disconnect signals
index a79c6772b50069c3ddf4f72a6812cb2b883c35ba..d30404528815718a587edb8528f2f56ac13358ca 100644 (file)
@@ -34,7 +34,6 @@ using std::max;
 using std::min;
 using std::find;
 
-static int min_wform;
 
 FormCitation::FormCitation(LyXView * lv, Dialogs * d)
        : FormCommand(lv, d, _("Citation")), dialog_(0)
@@ -60,6 +59,13 @@ FL_FORM * FormCitation::form() const
 }
 
 
+void FormCitation::connect()
+{
+       fl_set_form_maxsize( dialog_->form, 3*minw_, minh_ );
+       FormCommand::connect();
+}
+
+
 void FormCitation::disconnect()
 {
        citekeys.clear();
@@ -73,7 +79,10 @@ void FormCitation::disconnect()
 void FormCitation::build()
 {
        dialog_ = build_citation();
-       min_wform = dialog_->form->w;
+
+       // Workaround dumb xforms sizing bug
+       minw_ = form()->w;
+       minh_ = form()->h;
 }
 
 
@@ -223,25 +232,20 @@ void FormCitation::setSize( int hbrsr, bool bibPresent ) const
        static int const htext  = dialog_->textAftr->h;
        static int const hok    = dialog_->button_ok->h;
 
-       int const wform = dialog_->form->w;
        int hform = dh1 + hbrsr + dh1;
        if ( bibPresent ) hform += hinfo + dh1;
        if ( natbib ) hform += hstyle + dh1 + htext + dh2;
        hform += htext + dh1 + hok + dh2;
 
-       bool const sizeSet = ( hform != dialog_->form->h );
-       if ( sizeSet ) fl_set_form_size( dialog_->form, wform, hform );
-
-       // No vertical resizing is allowed
-       // min_wform set in build()
-       fl_set_form_minsize( dialog_->form, min_wform,   hform );
-       fl_set_form_maxsize( dialog_->form, 3*min_wform, hform );
-
-       if ( !sizeSet ) return;
+       if ( hform != minh_ ) {
+               minh_ = hform;
+               fl_set_form_size( dialog_->form, minw_, minh_ );
+       } else
+               return;
 
        int x = 0;
        int y = 0;
-       fl_set_object_geometry( dialog_->box, x, y, wform, hform );
+       fl_set_object_geometry( dialog_->box, x, y, minw_, minh_ );
 
        x = dialog_->citeBrsr->x;
        y += dh1; 
index ca49a7973a273ac7cb3ca1d3cc0fe9ef9fccb620..a8ac4cfb33b1c6ae2fb1110846ff914fb157d68c 100644 (file)
@@ -47,6 +47,8 @@ private:
                ///
                OFF
        };
+       /// Connect signals etc. Set form's max size.
+       virtual void connect();
        /// Disconnect signals. Also perform any necessary housekeeping.
        virtual void disconnect();
 
index 345335252245203098a6a8926a3095eabc424709..0cef3ce770b7d69240c3aeeea52a5218fdb4895b 100644 (file)
@@ -42,4 +42,8 @@ FL_FORM * FormCopyright::form() const
 void FormCopyright::build()
 {
        dialog_ = build_copyright();
+
+       // Workaround dumb xforms sizing bug
+       minw_ = form()->w;
+       minh_ = form()->h;
 }
index 27511bf231614ca9ba110148d9876d1c415df07b..e3051215e9afdd02aa8d7dccc24bc996f2262243 100644 (file)
@@ -94,6 +94,10 @@ void FormDocument::build()
     bc_.setUndoAll(dialog_->button_restore);
     bc_.refresh();
 
+    // Workaround dumb xforms sizing bug
+    minw_ = form()->w;
+    minh_ = form()->h;
+
     // the document paper form
     paper_ = build_doc_paper();
     fl_addto_choice(paper_->choice_papersize2,
index 9033ff487386cfde0dfef9c3a28e280be7218695..9bdf9dfb69b3977bcb717bf8831f433ebca3b912 100644 (file)
@@ -20,8 +20,6 @@
 #include "form_error.h"
 #include "insets/inseterror.h"
 
-static int minh, minw;
-
 FormError::FormError( LyXView * lv, Dialogs * d )
        : FormInset( lv, d, _("LaTeX Error") ),
          dialog_(0), inset_(0), message_("")
@@ -75,7 +73,6 @@ void FormError::update(bool switched)
                return;
        }
 
-       fl_set_form_minsize(form(), minw, minh);
        fl_set_object_label(dialog_->message, message_.c_str());
 }
 
@@ -84,7 +81,7 @@ void FormError::build()
 {
        dialog_ = build_error();
 
-       // XFORMS bug workaround
-       // Define the min/max dimensions. Actually applied in update()
-       minw = form()->w; minh = form()->h;
+       // Workaround dumb xforms sizing bug
+       minw_ = form()->w;
+       minh_ = form()->h;
 }
index 8e718e46d111f091a56152180ab02815f0364f78..cefacea8dba19096a5e2f929c73dde0c58b2bbf9 100644 (file)
@@ -26,7 +26,7 @@
 #include "lyxfunc.h"
 
 FormIndex::FormIndex(LyXView * lv, Dialogs * d)
-       : FormCommand(lv, d, _("Index")), minh(0), minw(0), dialog_(0)
+       : FormCommand(lv, d, _("Index")), dialog_(0)
 {
        // let the dialog be shown
        // These are permanent connections so we won't bother
@@ -49,6 +49,13 @@ FL_FORM * FormIndex::form() const
 }
 
 
+void FormIndex::connect()
+{
+       fl_set_form_maxsize( form(), 2*minw_, minh_ );
+       FormCommand::connect();
+}
+       
+
 void FormIndex::build()
 {
        dialog_ = build_index();
@@ -56,9 +63,9 @@ void FormIndex::build()
 #ifdef WITH_WARNINGS
 #warning use the buttoncontroller
 #endif
-       // XFORMS bug workaround
-       // Define the min/max dimensions. Actually applied in update()
-       minw = form()->w; minh = form()->h;
+       // Workaround dumb xforms sizing bug
+       minw_ = form()->w;
+       minh_ = form()->h;
 }
 
 
@@ -69,9 +76,6 @@ void FormIndex::update(bool switched)
                return;
        }
 
-       fl_set_form_minsize(form(), minw, minh);
-       fl_set_form_maxsize(form(), 2*minw, minh);
-
        fl_set_input(dialog_->key, params.getContents().c_str());
 
        if ( lv_->buffer()->isReadonly() ) {
index 7c3207391ff085b26f6d40a8e9c0fc96ad112b33..19f93e23911b1ce291d29857fe65d395f0520cbe 100644 (file)
@@ -28,6 +28,8 @@ public:
        ///
        ~FormIndex();
 private:
+       /// Connect signals etc. Set form's max size.
+       virtual void connect();
        /// Build the dialog
        virtual void build();
        /// Update dialog before showing it
@@ -38,10 +40,6 @@ private:
        virtual FL_FORM * form() const;
        ///
        FD_form_index * build_index();
-       /// 
-       int minh;
-       ///
-       int minw;
        /// Real GUI implementation.
        FD_form_index * dialog_;
 };
index 57362adac6216e62101880ae748828e56043aa1b..743293f8648db454878e3d86328cc5898bd9543c 100644 (file)
@@ -35,6 +35,7 @@ void FormInset::connect()
                 connect(slot(this, &FormInset::update));
        h_ = d_->hideBufferDependent.
                 connect(slot(this, &FormInset::hide));
+       FormBase::connect();
 }
 
 
index 865cb4516eb13d64174f5b1503085cdba1e8b138..1ffd4d2359cc30c1c1f94abd425569a70760f90a 100644 (file)
 /** This class is an XForms GUI base class to insets
  */
 class FormInset : public FormBaseBD {
-public:
+protected:
        /// Constructor
        FormInset( LyXView *, Dialogs *, string const &,
                   ButtonPolicy * bp = new OkCancelReadOnlyPolicy,
                   char const * close = N_("Close"),
                   char const * cancel = N_("Cancel"));
 
-protected: // methods
        /// Connect signals. Also perform any necessary initialisation.
        virtual void connect();
        /// Disconnect signals. Also perform any necessary housekeeping.
        virtual void disconnect();
 
-protected: // data
        /// inset::hide connection.
        Connection ih_;
 };
@@ -46,14 +44,13 @@ protected: // data
     InsetCommand
  */
 class FormCommand : public FormInset {
-public:
+protected:
        /// Constructor
        FormCommand( LyXView *, Dialogs *, string const &,
                     ButtonPolicy * = new OkCancelReadOnlyPolicy,
                     char const * close = N_("Close"),
                     char const * cancel = N_("Cancel"));
 
-protected:
        /// Disconnect signals. Also perform any necessary housekeeping.
        virtual void disconnect();
 
index 43ab071378abd147164b1ba05a33b0c2cf2a4a0d..0e2f85a95f2195921c8874985ba2d3c0a9d12d12 100644 (file)
@@ -61,6 +61,10 @@ void FormParagraph::build()
     // the tabbed folder
     dialog_ = build_tabbed_paragraph();
 
+    // Workaround dumb xforms sizing bug
+    minw_ = form()->w;
+    minh_ = form()->h;
+
     // manage the restore, ok, apply and cancel/close buttons
     bc_.setOK(dialog_->button_ok);
     bc_.setApply(dialog_->button_apply);
index 9bf62d3a0ed314567eca71204121e9e9a511e5b1..5815dd11ad95f42a988357ed6bbfbba7bc3484f0 100644 (file)
@@ -31,7 +31,7 @@ FormPreferences::FormPreferences(LyXView * lv, Dialogs * d)
        : FormBaseBI(lv, d, _("Preferences"), new PreferencesPolicy),
          dialog_(0), outputs_tab_(0), look_n_feel_tab_(0), inputs_tab_(0),
          lnf_general_(0), screen_fonts_(0), interface_(0),
-         printer_(0), paths_(0), outputs_general_(0), minw_(0), minh_(0)
+         printer_(0), paths_(0), outputs_general_(0)
 {
        // let the dialog be shown
        // This is a permanent connection so we won't bother
@@ -80,8 +80,8 @@ void FormPreferences::build()
        bc_.refresh();
 
        // Workaround dumb xforms sizing bug
-       minw_ = dialog_->form->w;
-       minh_ = dialog_->form->h;
+       minw_ = form()->w;
+       minh_ = form()->h;
 
        // build the tab folders
        outputs_tab_ = build_outer_tab();
@@ -225,15 +225,6 @@ FL_FORM * FormPreferences::form() const
 }
 
 
-void FormPreferences::connect()
-{
-       FormBaseBI::connect();
-       fl_set_form_minsize(dialog_->form,
-                           minw_,
-                           minh_);
-}
-
-
 void FormPreferences::apply()
 {
        // set the new lyxrc entries
index 501524011951e664924d7d5ee0d6d015c8b5ca31..5657707cb98094fb3a517d350aed9de54fd53931 100644 (file)
@@ -45,8 +45,6 @@ public:
        ///
        ~FormPreferences();
 private:
-       ///
-       virtual void connect();
        /// Update the dialog.
        virtual void update(bool = false);
        ///
@@ -100,10 +98,6 @@ private:
        FD_form_paths * paths_;
        ///
        FD_form_outputs_general * outputs_general_;
-       /// Overcome a dumb xforms sizing bug
-       int minw_;
-       ///
-       int minh_;
 };
 
 #endif
index 12147c2e798ca95ba99629bf3eb91104e37c76c5..4c9dff6571f2ad4c45aea32aa7b14ef937ce3f96 100644 (file)
@@ -54,6 +54,10 @@ void FormPrint::build()
 {
        dialog_ = build_print();
 
+       // Workaround dumb xforms sizing bug
+       minw_ = form()->w;
+       minh_ = form()->h;
+
        // manage the ok, apply and cancel/close buttons
        bc_.setOK(dialog_->button_ok);
        bc_.setApply(dialog_->button_apply);
@@ -107,15 +111,6 @@ void FormPrint::build()
 }
 
 
-void FormPrint::connect()
-{
-       FormBaseBD::connect();
-       fl_set_form_minsize(dialog_->form,
-                           dialog_->form->w,
-                           dialog_->form->h);
-}
-
-
 FL_FORM * FormPrint::form() const
 {
        if (dialog_) return dialog_->form;
index e18837efc9d803da728baf1f9a264f0353ac09f4..28acdcc4ca3fc2720dac563a14b001b010debb8c 100644 (file)
@@ -45,8 +45,6 @@ private:
        virtual void apply();
        /// Filter the inputs
        virtual bool input(FL_OBJECT *, long);
-       ///
-       virtual void connect();
        /// Pointer to the actual instantiation of the xform's form
        virtual FL_FORM * form() const;
        /// Build the dialog
index 23070c366109e3a1a0a07ae3389b9a1c94038b25..ecbd5db944b6c12686ec31a6ad977b85968b9e7f 100644 (file)
@@ -30,9 +30,6 @@
 using std::sort;
 using std::vector;
 
-static int formw;
-static int formh;
-
 FormRef::FormRef(LyXView * lv, Dialogs * d)
        : FormCommand(lv, d, _("Reference")), toggle(GOBACK), dialog_(0)
 {
@@ -57,6 +54,13 @@ FL_FORM * FormRef::form() const
 }
 
 
+void FormRef::connect()
+{
+       fl_set_form_maxsize( form(), 2*minw_, minh_ );
+       FormCommand::connect();
+}
+       
+
 void FormRef::disconnect()
 {
        refs.clear();
@@ -71,9 +75,9 @@ void FormRef::build()
        fl_addto_choice(dialog_->type,
                        _(" Ref | Page | TextRef | TextPage | PrettyRef "));
 
-       // XFORMS bug workaround
-       // Define the min/max dimensions. Actually applied in update()
-       formw = form()->w, formh = form()->h;
+       // Workaround dumb xforms sizing bug
+       minw_ = form()->w;
+       minh_ = form()->h;
 
        // Name is irrelevant to LaTeX documents
        if ( lv_->buffer()->isLatex() ) {
@@ -157,7 +161,7 @@ void FormRef::showBrowser() const
        fl_show_object( dialog_->button_update );
        fl_show_object( dialog_->sort );
 
-       setSize( formw, formh, 0 );
+       setSize( minw_, minh_, 0 );
 
        fl_deactivate_object( dialog_->type );
        fl_set_object_lcol( dialog_->type, FL_INACTIVE );
@@ -174,7 +178,7 @@ void FormRef::hideBrowser() const
        fl_hide_object( dialog_->button_update );
        fl_hide_object( dialog_->sort );
 
-       setSize( 250, formh, 280 );
+       setSize( 250, minh_, 280 );
 
        fl_activate_object( dialog_->type );
        fl_set_object_lcol( dialog_->type, FL_BLACK );
@@ -200,14 +204,13 @@ void FormRef::setSize( int w, int h, int dx ) const
        static int x6 = dialog_->button_cancel->x;
        static int y6 = dialog_->button_cancel->y;
 
-       if ( form()->w != w )
-               fl_set_form_size( form(), w, h );
-
-       fl_set_form_minsize( form(), w, h );
-       fl_set_form_maxsize( form(), 2*w, h );
-
-       if ( form()->w == w ) return;
-
+       if ( form()->w != w ) {
+               minw_ = w;
+               minh_ = h;
+               fl_set_form_size( form(), minw_, minh_ );
+       } else
+               return;
+       
        fl_set_object_position( dialog_->name,   x1-dx, y1 );
        fl_set_object_position( dialog_->ref,    x2-dx, y2 );
        fl_set_object_position( dialog_->type,   x3-dx, y3 );
index 65861a14ee7b9c4327ec8216d4427a206a81bd4f..e7ad15d418342a7be1cfcbf7dcbe45fd410ea599 100644 (file)
@@ -51,6 +51,8 @@ private:
                GOFIRST
        };
 
+       /// Connect signals etc. Set form's max size.
+       virtual void connect();
        /// Disconnect signals. Also perform any necessary housekeeping.
        virtual void disconnect();
 
index 2e5111cde5188320429e84f0e2b84d7ffbfb6603..2191473c4f217a54fc993d9b41c01e1c0058a2bc 100644 (file)
@@ -66,10 +66,15 @@ void FormToc::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;
 }
 
 
index 8d61d8ea02bca49ea8757d4a7e419dbb128618e9..b32450b5c10f27c31f5b6f73e20e90c1f0647f1b 100644 (file)
@@ -26,7 +26,7 @@
 #include "lyxfunc.h"
 
 FormUrl::FormUrl(LyXView * lv, Dialogs * d)
-       : FormCommand(lv, d, _("Url")), minh(0), minw(0), dialog_(0)
+       : FormCommand(lv, d, _("Url")), dialog_(0)
 {
        // let the dialog be shown
        // These are permanent connections so we won't bother
@@ -49,6 +49,13 @@ FL_FORM * FormUrl::form() const
 }
 
 
+void FormUrl::connect()
+{
+       fl_set_form_maxsize( form(), 2*minw_, minh_ );
+       FormCommand::connect();
+}
+       
+
 void FormUrl::build()
 {
        dialog_ = build_url();
@@ -56,10 +63,9 @@ void FormUrl::build()
 #ifdef WITH_WARNINGS
 #warning use the buttoncontroller
 #endif
-       // XFORMS bug workaround
-       // Define the min/max dimensions. Actually applied in update()
-       minw = form()->w;
-       minh = form()->h;
+       // Workaround dumb xforms sizing bug
+       minw_ = form()->w;
+       minh_ = form()->h;
 }
 
 
@@ -70,9 +76,6 @@ void FormUrl::update(bool switched)
                return;
        }
 
-       fl_set_form_minsize(form(), minw, minh);
-       fl_set_form_maxsize(form(), 2*minw, minh);
-
        fl_set_input(dialog_->url,  params.getContents().c_str());
        fl_set_input(dialog_->name, params.getOptions().c_str());
 
index add9278ce7757805cc4bb700c6cb8086bbce7845..e6f718ab0ab05ac76c912073229d9bf8831694f4 100644 (file)
@@ -28,6 +28,8 @@ public:
        ///
        ~FormUrl();
 private:
+       /// Connect signals etc. Set form's max size.
+       virtual void connect();
        /// Build the dialog
        virtual void build();
        /// Update dialog before showing it
@@ -38,10 +40,6 @@ private:
        virtual FL_FORM * form() const;
        ///
        FD_form_url * build_url();
-       /// 
-       int minh;
-       ///
-       int minw;
        /// Real GUI implementation.
        FD_form_url * dialog_;
 };