Author-Year/Numerical citation choice only if the natbib checkbox is
active.
+ * FormFloat.[Ch]: added new method input() to control the behaviour of
+ the buttons better.
+ * forms/form_float.fd: renamed Here as button_here_definitely.
+
* FormGraphics.C:
* forms/form_graphics.fd: add callbacks to a few widgets that didn't
have them, so enabling the Ok, Apply buttons appropriately.
// FIX: Needs to be implemented. (Lgb)
// A way to set to float default is missing.
// A way to set "force[!]" is missing.
-// Also there are two groups of buttons [Here] and [top,bottom,page,here],
-// is is not really possible to choose from both groups. So this should
-// be disallowed by the dialog too.
void FormFloat::build()
{
bc().addReadOnly(dialog_->radio_bottom);
bc().addReadOnly(dialog_->radio_page);
bc().addReadOnly(dialog_->radio_here);
- bc().addReadOnly(dialog_->Here);
+ bc().addReadOnly(dialog_->button_here_definitely);
}
void FormFloat::apply()
{
string placement;
- if (fl_get_button(dialog_->Here)) {
+ if (fl_get_button(dialog_->button_here_definitely)) {
placement += "H";
} else {
if (fl_get_button(dialog_->radio_top)) {
bool bottom = false;
bool page = false;
bool here = false;
- bool Here = false;
+ bool here_definitely = false;
string placement(controller().params().placement);
+ std::cerr << "FormFloat::update() " << placement << std::endl;
if (contains(placement, "H")) {
- Here = true;
+ here_definitely = true;
} else {
if (contains(placement, "t")) {
top = true;
fl_set_button(dialog_->radio_bottom, bottom);
fl_set_button(dialog_->radio_page, page);
fl_set_button(dialog_->radio_here, here);
- fl_set_button(dialog_->Here, Here);
-
+ fl_set_button(dialog_->button_here_definitely, here_definitely);
}
+
+ButtonPolicy::SMInput FormFloat::input(FL_OBJECT * ob, long)
+{
+ if (ob == dialog_->button_here_definitely) {
+ if (fl_get_button(dialog_->button_here_definitely)) {
+ fl_set_button(dialog_->radio_top, false);
+ fl_set_button(dialog_->radio_bottom, false);
+ fl_set_button(dialog_->radio_page, false);
+ fl_set_button(dialog_->radio_here, false);
+ }
+ } else {
+ if (fl_get_button(dialog_->button_here_definitely)) {
+ fl_set_button(dialog_->button_here_definitely, false);
+ }
+ }
+}
virtual void build();
/// Update dialog before/whilst showing it.
virtual void update();
+ /// Filter the inputs on callback from xforms
+ virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
/// Fdesign generated method
FD_form_float * build_float();
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ {
+ char const * const dummy = N_("Here, if possible|#i");
+ fdui->radio_here = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 190, 60, 152, 30, idex(_(dummy)));
+ fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+ }
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+ {
+ char const * const dummy = N_("Here, definitely|#H");
+ fdui->button_here_definitely = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 110, 152, 30, idex(_(dummy)));
+ fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+ }
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Cancel|^[");
fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 280, 160, 70, 30, idex(_(dummy)));
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormBaseRestoreCB, 0);
- {
- char const * const dummy = N_("Here, if possible|#i");
- fdui->radio_here = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 190, 60, 152, 30, idex(_(dummy)));
- fl_set_button_shortcut(obj, scex(_(dummy)), 1);
- }
- fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- {
- char const * const dummy = N_("Here, definitely|#H");
- fdui->Here = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 110, 152, 30, idex(_(dummy)));
- fl_set_button_shortcut(obj, scex(_(dummy)), 1);
- }
- fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
fl_end_form();
fdui->form->fdui = fdui;
FL_OBJECT *radio_top;
FL_OBJECT *radio_bottom;
FL_OBJECT *radio_page;
+ FL_OBJECT *radio_here;
+ FL_OBJECT *button_here_definitely;
FL_OBJECT *button_cancel;
FL_OBJECT *button_apply;
FL_OBJECT *button_ok;
FL_OBJECT *button_restore;
- FL_OBJECT *radio_here;
- FL_OBJECT *Here;
};
#endif /* FD_form_float_h_ */
callback: C_FormBaseInputCB
argument: 0
+--------------------
+class: FL_CHECKBUTTON
+type: PUSH_BUTTON
+box: 190 60 152 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: Here, if possible|#i
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: radio_here
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_CHECKBUTTON
+type: PUSH_BUTTON
+box: 20 110 152 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: Here, definitely|#H
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: button_here_definitely
+callback: C_FormBaseInputCB
+argument: 0
+
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
callback: C_FormBaseRestoreCB
argument: 0
---------------------
-class: FL_CHECKBUTTON
-type: PUSH_BUTTON
-box: 190 60 152 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: Here, if possible|#i
-shortcut:
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
-name: radio_here
-callback: C_FormBaseInputCB
-argument: 0
-
---------------------
-class: FL_CHECKBUTTON
-type: PUSH_BUTTON
-box: 20 110 152 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: Here, definitely|#H
-shortcut:
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
-name: Here
-callback: C_FormBaseInputCB
-argument: 0
-
==============================
create_the_forms