]> git.lyx.org Git - features.git/commitdiff
handle Wide attribute of floats in their dialog (from Juergen S)
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 24 Jul 2002 15:37:17 +0000 (15:37 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 24 Jul 2002 15:37:17 +0000 (15:37 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4772 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/MenuBackend.C
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlFloat.C
src/frontends/controllers/ControlFloat.h
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormFloat.C
src/frontends/xforms/forms/form_float.fd

index 5be52416c4866537a07b5252a8e9ad6ac1972a69..f4f572de65c18e4d4db9f5057a4d00286b9cd1cd 100644 (file)
@@ -3,6 +3,7 @@
        * MenuBackend.C (expand): move from Menu to MenuBackend; pass a
        Menu as first parameter. Now, this calls itself recursively to
        expand a whole tree (this will be useful for TOC handling)
+       (expandFloatInsert): remove 'wide' version of floats
 
        * MenuBackend.h (submenuname): returns the name of the submenu.
        (submenu): returns the submenu itself, provided it has been
index 620501284a992169397ab967213646364b51e88b..206e880174f85e509f08e4cc34d6cadaafd72a0f 100644 (file)
@@ -385,13 +385,6 @@ void expandFloatInsert(Menu & tomenu)
                                                  cit->second.type());
                string const label = _(cit->second.name());
                tomenu.add(MenuItem(MenuItem::Command, label, action));
-               
-               // and the wide version
-               int const action2 =
-                       lyxaction.getPseudoAction(LFUN_INSET_WIDE_FLOAT,
-                                                 cit->second.type());
-               string const label2 = label + _(" (wide)");
-               tomenu.add(MenuItem(MenuItem::Command, label2, action2));
        }
 }
 
index 6b7b88d839f177c5c0bfb09ec329c1dbb3547a66..7635b1b40fa57caa440b86c276012aef5f59993b 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-24  Juergen Spitzmueller <j.spitzmueller@gmx.de>
+
+       * ControlFloat.[Ch]: Implement Wide Float toggle
+       Replace "allow_here_definitely" by "wide"
+
 2002-07-22  Herbert Voss  <voss@lyx.org>
 
        * ControlGraphics.C: small changes
index a04eb8dd48bef49ad53ca2f53a988cccbb448ab0..c78ca8b67151abf7779a0fbebc59d3d44af588f7 100644 (file)
@@ -16,6 +16,7 @@
 #endif
 
 #include "ControlFloat.h"
+#include "BufferView.h"
 
 
 ControlFloat::ControlFloat(LyXView & lv, Dialogs & d)
@@ -26,6 +27,9 @@ ControlFloat::ControlFloat(LyXView & lv, Dialogs & d)
 void ControlFloat::applyParamsToInset()
 {
        inset()->placement(params().placement);
+       inset()->wide(params().wide);
+       lv_.view()->updateInset(inset(), true);
+
 }
 
 
@@ -41,11 +45,11 @@ FloatParams const ControlFloat::getParams(InsetFloat const & inset)
 
 FloatParams::FloatParams()
        : placement("htbp"),
-         allow_here_definitely(true)
+         wide(false)
 {}
 
 
 FloatParams::FloatParams(InsetFloat const & inset)
        : placement(inset.placement()),
-         allow_here_definitely(!inset.wide())
+         wide(inset.wide())
 {}
index cf93d6fe16de99076e388bbbd331d24c598772d8..29b810c856da2ba62595bc86b187c7bc8a23647b 100644 (file)
@@ -33,14 +33,14 @@ struct FloatParams {
        ///
        string placement;
        ///
-       bool allow_here_definitely;
+       bool wide;
 };
 
 
 inline
 bool operator==(FloatParams const & p1, FloatParams const & p2)
 {
-       return p1.placement == p2.placement && p1.allow_here_definitely == p2.allow_here_definitely;
+       return p1.placement == p2.placement && p1.wide == p2.wide;
 }
 
 
index 852bae07bd160486f7c134d045ab45ef5e6ee2ba..a0dcd2d2b8a3c27b5a3c07615f584f217c78e709 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-24  Juergen Spitzmueller <j.spitzmueller@gmx.de>
+
+       * FormFloat.C: 
+       * forms/form_float.fd: Implement Wide Float toggle
+
 2002-07-24  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * Menubar_pimpl.C (create_submenu): updates due to changes in
index 79cbf8a13a8b20132736e9ce587555e1e033a8b2..9f6c77191152208e22aed48e22ac43ba792d64fc 100644 (file)
@@ -46,6 +46,7 @@ void FormFloat::build()
        bc().addReadOnly(dialog_->check_page);
        bc().addReadOnly(dialog_->check_here);
        bc().addReadOnly(dialog_->check_here_definitely);
+       bc().addReadOnly(dialog_->check_wide);
 }
 
 
@@ -69,6 +70,7 @@ void FormFloat::apply()
                }
        }
        controller().params().placement = placement;
+       controller().params().wide = fl_get_button(dialog_->check_wide);
 }
 
 
@@ -103,7 +105,8 @@ void FormFloat::update()
        fl_set_button(dialog_->check_page, page);
        fl_set_button(dialog_->check_here, here);
        fl_set_button(dialog_->check_here_definitely, here_definitely);
-       setEnabled(dialog_->check_here_definitely, controller().params().allow_here_definitely);
+       setEnabled(dialog_->check_here_definitely, !controller().params().wide);
+       fl_set_button(dialog_->check_wide, controller().params().wide);
 }
 
 
@@ -121,6 +124,14 @@ ButtonPolicy::SMInput FormFloat::input(FL_OBJECT * ob, long)
                        fl_set_button(dialog_->check_here_definitely, false);
                }
        }
+       if (ob == dialog_->check_wide) {
+               if (fl_get_button(dialog_->check_wide)) {
+                       fl_set_button(dialog_->check_here_definitely, false);
+                       setEnabled(dialog_->check_here_definitely, false);
+               }
+               else
+                       setEnabled(dialog_->check_here_definitely, true);
+       }
 
        return ButtonPolicy::SMI_VALID;
 }
index c61bd1e4eb6e4f90c79361c00ae7aec27c95f852..9b136e1a4007fb06727f8f71f02b5da9edd4e016 100644 (file)
@@ -9,13 +9,13 @@ Unit of measure: FL_COORD_PIXEL
 =============== FORM ===============
 Name: form_float
 Width: 360
-Height: 200
+Height: 240
 Number of Objects: 12
 
 --------------------
 class: FL_BOX
 type: FLAT_BOX
-box: 0 0 360 200
+box: 0 0 360 240
 boxtype: FL_FLAT_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -30,42 +30,6 @@ name:
 callback: 
 argument: 
 
---------------------
-class: FL_FRAME
-type: ENGRAVED_FRAME
-box: 10 100 340 50
-boxtype: FL_NO_BOX
-colors: FL_BLACK FL_COL1
-alignment: FL_ALIGN_CENTER
-style: FL_NORMAL_STYLE
-size: FL_DEFAULT_SIZE
-lcol: FL_BLACK
-label: 
-shortcut: 
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
-name: 
-callback: 
-argument: 
-
---------------------
-class: FL_LABELFRAME
-type: ENGRAVED_FRAME
-box: 10 20 340 80
-boxtype: FL_NO_BOX
-colors: FL_BLACK FL_COL1
-alignment: FL_ALIGN_TOP_LEFT
-style: FL_BOLD_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Placement
-shortcut: 
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
-name: 
-callback: 
-argument: 
-
 --------------------
 class: FL_CHECKBUTTON
 type: PUSH_BUTTON
@@ -159,7 +123,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 10 160 80 30
+box: 10 200 80 30
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -177,7 +141,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: RETURN_BUTTON
-box: 120 160 70 30
+box: 120 200 70 30
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -195,7 +159,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 200 160 70 30
+box: 200 200 70 30
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -213,7 +177,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 280 160 70 30
+box: 280 200 70 30
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -228,5 +192,41 @@ name: button_close
 callback: C_FormBaseCancelCB
 argument: 0
 
+--------------------
+class: FL_CHECKBUTTON
+type: PUSH_BUTTON
+box: 20 160 30 30
+boxtype: FL_NO_BOX
+colors: FL_COL1 FL_YELLOW
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: Wide Float|#W
+shortcut: 
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: check_wide
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_LABELFRAME
+type: ENGRAVED_FRAME
+box: 10 20 340 130
+boxtype: FL_NO_BOX
+colors: FL_BLACK FL_COL1
+alignment: FL_ALIGN_TOP_LEFT
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: Placement
+shortcut: 
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: 
+callback: 
+argument: 
+
 ==============================
 create_the_forms