Please check the controller stuff. This is new land to me...
There's one problem and a few questions left, though:
The problem:
After changing the type from wide to normal or vice versa, the inset button
(label) gets not updated immediately. I guess an update call is needed. Can
someone have a look please?
Questions:
- I've read in a german float-doc (from Axel Reichert) that the [h]-option is
not allowed with *-floats. Can someone confirm this? If so, we should take
this into account.
- Is there a special reason why force ("!") is not implemented yet? This only
needs to be done in frontends, right? And the exclamation comes always in
first position (!htp, !h, !bp)?
I have not touched the menue entries yet, but I guess the wide ones can go if
this is in.
Thanks,
Juergen
Index: src/frontends/controllers/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/controllers/ChangeLog,v
retrieving revision 1.204
diff -u -r1.204 ChangeLog
--- src/frontends/controllers/ChangeLog 2002/07/22 12:36:40 1.204
+++ src/frontends/controllers/ChangeLog 2002/07/24 13:44:44
@@ -1,3 +1,8 @@
+2002-07-24 Juergen Spitzmueller <[EMAIL PROTECTED]>
+
+ * ControlFloat.[Ch]: Implement Wide Float toggle
+ Replace "allow_here_definitely" by "wide"
+
2002-07-22 Herbert Voss <[EMAIL PROTECTED]>
* ControlGraphics.C: small changes
Index: src/frontends/controllers/ControlFloat.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/controllers/ControlFloat.C,v
retrieving revision 1.8
diff -u -r1.8 ControlFloat.C
--- src/frontends/controllers/ControlFloat.C 2002/06/18 15:44:20 1.8
+++ src/frontends/controllers/ControlFloat.C 2002/07/24 13:44:44
@@ -26,6 +26,7 @@
void ControlFloat::applyParamsToInset()
{
inset()->placement(params().placement);
+ inset()->wide(params().wide);
}
@@ -41,11 +42,11 @@
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: src/frontends/controllers/ControlFloat.h
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/controllers/ControlFloat.h,v
retrieving revision 1.4
diff -u -r1.4 ControlFloat.h
--- src/frontends/controllers/ControlFloat.h 2002/03/21 21:21:27 1.4
+++ src/frontends/controllers/ControlFloat.h 2002/07/24 13:44:44
@@ -33,14 +33,14 @@
///
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: src/frontends/xforms/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/ChangeLog,v
retrieving revision 1.489
diff -u -r1.489 ChangeLog
--- src/frontends/xforms/ChangeLog 2002/07/23 22:42:12 1.489
+++ src/frontends/xforms/ChangeLog 2002/07/24 13:44:52
@@ -1,3 +1,8 @@
+2002-07-24 Juergen Spitzmueller <[EMAIL PROTECTED]>
+
+ * FormFloat.C:
+ * forms/form_float.fd: Implement Wide Float toggle
+
2002-07-24 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
* Menubar_pimpl.C (create_submenu): updates due to changes in
Index: src/frontends/xforms/FormFloat.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/FormFloat.C,v
retrieving revision 1.10
diff -u -r1.10 FormFloat.C
--- src/frontends/xforms/FormFloat.C 2002/07/02 19:23:09 1.10
+++ src/frontends/xforms/FormFloat.C 2002/07/24 13:44:52
@@ -46,6 +46,7 @@
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 @@
}
}
controller().params().placement = placement;
+ controller().params().wide = fl_get_button(dialog_->check_wide);
}
@@ -103,7 +105,8 @@
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);
}
@@ -120,6 +123,14 @@
if (fl_get_button(dialog_->check_here_definitely)) {
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: src/frontends/xforms/forms/form_float.fd
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/forms/form_float.fd,v
retrieving revision 1.4
diff -u -r1.4 form_float.fd
--- src/frontends/xforms/forms/form_float.fd 2002/03/12 14:11:15 1.4
+++ src/frontends/xforms/forms/form_float.fd 2002/07/24 13:44:53
@@ -9,13 +9,13 @@
=============== 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
@@ -31,42 +31,6 @@
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
box: 20 30 152 30
@@ -159,7 +123,7 @@
--------------------
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 @@
--------------------
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 @@
--------------------
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 @@
--------------------
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
@@ -227,6 +191,42 @@
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