diff --git a/src/ChangeLog b/src/ChangeLog index 5be52416c4..f4f572de65 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 diff --git a/src/MenuBackend.C b/src/MenuBackend.C index 620501284a..206e880174 100644 --- a/src/MenuBackend.C +++ b/src/MenuBackend.C @@ -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)); } } diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 6b7b88d839..7635b1b40f 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,8 @@ +2002-07-24 Juergen Spitzmueller + + * ControlFloat.[Ch]: Implement Wide Float toggle + Replace "allow_here_definitely" by "wide" + 2002-07-22 Herbert Voss * ControlGraphics.C: small changes diff --git a/src/frontends/controllers/ControlFloat.C b/src/frontends/controllers/ControlFloat.C index a04eb8dd48..c78ca8b671 100644 --- a/src/frontends/controllers/ControlFloat.C +++ b/src/frontends/controllers/ControlFloat.C @@ -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()) {} diff --git a/src/frontends/controllers/ControlFloat.h b/src/frontends/controllers/ControlFloat.h index cf93d6fe16..29b810c856 100644 --- a/src/frontends/controllers/ControlFloat.h +++ b/src/frontends/controllers/ControlFloat.h @@ -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; } diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 852bae07bd..a0dcd2d2b8 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,8 @@ +2002-07-24 Juergen Spitzmueller + + * FormFloat.C: + * forms/form_float.fd: Implement Wide Float toggle + 2002-07-24 Jean-Marc Lasgouttes * Menubar_pimpl.C (create_submenu): updates due to changes in diff --git a/src/frontends/xforms/FormFloat.C b/src/frontends/xforms/FormFloat.C index 79cbf8a13a..9f6c771911 100644 --- a/src/frontends/xforms/FormFloat.C +++ b/src/frontends/xforms/FormFloat.C @@ -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; } diff --git a/src/frontends/xforms/forms/form_float.fd b/src/frontends/xforms/forms/form_float.fd index c61bd1e4eb..9b136e1a40 100644 --- a/src/frontends/xforms/forms/form_float.fd +++ b/src/frontends/xforms/forms/form_float.fd @@ -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