Dekel Tsur wrote: > The harm is that users who don't know latex will be confused by the > outcome. I suggest that selecting wide float should disable the "here" and > "bottom" buttons, but add an "expert mode" button (either in the float > dialog, on in the preferences dialog) that will allow enabling them
I guess you're right. I have disabled them with wide floats. I don't think we need an option to allow them, because they don't make sense anyway (at least until we get complaints). Attached is a patch which renames "Wide" to "Span multiple columns", includes the wide-special-handling and introduces the !-option. It was difficult to get a good name; I think "force" is not clear, so I named it "Ignore internal placing rules" (which is the description in lshort.dvi). Dekel, I have had a look at your patch for #394. IMHO better than a "default" checkbox would be a "default"-button which sets the placement checkboxes to the default values (more informative to the user). Also the default placement should be initially set for new floats. But I don't know how to do this. Do you feel like having a go? Thanks, Juergen.
Index: src/frontends/xforms/ChangeLog =================================================================== RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/ChangeLog,v retrieving revision 1.490 diff -u -r1.490 ChangeLog --- src/frontends/xforms/ChangeLog 2002/07/24 15:37:17 1.490 +++ src/frontends/xforms/ChangeLog 2002/07/24 19:11:28 @@ -1,7 +1,8 @@ 2002-07-24 Juergen Spitzmueller <[EMAIL PROTECTED]> * FormFloat.C: - * forms/form_float.fd: Implement Wide Float toggle + * forms/form_float.fd: Implement Wide Float toggle and !-option; + disable h and b with wide floats 2002-07-24 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> Index: src/frontends/xforms/FormFloat.C =================================================================== RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/FormFloat.C,v retrieving revision 1.11 diff -u -r1.11 FormFloat.C --- src/frontends/xforms/FormFloat.C 2002/07/24 15:37:17 1.11 +++ src/frontends/xforms/FormFloat.C 2002/07/24 19:11:29 @@ -29,7 +29,6 @@ // FIX: Needs to be implemented. (Lgb) // A way to set to float default is missing. -// A way to set "force[!]" is missing. void FormFloat::build() { @@ -45,6 +44,7 @@ bc().addReadOnly(dialog_->check_bottom); bc().addReadOnly(dialog_->check_page); bc().addReadOnly(dialog_->check_here); + bc().addReadOnly(dialog_->check_force); bc().addReadOnly(dialog_->check_here_definitely); bc().addReadOnly(dialog_->check_wide); } @@ -56,6 +56,12 @@ if (fl_get_button(dialog_->check_here_definitely)) { placement += "H"; } else { + if (fl_get_button(dialog_->check_force)) { + placement += "!"; + } + if (fl_get_button(dialog_->check_here)) { + placement += "h"; + } if (fl_get_button(dialog_->check_top)) { placement += "t"; } @@ -65,9 +71,7 @@ if (fl_get_button(dialog_->check_page)) { placement += "p"; } - if (fl_get_button(dialog_->check_here)) { - placement += "h"; - } + } controller().params().placement = placement; controller().params().wide = fl_get_button(dialog_->check_wide); @@ -80,13 +84,18 @@ bool bottom = false; bool page = false; bool here = false; + bool force = false; bool here_definitely = false; string placement(controller().params().placement); if (contains(placement, "H")) { here_definitely = true; + } else { + if (contains(placement, "!")) { + force = true; + } if (contains(placement, "t")) { top = true; } @@ -104,8 +113,15 @@ fl_set_button(dialog_->check_bottom, bottom); fl_set_button(dialog_->check_page, page); fl_set_button(dialog_->check_here, here); + fl_set_button(dialog_->check_force, force); fl_set_button(dialog_->check_here_definitely, here_definitely); setEnabled(dialog_->check_here_definitely, !controller().params().wide); + if (controller().params().wide) { + fl_set_button(dialog_->check_here, false); + fl_set_button(dialog_->check_bottom, false); + } + setEnabled(dialog_->check_here, !controller().params().wide); + setEnabled(dialog_->check_bottom, !controller().params().wide); fl_set_button(dialog_->check_wide, controller().params().wide); } @@ -118,6 +134,7 @@ fl_set_button(dialog_->check_bottom, false); fl_set_button(dialog_->check_page, false); fl_set_button(dialog_->check_here, false); + fl_set_button(dialog_->check_force, false); } } else { if (fl_get_button(dialog_->check_here_definitely)) { @@ -128,9 +145,16 @@ if (fl_get_button(dialog_->check_wide)) { fl_set_button(dialog_->check_here_definitely, false); setEnabled(dialog_->check_here_definitely, false); - } - else + fl_set_button(dialog_->check_here, false); + setEnabled(dialog_->check_here, false); + fl_set_button(dialog_->check_bottom, false); + setEnabled(dialog_->check_bottom, false); + + } else { setEnabled(dialog_->check_here_definitely, true); + setEnabled(dialog_->check_here, true); + setEnabled(dialog_->check_bottom, true); + } } return ButtonPolicy::SMI_VALID; Index: src/frontends/xforms/forms/form_float.fd =================================================================== RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/forms/form_float.fd,v retrieving revision 1.5 diff -u -r1.5 form_float.fd --- src/frontends/xforms/forms/form_float.fd 2002/07/24 15:37:17 1.5 +++ src/frontends/xforms/forms/form_float.fd 2002/07/24 19:11:29 @@ -8,14 +8,14 @@ =============== FORM =============== Name: form_float -Width: 360 -Height: 240 -Number of Objects: 12 +Width: 370 +Height: 280 +Number of Objects: 13 -------------------- class: FL_BOX type: FLAT_BOX -box: 0 0 360 240 +box: 0 0 370 280 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -105,7 +105,7 @@ -------------------- class: FL_CHECKBUTTON type: PUSH_BUTTON -box: 20 110 152 30 +box: 20 145 152 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER @@ -123,7 +123,7 @@ -------------------- class: FL_BUTTON type: NORMAL_BUTTON -box: 10 200 80 30 +box: 10 240 100 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -141,7 +141,7 @@ -------------------- class: FL_BUTTON type: RETURN_BUTTON -box: 120 200 70 30 +box: 130 240 70 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -159,7 +159,7 @@ -------------------- class: FL_BUTTON type: NORMAL_BUTTON -box: 200 200 70 30 +box: 210 240 70 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -177,7 +177,7 @@ -------------------- class: FL_BUTTON type: NORMAL_BUTTON -box: 280 200 70 30 +box: 290 240 70 30 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER @@ -195,14 +195,14 @@ -------------------- class: FL_CHECKBUTTON type: PUSH_BUTTON -box: 20 160 30 30 +box: 20 195 30 30 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE -size: FL_DEFAULT_SIZE +size: FL_NORMAL_SIZE lcol: FL_BLACK -label: Wide Float|#W +label: Span multiple columns|#S shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity @@ -213,7 +213,7 @@ -------------------- class: FL_LABELFRAME type: ENGRAVED_FRAME -box: 10 20 340 130 +box: 10 20 350 160 boxtype: FL_NO_BOX colors: FL_BLACK FL_COL1 alignment: FL_ALIGN_TOP_LEFT @@ -227,6 +227,24 @@ name: callback: argument: + +-------------------- +class: FL_CHECKBUTTON +type: PUSH_BUTTON +box: 20 95 30 30 +boxtype: FL_NO_BOX +colors: FL_COL1 FL_YELLOW +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: Ignore internal placement rules|#g +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: check_force +callback: C_FormBaseInputCB +argument: 0 ============================== create_the_forms