+2002-03-08 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * ui/default.ui: add a toggle-tooltips item to the Help menu.
+
2002-03-08 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* tex/ejour2.cls:
# HELP MENU
#
Menu "help"
+ Item "What's This|W" "toggle-tooltips"
Item "Introduction|I" "help-open Intro"
Item "Tutorial|T" "help-open Tutorial"
Item "User's Guide|U" "help-open UserGuide"
+2002-03-08 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * commandtags.h:
+ * LyXAction.C: add LFUN_TOOLTIPS_TOGGLE, "toggle-tooltips"
+ * lyxfunc.C (getStatus(LFUN_TOOLTIPS_TOGGLE)): set flag based on
+ value of Dialogs::tooltipsEnabled().
+ (dispatch(LFUN_TOOLTIPS_TOGGLE)): emit signal Dialogs::toggleTooltips.
+
2002-03-08 Juergen Vigna <jug@sad.it>
* BufferView_pimpl.C (updateInset): update inset inside inset also
N_("Show the processes forked by LyX"), NoBuffer },
{ LFUN_FORKS_KILL, "kill-forks",
N_("Kill the forked process with this PID"), NoBuffer },
+ { LFUN_TOOLTIPS_TOGGLE, "toggle-tooltips", "", NoBuffer },
{ LFUN_NOACTION, "", "", Noop }
};
LFUN_HELP_TEXINFO, // Herbert 20011001
LFUN_FORKS_SHOW, // Angus 16 Feb 2002
LFUN_FORKS_KILL, // Angus 16 Feb 2002
+ LFUN_TOOLTIPS_TOGGLE, // Angus 8 Mar 2002
LFUN_LASTACTION /* this marks the end of the table */
};
+2002-03-08 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * Dialogs.[Ch]: add static signal toggleTooltips and
+ static method tooltipsEnabled.
+
2002-03-04 Angus Leeming <a.leeming@ic.ac.uk>
* Dialogs.h:
// E.g., when the GUI colours have been remapped.
SigC::Signal0<void> Dialogs::redrawGUI;
+
+// toggle tooltips on/off in all dialogs.
+SigC::Signal0<void> Dialogs::toggleTooltips;
+
void Dialogs::add(DialogBase * ptr)
{
lyx::Assert(ptr);
have been re-mapped. */
static SigC::Signal0<void> redrawGUI;
+ /// Toggle tooltips on/off in all dialogs.
+ static SigC::Signal0<void> toggleTooltips;
+
+ /// Are the tooltips on or off?
+ static bool tooltipsEnabled();
+
/**@name Global Hide and Update Signals */
//@{
/// Hide all visible dialogs
+2002-03-08 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * FeedbackController.[Ch]: new files, providing a standard interface to
+ the feedback and warning messages. Created by stripping code out of
+ FormBase.
+
+ * FormBase.[Ch]: strip out all the feedback code and simplify yet
+ further the tooltips code.
+
+ * FormBase.[Ch]:
+ * FormBaseDeprecated.[Ch]: Add a Tooltips pointer.
+ Derive both classes from FeedbackController so daughter classes each
+ have a common interface for same.
+
+ * Toolbar_pimpl.[Ch]: strip out all the tooltip code and use the
+ Tooltips wrapper class.
+
+ * Tooltips.[Ch]: work out how to update tooltips when using
+ xforms 0.89's fl_set_object_helper. Can now toggle tooltips with both
+ xforms 0.88 and 0.89. Change the cursor to a "?" when in query mode
+ and when the dialog has some tooltips.
+
+ * FormPreferences.[Ch]: strip out all the feedback code and use
+ the FeedbackController.
+
+ * xforms_helpers.C: save the color of the gui pointer.
+
+ * FormBibtex.[Ch]:
+ * forms/form_bibtex.fd:
+ * FormCitation.[Ch]:
+ * forms/form_citation.fd:
+ * FormForks.[Ch]:
+ * forms/form_forks.fd:
+ * FormSendto.[Ch]:
+ * forms/form_sendto.fd:
+ * FormTexinfo.[Ch]:
+ * forms/form_texinfo.fd: remove "Help" button and rejig for much
+ simplified tooltips code.
+
+ * Makefile.am: add FeedbackController.[Ch].
+
2002-03-08 Juergen Spitzmueller <j.spitzmueller@gmx.de>
* FormGraphics.C: Tiny stylistic correction.
#include "FormPreferences.h"
#include "FormTabular.h"
+#include "Tooltips.h"
+
+/// Are the tooltips on or off?
+bool Dialogs::tooltipsEnabled()
+{
+ return Tooltips::enabled();
+}
+
Dialogs::Dialogs(LyXView * lv)
{
--- /dev/null
+/*
+ * \file FeedbackController.C
+ * Copyright 2002 the LyX Team
+ * Read the file COPYING
+ *
+ * \author Angus Leeming, a.leeming@ic.ac.uk
+ *
+ * A common interface for posting feedback messages to a message widget in
+ * xforms.
+ * Derive FormBase and FormBaseDeprecated from it, so daughter classes of
+ * either can interface tooltips in the same way.
+ */
+
+#include <config.h>
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+#include "FeedbackController.h"
+#include "gettext.h" // _()
+#include "xforms_helpers.h" // formatted
+#include "support/LAssert.h"
+
+FeedbackController::FeedbackController()
+ : warning_posted_(false)
+{}
+
+
+FeedbackController::~FeedbackController()
+{}
+
+
+void FeedbackController::setMessageWidget(FL_OBJECT * ob)
+{
+ lyx::Assert(ob && ob->objclass == FL_TEXT);
+ message_widget_ = ob;
+}
+
+
+// preemptive handler for feedback messages
+void FeedbackController::MessageCB(FL_OBJECT * ob, int event)
+{
+ lyx::Assert(ob && message_widget_);
+
+ switch (event) {
+ case FL_ENTER:
+ warning_posted_ = false;
+ postMessage(getFeedback(ob));
+ break;
+
+ case FL_LEAVE:
+ if (!warning_posted_)
+ fl_set_object_label(message_widget_, "");
+ break;
+
+ default:
+ break;
+ }
+}
+
+
+void FeedbackController::PrehandlerCB(FL_OBJECT * ob, int event, int key)
+{
+ if (event == FL_PUSH && key == 2 && ob->objclass == FL_INPUT) {
+ // Trigger an input event when pasting in an xforms input object
+ // using the middle mouse button.
+ InputCB(ob, 0);
+
+ } else if (event == FL_ENTER || event == FL_LEAVE){
+ // Post feedback as the mouse enters the object,
+ // remove it as the mouse leaves.
+ MessageCB(ob, event);
+ }
+}
+
+
+void FeedbackController::postWarning(string const & warning)
+{
+ lyx::Assert(message_widget_);
+
+ warning_posted_ = true;
+
+ string const str = _("WARNING! ") + warning;
+ postMessage(str);
+}
+
+
+void FeedbackController::postMessage(string const & message)
+{
+ string const str = formatted(message,
+ message_widget_->w-10, FL_SMALL_SIZE);
+
+ fl_set_object_label(message_widget_, str.c_str());
+ fl_set_object_lsize(message_widget_, FL_SMALL_SIZE);
+}
--- /dev/null
+// -*- C++ -*-
+/*
+ * \file FeedbackController.h
+ * Copyright 2002 the LyX Team
+ * Read the file COPYING
+ *
+ * \author Angus Leeming, a.leeming@ic.ac.uk
+ *
+ * A common interface for posting feedback messages to a message widget in
+ * xforms.
+ * Derive FormBase and FormBaseDeprecated from it, so daughter classes of
+ * either can interface tooltips in the same way.
+ */
+
+#ifndef FEEDBACKCONTROLLER_H
+#define FEEDBACKCONTROLLER_H
+
+#include FORMS_H_LOCATION
+#include "LString.h"
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+class FeedbackController
+{
+public:
+ ///
+ FeedbackController();
+ ///
+ virtual ~FeedbackController();
+
+ /** Input callback function, invoked only by the xforms callback
+ interface. Is defined by FormBase, FormBaseDeprecated. */
+ virtual void InputCB(FL_OBJECT *, long) = 0;
+
+ /** Message callback function, invoked only by the xforms callback
+ interface */
+ void MessageCB(FL_OBJECT *, int event);
+
+ /** Prehandler callback function, invoked only by the xforms callback
+ interface */
+ void PrehandlerCB(FL_OBJECT * ob, int event, int key);
+
+protected:
+ /** Pass the class a pointer to the message_widget so that it can
+ post the message */
+ void setMessageWidget(FL_OBJECT * message_widget);
+
+ /** Send the warning message from the daughter class to the
+ message_widget direct. The message will persist till the mouse
+ movesto a new object. */
+ void postWarning(string const & warning);
+
+private:
+ /** Get the feedback message for ob.
+ Called if warning_posted_ == false. */
+ virtual string const getFeedback(FL_OBJECT * /* ob */)
+ { return string(); }
+
+ /// Post the feedback message for ob to message_widget_
+ void postMessage(string const & message);
+
+ /** Variable used to decide whether to remove the existing feedback
+ message or not (if it is in fact a warning) */
+ bool warning_posted_;
+
+ /// The widget to display the feedback
+ FL_OBJECT * message_widget_;
+};
+
+#endif // FEEDBACKCONTROLLER_H
#include "FormBase.h"
#include "xformsBC.h"
#include "GUIRunTime.h"
-#include "support/LAssert.h"
#include "Tooltips.h"
-#include "xforms_helpers.h" // formatted
+#include "support/LAssert.h"
extern "C" {
// Callback function invoked by xforms when the dialog is closed by the
// window manager
-static int C_FormBaseWMHideCB(FL_FORM * form, void *);
+static int C_WMHideCB(FL_FORM * form, void *);
-// Use this to diaplay feedback messages or to trigger an input event on paste
-// with the middle mouse button
-static int C_FormBasePrehandler(FL_OBJECT * ob, int event,
- FL_Coord, FL_Coord, int key, void *);
+// Callback function invoked by the xforms pre- and post-handler routines
+static int C_PrehandlerCB(FL_OBJECT *, int, FL_Coord, FL_Coord, int, void *);
} // extern "C"
FormBase::FormBase(ControlButtons & c, string const & t, bool allowResize)
: ViewBC<xformsBC>(c), minw_(0), minh_(0), allow_resize_(allowResize),
- title_(t), warning_posted_(false), tooltip_level_(NO_TOOLTIP)
+ title_(t), tooltips_(new Tooltips)
+{}
+
+FormBase::~FormBase()
{
- tooltip_ = new Tooltips;
- tooltip_->getTooltip.connect(SigC::slot(this, &FormBase::getTooltip));
+ delete tooltips_;
}
-FormBase::~FormBase()
+Tooltips & FormBase::tooltips()
{
- delete tooltip_;
+ return *tooltips_;
}
+
void FormBase::redraw()
{
if (form() && form()->visible)
minw_ = form()->w;
minh_ = form()->h;
- fl_set_form_atclose(form(), C_FormBaseWMHideCB, 0);
+ fl_set_form_atclose(form(), C_WMHideCB, 0);
}
fl_freeze_form(form());
}
+void FormBase::setPrehandler(FL_OBJECT * ob)
+{
+ lyx::Assert(ob);
+ fl_set_object_prehandler(ob, C_PrehandlerCB);
+}
+
+
void FormBase::InputCB(FL_OBJECT * ob, long data)
{
// It is possible to set the choice to 0 when using the
}
-// preemptive handler for feedback messages
-void FormBase::FeedbackCB(FL_OBJECT * ob, int event)
-{
- lyx::Assert(ob);
-
- switch (event) {
- case FL_ENTER:
- warning_posted_ = false;
- feedback(ob);
- break;
-
- case FL_LEAVE:
- if (!warning_posted_)
- clear_feedback();
- break;
-
- default:
- break;
- }
-}
-
-
-void FormBase::setTooltipHandler(FL_OBJECT * ob)
-{
- tooltip_->activateTooltip(ob);
-}
-
-
-string FormBase::getTooltip(FL_OBJECT const * ob)
-{
- lyx::Assert(ob);
-
- switch (tooltip_level_) {
- case VERBOSE_TOOLTIP:
- {
- string str = getVerboseTooltip(ob);
- if (!str.empty())
- return formatted(_(str), 400);
- // else, fall through
- }
-
- case MINIMAL_TOOLTIP:
- return getMinimalTooltip(ob);
-
- case NO_TOOLTIP:
- default:
- return string();
- }
-
-}
-
-
-/// Fill the tooltips chooser with the standard descriptions
-void FormBase::fillTooltipChoice(FL_OBJECT * ob)
-{
- lyx::Assert(ob && ob->objclass == FL_CHOICE);
-
- fl_clear_choice(ob);
- fl_addto_choice(ob, _(" None | Normal | Verbose "));
-
- switch (tooltip_level_) {
- case NO_TOOLTIP:
- fl_set_choice(ob, 1);
- break;
- case MINIMAL_TOOLTIP:
- fl_set_choice(ob, 2);
- break;
- case VERBOSE_TOOLTIP:
- fl_set_choice(ob, 3);
- break;
- }
-}
-
-
-void FormBase::setTooltipLevel(FL_OBJECT * ob)
-{
- lyx::Assert(ob && ob->objclass == FL_CHOICE &&
- fl_get_choice_maxitems(ob) == 3);
-
- switch (fl_get_choice(ob)) {
- case 1:
- tooltip_level_ = NO_TOOLTIP;
- break;
- case 2:
- tooltip_level_ = MINIMAL_TOOLTIP;
- break;
- case 3:
- tooltip_level_ = VERBOSE_TOOLTIP;
- break;
- }
-}
-
-
-void FormBase::setPrehandler(FL_OBJECT * ob)
-{
- lyx::Assert(ob);
- fl_set_object_prehandler(ob, C_FormBasePrehandler);
-}
-
-
-void FormBase::setWarningPosted(bool warning)
-{
- warning_posted_ = warning;
-}
-
-
namespace {
FormBase * GetForm(FL_OBJECT * ob)
{
lyx::Assert(ob && ob->form && ob->form->u_vdata);
- FormBase * pre = static_cast<FormBase *>(ob->form->u_vdata);
- return pre;
+ FormBase * ptr = static_cast<FormBase *>(ob->form->u_vdata);
+ return ptr;
}
} // namespace anon
}
-static int C_FormBaseWMHideCB(FL_FORM * form, void *)
+static int C_WMHideCB(FL_FORM * form, void *)
{
// Close the dialog cleanly, even if the WM is used to do so.
lyx::Assert(form && form->u_vdata);
- FormBase * pre = static_cast<FormBase *>(form->u_vdata);
- pre->CancelButton();
+ FormBase * ptr = static_cast<FormBase *>(form->u_vdata);
+ ptr->CancelButton();
return FL_CANCEL;
}
-
-static int C_FormBasePrehandler(FL_OBJECT * ob, int event,
- FL_Coord, FL_Coord, int key, void *)
+static int C_PrehandlerCB(FL_OBJECT * ob, int event,
+ FL_Coord, FL_Coord, int key, void *)
{
// Note that the return value is important in the pre-emptive handler.
// Don't return anything other than 0.
//Assert(ob->form);
if (!ob->form) return 0;
- FormBase * pre = static_cast<FormBase *>(ob->form->u_vdata);
- if (!pre) return 0;
-
- if (event == FL_PUSH && key == 2 && ob->objclass == FL_INPUT) {
- // Trigger an input event when pasting in an xforms input object
- // using the middle mouse button.
- pre->InputCB(ob, 0);
-
- } else if (event == FL_ENTER || event == FL_LEAVE) {
- // Post feedback as the mouse enters the object,
- // remove it as the mouse leaves.
- pre->FeedbackCB(ob, event);
- }
+ FormBase * ptr = static_cast<FormBase *>(ob->form->u_vdata);
+
+ if (ptr)
+ ptr->PrehandlerCB(ob, event, key);
return 0;
}
#include "ViewBase.h"
#include "LString.h"
#include "ButtonPolicies.h"
+#include "FeedbackController.h"
class xformsBC;
class Tooltips;
/** This class is an XForms GUI base class.
*/
-class FormBase : public ViewBC<xformsBC>, public SigC::Object
+class FormBase : public ViewBC<xformsBC>, public FeedbackController
{
public:
- ///
- enum TooltipLevel {
- NO_TOOLTIP,
- MINIMAL_TOOLTIP,
- VERBOSE_TOOLTIP
- };
-
///
FormBase(ControlButtons &, string const &, bool allowResize);
///
virtual ~FormBase();
- /** input callback function.
- Invoked only by C_FormBaseInputCB and by C_FormBasePrehandler */
+ /** input callback function. invoked only by the xforms callback
+ interface */
void InputCB(FL_OBJECT *, long);
- /// feedback callback function, invoked only by C_FormBasePrehandler
- void FeedbackCB(FL_OBJECT *, int event);
- /** Return the tooltip dependent on the value of tooltip_level_
- currently non-const becuase it gets connected to a SigC::slot */
- string getTooltip(FL_OBJECT const *);
+ Tooltips & tooltips();
protected:
/// Build the dialog
/// Create the dialog if necessary, update it and display it.
void show();
- /// Prepare the way to produce a tooltip when the mouse is over ob.
- void setTooltipHandler(FL_OBJECT * ob);
-
/** Prepare the way to:
1. display feedback as the mouse moves over ob. This feedback will
typically be rather more verbose than just a tooltip.
2. activate the button controller after a paste with the middle
- mouse button */
- void setPrehandler(FL_OBJECT * ob);
-
- /** Flag that the message is a warning and should not be removed
- when the mouse is no longer over the object.
- Used in conjunction with setPrehandler(ob) and with feedback(ob),
- clear_feedback(). */
- void setWarningPosted(bool);
-
- /** Fill the tooltips chooser with the standard descriptions
- and set it to the tooltips_level_ */
- void fillTooltipChoice(FL_OBJECT *);
- /// Set tooltips_level_ from the chooser.
- void setTooltipLevel(FL_OBJECT *);
-
+ mouse button.
+ */
+ static void setPrehandler(FL_OBJECT * ob);
+
private:
/// Pointer to the actual instantiation of xform's form
virtual FL_FORM * form() const = 0;
that the xform colors have been re-mapped). */
virtual void redraw();
- /// These methods can be overridden in the daughter classes.
- virtual string const getMinimalTooltip(FL_OBJECT const *) const
- { return string(); }
- virtual string const getVerboseTooltip(FL_OBJECT const *) const
- { return string(); }
-
- /// Post feedback for ob. Defaults to nothing
- virtual void feedback(FL_OBJECT * /* ob */) {}
- /// clear the feedback message
- virtual void clear_feedback() {}
-
/// The dialog's minimum allowable dimensions.
int minw_;
///
bool allow_resize_;
/// dialog title, displayed by WM.
string title_;
- /** Variable used to decide whether to remove the existing feedback
- message or not (if it is infact a warning) */
- bool warning_posted_;
///
- Tooltips * tooltip_;
- /// How verbose are the tooltips?
- TooltipLevel tooltip_level_;
+ Tooltips * tooltips_;
};
#include "Dialogs.h"
#include "FormBaseDeprecated.h"
-#include "LyXView.h"
-#include "GUIRunTime.h"
-#include "support/LAssert.h"
#include "xformsBC.h"
+#include "GUIRunTime.h"
+#include "Tooltips.h"
+#include "LyXView.h"
#include "lyxrc.h"
+#include "support/LAssert.h"
using SigC::slot;
// Callback function invoked by xforms when the dialog is closed by the
// window manager
-static int C_FormBaseDeprecatedWMHideCB(FL_FORM *, void *);
-
+static int C_WMHideCB(FL_FORM *, void *);
+
+// Callback function invoked by the xforms pre- and post-handler routines
+static int C_PrehandlerCB(FL_OBJECT *, int, FL_Coord, FL_Coord, int, void *);
+
} // extern "C"
FormBaseDeprecated::FormBaseDeprecated(LyXView * lv, Dialogs * d,
string const & t, bool allowResize)
: lv_(lv), d_(d), h_(0), r_(0), title_(t),
- minw_(0), minh_(0), allow_resize_(allowResize)
+ minw_(0), minh_(0), allow_resize_(allowResize),
+ tooltips_(new Tooltips)
{
lyx::Assert(lv && d);
}
+FormBaseDeprecated::~FormBaseDeprecated()
+{
+ delete tooltips_;
+}
+
+
+Tooltips & FormBaseDeprecated::tooltips()
+{
+ return *tooltips_;
+}
+
+
void FormBaseDeprecated::redraw()
{
if (form() && form()->visible)
minw_ = form()->w;
minh_ = form()->h;
- fl_set_form_atclose(form(),
- C_FormBaseDeprecatedWMHideCB, 0);
+ fl_set_form_atclose(form(), C_WMHideCB, 0);
}
fl_freeze_form(form());
}
-int FormBaseDeprecated::WMHideCB(FL_FORM * form, void *)
+void FormBaseDeprecated::setPrehandler(FL_OBJECT * ob)
{
- lyx::Assert(form);
- // Ensure that the signals (u and h) are disconnected even if the
- // window manager is used to close the dialog.
- FormBaseDeprecated * pre =
- static_cast<FormBaseDeprecated*>(form->u_vdata);
- lyx::Assert(pre);
- pre->hide();
- pre->bc().hide();
- return FL_CANCEL;
+ lyx::Assert(ob);
+ fl_set_object_prehandler(ob, C_PrehandlerCB);
}
-void FormBaseDeprecated::ApplyCB(FL_OBJECT * ob, long)
+void FormBaseDeprecated::WMHideCB()
{
- lyx::Assert(ob && ob->form);
- FormBaseDeprecated * pre =
- static_cast<FormBaseDeprecated*>(ob->form->u_vdata);
- lyx::Assert(pre);
- pre->apply();
- pre->bc().apply();
+ hide();
+ bc().hide();
}
-void FormBaseDeprecated::OKCB(FL_OBJECT * ob, long)
+void FormBaseDeprecated::ApplyCB()
{
- lyx::Assert(ob && ob->form);
- FormBaseDeprecated * pre =
- static_cast<FormBaseDeprecated*>(ob->form->u_vdata);
- lyx::Assert(pre);
- pre->ok();
- pre->bc().ok();
+ apply();
+ bc().apply();
}
-void FormBaseDeprecated::CancelCB(FL_OBJECT * ob, long)
+void FormBaseDeprecated::OKCB()
{
- lyx::Assert(ob && ob->form);
- FormBaseDeprecated * pre =
- static_cast<FormBaseDeprecated*>(ob->form->u_vdata);
- lyx::Assert(pre);
- pre->cancel();
- pre->bc().cancel();
+ ok();
+ bc().ok();
}
-void FormBaseDeprecated::InputCB(FL_OBJECT * ob, long data)
+void FormBaseDeprecated::CancelCB()
{
- lyx::Assert(ob && ob->form);
- FormBaseDeprecated * pre =
- static_cast<FormBaseDeprecated*>(ob->form->u_vdata);
- lyx::Assert(pre);
+ cancel();
+ bc().cancel();
+}
+
+void FormBaseDeprecated::InputCB(FL_OBJECT * ob, long data)
+{
// It is possible to set the choice to 0 when using the
// keyboard shortcuts. This work-around deals with the problem.
if (ob && ob->objclass == FL_CHOICE && fl_get_choice(ob) < 1) {
fl_set_choice(ob, 1);
}
- pre->bc().valid(pre->input(ob, data));
+ bc().valid(input(ob, data));
}
-void FormBaseDeprecated::RestoreCB(FL_OBJECT * ob, long)
+void FormBaseDeprecated::RestoreCB()
{
- lyx::Assert(ob && ob->form);
- FormBaseDeprecated * pre =
- static_cast<FormBaseDeprecated*>(ob->form->u_vdata);
- lyx::Assert(pre);
- pre->bc().restore();
- pre->restore();
+ bc().restore();
+ restore();
}
}
-extern "C" {
-
-static int C_FormBaseDeprecatedWMHideCB(FL_FORM * ob, void * d)
+namespace {
+
+FormBaseDeprecated * GetForm(FL_OBJECT * ob)
{
- return FormBaseDeprecated::WMHideCB(ob, d);
+ lyx::Assert(ob && ob->form && ob->form->u_vdata);
+ FormBaseDeprecated * ptr =
+ static_cast<FormBaseDeprecated *>(ob->form->u_vdata);
+ return ptr;
}
+} // namespace anon
-void C_FormBaseDeprecatedApplyCB(FL_OBJECT * ob, long d)
+
+extern "C" {
+
+void C_FormBaseDeprecatedApplyCB(FL_OBJECT * ob, long)
{
- FormBaseDeprecated::ApplyCB(ob, d);
+ GetForm(ob)->ApplyCB();
}
-void C_FormBaseDeprecatedOKCB(FL_OBJECT * ob, long d)
+void C_FormBaseDeprecatedOKCB(FL_OBJECT * ob, long)
{
- FormBaseDeprecated::OKCB(ob, d);
+ GetForm(ob)->OKCB();
}
-void C_FormBaseDeprecatedCancelCB(FL_OBJECT * ob, long d)
+void C_FormBaseDeprecatedCancelCB(FL_OBJECT * ob, long)
{
- FormBaseDeprecated::CancelCB(ob, d);
+ GetForm(ob)->CancelCB();
}
void C_FormBaseDeprecatedInputCB(FL_OBJECT * ob, long d)
{
- FormBaseDeprecated::InputCB(ob, d);
+ GetForm(ob)->InputCB(ob, d);
}
-void C_FormBaseDeprecatedRestoreCB(FL_OBJECT * ob, long d)
+void C_FormBaseDeprecatedRestoreCB(FL_OBJECT * ob, long)
{
- FormBaseDeprecated::RestoreCB(ob, d);
+ GetForm(ob)->RestoreCB();
}
-} // extern "C"
+static int C_WMHideCB(FL_FORM * form, void *)
+{
+ // Close the dialog cleanly, even if the WM is used to do so.
+ lyx::Assert(form && form->u_vdata);
+ FormBaseDeprecated * ptr =
+ static_cast<FormBaseDeprecated *>(form->u_vdata);
+ ptr->WMHideCB();
+ return FL_CANCEL;
+}
+
+static int C_PrehandlerCB(FL_OBJECT * ob, int event,
+ FL_Coord, FL_Coord, int key, void *)
+{
+ // Note that the return value is important in the pre-emptive handler.
+ // Don't return anything other than 0.
+ lyx::Assert(ob);
+
+ // Don't Assert this one, as it can happen quite naturally when things
+ // are being deleted in the d-tor.
+ //Assert(ob->form);
+ if (!ob->form) return 0;
+ FormBaseDeprecated * ptr =
+ static_cast<FormBaseDeprecated *>(ob->form->u_vdata);
+
+ if (ptr)
+ ptr->PrehandlerCB(ob, event, key);
+
+ return 0;
+}
+
+} // extern "C"
#include "DialogBase.h"
#include "LString.h"
#include "xformsBC.h"
+#include "FeedbackController.h"
class Buffer;
class Dialogs;
class LyXView;
+class Tooltips;
/** This class is an XForms GUI base class.
It is meant to be used solely as the parent class to FormBaseBI
@author Angus Leeming
*/
-class FormBaseDeprecated : public DialogBase {
+class FormBaseDeprecated : public DialogBase, public FeedbackController
+{
public:
+ ///
+ FormBaseDeprecated(LyXView *, Dialogs *, string const &, bool);
+ ///
+ virtual ~FormBaseDeprecated();
+
/// Callback functions
- static int WMHideCB(FL_FORM *, void *);
+ void WMHideCB();
///
- static void ApplyCB(FL_OBJECT *, long);
+ void ApplyCB();
///
- static void OKCB(FL_OBJECT *, long);
+ void OKCB();
///
- static void CancelCB(FL_OBJECT *, long);
+ void CancelCB();
///
- static void InputCB(FL_OBJECT *, long);
+ void InputCB(FL_OBJECT *, long);
///
- static void RestoreCB(FL_OBJECT *, long);
+ void RestoreCB();
+
+ Tooltips & tooltips();
protected: // methods
- ///
- FormBaseDeprecated(LyXView *, Dialogs *, string const &, bool);
- ///
- virtual ~FormBaseDeprecated() {}
/// Pointer to the actual instantiation of the ButtonController.
virtual xformsBC & bc() = 0;
/// Pointer to the actual instantiation of xform's form
virtual FL_FORM * form() const = 0;
+ /** Prepare the way to:
+ 1. display feedback as the mouse moves over ob. This feedback will
+ typically be rather more verbose than just a tooltip.
+ 2. activate the button controller after a paste with the middle
+ mouse button.
+ */
+ static void setPrehandler(FL_OBJECT * ob);
+
/** Which LyXFunc do we use?
We could modify Dialogs to have a visible LyXFunc* instead and
save a couple of bytes per dialog.
int minh_;
/// Can the dialog be resized after it has been created?
bool allow_resize_;
+ ///
+ Tooltips * tooltips_;
};
#include "ControlBibtex.h"
#include "FormBibtex.h"
#include "form_bibtex.h"
-#include "gettext.h"
-#include "debug.h"
+#include "Tooltips.h"
#include "xforms_helpers.h"
#include "helper_funcs.h"
+#include "gettext.h"
+#include "debug.h"
#include "support/LAssert.h"
#include "support/lstrings.h"
#include "support/filetools.h"
{
dialog_.reset(build_bibtex());
- // the help choice
- fillTooltipChoice(dialog_->choice_help);
fl_set_input_return(dialog_->database, FL_RETURN_CHANGED);
fl_set_input_return(dialog_->style, FL_RETURN_CHANGED);
bc().addReadOnly(dialog_->style);
bc().addReadOnly(dialog_->radio_bibtotoc);
- // set up the help mechanism
- setTooltipHandler(dialog_->database_browse);
- setTooltipHandler(dialog_->database);
- setTooltipHandler(dialog_->style_browse);
- setTooltipHandler(dialog_->style);
- setTooltipHandler(dialog_->radio_bibtotoc);
+ // set up the tooltips
+ string str = N_("The database you want to cite from. Insert it without the default extension \".bib\". If you insert it with the browser, LyX strips the extension. Several databases must be separated by a comma: \"natbib, books\".");
+ tooltips().initTooltip(dialog_->database_browse, str);
+
+ str = N_("Browse your directory for BibTeX stylefiles.");
+ tooltips().initTooltip(dialog_->style_browse, str);
+
+ str = N_("The BibTeX style to use (only one allowed). Insert it without the default extension \".bst\" and without path. Most of the bibstyles are stored in $TEXMF/bibtex/bst. $TEXMF is the root dir of the local TeX tree. In \"Help->TeX Info\" you can list all installed styles.");
+ tooltips().initTooltip(dialog_->style, str);
+
+ str = N_("Activate this option if you want the bibliography to appear in the Table of Contents (which doesn't happen by default).");
+ tooltips().initTooltip(dialog_->radio_bibtotoc, str);
}
}
}
- if (ob == dialog_->choice_help) {
- setTooltipLevel(dialog_->choice_help);
- return ButtonPolicy::SMI_NOOP;
- }
-
if (!compare(fl_get_input(dialog_->database),"")) {
return ButtonPolicy::SMI_NOOP;
}
controller().params().setOptions(bibstyle);
}
}
-
-
-string const FormBibtex::getMinimalTooltip(FL_OBJECT const * ob) const
-{
- string str;
-
- if (ob == dialog_->database) {
- str = N_("The BibTeX Database");
-
- } else if (ob == dialog_->database_browse) {
- str = _("Browse for BibTeX databases.");
-
- } else if (ob == dialog_->style) {
- str = _("The BibTeX style to use");
-
- } else if (ob == dialog_->style_browse) {
- str = _("Browse for BibTeX stylefiles.");
-
- } else if (ob == dialog_->radio_bibtotoc) {
- str = _("Bibliography to Table of Contents");
- }
-
- return str;
-}
-
-string const FormBibtex::getVerboseTooltip(FL_OBJECT const * ob) const
-{
- string str;
-
- if (ob == dialog_->database) {
- str = N_("The database you want to cite from. Insert it without the default extension \".bib\". If you insert it with the browser, LyX strips the extension. Several databases must be separated by a comma: \"natbib, books\".");
-
- } else if (ob == dialog_->database_browse) {
- str = _("Browse your directory for BibTeX databases.");
-
- } else if (ob == dialog_->style) {
- str = _("The BibTeX style to use (only one allowed). Insert it without the default extension \".bst\" and without path. Most of the bibstyles are stored in $TEXMF/bibtex/bst. $TEXMF is the root dir of the local TeX tree. In \"Help->TeX Info\" you can list all installed styles.");
-
- } else if (ob == dialog_->style_browse) {
- str = _("Browse your directory for BibTeX stylefiles.");
-
- } else if (ob == dialog_->radio_bibtotoc) {
- str = _("Activate this option if you want the bibliography to appear in the Table of Contents (which doesn't happen by default).");
- }
-
- return str;
-}
virtual void update();
/// Filter the inputs on callback from xforms
virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
- /// tooltips
- string const getVerboseTooltip(FL_OBJECT const *) const;
- ///
- string const getMinimalTooltip(FL_OBJECT const *) const;
/// Fdesign generated method
FD_form_bibtex * build_bibtex();
#include "ControlCitation.h"
#include "FormCitation.h"
#include "form_citation.h"
+#include "Tooltips.h"
+#include "helper_funcs.h"
+#include "xforms_helpers.h"
#include "gettext.h"
#include "support/LAssert.h"
#include "support/lstrings.h"
-#include "helper_funcs.h"
-#include "xforms_helpers.h"
using std::find;
using std::max;
fl_set_button(dialog_->button_search_case, 0);
fl_set_button(dialog_->button_search_type, 0);
- // the help choice
- fillTooltipChoice(dialog_->choice_help);
// Manage the ok, apply, restore and cancel/close buttons
bc().setOK(dialog_->button_ok);
bc().addReadOnly(dialog_->button_force_uppercase);
//set up the tooltip mechanism
- setTooltipHandler(dialog_->button_add);
- setTooltipHandler(dialog_->button_del);
- setTooltipHandler(dialog_->button_up);
- setTooltipHandler(dialog_->button_down);
- setTooltipHandler(dialog_->choice_style);
- setTooltipHandler(dialog_->input_before);
- setTooltipHandler(dialog_->input_after);
- setTooltipHandler(dialog_->button_full_author_list);
- setTooltipHandler(dialog_->button_force_uppercase);
- setTooltipHandler(dialog_->input_search);
- setTooltipHandler(dialog_->button_search_case);
- setTooltipHandler(dialog_->button_search_type);
- setTooltipHandler(dialog_->button_previous);
- setTooltipHandler(dialog_->button_next);
+ string str = N_("Add the selected entry to the current citation reference.");
+ tooltips().initTooltip(dialog_->button_add, str);
+
+ str = N_("Delete the selected entry from the current citation reference.");
+ tooltips().initTooltip(dialog_->button_del, str);
+
+ str = N_("Move the selected entry upwards (in the current list).");
+ tooltips().initTooltip(dialog_->button_up, str);
+
+ str = N_("Move the selected entry downwards (in the current list).");
+ tooltips().initTooltip(dialog_->button_down, str);
+
+ str = N_("The entries which will be cited. Select them with the arrow buttons from the right browser window.");
+ tooltips().initTooltip(dialog_->browser_cite, str);
+
+ str = N_("All entries in the database you have loaded (via \"Insert->Lists&TOC->BibTex Reference\"). Move the ones you want to cite with the arrow buttons into the left browser window.");
+ tooltips().initTooltip(dialog_->browser_bib, str);
+
+ str = N_("Information about the selected entry");
+ tooltips().initTooltip(dialog_->browser_info, str);
+
+ str = N_("Here you may select how the citation label should look inside the text (Natbib).");
+ tooltips().initTooltip(dialog_->choice_style, str);
+
+ str = N_("Activate if you want to print all authors in a reference with more than three authors, and not \"<First Author> et.al.\" (Natbib).");
+ tooltips().initTooltip(dialog_->button_full_author_list, str);
+
+ str = N_("Activate if you want to print the first character of the author name as uppercase (\"Van Gogh\", not \"van Gogh\"). Useful at the beginning of sentences (Natbib).");
+ tooltips().initTooltip(dialog_->button_force_uppercase, str);
+
+ str = N_("Optional text which appears before the citation reference, e.g. \"see <Ref>\"");
+ tooltips().initTooltip(dialog_->input_before, str);
+
+ str = N_("Optional text which appears after the citation reference, e.g. \"pp. 12\"");
+ tooltips().initTooltip(dialog_->input_after, str);
+
+ str = N_("Search your database (all fields will be searched).");
+ tooltips().initTooltip(dialog_->input_search, str);
+
+ str = N_("Activate if you want to have case sensitive search: \"bibtex\" finds \"bibtex\", but not \"BibTeX\".");
+ tooltips().initTooltip(dialog_->button_search_case, str);
+
+ str = N_("Activate if you want to enter Regular Expressions.");
+ tooltips().initTooltip(dialog_->button_search_type, str);
}
activate = ButtonPolicy::SMI_VALID;
}
- if (ob == dialog_->choice_help) {
- setTooltipLevel(dialog_->choice_help);
- return ButtonPolicy::SMI_NOOP;
- }
-
string currentCitekey;
if (!citekeys.empty())
currentCitekey = citekeys[0];
setEnabled(dialog_->button_up, activate_up);
setEnabled(dialog_->button_down, activate_down);
}
-
-
-string const FormCitation::getMinimalTooltip(FL_OBJECT const * ob) const
-{
- string str;
-
- if (ob == dialog_->button_add) {
- str = N_("Add entry");
-
- } else if (ob == dialog_->button_del) {
- str = _("Delete entry");
-
- } else if (ob == dialog_->button_up) {
- str = _("Move entry up");
-
- } else if (ob == dialog_->button_down) {
- str = _("Move entry down");
-
- } else if (ob == dialog_->choice_style) {
- str = N_("Natbib Citation Style");
-
- } else if (ob == dialog_->button_full_author_list) {
- str = N_("List all authors");
-
- } else if (ob == dialog_->button_force_uppercase) {
- str = N_("Author Name begins with uppercase");
-
- } else if (ob == dialog_->input_before) {
- str = N_("Optional text before");
-
- } else if (ob == dialog_->input_after) {
- str = N_("Optional text after");
-
- } else if (ob == dialog_->input_search) {
- str = N_("Search the database");
-
- } else if (ob == dialog_->button_search_case) {
- str = N_("Case sensitive search");
-
- } else if (ob == dialog_->button_search_type) {
- str = N_("Use Regular Expressions.");
-
- } else if (ob == dialog_->button_previous) {
- str = N_("Search Backwards");
-
- } else if (ob == dialog_->button_next) {
- str = N_("Search Forwards");
- }
-
- return str;
-}
-
-
-string const FormCitation::getVerboseTooltip(FL_OBJECT const * ob) const
-{
- string str;
-
- if (ob == dialog_->button_add) {
- str = N_("Add the selected entry to the current citation reference.");
-
- } else if (ob == dialog_->button_del) {
- str = N_("Delete the selected entry from the current citation reference.");
-
- } else if (ob == dialog_->button_up) {
- str = N_("Move the selected entry upwards (in the current list).");
-
- } else if (ob == dialog_->button_down) {
- str = N_("Move the selected entry downwards (in the current list).");
-
- } else if (ob == dialog_->browser_cite) {
- str = N_("The entries which will be cited. Select them with the arrow buttons from the right browser window.");
-
- } else if (ob == dialog_->browser_bib) {
- str = N_("All entries in the database you have loaded (via \"Insert->Lists&TOC->BibTex Reference\"). Move the ones you want to cite with the arrow buttons into the left browser window.");
-
- } else if (ob == dialog_->browser_info) {
- str = N_("Information about the selected entry");
-
- } else if (ob == dialog_->choice_style) {
- str = N_("Here you may select how the citation label should look inside the text (Natbib).");
-
- } else if (ob == dialog_->button_full_author_list) {
- str = N_("Activate if you want to print all authors in a reference with more than three authors, and not \"<First Author> et.al.\" (Natbib).");
-
- } else if (ob == dialog_->button_force_uppercase) {
- str = N_("Activate if you want to print the first character of the author name as uppercase (\"Van Gogh\", not \"van Gogh\"). Useful at the beginning of sentences (Natbib).");
-
- } else if (ob == dialog_->input_before) {
- str = N_("Optional text which appears before the citation reference, e.g. \"see <Ref>\"");
-
- } else if (ob == dialog_->input_after) {
- str = N_("Optional text which appears after the citation reference, e.g. \"pp. 12\"");
-
- } else if (ob == dialog_->input_search) {
- str = N_("Search your database (all fields will be searched).");
-
- } else if (ob == dialog_->button_search_case) {
- str = N_("Activate if you want to have case sensitive search: \"bibtex\" finds \"bibtex\", but not \"BibTeX\".");
-
- } else if (ob == dialog_->button_search_type) {
- str = N_("Activate if you want to enter Regular Expressions.");
- }
-
- return str;
-}
virtual void update();
/// Filter the inputs on callback from xforms
virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
- /// tooltips
- string const getMinimalTooltip(FL_OBJECT const *) const;
- ///
- string const getVerboseTooltip(FL_OBJECT const *) const;
/// Fdesign generated method
FD_form_citation * build_citation();
#include "FormForks.h"
#include "ControlForks.h"
#include "form_forks.h"
-#include "gettext.h"
+#include "Tooltips.h"
#include "helper_funcs.h"
#include "xforms_helpers.h"
+#include "gettext.h"
#include "support/lstrings.h"
using std::vector;
bc().invalid();
// Set up the tooltip mechanism
- setTooltipHandler(dialog_->browser_children);
- setTooltipHandler(dialog_->browser_kill);
- setTooltipHandler(dialog_->button_all);
- setTooltipHandler(dialog_->button_add);
- setTooltipHandler(dialog_->button_remove);
+ string str = N_("All currently running child processes forked by LyX.");
+ tooltips().initTooltip(dialog_->browser_children, str);
+
+ str = N_("A list of all child processes to kill.");
+ tooltips().initTooltip(dialog_->browser_kill, str);
+
+ str = N_("Add all processes to the list of processes to kill.");
+ tooltips().initTooltip(dialog_->button_all, str);
+
+ str = N_("Add the currently selected child process to the list of processes to kill.");
+ tooltips().initTooltip(dialog_->button_add, str);
+
+ str = N_("Remove the currently selected item from the list of processes to kill.");
+ tooltips().initTooltip(dialog_->button_remove, str);
}
return ButtonPolicy::SMI_VALID;
}
-
-
-string const FormForks::getVerboseTooltip(FL_OBJECT const * ob) const
-{
- string str;
-
- if (ob == dialog_->browser_children) {
- str = _("All currently running child processes forked by LyX.");
- } else if (ob == dialog_->browser_kill) {
- str = _("A list of all child processes to kill.");
- } else if (ob == dialog_->button_all) {
- str = _("Add all processes to the list of processes to kill.");
- } else if (ob == dialog_->button_add) {
- str = _("Add the currently selected child process to the list of processes to kill.");
- } else if (ob == dialog_->button_remove) {
- str = _("Remove the currently selected item from the list of processes to kill.");
- }
-
- return str;
-}
-
-
virtual void update();
/// Filter the inputs on callback from xforms
virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
- /// tooltips
- string const getVerboseTooltip(FL_OBJECT const * ob) const;
+
/// Fdesign generated method
FD_form_forks * build_forks();
FormPreferences::FormPreferences(LyXView * lv, Dialogs * d)
: FormBaseBI(lv, d, _("Preferences"), false),
- warningPosted(false),
colors_(*this), converters_(*this), inputs_misc_(*this),
formats_(*this), interface_(*this), language_(*this),
lnf_misc_(*this), outputs_misc_(*this), paths_(*this),
bc().setCancel(dialog_->button_cancel);
bc().setRestore(dialog_->button_restore);
+ // Allow the base class to control messages
+ setMessageWidget(dialog_->text_warning);
+
// build the tab folders
converters_tab_.reset(build_inner_tab());
look_n_feel_tab_.reset(build_inner_tab());
}
-void FormPreferences::feedback(FL_OBJECT * ob)
+string const FormPreferences::getFeedback(FL_OBJECT * ob)
{
lyx::Assert(ob);
str = spelloptions_.feedback(ob);
}
- str = formatted(_(str), dialog_->text_warning->w-10, FL_SMALL_SIZE);
-
- fl_set_object_label(dialog_->text_warning, str.c_str());
- fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
+ return str;
}
cit->r, cit->g, cit->b);
fl_set_cursor_color(FL_DEFAULT_CURSOR,
GUI_COLOR_CURSOR, FL_WHITE);
+ fl_set_cursor_color(XC_question_arrow,
+ GUI_COLOR_CURSOR, FL_WHITE);
}
}
Dialogs::redrawGUI();
fl_set_slider_bounds(dialog_->slider_blue, 0.0, 255.0);
fl_set_slider_step(dialog_->slider_blue, 1.0);
fl_set_slider_return(dialog_->slider_blue, FL_RETURN_CHANGED);
-
+
// set up the feedback mechanism
- setPreHandler(dialog_->browser_lyx_objs);
- setPreHandler(dialog_->button_color);
- setPreHandler(dialog_->button_modify);
- setPreHandler(dialog_->dial_hue);
- setPreHandler(dialog_->slider_saturation);
- setPreHandler(dialog_->slider_value);
- setPreHandler(dialog_->slider_red);
- setPreHandler(dialog_->slider_green);
- setPreHandler(dialog_->slider_blue);
- setPreHandler(dialog_->radio_rgb);
- setPreHandler(dialog_->radio_hsv);
+ setPrehandler(dialog_->browser_lyx_objs);
+ setPrehandler(dialog_->button_color);
+ setPrehandler(dialog_->button_modify);
+ setPrehandler(dialog_->dial_hue);
+ setPrehandler(dialog_->slider_saturation);
+ setPrehandler(dialog_->slider_value);
+ setPrehandler(dialog_->slider_red);
+ setPrehandler(dialog_->slider_green);
+ setPrehandler(dialog_->slider_blue);
+ setPrehandler(dialog_->radio_rgb);
+ setPrehandler(dialog_->radio_hsv);
}
string const
xcol.colorID = FL_BLACK;
fl_getmcolor(FL_BLACK, &xcol.r, &xcol.g, &xcol.b);
- fl_mapcolor(GUI_COLOR_CURSOR, xcol.r, xcol.g, xcol.b);
- fl_set_cursor_color(FL_DEFAULT_CURSOR, GUI_COLOR_CURSOR, FL_WHITE);
-
xformsColorDB.push_back(xcol);
xcol.name = _("GUI selection");
fl_set_input_return(dialog_->input_flags, FL_RETURN_CHANGED);
// set up the feedback mechanism
- setPreHandler(dialog_->browser_all);
- setPreHandler(dialog_->button_delete);
- setPreHandler(dialog_->button_add);
- setPreHandler(dialog_->input_converter);
- setPreHandler(dialog_->choice_from);
- setPreHandler(dialog_->choice_to);
- setPreHandler(dialog_->input_flags);
+ setPrehandler(dialog_->browser_all);
+ setPrehandler(dialog_->button_delete);
+ setPrehandler(dialog_->button_add);
+ setPrehandler(dialog_->input_converter);
+ setPrehandler(dialog_->choice_from);
+ setPrehandler(dialog_->choice_to);
+ setPrehandler(dialog_->input_flags);
}
fl_set_input_filter(dialog_->input_format, fl_lowercase_filter);
// set up the feedback mechanism
- setPreHandler(dialog_->browser_all);
- setPreHandler(dialog_->input_format);
- setPreHandler(dialog_->input_gui_name);
- setPreHandler(dialog_->button_delete);
- setPreHandler(dialog_->button_add);
- setPreHandler(dialog_->input_extension);
- setPreHandler(dialog_->input_viewer);
- setPreHandler(dialog_->input_shrtcut);
+ setPrehandler(dialog_->browser_all);
+ setPrehandler(dialog_->input_format);
+ setPrehandler(dialog_->input_gui_name);
+ setPrehandler(dialog_->button_delete);
+ setPrehandler(dialog_->button_add);
+ setPrehandler(dialog_->input_extension);
+ setPrehandler(dialog_->input_viewer);
+ setPrehandler(dialog_->input_shrtcut);
}
string const name = fl_get_input(dialog_->input_format);
if (local_converters.formatIsUsed(name)) {
- parent_.printWarning(_("Cannot remove a Format used by a Converter. Remove the converter first."));
+ parent_.postWarning(_("Cannot remove a Format used by a Converter. Remove the converter first."));
setEnabled(dialog_->button_delete, false);
return false;
}
fl_set_input_return(dialog_->input_date_format, FL_RETURN_CHANGED);
// set up the feedback mechanism
- setPreHandler(dialog_->input_date_format);
+ setPrehandler(dialog_->input_date_format);
}
fl_set_input_return(dialog_->input_ui_file, FL_RETURN_CHANGED);
// set up the feedback mechanism
- setPreHandler(dialog_->input_popup_normal_font);
- setPreHandler(dialog_->input_popup_bold_font);
- setPreHandler(dialog_->input_popup_font_encoding);
- setPreHandler(dialog_->input_bind_file);
- setPreHandler(dialog_->button_bind_file_browse);
- setPreHandler(dialog_->input_ui_file);
- setPreHandler(dialog_->button_ui_file_browse);
- setPreHandler(dialog_->check_override_x_dead_keys);
+ setPrehandler(dialog_->input_popup_normal_font);
+ setPrehandler(dialog_->input_popup_bold_font);
+ setPrehandler(dialog_->input_popup_font_encoding);
+ setPrehandler(dialog_->input_bind_file);
+ setPrehandler(dialog_->button_bind_file_browse);
+ setPrehandler(dialog_->input_ui_file);
+ setPrehandler(dialog_->button_ui_file_browse);
+ setPrehandler(dialog_->check_override_x_dead_keys);
}
fl_unfreeze_form(dialog_->form);
// set up the feedback mechanism
- setPreHandler(dialog_->input_package);
- setPreHandler(dialog_->check_use_kbmap);
+ setPrehandler(dialog_->input_package);
+ setPrehandler(dialog_->check_use_kbmap);
// This is safe, as nothing is done to the pointer, other than
// to use its address in a block-if statement.
// No it's not! Leads to crash.
- // setPreHandler(
+ // setPrehandler(
// reinterpret_cast<FL_OBJECT *>(combo_default_lang),
// C_FormPreferencesFeedbackCB);
- setPreHandler(dialog_->input_kbmap1);
- setPreHandler(dialog_->input_kbmap2);
- setPreHandler(dialog_->check_rtl_support);
- setPreHandler(dialog_->check_mark_foreign);
- setPreHandler(dialog_->check_auto_begin);
- setPreHandler(dialog_->check_auto_end);
- setPreHandler(dialog_->check_use_babel);
- setPreHandler(dialog_->check_global_options);
- setPreHandler(dialog_->input_command_begin);
- setPreHandler(dialog_->input_command_end);
+ setPrehandler(dialog_->input_kbmap1);
+ setPrehandler(dialog_->input_kbmap2);
+ setPrehandler(dialog_->check_rtl_support);
+ setPrehandler(dialog_->check_mark_foreign);
+ setPrehandler(dialog_->check_auto_begin);
+ setPrehandler(dialog_->check_auto_end);
+ setPrehandler(dialog_->check_use_babel);
+ setPrehandler(dialog_->check_global_options);
+ setPrehandler(dialog_->input_command_begin);
+ setPrehandler(dialog_->input_command_end);
// Activate/Deactivate the input fields dependent on the state of the
// buttons.
fl_set_counter_return(dialog_->counter_wm_jump, FL_RETURN_CHANGED);
// set up the feedback mechanism
- setPreHandler(dialog_->check_banner);
- setPreHandler(dialog_->check_auto_region_delete);
- setPreHandler(dialog_->check_exit_confirm);
- setPreHandler(dialog_->check_display_shrtcuts);
- setPreHandler(dialog_->counter_autosave);
- setPreHandler(dialog_->check_ask_new_file);
- setPreHandler(dialog_->check_cursor_follows_scrollbar);
- setPreHandler(dialog_->check_dialogs_iconify_with_main);
- setPreHandler(dialog_->counter_wm_jump);
- setPreHandler(dialog_->radio_display_monochrome);
- setPreHandler(dialog_->radio_display_grayscale);
- setPreHandler(dialog_->radio_display_color);
- setPreHandler(dialog_->radio_no_display);
+ setPrehandler(dialog_->check_banner);
+ setPrehandler(dialog_->check_auto_region_delete);
+ setPrehandler(dialog_->check_exit_confirm);
+ setPrehandler(dialog_->check_display_shrtcuts);
+ setPrehandler(dialog_->counter_autosave);
+ setPrehandler(dialog_->check_ask_new_file);
+ setPrehandler(dialog_->check_cursor_follows_scrollbar);
+ setPrehandler(dialog_->check_dialogs_iconify_with_main);
+ setPrehandler(dialog_->counter_wm_jump);
+ setPrehandler(dialog_->radio_display_monochrome);
+ setPrehandler(dialog_->radio_display_grayscale);
+ setPrehandler(dialog_->radio_display_color);
+ setPrehandler(dialog_->radio_no_display);
}
_(" default | US letter | legal | executive | A3 | A4 | A5 | B5 "));
// set up the feedback mechanism
- setPreHandler(dialog_->counter_line_len);
- setPreHandler(dialog_->input_tex_encoding);
- setPreHandler(dialog_->choice_default_papersize);
- setPreHandler(dialog_->input_ascii_roff);
- setPreHandler(dialog_->input_checktex);
- setPreHandler(dialog_->input_paperoption);
- setPreHandler(dialog_->check_autoreset_classopt);
+ setPrehandler(dialog_->counter_line_len);
+ setPrehandler(dialog_->input_tex_encoding);
+ setPrehandler(dialog_->choice_default_papersize);
+ setPrehandler(dialog_->input_ascii_roff);
+ setPrehandler(dialog_->input_checktex);
+ setPrehandler(dialog_->input_paperoption);
+ setPrehandler(dialog_->check_autoreset_classopt);
}
fl_set_input_return(dialog_->input_serverpipe, FL_RETURN_CHANGED);
// set up the feedback mechanism
- setPreHandler(dialog_->input_default_path);
- setPreHandler(dialog_->counter_lastfiles);
- setPreHandler(dialog_->input_template_path);
- setPreHandler(dialog_->check_last_files);
- setPreHandler(dialog_->input_lastfiles);
- setPreHandler(dialog_->check_make_backups);
- setPreHandler(dialog_->input_backup_path);
- setPreHandler(dialog_->input_serverpipe);
- setPreHandler(dialog_->input_temp_dir);
- setPreHandler(dialog_->check_use_temp_dir);
+ setPrehandler(dialog_->input_default_path);
+ setPrehandler(dialog_->counter_lastfiles);
+ setPrehandler(dialog_->input_template_path);
+ setPrehandler(dialog_->check_last_files);
+ setPrehandler(dialog_->input_lastfiles);
+ setPrehandler(dialog_->check_make_backups);
+ setPrehandler(dialog_->input_backup_path);
+ setPrehandler(dialog_->input_serverpipe);
+ setPrehandler(dialog_->input_temp_dir);
+ setPrehandler(dialog_->check_use_temp_dir);
}
if (!ob || ob == dialog_->input_default_path) {
string const name = fl_get_input(dialog_->input_default_path);
if (!name.empty() && !RWInfo::WriteableDir(name)) {
- parent_.printWarning(RWInfo::ErrorMessage());
+ parent_.postWarning(RWInfo::ErrorMessage());
return false;
}
}
if (!ob || ob == dialog_->input_template_path) {
string const name = fl_get_input(dialog_->input_template_path);
if (!name.empty() && !RWInfo::ReadableDir(name)) {
- parent_.printWarning(RWInfo::ErrorMessage());
+ parent_.postWarning(RWInfo::ErrorMessage());
return false;
}
}
if (fl_get_button(dialog_->check_make_backups)
&& !name.empty()
&& !RWInfo::WriteableDir(name)) {
- parent_.printWarning(RWInfo::ErrorMessage());
+ parent_.postWarning(RWInfo::ErrorMessage());
return false;
}
}
if (fl_get_button(dialog_->check_make_backups)
&& !name.empty()
&& !RWInfo::WriteableDir(name)) {
- parent_.printWarning(RWInfo::ErrorMessage());
+ parent_.postWarning(RWInfo::ErrorMessage());
return false;
}
}
if (fl_get_button(dialog_->check_last_files)
&& !name.empty()
&& !RWInfo::WriteableFile(name)) {
- parent_.printWarning(RWInfo::ErrorMessage());
+ parent_.postWarning(RWInfo::ErrorMessage());
return false;
}
}
// strip off the extension
string const str = ChangeExtension(name, "");
if (!RWInfo::WriteableFile(str + ".in")) {
- parent_.printWarning(RWInfo::ErrorMessage());
+ parent_.postWarning(RWInfo::ErrorMessage());
return false;
}
if (!RWInfo::WriteableFile(str + ".out")) {
- parent_.printWarning(RWInfo::ErrorMessage());
+ parent_.postWarning(RWInfo::ErrorMessage());
return false;
}
}
fl_set_input_return(dialog_->input_name, FL_RETURN_CHANGED);
// set up the feedback mechanism
- setPreHandler(dialog_->input_command);
- setPreHandler(dialog_->input_page_range);
- setPreHandler(dialog_->input_copies);
- setPreHandler(dialog_->input_reverse);
- setPreHandler(dialog_->input_to_printer);
- setPreHandler(dialog_->input_file_extension);
- setPreHandler(dialog_->input_spool_command);
- setPreHandler(dialog_->input_paper_type);
- setPreHandler(dialog_->input_even_pages);
- setPreHandler(dialog_->input_odd_pages);
- setPreHandler(dialog_->input_collated);
- setPreHandler(dialog_->input_landscape);
- setPreHandler(dialog_->input_to_file);
- setPreHandler(dialog_->input_extra_options);
- setPreHandler(dialog_->input_spool_prefix);
- setPreHandler(dialog_->input_paper_size);
- setPreHandler(dialog_->input_name);
- setPreHandler(dialog_->check_adapt_output);
+ setPrehandler(dialog_->input_command);
+ setPrehandler(dialog_->input_page_range);
+ setPrehandler(dialog_->input_copies);
+ setPrehandler(dialog_->input_reverse);
+ setPrehandler(dialog_->input_to_printer);
+ setPrehandler(dialog_->input_file_extension);
+ setPrehandler(dialog_->input_spool_command);
+ setPrehandler(dialog_->input_paper_type);
+ setPrehandler(dialog_->input_even_pages);
+ setPrehandler(dialog_->input_odd_pages);
+ setPrehandler(dialog_->input_collated);
+ setPrehandler(dialog_->input_landscape);
+ setPrehandler(dialog_->input_to_file);
+ setPrehandler(dialog_->input_extra_options);
+ setPrehandler(dialog_->input_spool_prefix);
+ setPrehandler(dialog_->input_paper_size);
+ setPrehandler(dialog_->input_name);
+ setPrehandler(dialog_->check_adapt_output);
}
fl_set_input_filter(dialog_->input_huger, fl_unsigned_float_filter);
// set up the feedback mechanism
- setPreHandler(dialog_->input_roman);
- setPreHandler(dialog_->input_sans);
- setPreHandler(dialog_->input_typewriter);
- setPreHandler(dialog_->counter_zoom);
- setPreHandler(dialog_->counter_dpi);
- setPreHandler(dialog_->check_scalable);
- setPreHandler(dialog_->input_screen_encoding);
- setPreHandler(dialog_->input_tiny);
- setPreHandler(dialog_->input_script);
- setPreHandler(dialog_->input_footnote);
- setPreHandler(dialog_->input_small);
- setPreHandler(dialog_->input_large);
- setPreHandler(dialog_->input_larger);
- setPreHandler(dialog_->input_largest);
- setPreHandler(dialog_->input_normal);
- setPreHandler(dialog_->input_huge);
- setPreHandler(dialog_->input_huger);
+ setPrehandler(dialog_->input_roman);
+ setPrehandler(dialog_->input_sans);
+ setPrehandler(dialog_->input_typewriter);
+ setPrehandler(dialog_->counter_zoom);
+ setPrehandler(dialog_->counter_dpi);
+ setPrehandler(dialog_->check_scalable);
+ setPrehandler(dialog_->input_screen_encoding);
+ setPrehandler(dialog_->input_tiny);
+ setPrehandler(dialog_->input_script);
+ setPrehandler(dialog_->input_footnote);
+ setPrehandler(dialog_->input_small);
+ setPrehandler(dialog_->input_large);
+ setPrehandler(dialog_->input_larger);
+ setPrehandler(dialog_->input_largest);
+ setPrehandler(dialog_->input_normal);
+ setPrehandler(dialog_->input_huge);
+ setPrehandler(dialog_->input_huger);
}
}
if (!activate)
- parent_.printWarning(str);
+ parent_.postWarning(str);
return activate;
}
fl_set_input_return(dialog_->input_personal_dict, FL_RETURN_CHANGED);
// set up the feedback mechanism
- setPreHandler(dialog_->choice_spell_command);
- setPreHandler(dialog_->check_alt_lang);
- setPreHandler(dialog_->input_alt_lang);
- setPreHandler(dialog_->check_escape_chars);
- setPreHandler(dialog_->input_escape_chars);
- setPreHandler(dialog_->check_personal_dict);
- setPreHandler(dialog_->input_personal_dict);
- setPreHandler(dialog_->button_personal_dict);
- setPreHandler(dialog_->check_compound_words);
- setPreHandler(dialog_->check_input_enc);
+ setPrehandler(dialog_->choice_spell_command);
+ setPrehandler(dialog_->check_alt_lang);
+ setPrehandler(dialog_->input_alt_lang);
+ setPrehandler(dialog_->check_escape_chars);
+ setPrehandler(dialog_->input_escape_chars);
+ setPrehandler(dialog_->check_personal_dict);
+ setPrehandler(dialog_->input_personal_dict);
+ setPrehandler(dialog_->button_personal_dict);
+ setPrehandler(dialog_->check_compound_words);
+ setPrehandler(dialog_->check_input_enc);
}
}
-void FormPreferences::printWarning(string const & warning)
-{
- warningPosted = true;
-
- string str = _("WARNING!") + string(" ") + warning;
- str = formatted(str, dialog_->text_warning->w-10, FL_SMALL_SIZE);
-
- fl_set_object_label(dialog_->text_warning, str.c_str());
- fl_set_object_lsize(dialog_->text_warning, FL_SMALL_SIZE);
-}
-
-
void FormPreferences::browse(FL_OBJECT * inpt,
string const & title,
string const & pattern,
input(inpt, 0);
}
}
-
-
-// C function wrapper, required by xforms.
-extern "C" {
-
- static
- int C_FormPreferencesFeedbackCB(FL_OBJECT * ob, int event,
- FL_Coord mx, FL_Coord my,
- int key, void * xev)
- {
- return FormPreferences::FeedbackCB(ob, event,
- mx, my, key, xev);
- }
-
-}
-
-
-int FormPreferences::FeedbackCB(FL_OBJECT * ob, int event,
- FL_Coord, FL_Coord, int, void *)
-{
- // Note that the return value is important in the pre-emptive handler.
- // Don't return anything other than 0.
-
- lyx::Assert(ob);
- // Don't Assert this one, as it can happen quite reasonably when things
- // are being deleted in the d-tor.
- //Assert(ob->form);
- if (!ob->form) return 0;
-
- FormPreferences * pre =
- static_cast<FormPreferences*>(ob->form->u_vdata);
- pre->Feedback(ob, event);
- return 0;
-}
-
-
-// preemptive handler for feedback messages
-void FormPreferences::Feedback(FL_OBJECT * ob, int event)
-{
- lyx::Assert(ob);
-
- switch (event) {
- case FL_ENTER:
- warningPosted = false;
- feedback(ob);
- break;
-
- case FL_LEAVE:
- if (!warningPosted)
- fl_set_object_label(dialog_->text_warning, "");
- break;
-
- default:
- break;
- }
-}
-
-
-void FormPreferences::setPreHandler(FL_OBJECT * ob)
-{
- lyx::Assert(ob);
- fl_set_object_prehandler(ob, C_FormPreferencesFeedbackCB);
-}
*/
class FormPreferences : public FormBaseBI {
public:
- /// #FormPreferences x(LyXFunc ..., Dialogs ...);#
- FormPreferences(LyXView *, Dialogs *);
///
- static int FeedbackCB(FL_OBJECT *, int,
- FL_Coord, FL_Coord, int, void *);
+ FormPreferences(LyXView *, Dialogs *);
private:
/// Pointer to the actual instantiation of the ButtonController.
virtual void build();
/// Pointer to the actual instantiation of the xforms form.
virtual FL_FORM * form() const;
- /// control which feedback message is output
- void feedback(FL_OBJECT *);
-
- /// Set the preemptive handler for each FL_OBJECT.
- static void setPreHandler(FL_OBJECT *);
- /// The preemptive handler for feedback messages.
- void Feedback(FL_OBJECT *, int);
- /// Print a warning message and set warning flag.
- void printWarning(string const &);
- /** Launch a file dialog and modify input if it returns a new file.
- For an explanation of the various parameters, see xforms_helpers.h.
- */
+ /// control which feedback message is output
+ string const getFeedback(FL_OBJECT *);
+ ///
void browse(FL_OBJECT * input,
string const & title, string const & pattern,
std::pair<string,string> const & dir1= std::make_pair(string(),string()),
/// Spellchecker, language stuff, etc
boost::scoped_ptr<FD_form_inner_tab> lang_opts_tab_;
- /** Flag whether a warning has been posted to the text window.
- If so, don't redraw the window when the mouse leaves an object. */
- bool warningPosted;
-
/** Each tab folder is encapsulated in its own class.
*/
public:
///
enum GuiColors {
- GUI_COLOR_CHOICE = FL_FREE_COL1,
- GUI_COLOR_HUE_DIAL = FL_FREE_COL2,
- GUI_COLOR_CURSOR = FL_FREE_COL3
+ GUI_COLOR_CHOICE = FL_FREE_COL14,
+ GUI_COLOR_HUE_DIAL = FL_FREE_COL15,
+ GUI_COLOR_CURSOR = FL_FREE_COL16
};
///
Colors(FormPreferences & p);
#include "form_sendto.h"
#include "ControlSendto.h"
#include "xformsBC.h"
+#include "Tooltips.h"
#include "xforms_helpers.h"
#include "converter.h"
#include "gettext.h"
fl_set_input_return(dialog_->input_command, FL_RETURN_CHANGED);
- // The help choice
- fillTooltipChoice(dialog_->choice_help);
-
- // Set up the tooltip mechanism
- setTooltipHandler(dialog_->browser_formats);
- setTooltipHandler(dialog_->input_command);
-
// Manage the ok, apply, restore and cancel/close buttons
bc().setOK(dialog_->button_ok);
bc().setApply(dialog_->button_apply);
bc().setCancel(dialog_->button_cancel);
+
+ // Set up the tooltip mechanism
+ string str = N_("Export the buffer to this format before running the command below on it.");
+ tooltips().initTooltip(dialog_->browser_formats, str);
+
+ str = N_("Run this command on the buffer exported to the chosen format. $$FName will be replaced by the name of this file.");
+ tooltips().initTooltip(dialog_->input_command, str);
}
for (; it != end; ++it, ++result) {
*result = (*it)->prettyname();
}
-
+
vector<string> const browser_keys =
getVectorFromBrowser(dialog_->browser_formats);
}
-ButtonPolicy::SMInput FormSendto::input(FL_OBJECT * ob, long)
+ButtonPolicy::SMInput FormSendto::input(FL_OBJECT *, long)
{
- if (ob == dialog_->choice_help) {
- setTooltipLevel(dialog_->choice_help);
- return ButtonPolicy::SMI_NOOP;
- }
-
int const line = fl_get_browser(dialog_->browser_formats);
if (line < 1 || line > fl_get_browser_maxline(dialog_->browser_formats))
return ButtonPolicy::SMI_INVALID;
controller().setFormat(all_formats_[line-1]);
controller().setCommand(cmd);
}
-
-
-string const FormSendto::getVerboseTooltip(FL_OBJECT const * ob) const
-{
- string str;
-
- if (ob == dialog_->browser_formats) {
- str = N_("Export the buffer to this format before running the command below on it.");
-
- } else if (ob == dialog_->input_command) {
- str = N_("Run this command on the buffer exported to the chosen format. $$FName will be replaced by the name of this file.");
- }
-
- return str;
-}
/// Filter the inputs on callback from xforms
virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
- /// tooltips
- string const getVerboseTooltip(FL_OBJECT const *) const;
-
/// Fdesign generated method
FD_form_sendto * build_sendto();
#include "xformsBC.h"
#include "FormTexinfo.h"
#include "form_texinfo.h"
+#include "Tooltips.h"
#include "gettext.h"
#include "debug.h"
#include "xforms_helpers.h"
fl_set_button(dialog_->button_fullPath, 1);
updateStyles(ControlTexinfo::cls);
- // the help choice
- fillTooltipChoice(dialog_->choice_help);
-
- // setting up the help mechanism
- setTooltipHandler(dialog_->button_rescan);
- setTooltipHandler(dialog_->button_view);
- setTooltipHandler(dialog_->button_texhash);
- setTooltipHandler(dialog_->button_fullPath);
- setTooltipHandler(dialog_->browser);
- setTooltipHandler(dialog_->radio_cls);
- setTooltipHandler(dialog_->radio_sty);
- setTooltipHandler(dialog_->radio_bst);
+ // set up the tooltips
+ string str = N_("Runs the script \"TexFiles.sh\" to build new file lists.");
+ tooltips().initTooltip(dialog_->button_rescan, str);
+
+ str = N_("Shows the contents of the marked file. Only possible in full path mode.");
+ tooltips().initTooltip(dialog_->button_view, str);
+
+ str = N_("Runs the script \"texhash\" which builds the a new LaTeX tree. Needed if you install a new TeX class or style. To execute it, you need the write permissions for the tex-dirs, often /var/lib/texmf and other.");
+ tooltips().initTooltip(dialog_->button_texhash, str);
+
+ str = N_("View full path or only file name. Full path is needed to view the contents of a file.");
+ tooltips().initTooltip(dialog_->button_fullPath, str);
+
+ str = N_("Shows the installed LaTeX Document classes. Remember, that these classes are only available in LyX if a corresponding LyX layout file exists!");
+ tooltips().initTooltip(dialog_->radio_cls, str);
+
+ str = N_("Shows the installed LaTeX style files, which are available in LyX by default, like \"babel\" or through \\usepackage{<the stylefile>} in LaTeX preamble.");
+ tooltips().initTooltip(dialog_->radio_sty, str);
+
+ str = N_("Shows the installed style files for BibTeX. They can be loaded through insert->Lists&Toc->BibTeX Reference->Style.");
+ tooltips().initTooltip(dialog_->radio_bst, str);
}
}
}
- if (ob == dialog_->choice_help) {
- setTooltipLevel(dialog_->choice_help);
- return ButtonPolicy::SMI_NOOP;
- }
-
return ButtonPolicy::SMI_VALID;
}
activeStyle = whichStyle;
}
-
-
-string const FormTexinfo::getMinimalTooltip(FL_OBJECT const * ob) const
-{
- string str;
-
- if (ob == dialog_->radio_cls) {
- str = N_("Available LaTeX Classes");
-
- } else if (ob == dialog_->radio_sty) {
- str = _("Available LaTeX Styles");
-
- } else if (ob == dialog_->radio_bst) {
- str = _("Available BibTeX Styles");
-
- } else if (ob == dialog_->button_rescan) {
- str = _("Rescan File List");
-
- } else if (ob == dialog_->button_fullPath) {
- str = _("Show Full Path or not");
-
- } else if (ob == dialog_->button_texhash) {
- str = _("Execute Script \"Texhash\"");
-
- } else if (ob == dialog_->button_view) {
- str = N_("View Content of the File");
-
- }
-
- return str;
-}
-
-
-string const FormTexinfo::getVerboseTooltip(FL_OBJECT const * ob) const
-{
- string str;
-
- if (ob == dialog_->radio_cls) {
- str = N_("Shows the installed LaTeX Document classes. Remember, that these classes are only available in LyX if a corresponding LyX layout file exists!");
-
- } else if (ob == dialog_->radio_sty) {
- str = _("Shows the installed LaTeX style files, which are available in LyX by default, like \"babel\" or through \\usepackage{<the stylefile>} in LaTeX preamble.");
-
- } else if (ob == dialog_->radio_bst) {
- str = _("Shows the installed style files for BibTeX. They can be loaded through insert->Lists&Toc->BibTeX Reference->Style.");
-
- } else if (ob == dialog_->button_rescan) {
- str = _("Runs the script \"TexFiles.sh\" to build new file lists.");
-
- } else if (ob == dialog_->button_fullPath) {
- str = _("View full path or only file name. Full path is needed to view the contents of a file.");
-
- } else if (ob == dialog_->button_texhash) {
- str = _("Runs the script \"texhash\" which builds the a new LaTeX tree. Needed if you install a new TeX class or style. To execute it, you need the write permissions for the tex-dirs, often /var/lib/texmf and other.");
-
- } else if (ob == dialog_->button_view) {
- str = N_("Shows the contents of the marked file. Only possible in full path mode.");
-
- }
-
- return str;
-}
/// Filter the inputs on callback from xforms
virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
///
- string const getMinimalTooltip(FL_OBJECT const *) const;
- ///
- string const getVerboseTooltip(FL_OBJECT const *) const;
- ///
void updateStyles(ControlTexinfo::texFileSuffix);
/// Fdesign generated method
FD_form_texinfo * build_texinfo();
Dialogs.C \
DropDown.h \
DropDown.C \
+ FeedbackController.C \
+ FeedbackController.h \
FileDialog.C \
FormFiledialog.h \
FormFiledialog.C \
form_filedialog.C \
form_filedialog.h \
- GUIRunTime.C \
FormAboutlyx.C \
FormAboutlyx.h \
form_aboutlyx.C \
form_url.h \
FormVCLog.C \
FormVCLog.h \
+ GUIRunTime.C \
input_validators.C \
input_validators.h \
MathsSymbols.C \
#include "LyXAction.h"
#include "MathsSymbols.h"
#include "gettext.h"
+#include "Tooltips.h"
+#include "support/LAssert.h"
#include "support/filetools.h"
#include "support/lstrings.h"
: owner(static_cast<XFormsView *>(o)), sxpos(x), sypos(y)
{
combox = 0;
-#if FL_REVISION < 89
- bubble_timer = 0;
-#endif
+ tooltip_ = new Tooltips();
}
-namespace {
-
-#if FL_REVISION < 89
-// timer-cb for bubble-help (Matthias)
-void BubbleTimerCB(FL_OBJECT *, long data)
-{
- FL_OBJECT * ob = reinterpret_cast<FL_OBJECT*>(data);
- // The trick we use to get the help text is to read the
- // argument of the callback that has been registered for
- // ToolBarCB. (JMarc)
- string help = _(lyxaction.helpText(ob->argument));
- fl_show_oneliner(help.c_str(), ob->form->x + ob->x,
- ob->form->y + ob->y + ob->h);
-}
-
-
-extern "C" {
-
-static
-void C_Toolbar_BubbleTimerCB(FL_OBJECT * ob, long data)
+Toolbar::Pimpl::~Pimpl()
{
- BubbleTimerCB(ob, data);
-}
-
-}
-
-// post_handler for bubble-help (Matthias)
-int BubblePost(FL_OBJECT *ob, int event,
- FL_Coord /*mx*/, FL_Coord /*my*/,
- int /*key*/, void * /*xev*/)
-{
- FL_OBJECT * bubble_timer = reinterpret_cast<FL_OBJECT *>(ob->u_cdata);
-
- // We do not test for empty help here, since this can never happen
- if (event == FL_ENTER) {
- fl_set_object_callback(bubble_timer,
- C_Toolbar_BubbleTimerCB,
- reinterpret_cast<long>(ob));
- fl_set_timer(bubble_timer, 1);
- }
- else if (event != FL_MOTION) {
- fl_set_timer(bubble_timer, 0);
- fl_hide_oneliner();
- }
- return 0;
-}
-
-
-extern "C" {
-
-static
-int C_Toolbar_BubblePost(FL_OBJECT * ob, int event,
- FL_Coord /*mx*/, FL_Coord /*my*/,
- int key, void * xev)
-{
- return BubblePost(ob, event, 0, 0, key, xev);
-}
-
+ clean();
+ delete tooltip_;
}
-#endif
-
-} // namespace anon
void Toolbar::Pimpl::activate()
fl_addto_form(owner->getForm());
}
-#if FL_REVISION < 89
- // add the time if it don't exist
- if (bubble_timer == 0)
- bubble_timer = fl_add_timer(FL_HIDDEN_TIMER,
- xpos, ypos, 0, 0, "Timer");
-#endif
-
ToolbarList::iterator item = toollist.begin();
ToolbarList::iterator end = toollist.end();
for (; item != end; ++item) {
// Remove the blue feedback rectangle
fl_set_pixmapbutton_focus_outline(obj, 0);
- // Set the tooltip
-#if FL_REVISION >= 89
- string const help(_(lyxaction.helpText(item->action)));
- fl_set_object_helper(obj, help.c_str());
-#else
- fl_set_object_posthandler(obj, C_Toolbar_BubblePost);
- obj->u_cdata = reinterpret_cast<char *>(bubble_timer);
-#endif
-
+ // initialise the tooltip
+ string const tip = _(lyxaction.helpText(obj->argument));
+ tooltip_->initTooltip(obj, tip);
+
// The view that this object belongs to.
obj->u_vdata = owner;
#endif
class XFormsView;
+class Tooltips;
/** The LyX xforms toolbar class
*/
static void layoutSelectedCB(int, void *, Combox *);
///
Pimpl(LyXView * o, int x, int y);
-
///
- ~Pimpl() {
- clean();
- }
+ ~Pimpl();
/// (re)sets the toolbar
void set(bool doingmain = false);
ToolbarList toollist;
///
XFormsView * owner;
-#if FL_REVISION < 89
///
- FL_OBJECT * bubble_timer;
-#endif
+ Tooltips * tooltip_;
///
Combox * combox;
/// Starting position
#endif
#include "Tooltips.h"
+#include "Dialogs.h"
+#include "xforms_helpers.h" // formatted
+#include "gettext.h"
+#include "support/lstrings.h"
#include "support/LAssert.h"
-//#if FL_REVISION >= 89
-// Usually, this is all that is needed for xforms 0.89
-// However, I can't see an easy way to change Tooltips on the fly
-// with this method, so for now use the jiggery pokery below. ;-)
-// Angus 6 Feb 2002
+using SigC::slot;
-/*
-void Tooltips::activateTooltip(FL_OBJECT * ob)
+
+bool Tooltips::enabled_ = false;
+
+SigC::Signal0<void> Tooltips::tooltipsToggled;
+
+
+#if FL_REVISION >= 89
+
+Tooltips::Tooltips()
+{
+ static bool first = true;
+ if (first) {
+ first = false;
+ Dialogs::toggleTooltips.connect(slot(&Tooltips::toggleEnabled));
+ }
+ tooltipsToggled.connect(slot(this, &Tooltips::toggleTooltips));
+}
+
+
+void Tooltips::toggleEnabled()
+{
+ enabled_ = !enabled_;
+ tooltipsToggled();
+}
+
+
+void Tooltips::toggleTooltips()
+{
+ if (tooltipsMap.empty())
+ // There are no objects with tooltips in this dialog, so
+ // just go away. Don't change the cursor to a question mark.
+ return;
+
+ TooltipsMap::iterator it = tooltipsMap.begin();
+ TooltipsMap::iterator end = tooltipsMap.end();
+ for (; it != end; ++it) {
+ FL_OBJECT * const ob = it->first;
+ char const * const c_str = enabled_ ? it->second.c_str() : 0;
+ fl_set_object_helper(ob, c_str);
+ }
+
+ // Set the cursor to a question mark or back to the default.
+ FL_OBJECT * const ob = tooltipsMap.begin()->first;
+ int const cursor = enabled_ ? XC_question_arrow : FL_DEFAULT_CURSOR;
+ fl_set_cursor(FL_ObjWin(ob), cursor);
+}
+
+
+void Tooltips::initTooltip(FL_OBJECT * ob, string const & tip)
{
lyx::Assert(ob);
- string const help(getTooltip(ob));
- if (!help.empty())
- fl_set_object_helper(ob, help.c_str());
+ // Paranoia check!
+ TooltipsMap::const_iterator it = tooltipsMap.find(ob);
+ if (it != tooltipsMap.end())
+ return;
+
+ string const str = strip(frontStrip(tip));
+ if (str.empty())
+ return;
+
+ // Store the tooltip string
+ tooltipsMap[ob] = formatted(_(str), 400);
+
+ // Set the initial state of the tooltips
+ char const * const c_str = enabled_ ? str.c_str() : 0;
+ fl_set_object_helper(ob, c_str);
}
-*/
-//#else // if FL_REVISION < 89
+
+#else // if FL_REVISION < 89
namespace {
}
-void Tooltips::activateTooltip(FL_OBJECT * ob)
+Tooltips::Tooltips()
+ : tooltip_timer_(0)
+{
+ static bool first = true;
+ if (first) {
+ first = false;
+ Dialogs::toggleTooltips.connect(slot(&Tooltips::toggleEnabled));
+ }
+ tooltipsToggled.connect(slot(this, &Tooltips::toggleTooltips));
+}
+
+
+void Tooltips::toggleEnabled()
+{
+ enabled_ = !enabled_;
+ tooltipsToggled();
+}
+
+
+void Tooltips::toggleTooltips()
+{
+ if (tooltipsMap.empty())
+ // There are no objects with tooltips in this dialog, so
+ // just go away. Don't change the cursor to a question mark.
+ return;
+
+ // Set the cursor to a question mark or back to the default.
+ FL_OBJECT * const ob = tooltipsMap.begin()->first;
+ int const cursor = enabled_ ? XC_question_arrow : FL_DEFAULT_CURSOR;
+ fl_set_cursor(FL_ObjWin(ob), cursor);
+}
+
+
+void Tooltips::initTooltip(FL_OBJECT * ob, string const & tip)
{
lyx::Assert(ob);
+ // Paranoia check!
+ TooltipsMap::const_iterator it = tooltipsMap.find(ob);
+ if (it != tooltipsMap.end())
+ return;
+
+ string const str = strip(frontStrip(tip));
+ if (str.empty())
+ return;
+
+ // Store the tooltip string
+ tooltipsMap[ob] = formatted(_(str), 400);
+
if (!tooltip_timer_) {
lyx::Assert(ob->form);
- fl_addto_form(ob->form);
+ if (fl_current_form && ob->form != fl_current_form)
+ fl_end_form();
+
+ bool const open_form = !fl_current_form;
+ if (open_form)
+ fl_addto_form(ob->form);
+
tooltip_timer_ = fl_add_timer(FL_HIDDEN_TIMER, 0, 0, 0, 0, "");
- fl_end_form();
+
+ if (open_form)
+ fl_end_form();
}
fl_set_object_posthandler(ob, C_TooltipHandler);
}
+string const Tooltips::getTooltip(FL_OBJECT * ob) const
+{
+ TooltipsMap::const_iterator it = tooltipsMap.find(ob);
+ if (it == tooltipsMap.end())
+ return string();
+ return it->second;
+}
+
+
namespace {
void TooltipTimerCB(FL_OBJECT * timer, long data)
}
-// post_handler for bubble-help (Matthias)
-int TooltipHandler(FL_OBJECT *ob, int event)
+// post_handler for tooltip help
+int TooltipHandler(FL_OBJECT * ob, int event)
{
+ if (!Tooltips::enabled())
+ return 0;
+
lyx::Assert(ob);
FL_OBJECT * timer = reinterpret_cast<FL_OBJECT *>(ob->u_cdata);
lyx::Assert(timer);
} // namespace anon
-//#endif // FL_REVISION < 89
+#endif // FL_REVISION >= 89
#include <boost/utility.hpp>
#include <sigc++/signal_system.h>
#include FORMS_H_LOCATION // Can't forward-declare FL_OBJECT
+#include <map>
#ifdef __GNUG__
#pragma interface
#endif
-class Tooltips : boost::noncopyable {
+class Tooltips : boost::noncopyable, public SigC::Object {
public:
- /// Activate tooltips for this ob
- void activateTooltip(FL_OBJECT * ob);
- /** Connect this signal to the function returning the tooltip for ob
- Eg, string FormBase::getTooltip(FL_OBJECT const *)
- Note that SigC is unable to create a Signal1 returning string const
- or to connect it to a const method.
- */
- SigC::Signal1<string, FL_OBJECT const *> getTooltip;
+ Tooltips();
+
+ /// Initialise a tooltip for this ob
+ void initTooltip(FL_OBJECT * ob, string const & tip);
+
+ /// Are the tooltips on or off?
+ static bool enabled() { return enabled_; }
+
+#if FL_REVISION < 89
- // We use the old method because we want to change tooltips on the fly
-//#if FL_REVISION < 89
- ///
- Tooltips() : tooltip_timer_(0) {}
+ /// Return the tooltip associated with this object
+ string const getTooltip(FL_OBJECT *) const;
+
+#endif
private:
+ /// Are the tooltips on or off?
+ static bool enabled_;
+
+ /** This method is connected to Dialogs::toggleTooltips and toggles
+ * the state of enabled_
+ */
+ static void toggleEnabled();
+
+ /** Once enabled_ is changed, then this signal is emitted to update
+ * all the tooltips.
+ */
+ static SigC::Signal0<void> tooltipsToggled;
+
+ /// This method is connected to the tooltipsToggled signal.
+ void toggleTooltips();
+
+ /// The tooltips are stored so that they can be turned on and off
+ typedef std::map<FL_OBJECT *, string> TooltipsMap;
+
+ TooltipsMap tooltipsMap;
+
+#if FL_REVISION < 89
+
FL_OBJECT * tooltip_timer_;
-//#endif
+
+#endif // FL_REVISION >= 89
};
#endif // TOOLTIPS_H
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- {
- char const * const dummy = N_("Help:|#H");
- fdui->choice_help = obj = fl_add_choice(FL_NORMAL_CHOICE, 89, 120, 136, 29, idex(_(dummy)));
- fl_set_button_shortcut(obj, scex(_(dummy)), 1);
- }
- fl_set_object_boxtype(obj, FL_FRAME_BOX);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
fl_end_form();
fdui->form->fdui = fdui;
FL_OBJECT *database_browse;
FL_OBJECT *style_browse;
FL_OBJECT *radio_bibtotoc;
- FL_OBJECT *choice_help;
};
#endif /* FD_form_bibtex_h_ */
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Restore|#R");
- fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 220, 400, 100, 30, idex(_(dummy)));
+ fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 400, 100, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
- {
- char const * const dummy = N_("Help:|#H");
- fdui->choice_help = obj = fl_add_choice(FL_NORMAL_CHOICE, 80, 400, 130, 30, idex(_(dummy)));
- fl_set_button_shortcut(obj, scex(_(dummy)), 1);
- }
- fl_set_object_boxtype(obj, FL_FRAME_BOX);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
fl_end_form();
fdui->form->fdui = fdui;
FL_OBJECT *button_ok;
FL_OBJECT *button_apply;
FL_OBJECT *button_cancel;
- FL_OBJECT *choice_help;
};
#endif /* FD_form_citation_h_ */
obj = fl_add_box(FL_UP_BOX, 0, 0, 360, 410, "");
{
char const * const dummy = N_("Export format|#E");
- fdui->browser_formats = obj = fl_add_browser(FL_HOLD_BROWSER, 15, 30, 145, 250, idex(_(dummy)));
+ fdui->browser_formats = obj = fl_add_browser(FL_HOLD_BROWSER, 105, 30, 145, 250, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
- {
- char const * const dummy = N_("Help:|#H");
- fdui->choice_help = obj = fl_add_choice(FL_NORMAL_CHOICE, 215, 250, 130, 30, idex(_(dummy)));
- fl_set_button_shortcut(obj, scex(_(dummy)), 1);
- }
- fl_set_object_boxtype(obj, FL_FRAME_BOX);
- fl_set_object_lsize(obj, FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 65, 370, 90, 30, _("OK"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
FL_FORM *form;
FL_OBJECT *browser_formats;
FL_OBJECT *input_command;
- FL_OBJECT *choice_help;
FL_OBJECT *button_ok;
FL_OBJECT *button_apply;
FL_OBJECT *button_cancel;
FL_OBJECT *obj;
FD_form_texinfo *fdui = new FD_form_texinfo;
- fdui->form = fl_bgn_form(FL_NO_BOX, 513, 353);
+ fdui->form = fl_bgn_form(FL_NO_BOX, 513, 312);
fdui->form->u_vdata = this;
- obj = fl_add_box(FL_UP_BOX, 0, 0, 513, 353, "");
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 513, 312, "");
fl_set_object_lstyle(obj, FL_FIXED_STYLE);
fdui->browser = obj = fl_add_browser(FL_HOLD_BROWSER, 15, 12, 324, 241, "");
fl_set_object_lalign(obj, FL_ALIGN_TOP);
fl_set_object_callback(obj, C_FormBaseInputCB, 0);
{
char const * const dummy = N_("Close|^[^M");
- fdui->button_close = obj = fl_add_button(FL_NORMAL_BUTTON, 409, 313, 90, 30, idex(_(dummy)));
+ fdui->button_close = obj = fl_add_button(FL_NORMAL_BUTTON, 409, 270, 90, 30, idex(_(dummy)));
fl_set_button_shortcut(obj, scex(_(dummy)), 1);
}
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
- {
- char const * const dummy = N_("Help:|#H");
- fdui->choice_help = obj = fl_add_choice(FL_NORMAL_CHOICE, 344, 270, 155, 29, idex(_(dummy)));
- fl_set_button_shortcut(obj, scex(_(dummy)), 1);
- }
- fl_set_object_boxtype(obj, FL_FRAME_BOX);
- fl_set_object_callback(obj, C_FormBaseInputCB, 0);
fl_end_form();
fdui->form->fdui = fdui;
FL_OBJECT *button_fullPath;
FL_OBJECT *button_texhash;
FL_OBJECT *button_close;
- FL_OBJECT *choice_help;
};
#endif /* FD_form_texinfo_h_ */
Name: form_bibtex
Width: 450
Height: 160
-Number of Objects: 9
+Number of Objects: 8
--------------------
class: FL_BOX
callback: C_FormBaseInputCB
argument: 0
---------------------
-class: FL_CHOICE
-type: NORMAL_CHOICE
-box: 89 120 136 29
-boxtype: FL_FRAME_BOX
-colors: FL_COL1 FL_BLACK
-alignment: FL_ALIGN_LEFT
-style: FL_NORMAL_STYLE
-size: FL_DEFAULT_SIZE
-lcol: FL_BLACK
-label: Help:|#H
-shortcut:
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
-name: choice_help
-callback: C_FormBaseInputCB
-argument: 0
-
==============================
create_the_forms
Name: form_citation
Width: 680
Height: 440
-Number of Objects: 26
+Number of Objects: 25
--------------------
class: FL_BOX
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
-box: 220 400 100 30
+box: 10 400 100 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
callback: C_FormBaseCancelCB
argument: 0
---------------------
-class: FL_CHOICE
-type: NORMAL_CHOICE
-box: 80 400 130 30
-boxtype: FL_FRAME_BOX
-colors: FL_COL1 FL_BLACK
-alignment: FL_ALIGN_LEFT
-style: FL_NORMAL_STYLE
-size: FL_DEFAULT_SIZE
-lcol: FL_BLACK
-label: Help:|#H
-shortcut:
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
-name: choice_help
-callback: C_FormBaseInputCB
-argument: 0
-
==============================
create_the_forms
Name: form_sendto
Width: 360
Height: 410
-Number of Objects: 7
+Number of Objects: 6
--------------------
class: FL_BOX
--------------------
class: FL_BROWSER
type: HOLD_BROWSER
-box: 15 30 145 250
+box: 105 30 145 250
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_TOP_LEFT
callback: C_FormBaseInputCB
argument: 0
---------------------
-class: FL_CHOICE
-type: NORMAL_CHOICE
-box: 215 250 130 30
-boxtype: FL_FRAME_BOX
-colors: FL_COL1 FL_BLACK
-alignment: FL_ALIGN_LEFT
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Help:|#H
-shortcut:
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
-name: choice_help
-callback: C_FormBaseInputCB
-argument: 0
-
--------------------
class: FL_BUTTON
type: RETURN_BUTTON
=============== FORM ===============
Name: form_texinfo
Width: 513
-Height: 353
-Number of Objects: 13
+Height: 312
+Number of Objects: 12
--------------------
class: FL_BOX
type: UP_BOX
-box: 0 0 513 353
+box: 0 0 513 312
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
-box: 409 313 90 30
+box: 409 270 90 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
callback: C_FormBaseCancelCB
argument: 0
---------------------
-class: FL_CHOICE
-type: NORMAL_CHOICE
-box: 344 270 155 29
-boxtype: FL_FRAME_BOX
-colors: FL_COL1 FL_BLACK
-alignment: FL_ALIGN_LEFT
-style: FL_NORMAL_STYLE
-size: FL_DEFAULT_SIZE
-lcol: FL_BLACK
-label: Help:|#H
-shortcut:
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
-name: choice_help
-callback: C_FormBaseInputCB
-argument: 0
-
==============================
create_the_form
// sorted by hand to prevent LyXLex from complaining on read().
keyword_item xformTags[] = {
- { "\\gui_background", FL_COL1 },
+ { "\\gui_background", FL_COL1 },
{ "\\gui_buttonbottom", FL_BOTTOM_BCOL },
- { "\\gui_buttonleft", FL_LEFT_BCOL },
- { "\\gui_buttonright", FL_RIGHT_BCOL },
- { "\\gui_buttontop", FL_TOP_BCOL },
- { "\\gui_inactive", FL_INACTIVE },
- { "\\gui_push_button", FL_YELLOW },
- { "\\gui_selected", FL_MCOL },
- { "\\gui_text", FL_BLACK }
+ { "\\gui_buttonleft", FL_LEFT_BCOL },
+ { "\\gui_buttonright", FL_RIGHT_BCOL },
+ { "\\gui_buttontop", FL_TOP_BCOL },
+ { "\\gui_inactive", FL_INACTIVE },
+ { "\\gui_pointer", FL_FREE_COL16 },
+ { "\\gui_push_button", FL_YELLOW },
+ { "\\gui_selected", FL_MCOL },
+ { "\\gui_text", FL_BLACK }
};
default: break;
}
+ string const tag = lexrc.getString();
+
RGBColor col;
if (!lexrc.next()) break;
col.b = lexrc.getInteger();
fl_mapcolor(le, col.r, col.g, col.b);
+
+ if (tag == "\\gui_pointer") {
+ fl_set_cursor_color(FL_DEFAULT_CURSOR,
+ FL_FREE_COL16, FL_WHITE);
+ fl_set_cursor_color(XC_question_arrow,
+ FL_FREE_COL16, FL_WHITE);
+ }
}
return true;
<< "### LyX, The Document Processor\n"
<< "###\n"
<< "### Copyright 1995 Matthias Ettrich\n"
- << "### Copyright 1995-2001 The LyX Team.\n"
+ << "### Copyright 1995-2002 The LyX Team.\n"
<< "###\n"
<< "### ========================================================\n"
<< "\n"
// A few general toggles
switch (action) {
+ case LFUN_TOOLTIPS_TOGGLE:
+ flag.setOnOff(owner->getDialogs()->tooltipsEnabled());
+ break;
+
case LFUN_READ_ONLY_TOGGLE:
flag.setOnOff(buf->isReadonly());
break;
break;
}
+ case LFUN_TOOLTIPS_TOGGLE:
+ owner->getDialogs()->toggleTooltips();
+ break;
+
default:
// Then if it was none of the above
// Trying the BufferView::pimpl dispatch: