#include "Alert.h"
#include "debug.h"
-#include "lyxrc.h"
-
+#include "lyxrc.h"
+
#include "Alert_pimpl.h"
#include <cerrno>
-
+
using std::endl;
using std::pair;
using std::make_pair;
lyxerr << "------------------------------" << endl
<< s1 << endl << s2 << endl << s3 << endl
<< "------------------------------" << endl;
- } else {
+ } else {
alert_pimpl(s1, s2, s3);
}
}
namespace Alert {
/// show an alert message
-void alert(string const & s1, string const & s2 = string(),
+void alert(string const & s1, string const & s2 = string(),
string const & s3 = string());
/// show an alert message and strerror(errno)
void err_alert(string const & s1, string const & s2 = string());
-/// ask a question
+/// ask a question
bool askQuestion(string const & s1, string const & s2 = string(),
string const & s3 = string(), bool default_value = true);
/// Returns 1 for yes, 2 for no, 3 for cancel.
-int askConfirmation(string const & s1, string const & s2 = string(),
+int askConfirmation(string const & s1, string const & s2 = string(),
string const & s3 = string(), int default_value = 1);
/// Asks for a text
std::pair<bool, string> const
-askForText(string const & msg,
+askForText(string const & msg,
string const & dflt = string());
}
*/
#include "debug.h"
-
+
// GUI-specific implementations
void alert_pimpl(string const & s1, string const & s2, string const & s3);
bool askQuestion_pimpl(string const & s1, string const & s2, string const & s3);
2002-03-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
+ * most files: ws cleanup
+
* Makefile.am: remove ld -r stuff
2002-03-20 Lars Gullik Bjønnes <larsbj@birdstep.com>
2001-12-19 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
- * Timeout.h:
+ * Timeout.h:
* FileDialog.h: do not include <config.h> in header files.
2001-12-12 Angus Leeming <a.leeming@ic.ac.uk>
* Alert.h: remove spurious semi-colon at the end of the namespace
- scope.
+ scope.
2001-11-22 John Levon <moz@compsoc.man.ac.uk>
- * Makefile.am:
+ * Makefile.am:
* Alert.h:
* Alert.C:
* Alert_pimpl.h: alerts etc.
2001-08-27 John Levon <moz@compsoc.man.ac.uk>
- * GUIRunTime.h: initApplication() should take a & to argc
-
+ * GUIRunTime.h: initApplication() should take a & to argc
+
2001-08-01 John Levon <moz@compsoc.man.ac.uk>
* Liason.C: IsDirWriteable changed
-
+
2001-07-30 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* Liason.C: #include LAssert.h
2001-07-24 John Levon <moz@compsoc.man.ac.uk>
* Dialogs.h: add showThesaurus
-
+
2001-07-13 Edwin Leuven <leuven@fee.uva.nl>
-
+
* Dialogs.h: add showAboutlyx and remove showCredits and Copyright
2001-07-13 Edwin Leuven <leuven@fee.uva.nl>
* Dialogs.h: added showSpellchecker
-
+
2001-07-03 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
- * GUIRunTime.h: (x11Display):
- (x11Screen):
- (x11Colormap):
+ * GUIRunTime.h: (x11Display):
+ (x11Screen):
+ (x11Colormap):
(x11VisualDepth): new methods
2001-07-03 Lars Gullik Bjønnes <larsbj@birdstep.com>
2001-06-22 John Levon <moz@compsoc.man.ac.uk>
* Makefile.am: remove kde frontend
-
+
2001-06-15 Angus Leeming <a.leeming@ic.ac.uk>
* Dialogs.h: removed unused signal showCharacter.
* DialogBase.h: commented out abstract method show().
- * Dialogs.h: The dialogs are now stored as a
+ * Dialogs.h: The dialogs are now stored as a
std::vector<boost::shared_ptr<DialogBase> >.
Removed using directives.
(d-tor) removed.
* Abstract base class of all dialogs.
* Author: Allan Rae <rae@lyx.org>
* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
/* This file is part of
- * ======================================================
- *
+ * ======================================================
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX Team.
*
//@{
/// Hide all visible dialogs
SigC::Signal0<void> hideAll;
-
+
/// Hide any dialogs that require a buffer for them to operate
SigC::Signal0<void> hideBufferDependent;
-
+
/** Update visible, buffer-dependent dialogs
If the bool is true then a buffer change has occurred
else its still the same buffer.
///
SigC::Signal1<void, InsetError *> showError;
/// show the external inset dialog
- SigC::Signal1<void, InsetExternal *> showExternal;
+ SigC::Signal1<void, InsetExternal *> showExternal;
/// show the contents of a file.
SigC::Signal1<void, string const &> showFile;
/// show all forked child processes
SigC::Signal1<void, InsetInfo *> showInfo;
/// show the LaTeX log or build file
SigC::Signal0<void> showLogFile;
- /// display the top-level maths panel
- SigC::Signal0<void> showMathPanel;
+ /// display the top-level maths panel
+ SigC::Signal0<void> showMathPanel;
///
SigC::Signal1<void, InsetMinipage *> showMinipage;
///
/// show the TexInfo
SigC::Signal0<void> showTexinfo;
/// show the thesaurus dialog
- SigC::Signal1<void, string const &> showThesaurus;
+ SigC::Signal1<void, string const &> showThesaurus;
///
SigC::Signal1<void, InsetCommand *> showTOC;
///
kb_action a = LFUN_SELECT_FILE_SYNC,
Button b1 = Button(string(), string()),
Button b2 = Button(string(), string()));
-
+
~FileDialog();
/**
* Choose a file for selection, starting in directory \param
* path, with the file selection \param mask. The \param mask
- * string is of the form :
+ * string is of the form :
*
* <regular expression to match> | <description>
*
// -*- C++ -*-
/* This file is part of
* ======================================================
- *
+ *
* LyX, The Document Processor
*
* Copyright 2000-2001 The LyX Team.
*/
class GUIRunTime {
public:
- /// initialise the toolkit
+ /// initialise the toolkit
static
int initApplication(int & argc, char * argv[]);
/// process pending events
int x11VisualDepth();
/// the server's DPI estimate
static
- float getScreenDPI();
+ float getScreenDPI();
};
#endif
/* This file is part of
- * ======================================================
- *
+ * ======================================================
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX Team.
*
}
-bool printBuffer(Buffer * buffer, PrinterParams const & pp)
+bool printBuffer(Buffer * buffer, PrinterParams const & pp)
{
string command(lyxrc.print_command + ' ');
-
+
if (pp.target == PrinterParams::PRINTER
&& lyxrc.print_adapt_output // dvips wants a printer name
&& !pp.printer_name.empty()) {// printer name given
case PrinterParams::ODD:
command += lyxrc.print_oddpage_flag + ' ';
break;
-
+
default:
// only option left is print all of them
break;
until XTL and the compilers of the world are ready for something more
elaborate. This is basically the Communicator class from the lyx cvs module
all over again.
-
+
Eventually, we will switch back to the XTL+LyXFunc combination that
worked so nicely on a very small number of compilers and systems.
See the "dialogbase" branch of lyx-devel cvs module for xtl implementation.
} // namespace Liason
#endif
-
-
-
-
/* This file is part of
- * ======================================================
- *
+ * ======================================================
+ *
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
// -*- C++ -*-
/* This file is part of
* ======================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX Team.
class MenuBackend;
/** The LyX GUI independent menubar class
- The GUI interface is implemented in the corresponding Menubar_pimpl class.
+ The GUI interface is implemented in the corresponding Menubar_pimpl class.
*/
class Menubar {
public:
/* This file is part of
- * ======================================================
- *
+ * ======================================================
+ *
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
pimpl_->updateLayoutList(force);
}
-
+
void Toolbar::openLayoutList()
{
pimpl_->openLayoutList();
if (tf == -1) {
lyxerr << "Toolbar::add: no LyX command called`"
- << func << "'exists!" << endl;
+ << func << "'exists!" << endl;
} else {
pimpl_->add(tf, doclean);
}
// -*- C++ -*-
/* This file is part of
* ======================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX Team.
class ToolbarDefaults;
/** The LyX GUI independent toolbar class
- The GUI interface is implemented in the corresponding Toolbar_pimpl class.
+ The GUI interface is implemented in the corresponding Toolbar_pimpl class.
*/
class Toolbar {
public:
///
~Toolbar();
-
+
/// (re)sets the toolbar
void set(bool doingmain = false);
frame, where you can change the toolbar realtime. */
void edit();
/// add a new button to the toolbar.
- void add(int , bool doclean = true);
+ void add(int , bool doclean = true);
/// name of func instead of kb_action
void add(string const & , bool doclean = true);
/// invokes the n'th icon in the toolbar
void push(int);
/// activates the toolbar
- void activate();
+ void activate();
/// deactivates the toolbar
- void deactivate();
+ void deactivate();
/// update the state of the icons
void update();
///
GuiBC(string const & cancel, string const & close);
- ///
+ ///
void setOK(Button * obj) { okay_ = obj; }
- ///
+ ///
void setApply(Button * obj) { apply_ = obj; }
- ///
+ ///
void setCancel(Button * obj) { cancel_ = obj; }
///
void setRestore(Button * obj) { restore_ = obj; }
Button * apply_;
Button * cancel_;
Button * restore_;
-
+
typedef std::list<Widget *> Widgets;
Widgets read_only_;
};
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
#include <config.h>
#include "ButtonControllerBase.h"
#include "support/LAssert.h"
-#include "debug.h"
+#include "debug.h"
ButtonControllerBase::ButtonControllerBase(string const & cancel,
bool ButtonControllerBase::readOnly(bool ro)
{
lyxerr[Debug::GUI] << "Setting controller ro: " << ro << std::endl;
-
+
if (ro) {
bp().input(ButtonPolicy::SMI_READ_ONLY);
} else {
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
///
string cancel_label_;
///
- string close_label_;
+ string close_label_;
};
#endif // BUTTONCONTROLLERBASE_H
lyxerr[Debug::GUI] << "Transition from state "
<< state << " to state " << tmp << " after input "
<< in << std::endl;
-
+
if (ButtonPolicy::BOGUS != tmp) {
state = tmp;
} else {
//lyxerr << "PreferencesPolicy::input" << endl;
// CANCEL and HIDE always take us to INITIAL for all cases.
// Note that I didn't put that special case in the helper function
- // because it doesn't belong there. Some other
+ // because it doesn't belong there. Some other
// This is probably optimising for the wrong case since it occurs as the
// dialog will be hidden. It would have saved a little memory in the
// state machine if I could have gotten map working. ARRae 20000813
void OkCancelPolicy::input(SMInput input)
{
//lyxerr << "OkCancelPolicy::input" << endl;
-
+
// CANCEL and HIDE always take us to INITIAL for all cases
if (SMI_CANCEL == input
|| SMI_HIDE == input) {
void OkCancelReadOnlyPolicy::input(SMInput input)
{
//lyxerr << "OkCancelReadOnlyPolicy::input" << endl;
-
+
// CANCEL and HIDE always take us to INITIAL for all cases
if (SMI_CANCEL == input
|| SMI_HIDE == input) {
void NoRepeatedApplyReadOnlyPolicy::input(SMInput input)
{
//lyxerr << "NoReapeatedApplyReadOnlyPolicy::input" << endl;
-
+
// CANCEL and HIDE always take us to INITIAL for all cases
if (SMI_CANCEL == input
|| SMI_HIDE == input) {
void OkApplyCancelReadOnlyPolicy::input(SMInput input)
{
//lyxerr << "OkApplyCancelReadOnlyPolicy::input" << endl;
-
+
// CANCEL and HIDE always take us to INITIAL for all cases
if (SMI_CANCEL == input
|| SMI_HIDE == input) {
void OkApplyCancelPolicy::input(SMInput input)
{
//lyxerr << "OkApplyCancelPolicy::input" << endl;
-
+
// CANCEL and HIDE always take us to INITIAL for all cases
if (SMI_CANCEL == input
|| SMI_HIDE == input) {
void NoRepeatedApplyPolicy::input(SMInput input)
{
//lyxerr << "NoRepeatedApplyPolicy::input" << endl;
-
+
// CANCEL and HIDE always take us to INITIAL for all cases
if (SMI_CANCEL == input
|| SMI_HIDE == input) {
///
BOGUS = 55
};
-
+
/// The various button types.
enum Button {
///
///
static const Button ALL_BUTTONS =
Button(OKAY | APPLY | CANCEL | RESTORE);
-
+
/** State machine inputs.
All the policies so far have both CANCEL and HIDE always going to
INITIAL. This won't necessarily be true for all [future] policies
SMI_INVALID,
/// an apply-and-hide action has happened
SMI_OKAY,
- /// an apply action has happened
+ /// an apply action has happened
SMI_APPLY,
/// a cancel action has happened
SMI_CANCEL,
SMI_READ_ONLY,
/// the dialog contents can be modified
SMI_READ_WRITE,
- /// the state of the dialog contents has not changed
+ /// the state of the dialog contents has not changed
SMI_NOOP,
/// for internal use
SMI_TOTAL
OkCancelPolicy();
///
//virtual ~OkCancelPolicy() {}
-
+
/// Trigger a transition with this input.
virtual void input(SMInput);
/** Activation status of a button.
OkCancelReadOnlyPolicy();
///
//virtual ~OkCancelReadOnlyPolicy() {}
-
+
/// Trigger a transition with this input.
virtual void input(SMInput);
/// Activation status of a button.
NoRepeatedApplyReadOnlyPolicy();
///
//virtual ~NoRepeatedApplyReadOnlyPolicy() {}
-
+
/// Trigger a transition with this input.
virtual void input(SMInput);
/// Activation status of a button.
OkApplyCancelReadOnlyPolicy();
///
//virtual ~OkApplyCancelReadOnlyPolicy() {}
-
+
/// Trigger a transition with this input.
virtual void input(SMInput);
/// Activation status of a button.
OkApplyCancelPolicy();
///
//virtual ~OkApplyCancelPolicy() {}
-
+
/// Trigger a transition with this input.
virtual void input(SMInput);
/// Activation status of a button.
NoRepeatedApplyPolicy();
///
//virtual ~NoRepeatedApplyPolicy() {}
-
+
/// Trigger a transition with this input.
virtual void input(SMInput);
/// Activation status of a button.
PreferencesPolicy();
///
//virtual ~PreferencesPolicy() {}
-
+
/// Trigger a transition with this input.
virtual void input(SMInput);
/// Activation status of a button.
class IgnorantPolicy : public ButtonPolicy {
public:
//virtual ~IgnorantPolicy() {}
-
+
/// Trigger a transition with this input.
virtual void input(SMInput) {}
/// Activation status of a button.
+2002-03-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * most files: ws cleanup
+
2002-03-18 Angus Leeming <a.leeming@ic.ac.uk>
* biblio.C (getInfo): string::c_str() never returns NULL. Don't test
* ControlGraphics.C:
* ControlInclude.C: better error messages
-
+
2002-03-11 Herbert Voss <voss@lyx.org>
* biblio.C (parseBibTeX): fix another minibug with an
2002-03-09 Herbert Voss <voss@lyx.org>
- * ControlGraphics.[Ch]: adding checkFilename() for testing
+ * ControlGraphics.[Ch]: adding checkFilename() for testing
of non-existing files
2002-03-07 Lars Gullik Bjønnes <larsbj@birdstep.com>
2002-03-05 Herbert Voss <voss@lyx.org>
* biblio.C (getInfo): simplify if using paragraph layout
- "bibliography".
+ "bibliography".
2002-03-05 Angus Leeming <a.leeming@ic.ac.uk>
* ControlGraphics.C: remove #include "support/syscall.h" as it's not
used.
- * ControlTexinfo.C:
+ * ControlTexinfo.C:
change Systemcalls::System to Systemcalls::Wait and
No change of functionality, just reflects the stripped down Systemcalls
class.
* ControlSpellchecker.C: clear any selection left
(bug #211)
-
+
2002-02-01 Herbert Voss <voss@lyx.org>
* ControlGraphics.[C] (readBB): search only, if it is a
* biblio.C (getInfo): fix bug when no author is given
- * biblio.C (parseBibTeX): change the parsing, so that
+ * biblio.C (parseBibTeX): change the parsing, so that
'#'-characters in a bibtex entry are no more a problem.
2002-01-19 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
Rename ControlDialogs.h as ControlDialog.h.
Add ButtonController.tmpl ControlDialog.tmpl ControlInset.tmpl to
EXTRA_DIST.
-
+
2002-01-15 Angus Leeming <a.leeming@ic.ac.uk>
* ControlInset.h (apply): fix bug unearthed by Michael Koziarski.
* helper_funcs.h (browseFile): add default empty button descriptions.
- * ControlGraphics.C (Browse):
- * ControlBibtex.C (Browse):
+ * ControlGraphics.C (Browse):
+ * ControlBibtex.C (Browse):
* ControlInclude.C (Browse): add shortcuts to directory buttons
2002-01-12 John Levon <moz@compsoc.man.ac.uk>
* ControlThesaurus.h:
* ControlThesaurus.C: update to Aiksaurus 0.14
-
+
2002-01-07 Angus Leeming <a.leeming@ic.ac.uk>
* ControlSpellchecker.C (clearParams): show the closing message
2001-11-04 John Levon <moz@compsoc.man.ac.uk>
* ControlToc.C: changes for floatlist
-
+
2001-11-04 John Levon <moz@compsoc.man.ac.uk>
* ControlVCLog.C: use _()
-
+
2001-10-23 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* ControlSpellchecker.C: include <sys/types.h> since FreeBSD needs
* ControlTexinfo.C: new path for the shellscript TeXFiles.sh
and some more stuff from FormTexinfo.C
-
+
* ControlShowFile.C: hiding the update-button
2001-10-09 Herbert Voss <voss@perce.de>
* ControlDialogs.h: remove bc() hack, now fixed in
Qt2 frontend. use member dialog_built_ instead of shared
static.
-
- * ButtonController.h:
+
+ * ButtonController.h:
* ButtonPolicies.C: more debug info
-
+
* ButtonControllerBase.C: call refresh() when setting readOnly !
-
+
* GUI.h: External form has apply, use the right policy
* character.C: fix two off-by-one errors when latex font was removed
-
+
2001-08-15 Angus Leeming <a.leeming@ic.ac.uk>
* ControlInset.h (apply): tentative fix for the press Apply multiple
* ControlCharacter.C: fix typo
- * ViewBase.h:
+ * ViewBase.h:
* ControlDialogs.C:
* ControlInsets.C: make sure dialog is built before it is shown, so
it works properly the very first time it is shown
-
+
2001-08-20 Herbert Voss <voss@perce.de>
* ControlBibtex.[Ch]: enhanced bibtex-data gui to browse for databases
2001-08-09 Allan Rae <rae@lyx.org>
- * Makefile.am (SUBDIRS, dist-hook): remove bogus entries.
+ * Makefile.am (SUBDIRS, dist-hook): remove bogus entries.
2001-08-07 Angus Leeming <a.leeming@ic.ac.uk>
* ControlInclude.h:
* ControlInclude.C: implement ability to load file
-
+
2001-07-18 Juergen Vigna <jug@sad.it>
* ControlSearch.C (replace): changes to lyxfind.h function calls.
2001-07-17 Edwin Leuven <leuven@fee.uva.nl>
* ControlSpellchecker.[Ch]: remove member quit() and some cleaning
-
+
2001-07-16 Juergen Vigna <jug@sad.it>
* ControlSpellchecker.C (show): use the lyxrc.use_pspell flag (if
2001-07-13 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
- * ControlSpellchecker.C (getSuggestion):
+ * ControlSpellchecker.C (getSuggestion):
(getWord): add std:: qualifier
2001-07-13 Edwin Leuven <leuven@fee.uva.nl>
* ControlSpellchecker.[Ch]: added
* ViewBase.h: added partialUpdate(int) member
* GUI.h: added spell stuff
-
+
2001-07-12 Lars Gullik Bjønnes <larsbj@birdstep.com>
* ControlExternal.C: (*it). -> it->
2001-04-17 Lars Gullik Bjønnes <larsbj@birdstep.com>
* ButtonControllerBase.h: C++ mode, inherit privately from
- noncopyable
+ noncopyable
* ButtonPolicies.h: ditto
* ButtonController.h: C++ mode, swap init order of restore_ and
- cancel_
+ cancel_
2001-04-06 John Levon <moz@compsoc.man.ac.uk>
2001-04-05 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
- * ControlToc.C:
- * ControlSearch.C:
- * ControlPrint.C:
- * ControlPreamble.C:
- * ControlInclude.C:
- * ControlGraphics.C:
- * ControlExternal.C:
+ * ControlToc.C:
+ * ControlSearch.C:
+ * ControlPrint.C:
+ * ControlPreamble.C:
+ * ControlInclude.C:
+ * ControlGraphics.C:
+ * ControlExternal.C:
* ControlCopyright.C: include gettext.h
- * ControlCharacter.C:
+ * ControlCharacter.C:
* character.C: include gettext.h and language.h
2001-04-03 John Levon <moz@compsoc.man.ac.uk>
* ViewBase.h:
* ControlConnections.h: associated change in #include and class names.
-
+
* ControlExternal.[Ch]: new files; a controller for the External
Material popup.
2001-03-23 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* ControlCredits.C (getCredits): remove std:: qualifier for
- getline().
+ getline().
2001-03-23 Lars Gullik Bjønnes <larsbj@trylle.birdstep.com>
* ControlCommand.h (c-tor): give kb_action a default value of
LFUN_NOACTION.
-
+
* ControlCommand.C (apply): do nothing if kb_action is LFUN_NOACTION.
-
+
* ControlCitation.[Ch]: moved search functions out of class.
(bibkeysInfo): new method. Returns const reference to private data.
(searchKeys): added case-sensitive switch. Used only by simpleSearch
* ControlCitation.h: the templatised class GUICitation instantiates
the methods view() and bc(). It also stores the instances of the
View and ButtonController.
-
+
2001-02-23 Angus Leeming <a.leeming@ic.ac.uk>
* ButtonControllerBase.[Ch]: renamed as ButtonController.[Ch]. Class
<< "\n"
<< _("User directory: ")
<< MakeDisplayPath(user_lyxdir);
-
+
return ss.str().c_str();
}
///
stringstream & getCredits(stringstream &) const;
-
+
///
string const getCopyright() const;
///
string const getVersion() const;
-
+
private:
/// not needed.
};
#endif // CONTROLABOUTLYX_H
-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
{}
-string const ControlBibtex::Browse(string const & in_name,
- string const & title,
+string const ControlBibtex::Browse(string const & in_name,
+ string const & title,
string const & pattern)
{
pair<string, string> dir1(N_("Documents|#o#O"), string(lyxrc.document_path));
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
ControlBibtex(LyXView &, Dialogs &);
/// Browse for a file
string const Browse(string const &, string const &, string const &);
-
+
private:
/// Dispatch the changed parameters to the kernel.
virtual void applyParamsToInset();
- ///
+ ///
virtual void applyParamsNoInset();
};
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
bool ControlButtons::IconifyWithMain() const
{
- return lyxrc.dialogs_iconify_with_main;
+ return lyxrc.dialogs_iconify_with_main;
}
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
private:
///
bool is_closing_;
-
+
};
#endif // CONTROLBUTTONS_H
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
private:
/// create the InfoMap of keys and data
virtual void setDaughterParams();
- ///
+ ///
virtual void clearDaughterParams();
/** disconnect from the inset when the Apply button is pressed.
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
if (action_ == LFUN_NOACTION) return;
lv_.getLyXFunc()->dispatch(action_, params().getAsString());
}
-
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* The class is likely to be changed as other Inset controllers are created
* and it becomes clear just what functionality can be moved back into
* ControlInset.
- *
+ *
*/
#ifndef CONTROLCOMMAND_H
#include "insets/insetcommand.h"
#include "commandtags.h" // kb_action
-/** The Inset dialog controller. Connects/disconnects signals, launches
+/** The Inset dialog controller. Connects/disconnects signals, launches
GUI-dependent View and returns the output from this View to the kernel.
*/
class ControlCommand : public ControlInset<InsetCommand, InsetCommandParams>
private:
/// Dispatch the changed parameters to the kernel.
virtual void applyParamsToInset();
- ///
+ ///
virtual void applyParamsNoInset();
/// get the parameters from the string passed to createInset.
virtual InsetCommandParams const getParams(string const &);
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
ControlConnectBI::ControlConnectBI(LyXView & lv, Dialogs & d)
- : ControlConnectBase(lv, d)
+ : ControlConnectBase(lv, d)
{}
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
ControlConnectBase(LyXView &, Dialogs &);
/// The View may need to know if the buffer is read-only.
bool isReadonly() const;
- ///
+ ///
DocTypes docType() const;
protected:
class ControlConnectBI : public ControlConnectBase
{
public:
- ///
- ControlConnectBI(LyXView &, Dialogs &);
+ ///
+ ControlConnectBI(LyXView &, Dialogs &);
protected:
///
* \author Angus Leeming <a.leeming@ic.ac.uk>
*
* ControlDialog is to be used as a parent class for dialogs that are not
- * views onto parameters of insets. (An ugly description I know, but I hope
- * the meaning is clear! Can anyone do any better?) Examples would be the
+ * views onto parameters of insets. (An ugly description I know, but I hope
+ * the meaning is clear! Can anyone do any better?) Examples would be the
* Document and Paragraph dialogs.
*/
class LyXView;
-class ControlDialogBD : public ControlDialog<ControlConnectBD>
+class ControlDialogBD : public ControlDialog<ControlConnectBD>
{
public:
///
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
// -*- C++ -*-
/* This file is part of
* ======================================================
- *
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 2001 The LyX Team.
*
*======================================================
private:
/// Dispatch the changed parameters to the kernel.
virtual void applyParamsToInset();
- ///
+ ///
virtual void applyParamsNoInset();
/// get the parameters from the string passed to createInset.
virtual ERTParams const getParams(string const &)
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
{
return inset.getContents();
}
-
/*
* \file ControlError.h
* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
private:
/// not needed.
virtual void applyParamsToInset() {}
- ///
+ ///
virtual void applyParamsNoInset() {}
/// get the parameters from the string passed to createInset.
virtual string const getParams(string const &) { return string(); }
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
return InsetExternal::Params();
}
-InsetExternal::Params const
+InsetExternal::Params const
ControlExternal::getParams(InsetExternal const & inset)
{
return inset.params();
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
#include "insets/insetexternal.h"
/** A controller for External dialogs.
- */
+ */
class ControlExternal
: public ControlInset<InsetExternal, InsetExternal::Params>
{
string const Browse(string const &) const;
private:
- ///
+ ///
virtual void applyParamsToInset();
/// not needed.
virtual void applyParamsNoInset() {}
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
FloatParams::FloatParams(InsetFloat const & inset)
- : placement(inset.placement()),
+ : placement(inset.placement()),
allow_here_definitely(!inset.wide())
{}
// -*- C++ -*-
/* This file is part of
* ======================================================
- *
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 2001 The LyX Team.
*
*======================================================
inline
-bool operator==(FloatParams const & p1, FloatParams const & p2)
+bool operator==(FloatParams const & p1, FloatParams const & p2)
{
return p1.placement == p2.placement && p1.allow_here_definitely == p2.allow_here_definitely;
}
inline
-bool operator!=(FloatParams const & p1, FloatParams const & p2)
+bool operator!=(FloatParams const & p1, FloatParams const & p2)
{
return !(p1 == p2);
}
private:
/// Dispatch the changed parameters to the kernel.
virtual void applyParamsToInset();
- ///
+ ///
virtual void applyParamsNoInset();
/// get the parameters from the string passed to createInset.
virtual FloatParams const getParams(string const &)
-/**
+/**
* \file ControlForks.C
* Copyright 2001 The LyX Team
* Read COPYING
pids_.clear();
childrenChanged_.disconnect();
}
-
// -*- C++ -*-
-/**
+/**
* \file ControlForks.h
* Copyright 2001 The LyX Team
* Read COPYING
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* \author Herbert Voss <voss@perce.de>
*/
-#include <config.h>
+#include <config.h>
#include <fstream>
#ifdef __GNUG__
#pragma implementation
-#endif
+#endif
#include "ViewBase.h"
#include "ButtonControllerBase.h"
// We need these in the file browser.
extern string system_lyxdir;
extern string user_lyxdir;
-
+
string const ControlGraphics::Browse(string const & in_name)
{
string const title = N_("Select graphics file");
- // FIXME: currently we need the second '|' to prevent mis-interpretation
+ // FIXME: currently we need the second '|' to prevent mis-interpretation
string const pattern = "*.(ps|eps|png|jpeg|jpg|gif|gz)|";
- // Does user clipart directory exist?
- string clipdir = AddName (user_lyxdir, "clipart");
- FileInfo fileInfo(clipdir);
- if (!(fileInfo.isOK() && fileInfo.isDir()))
- // No - bail out to system clipart directory
- clipdir = AddName (system_lyxdir, "clipart");
+ // Does user clipart directory exist?
+ string clipdir = AddName (user_lyxdir, "clipart");
+ FileInfo fileInfo(clipdir);
+ if (!(fileInfo.isOK() && fileInfo.isDir()))
+ // No - bail out to system clipart directory
+ clipdir = AddName (system_lyxdir, "clipart");
pair<string, string> dir1(N_("Clipart|#C#c"), clipdir);
pair<string, string> dir2(N_("Documents|#o#O"), string(lyxrc.document_path));
// Show the file browser dialog
return browseFile(&lv_, in_name, title, pattern, dir1, dir2);
}
-
+
string const ControlGraphics::readBB(string const & file)
{
// in a file it's an entry like %%BoundingBox:23 45 321 345
// the first number can following without a space, so we have
-// to check a bit more.
+// to check a bit more.
// on the other hand some plot programs write the bb at the
// end of the file. Than we have in the header a
-// %%BoundingBox: (atend)
+// %%BoundingBox: (atend)
// In this case we must check until the end.
string file_ = file;
if (zippedFile(file_))
file_ = unzipFile(file_);
std::ifstream is(file_.c_str());
- if (!contains(getExtFromContents(file_),"ps")) // bb exists?
+ if (!contains(getExtFromContents(file_),"ps")) // bb exists?
return string();
while (is) {
string s;
string a, b, c, d;
is >> a >> b >> c >> d;
if (is && !contains(a,"atend")) { // bb at the end?
- if (s != "%%BoundingBox:")
+ if (s != "%%BoundingBox:")
return (s.substr(14)+" "+a+" "+b+" "+c+" ");
else
return (a+" "+b+" "+c+" "+d+" ");
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
#ifdef __GNUG__
#pragma interface
-#endif
+#endif
#include "ControlInset.h"
private:
/// Dispatch the changed parameters to the kernel.
virtual void applyParamsToInset();
- ///
+ ///
virtual void applyParamsNoInset();
/// get the parameters from the string passed to createInset.
virtual InsetGraphicsParams const getParams(string const &);
};
#endif // CONTROLGRAPHICS_H
-
string const title = _("Select document to include");
// input TeX, verbatim, or LyX file ?
- string pattern;
+ string pattern;
switch (in_type) {
case INPUT:
pattern = _("*.tex| LaTeX Documents (*.tex)");
pattern = _("*.lyx| LyX Documents (*.lyx)");
break;
}
-
+
pair<string, string> dir1(N_("Documents|#o#O"),
string(lyxrc.document_path));
string const docpath = OnlyPath(params().masterFilename_);
-
+
return browseRelFile(&lv_, in_name, docpath, title, pattern, dir1);
}
bool ControlInclude::fileExists(string const & file)
{
- string const fileWithAbsPath = MakeAbsPath(file, OnlyPath(params().masterFilename_));
+ string const fileWithAbsPath = MakeAbsPath(file, OnlyPath(params().masterFilename_));
if (IsFileReadable(fileWithAbsPath))
return true;
else
Alert::alert(_("Specified file doesn't exist !"));
return false;
}
-
string const Browse(string const &, Type);
/// load a file
- void load(string const & file);
+ void load(string const & file);
/// test if file exist
- bool fileExists(string const & file);
+ bool fileExists(string const & file);
private:
/// Dispatch the changed parameters to the kernel.
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
virtual bool disconnectOnApply() { return false; }
-
+
/// Instantiation of ControlButtons virtual methods.
/// Get changed parameters and Dispatch them to the kernel.
void connectInset(Inset * = 0);
/// pointer to the inset passed through connectInset
- Inset * inset_;
+ Inset * inset_;
/// inset::hide connection.
SigC::Connection ih_;
/** A local copy of the inset's params.
/// is the dialog built ?
bool dialog_built_;
-
+
};
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
// -*- C++ -*-
/* This file is part of
* ======================================================
- *
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 2001 The LyX Team.
*
*======================================================
private:
/// Dispatch the changed parameters to the kernel.
virtual void applyParamsToInset();
- ///
+ ///
virtual void applyParamsNoInset();
/// get the parameters from the string passed to createInset.
virtual MinipageParams const getParams(string const &)
{
if (!lv_.view()->available())
return;
-
+
view().apply();
lv_.buffer()->params.preamble = params();
virtual void setParams();
/// clean-up on hide.
virtual void clearParams();
-
+
///
string * params_;
};
/* This file is part of
* ======================================================
- *
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 2001 The LyX Team.
*
*======================================================
{
if (!lv_.view()->available())
return;
-
+
view().apply();
if (!printBuffer(lv_.buffer(), params())) {
// -*- C++ -*-
/* This file is part of
* ======================================================
- *
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 2001 The LyX Team.
*
*======================================================
*/
class ControlPrint : public ControlDialogBD {
public:
- ///
+ ///
ControlPrint(LyXView &, Dialogs &);
/// Browse for a file
virtual void setParams();
/// clean-up on hide.
virtual void clearParams();
-
+
///
PrinterParams * params_;
};
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
vector<string> const ControlRef::getBufferList() const
{
-
+
vector<string> buffers = bufferlist.getFileNames();
for (vector<string>::iterator it = buffers.begin();
it != buffers.end(); ++it) {
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
bool casesensitive, bool matchword, bool forward) const
{
bool const found = LyXFind(lv_.view(), search,
- forward, false, casesensitive, matchword);
-
+ forward, false, casesensitive, matchword);
+
if (!found)
setMinibuffer(&lv_, _("String not found!"));
}
// changed
bool const once = !all;
int const replace_count = LyXReplace(lv_.view(),
- search, replace, true, casesensitive,
- matchword, all, once);
-
+ search, replace, true, casesensitive,
+ matchword, all, once);
+
if (replace_count == 0) {
setMinibuffer(&lv_, _("String not found!"));
} else {
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
public:
///
ControlSearch(LyXView &, Dialogs &);
-
+
/// Searches occurence of string
void find(string const & search,
bool casesensitive, bool matchword, bool forward) const;
{
if (!lv_.view()->available())
return;
-
+
view().apply();
if (command_.empty() || !format_)
} else {
Exporter::Export(lv_.buffer(), format_->name(), true, filename);
- }
+ }
// Substitute $$FName for filename
string command = command_;
Systemcall call;
call.startscript(Systemcall::DontWait, command);
}
-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
#include "buffer.h"
#include "lyxrc.h"
#include "BufferView.h"
-#include "LyXView.h"
+#include "LyXView.h"
#include "lyxtext.h"
#include "gettext.h"
#include "support/lstrings.h"
if (lyxrc.use_pspell) {
tmp = (lyxrc.isp_use_alt_lang) ?
lyxrc.isp_alt_lang : lv_.buffer()->params.language->code();
-
+
speller_ = new PSpell(lv_.view()->buffer()->params, tmp);
} else {
#endif
tmp = (lyxrc.isp_use_alt_lang) ?
lyxrc.isp_alt_lang : lv_.buffer()->params.language->lang();
-
+
speller_ = new ISpell(lv_.view()->buffer()->params, tmp);
#ifdef USE_PSPELL
}
#endif
-
+
if (lyxrc.isp_use_alt_lang) {
Language const * lang = languages.getLanguage(tmp);
if (lang)
} else {
rtl_ = lv_.buffer()->params.language->RightToLeft();
}
-
+
if (speller_->error() != 0) {
#if 0
message_ = speller_->error();
{
result_ = SpellBase::ISP_OK;
stop_ = false;
-
+
// clear any old selection
LyXText * text = lv_.view()->getLyXText();
lv_.view()->toggleSelection(true);
lv_.view()->update(text, BufferView::SELECT);
-
+
while ((result_==SpellBase::ISP_OK || result_==SpellBase::ISP_IGNORE) &&
!stop_) {
word_ = lv_.view()->nextWord(newval_);
-
+
if (word_.empty()) {
clearParams();
break;
}
-
+
++count_;
// Update slider if and only if value has changed
// set progress bar
view().partialUpdate(0);
}
-
+
if (!speller_->alive()) clearParams();
-
+
result_ = speller_->check(word_);
}
-
+
if (!stop_ && !word_.empty())
lv_.view()->selectLastWord();
// segfaults when nextMiss is 0
string tmp;
char const * w = speller_->nextMiss();
-
+
if (w!=0) {
tmp = w;
if (rtl_) std::reverse(tmp.begin(), tmp.end());
}
-
+
return tmp;
}
void ControlSpellchecker::clearParams()
{
if (!speller_) return;
-
+
if (speller_->alive()) {
speller_->close();
message_ = tostr(count_);
// make sure that the dialog is not launched
emergency_exit_ = true;
}
-
+
delete speller_;
-
+
lv_.view()->endOfSpellCheck();
// show closing message if any words were checked.
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
/// ignore all occurances of word
void ignoreAll();
-
+
/// stop checking
void stop();
/// spell options
void options();
-
+
/// get suggestion
string getSuggestion();
/// returns progress value
int getProgress() {
- return oldval_;
+ return oldval_;
}
/// returns exit message
string getMessage() {
return message_;
}
-
+
private:
-
+
/// set the params before show or update
void setParams();
/// clean-up on hide.
/// The actual spellchecker object
SpellBase * speller_;
-
+
};
#endif // CONTROLSPELLCHECKER_H
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
{
if (!lv_.view()->available())
return;
-
+
view().apply();
- string const val(tostr(params().first) + " " + tostr(params().second));
-
+ string const val(tostr(params().first) + " " + tostr(params().second));
+
lv_.getLyXFunc()->dispatch(LFUN_INSET_TABULAR, val);
}
// -*- C++ -*-
/* This file is part of
* ======================================================
- *
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 2001 The LyX Team.
*
*======================================================
#define CONTROLTABULARCREATE_H
#include <utility>
-
+
#ifdef __GNUG__
#pragma interface
#endif
*/
class ControlTabularCreate : public ControlDialogBD {
public:
- ///
+ ///
ControlTabularCreate(LyXView &, Dialogs &);
-
+
typedef std::pair<unsigned int, unsigned int> rowsCols;
///
/// set the params before show or update
virtual void setParams();
-
+
/// rows, cols params
rowsCols params_;
};
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
//path to texhash through system
Systemcall one;
one.startscript(Systemcall::Wait, "texhash");
-
+
p.pop();
-// Alert::alert(_("texhash run!"),
+// Alert::alert(_("texhash run!"),
// _("rebuilding of the TeX-tree could only be successfull"),
// _("if you have had user-write-permissions to the tex-dir."));
}
string const sortEntries(string & str_in)
{
std::vector<string> dbase = getVectorFromString(str_in,"\n");
- std::sort(dbase.begin(), dbase.end()); // sort entries
- std::vector<string>::iterator p =
- std::unique(dbase.begin(), dbase.end()); // compact
- dbase.erase(p, dbase.end()); // shrink
+ std::sort(dbase.begin(), dbase.end()); // sort entries
+ std::vector<string>::iterator p =
+ std::unique(dbase.begin(), dbase.end()); // compact
+ dbase.erase(p, dbase.end()); // shrink
return getStringFromVector(dbase,"\n");
}
string filename;
switch (type) {
- case bst:
+ case bst:
filename = bstFilename;
break;
case cls:
{
lv_.getDialogs()->showFile(filename);
}
-
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
public:
///
ControlThesaurus(LyXView &, Dialogs &);
-
+
/// replace the particular string
void replace(string const & newstr);
/// get meanings
Thesaurus::Meanings const & getMeanings(string const & str);
-
+
/// the text
string const & text() {
return oldstr_;
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
}
-namespace toc
+namespace toc
{
string const getType(string const & cmdName)
return type;
}
-
-} // namespace toc
+
+} // namespace toc
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
Buffer::SingleList const getContents(string const & type) const;
};
-namespace toc
+namespace toc
{
/** Given the cmdName of the TOC param, returns the type used
by ControlToc::getContents() */
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
/** A controller for the Url Dialog.
*/
-class ControlUrl : public ControlCommand
+class ControlUrl : public ControlCommand
{
public:
///
ss << in.rdbuf();
found = ss.good();
}
-
+
if (!found)
ss << _("No version control log file found.") << endl;
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
template <class GUIview, class GUIbc>
class GUITabularCreate :
public GUI<ControlTabularCreate, GUIview,
- OkApplyCancelReadOnlyPolicy, GUIbc> {
+ OkApplyCancelReadOnlyPolicy, GUIbc> {
public:
///
GUITabularCreate(LyXView & lv, Dialogs & d)
template <class GUIview, class GUIbc>
class GUIThesaurus :
public GUI<ControlThesaurus, GUIview,
- OkApplyCancelReadOnlyPolicy, GUIbc> {
+ OkApplyCancelReadOnlyPolicy, GUIbc> {
public:
///
GUIThesaurus(LyXView & lv, Dialogs & d)
OkApplyCancelReadOnlyPolicy, GUIbc>(lv, d) {}
};
-
+
/** Specialization for Url dialog
*/
template <class GUIview, class GUIbc>
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
class ViewBase {
public:
- ///
+ ///
ViewBase(ControlButtons & c) : controller_(c) {}
- ///
+ ///
virtual ~ViewBase() {}
/// Apply changes to LyX data from dialog.
/** These shortcuts allow (e.g. xform's) global callback functions
access to the buttons without making the whole controller_ public.
*/
- ///
- void ApplyButton() { controller_.ApplyButton(); }
- ///
- void OKButton() { controller_.OKButton(); }
- ///
- void CancelButton() { controller_.CancelButton(); }
- ///
- void RestoreButton() { controller_.RestoreButton(); }
-
+ ///
+ void ApplyButton() { controller_.ApplyButton(); }
+ ///
+ void OKButton() { controller_.OKButton(); }
+ ///
+ void CancelButton() { controller_.CancelButton(); }
+ ///
+ void RestoreButton() { controller_.RestoreButton(); }
+
/** Defaults to nothing. Can be used by the Controller, however, to
indicate to the View that something has changed and that the
dialog therefore needs updating. */
virtual void partialUpdate(int) {}
-
+
protected:
/// The view is, after all, controlled!
ControlButtons & controller_;
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
using std::vector;
using std::sort;
-namespace biblio
+namespace biblio
{
namespace {
using namespace biblio;
-
+
char const * const citeCommands[] = {
- "cite", "citet", "citep", "citealt", "citealp", "citeauthor",
+ "cite", "citet", "citep", "citealt", "citealp", "citeauthor",
"citeyear", "citeyearpar" };
unsigned int const nCiteCommands =
unsigned int const nCiteStylesUCase =
sizeof(citeStylesUCase) / sizeof(CiteStyle);
-
+
// The functions doing the dirty work for the search.
vector<string>::const_iterator
break;
}
}
-
+
if (found) return it;
}
return keys.end();
}
-
+
vector<string>::const_iterator
regexSearch(InfoMap const & theMap,
vector<string> const & keys,
idx = fname.rfind(".");
if (idx != string::npos)
fname = frontStrip(fname.substr(idx+1));
-
+
return fname;
}
{
lyx::Assert(!map.empty());
- InfoMap::const_iterator it = map.find(key);
+ InfoMap::const_iterator it = map.find(key);
string author;
if (it != map.end()) {
{
lyx::Assert(!map.empty());
- InfoMap::const_iterator it = map.find(key);
+ InfoMap::const_iterator it = map.find(key);
string year;
if (year.empty())
year = "50BC";
-
+
return year;
}
-} // namespace anon
+} // namespace anon
// A functor for use with std::sort, leading to case insensitive sorting
-struct compareNoCase: public std::binary_function<string, string, bool>
+struct compareNoCase: public std::binary_function<string, string, bool>
{
bool operator()(string const & s1, string const & s2) const {
return compare_no_case(s1, s2) < 0;
{
lyx::Assert(!map.empty());
- InfoMap::const_iterator it = map.find(key);
+ InfoMap::const_iterator it = map.find(key);
if (it == map.end())
return string();
// is the entry a BibTeX one or one from lyx-layout "bibliography"?
// This should never happen (or at least be very unusual!)
return it->second;
}
-
+
vector<string>::const_iterator
searchKeys(InfoMap const & theMap,
// Preliminary checks
if (start < keys.begin() || start >= keys.end())
return keys.end();
-
+
string search_expr = frontStrip(strip(expr));
if (search_expr.empty())
return keys.end();
return string();
// now get only the important line of the bibtex entry.
- // all entries are devided by ',' except the last one.
+ // all entries are devided by ',' except the last one.
data += ','; // now we have same behaviour for all entries
// because the last one is "blah ... }"
- Entries = 0;
+ Entries = 0;
dummy = token(data, ',', Entries);
while (!contains(lowercase(dummy), findkey) && !dummy.empty())
dummy = token(data, ',', ++Entries);
keyvalue += (',' + dummy);
dummy = token(data, ',', ++Entries);
}
- data = keyvalue; // now we have the important line
+ data = keyvalue; // now we have the important line
data = strip(data, ' '); // all spaces
if (!contains(data, '{')) // no opening '{'
data = strip(data, '}');// maybe there is a main closing '}'
} else {
// no {} and no "", pure data but with a
// possible ',' at the end
- return strip(data,',');
+ return strip(data,',');
}
string tmp = data.substr(keypos);
while (tmp.find('{') != string::npos &&
tmp.find('}') != string::npos &&
tmp.find('{') < tmp.find('}') &&
tmp.find('{') < tmp.find(enclosing)) {
-
+
keypos += tmp.find('{') + 1;
tmp = data.substr(keypos);
keypos += tmp.find('}') + 1;
- tmp = data.substr(keypos);
+ tmp = data.substr(keypos);
}
if (tmp.find(enclosing) == string::npos)
return data;
CitationStyle const getCitationStyle(string const & command)
{
if (command.empty()) return CitationStyle();
-
+
CitationStyle cs;
string cmd = command;
return cite;
}
-
+
vector<CiteStyle> const getCiteStyles(bool usingNatbib)
{
unsigned int nStyles = 1;
vec[0] = _("No database");
return vec;
}
-
+
vector<string> vec(styles.size());
string const author = getAbbreviatedAuthor(map, key);
string const year = getYear(map, key);
-
+
for (vector<string>::size_type i = 0; i != vec.size(); ++i) {
string str;
case CITEP:
str = "[#ID]";
break;
-
+
case CITET:
str = author + " [#ID]";
break;
-
+
case CITEALT:
str = author + " #ID";
break;
-
+
case CITEALP:
str = "#ID";
break;
-
+
case CITEAUTHOR:
str = author;
break;
-
+
case CITEYEAR:
str = year;
break;
-
+
case CITEYEARPAR:
str = "(" + year + ")";
break;
vec[i] = str;
}
-
+
return vec;
}
vec[0] = _("No database");
return vec;
}
-
+
vector<string> vec(styles.size());
string const author = getAbbreviatedAuthor(map, key);
string const year = getYear(map, key);
-
+
for (vector<string>::size_type i = 0; i != vec.size(); ++i) {
string str;
case CITET:
str = author + " (" + year + ")";
break;
-
+
case CITE:
case CITEP:
str = "(" + author + ", " + year + ")";
break;
-
+
case CITEALT:
str = author + " " + year ;
break;
-
+
case CITEALP:
str = author + ", " + year ;
break;
-
+
case CITEAUTHOR:
str = author;
break;
-
+
case CITEYEAR:
str = year;
break;
-
+
case CITEYEARPAR:
str = "(" + year + ")";
break;
vec[i] = str;
}
-
+
return vec;
}
-} // namespace biblio
+} // namespace biblio
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
#endif
/** Functions of use to citation and bibtex GUI controllers and views */
-namespace biblio
+namespace biblio
{
///
enum CiteStyle {
[XX] is used in place of the actual reference
Eg, the vector will contain: [XX], Jones et al. [XX], ...
-
+
User supplies :
the key,
the InfoMap of bibkeys info,
/**
"Translates" the available Citation Styles into strings for this key.
The returned string is displayed by the GUI.
-
+
Eg, the vector will contain:
Jones et al. (1990), (Jones et al. 1990), Jones et al. 1990, ...
-
+
User supplies :
the key,
the InfoMap of bibkeys info,
getAuthorYearStrings(string const & key,
InfoMap const & map,
std::vector<CiteStyle> const & styles);
-} // namespace biblio
+} // namespace biblio
#endif // BIBLIOHELPERS_H
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
series[2] = pr;
pr.first = _("Reset"); pr.second = LyXFont::INHERIT_SERIES;
series[3] = pr;
-
+
return series;
}
shape[4] = pr;
pr.first = _("Reset"); pr.second = LyXFont::INHERIT_SHAPE;
shape[5] = pr;
-
+
return shape;
}
size[12] = pr;
pr.first = _("Reset"); pr.second = LyXFont::INHERIT_SIZE;
size[13] = pr;
-
+
return size;
}
bar[3] = pr;
pr.first = _("Reset"); pr.second = INHERIT;
bar[4] = pr;
-
+
return bar;
}
color[9] = pr;
pr.first = _("Reset"); pr.second = LColor::inherit;
color[10] = pr;
-
+
return color;
}
langs[1] = _("Reset");
vector<string>::size_type i = 1;
- for (Languages::const_iterator cit = languages.begin();
+ for (Languages::const_iterator cit = languages.begin();
cit != languages.end(); ++cit) {
langs[++i] = cit->second.lang();
}
return langs;
}
-
+
} // namespace character
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
string const browseFile(LyXView * lv, string const & filename,
string const & title,
- string const & pattern,
+ string const & pattern,
pair<string,string> const & dir1,
pair<string,string> const & dir2)
{
FileDialog fileDlg(lv, title, LFUN_SELECT_FILE_SYNC, dir1, dir2);
FileDialog::Result result;
-
+
while (1) {
result = fileDlg.Select(lastPath, pattern, OnlyFilename(filename));
- if (result.second.empty())
+ if (result.second.empty())
return result.second;
lastPath = OnlyPath(result.second);
if (result.second.find_first_of("#~$% ") == string::npos)
- break;
-
+ break;
+
Alert::alert(_("Filename can't contain any "
"of these characters:"),
_("space, '#', '~', '$' or '%'."));
string const browseRelFile(LyXView * lv, string const & filename,
string const & refpath,
string const & title,
- string const & pattern,
+ string const & pattern,
pair<string,string> const & dir1,
pair<string,string> const & dir2)
{
string const fname = MakeAbsPath(filename, refpath);
-
+
string const outname = browseFile(lv, fname, title, pattern,
dir1, dir2);
string const reloutname = MakeRelPath(outname, refpath);
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
getVectorFromString(string const & str, string const & delim=",");
class LyXView;
-
+
/** Launch a file dialog and return the chosen file.
filename: a suggested filename.
title: the title of the dialog.
*/
string const browseFile(LyXView *lv, string const & filename,
string const & title,
- string const & pattern,
+ string const & pattern,
std::pair<string,string> const & dir1 = std::make_pair(string(), string()),
std::pair<string,string> const & dir2 = std::make_pair(string(), string()));
string const browseRelFile(LyXView *lv, string const & filename,
string const & refpath,
string const & title,
- string const & pattern,
+ string const & pattern,
std::pair<string,string> const & dir1 = std::make_pair(string(), string()),
std::pair<string,string> const & dir2 = std::make_pair(string(), string()));
typedef typename Pair::second_type second_type;
second_type const & operator()(Pair const & p) { return p.second; }
};
-
+
}
///
+2002-03-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * most files: ws cleanup
+
2002-03-16 Michael A. Koziarski <michael@koziarski.com>
- * Makefile.am: Cleanup and linking fix.
+ * Makefile.am: Cleanup and linking fix.
* README: Added procedure for adding a new dialog.
* Dialogs.C (tooltipsEnable): new method.
2002-03-14 Michael A. Koziarski <michael@koziarski.org>
* Timeout_pimpl.C
- * Timeout_pimpl.h: implemented running to fix compilation, linking
- fix still to come
+ * Timeout_pimpl.h: implemented running to fix compilation, linking
+ fix still to come
2002-03-11 Lars Gullik Bjønnes <larsbj@birdstep.com>
2002-03-02 Lars Gullik Bjønnes <larsbj@birdstep.com>
- * Makefile.am: get rid of LYX_LIBS
+ * Makefile.am: get rid of LYX_LIBS
2002-02-10 Michael A. Koziarski <michael@koziarski.com>
2002-01-12 Michael A. Koziarski <michael@koziarski.com>
* various: Cleaned out the old stuff, standardised the new
- stuff.
+ stuff.
* GnomeBase.C
* GnomeBase.h: Changed the constructor to take one argument. The
dialog name. The path and name of the glade files can be
* FormTabularCreate.C
* FormTabularCreate.h: updated them to use the new system.
Removed Local inline *Clicked functions as they're now in the base
- class.
+ class.
* README: new, brief outline of what I'm doing here.
* accessors.py: Described in README, generates the accessor
functions from the glade file.
2002-01-08 Martin Vermeer <martin.vermeer@hut.fi>
- * Menubar_pimpl.C (composeUIInfo):
+ * Menubar_pimpl.C (composeUIInfo):
(update): use FuncStatus
2002-01-03 Michael Koziarski <michael@koziarski.com>
2001-08-27 John Levon <moz@compsoc.man.ac.uk>
* GUIRunTime.C: initApplication() should take a int & argc, add debug
-
+
2001-07-19 Baruch Even <baruch@lyx.org>
* Menubar_pimpl.C: Renamed LyXFunc::Dispatch to LyXFunc::dispatch.
* Makefile.am:
* Dialogs.C: Removed Citation and Copyright dialogs from build. Left them
in repository until they get redone as About Dialog.
-
+
* FileDialog.C:
* Menubar_pimpl.C:
* Menubar_pimpl.h:
2001-04-16 Allan Rae <rae@lyx.org>
- * gnomeBC.C (setButtonLabel):
- * Menubar_pimpl.C (updateAllLists):
+ * gnomeBC.C (setButtonLabel):
+ * Menubar_pimpl.C (updateAllLists):
* GnomeBase.C (loadXML): #warning triggers an error on Sun CC 6.0 as
- an unrecognised preprocessor directive. So ensure they're wrapped.
+ an unrecognised preprocessor directive. So ensure they're wrapped.
2001-04-03 Baruch Even <baruch@lyx.org>
* GnomeBase.C:
* GnomeBase.h: s/ControlButton/ControlButtons/
s/UndoAll/Restore/
-
+
2001-04-02 Michael Koziarski <michael@koziarski.org>
* FormCopyright.[Ch]: Reimplemented as an MVC dialog.
2001-03-26 Baruch Even <baruch@lyx.org>
- * Various files: Fixes to get the gnome frontend to compile again.
+ * Various files: Fixes to get the gnome frontend to compile again.
Removed most xforms dialogs in order to reduce compilation breaks caused
by the moves to MVC in the xforms frontend.
#include "FormVCLog.h"
#include "FormDocument.h"
-#include "FormExternal.h"
+#include "FormExternal.h"
#include "FormGraphics.h"
#include "FormInclude.h"
#include "FormIndex.h"
add(new GUITabularCreate<FormTabularCreate, gnomeBC>(*lv, *this));
add(new GUIERT<FormERT, gnomeBC>(*lv, *this));
-/*
+/*
add(new GUIBibitem<FormBibitem, xformsBC>(*lv, *this));
add(new GUIBibtex<FormBibtex, xformsBC>(*lv, *this));
add(new GUICharacter<FormCharacter, xformsBC>(*lv, *this));
// For now we use the gnome non MVC dialogs
add(new FormCitation(lv, this));
-
+
add(new FormDocument(lv, this));
add(new FormExternal(lv, this));
add(new FormGraphics(lv, this));
add(new FormInclude(lv, this));
add(new FormIndex(lv, this));
- add(new FormMathsPanel(lv, this));
+ add(new FormMathsPanel(lv, this));
add(new FormParagraph(lv, this));
add(new FormPreamble(lv, this));
add(new FormPreferences(lv, this));
the newly created Dialogs instance using `this'.
(*) -- I'm using signals exclusively to guarantee that the gui code
- remains hidden from the rest of the system. In fact the only
+ remains hidden from the rest of the system. In fact the only
header related to dialogs that anything in the non-gui-specific
- code gets to see is Dialogs.h! Even Dialogs.h doesn't know what a
+ code gets to see is Dialogs.h! Even Dialogs.h doesn't know what a
FormCopyright class looks like or that its even going to be used!
No other gui dialog headers are seen outside of the gui-specific
by adding a specific show or update signal. For example, spellchecker
needs to set the next suspect word and its options/replacements so we
need a:
- Signal0<void> updateSpellChecker;
+ Signal0<void> updateSpellChecker;
Since we would have to have a
- Signal0<void> showSpellChecker;
+ Signal0<void> showSpellChecker;
in order to just see the spellchecker and let the user push the [Start]
button then the updateSpellChecker signal will make the SpellChecker
dialog get the new word and replacements list from LyX. If you really,
really wanted to you could define a signal that would pass the new
word and replacements:
- Signal2<void, string, vector<string> > updateSpellChecker;
+ Signal2<void, string, vector<string> > updateSpellChecker;
(or something similar) but, why bother when the spellchecker can get
it anyway with a LyXFunc call or two. Besides if someone extends
- what a dialog does then they also have to change code in the rest of
- LyX to pass more parameters or get the extra info via a function
+ what a dialog does then they also have to change code in the rest of
+ LyX to pass more parameters or get the extra info via a function
call anyway. Thus reducing the independence of the two code bases.
- We don't need a separate update signal for each dialog because most of
+ We don't need a separate update signal for each dialog because most of
them will be changed only when the buffer is changed (either by closing
the current open buffer or switching to another buffer in the current
LyXView -- different BufferView same LyXView or same BufferView same
LyXView).
- So we minimise signals but maximise independence and programming
+ So we minimise signals but maximise independence and programming
simplicity, understandability and maintainability. It's also
extremely easy to add support for Qt or gtk-- because they use
signals already. Guis that use callbacks, like xforms, must have their
/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995-2000 The LyX Team.
*
- * =================================================
+ * =================================================
*
- * \author Baruch Even
+ * \author Baruch Even
**/
#ifdef __GNUG__
void button_clicked(bool canceled);
void ok_clicked() { button_clicked(false); }
void cancel_clicked() { button_clicked(true); }
-
+
private:
Gtk::FileSelection sel_;
bool modal_;
};
FileDialog::Private::Private(string const & title)
- : sel_(title), modal_(false)
+ : sel_(title), modal_(false)
{
- sel_.get_ok_button()->clicked.connect(slot(this,
+ sel_.get_ok_button()->clicked.connect(slot(this,
&FileDialog::Private::ok_clicked));
- sel_.get_cancel_button()->clicked.connect(slot(this,
+ sel_.get_cancel_button()->clicked.connect(slot(this,
&FileDialog::Private::cancel_clicked));
}
sel_.show();
Gnome::Main::run();
// Find if its canceled or oked and return as needed.
-
+
if (canceled_)
return string();
else
// FileDialog
-FileDialog::FileDialog(LyXView * lv, string const & title, kb_action a,
+FileDialog::FileDialog(LyXView * lv, string const & title, kb_action a,
Button /*b1*/, Button /*b2*/)
: private_(new Private(title))
, lv_(lv), title_(title), success_(a)
}
-FileDialog::Result const
-FileDialog::Select(string const & path, string const & mask,
+FileDialog::Result const
+FileDialog::Select(string const & path, string const & mask,
string const & suggested)
{
// For some reason we need to ignore the asynchronous method...
}
#endif
lyxerr << "Synchronous file dialog." << std::endl;
-
+
lyxerr << "Path: " << path << "\nMask: " << mask << "\nSuggested: " << suggested << std::endl;
-
+
string filter = mask;
rsplit(mask, filter, '|');
private_->set_complete(mask);
private_->set_filename(path+suggested);
-
+
lv_->prohibitInput();
string const filename = private_->exec();
lv_->allowInput();
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
void FormCitation::showInset( InsetCommand * const inset )
{
if( dialog_!=0 || inset == 0 ) return;
-
+
inset_ = inset;
ih_ = inset_->hideDialog.connect(SigC::slot(this, &FormCitation::hide));
u_ = d_->updateBufferDependent.connect(SigC::slot(this, &FormCitation::updateSlot));
h_ = d_->hideBufferDependent.connect(SigC::slot(this, &FormCitation::hide));
-
+
params = inset->params();
if ( params.getContents().empty() ) showStageSearch();
void FormCitation::createInset( string const & arg )
{
if( dialog_!=0 ) return;
-
- u_ = d_->updateBufferDependent.connect(SigC::slot(this, &FormCitation::updateSlot));
+
+ u_ = d_->updateBufferDependent.connect(SigC::slot(this, &FormCitation::updateSlot));
h_ = d_->hideBufferDependent.connect(SigC::slot(this, &FormCitation::hide));
-
+
params.setFromString( arg );
showStageSearch();
}
{
unsigned int i;
string data(dat);
-
+
keyvalue = "";
-
+
for (i=0; i<data.length(); ++i)
if (data[i]=='\n' || data[i]=='\t')
data[i] = ' ';
-
+
data = frontStrip(data);
while (!data.empty()
&& data[0]!='='
string value;
string tmp;
char enclosing;
-
+
data = data.substr(keypos, data.length()-1);
data = frontStrip(strip(data));
if (data.length() > 1 && data[0]=='=')
keypos = data.find(',');
value = data.substr(0, keypos);
-
+
if (keypos+1<data.length()-1) data = frontStrip(data.substr(keypos+1, data.length()-1));
else data = "";
}
else return;
- if (findkey == key) { keyvalue = value; return; }
+ if (findkey == key) { keyvalue = value; return; }
data = frontStrip(frontStrip(data,','));
}
w = path + "/" + CONF_COLUMN + "_" + tostr(i) + CONF_COLUMN_DEFAULT;
clist_bib_->column(i).set_width( gnome_config_get_int(w.c_str()) );
}
-
+
// retrieving data
vector<pair<string,string> > blist = lv_->buffer()->getBibkeyList();
bibkeys.push_back(blist[i].first);
bibkeysInfo.push_back(blist[i].second);
}
-
- blist.clear();
-
+
+ blist.clear();
+
// updating list
search();
r.clear();
r.push_back(tmp);
clist_selected_->rows().push_back(r);
-
+
keys = frontStrip( split(keys, tmp, ',') );
}
gnome_config_set_int(w.c_str(), button_regexp_->get_active());
}
- if (paned_info_ != 0)
+ if (paned_info_ != 0)
{
string w = path + "/" + CONF_PANE_INFO;
gnome_config_set_int(w.c_str(), paned_info_->width() - info_->width());
// set up spacing
bbox->set_spacing(4);
bbox->set_layout(GTK_BUTTONBOX_SPREAD);
-
+
bbox->children().push_back(Element(*b_add, false, false));
bbox->children().push_back(Element(*b_edit, false, false));
bbox->children().push_back(Element(*b_cancel, false, false));
b_add->add_accelerator("clicked", *accel, b_add->get_accelkey(), 0, GTK_ACCEL_VISIBLE);
b_edit->add_accelerator("clicked", *accel, b_edit->get_accelkey(), 0, GTK_ACCEL_VISIBLE);
-
+
// packing dialog to main window
dialog_ = mbox;
mainAppWin->add_action(*dialog_, _(" Citation: Select action "), false, accel);
initWidgets();
-
+
// setting focus
gtk_widget_grab_focus (GTK_WIDGET(b_add->gtkobj()));
// stores configuration and cleans all widgets
storeWidgets();
cleanupWidgets();
-
+
// moves to stage "search"
mainAppWin->remove_action();
showStageSearch();
// stores configuration and cleans all widgets
storeWidgets();
cleanupWidgets();
-
+
// moves to stage "edit"
mainAppWin->remove_action();
showStageEdit();
Gtk::Box * mbox = manage( new Gtk::HBox() );
Gtk::ButtonBox * bbox = manage( new Gtk::HButtonBox() );
Gtk::Separator * sep = manage( new Gtk::VSeparator() );
-
+
search_text_ = manage( new Gnome::Entry() );
-
+
button_regexp_ = manage( new Gtk::CheckButton(_("Use Regular Expression")) );
b_ok = manage( new Gtk::Button(_("Search")) );
b_cancel = Gtk::wrap( GTK_BUTTON( gnome_stock_button(GNOME_STOCK_BUTTON_CANCEL) ) );
-
+
// set up spacing
mbox->set_spacing(4);
bbox->set_spacing(4);
mainAppWin->add_action(*dialog_, _(" Insert Citation: Enter keyword(s) or regular expression "));
initWidgets();
-
+
// setting focus
GTK_WIDGET_SET_FLAGS (GTK_WIDGET(search_text_->get_entry()->gtkobj()), GTK_CAN_DEFAULT);
gtk_widget_grab_focus (GTK_WIDGET(search_text_->get_entry()->gtkobj()));
// stores configuration and cleans all widgets
storeWidgets();
cleanupWidgets();
-
+
// moves to stage "select"
mainAppWin->remove_action();
showStageSelect();
info_ = manage( new Gnome::Less() );
paned_info_ = manage( new Gtk::HPaned() );
text_after_ = manage( new Gnome::Entry() );
-
+
b_ok = Gtk::wrap( GTK_BUTTON( gnome_stock_button(GNOME_STOCK_BUTTON_OK) ) );
b_cancel = Gtk::wrap( GTK_BUTTON( gnome_stock_button(GNOME_STOCK_BUTTON_CANCEL) ) );
clist_bib_ = manage( new Gtk::CList(colnames) );
bbox->set_layout(GTK_BUTTONBOX_END);
-
+
// set up spacing
mbox->set_spacing(4);
bbox->set_spacing(4);
mbox->children().push_back(Element(*paned_info_,true,true));
mbox->children().push_back(Element(*sep, false, false));
mbox->children().push_back(Element(*tbox, false, false));
-
+
// packing dialog to main window
dialog_ = mbox;
mainAppWin->add_action(*dialog_, _(" Insert Citation: Select citation "), true);
initWidgets();
-
+
// setting focus
GTK_WIDGET_SET_FLAGS (GTK_WIDGET(b_ok->gtkobj()), GTK_CAN_DEFAULT);
GTK_WIDGET_SET_FLAGS (GTK_WIDGET(b_cancel->gtkobj()), GTK_CAN_DEFAULT);
colnames.push_back(" ");
clist_selected_ = manage( new Gtk::CList(colnames) );
clist_selected_->column_titles_hide();
-
+
text_after_ = manage( new Gnome::Entry() );
-
+
button_unselect_ = manage( new Gnome::PixButton( _("_Remove"), GNOME_STOCK_PIXMAP_TRASH ) );
button_up_ = manage( new Gnome::PixButton( _("_Up"), GNOME_STOCK_PIXMAP_UP ) );
button_down_ = manage( new Gnome::PixButton( _("_Down"), GNOME_STOCK_PIXMAP_DOWN ) );
bbox->set_layout(GTK_BUTTONBOX_END);
actbbox->set_layout(GTK_BUTTONBOX_START);
-
+
// set up spacing
mbox->set_spacing(4);
bbox->set_spacing(4);
mbox->children().push_back(Element(*t2box,true,true));
mbox->children().push_back(Element(*manage(new Gtk::HSeparator()), false, false));
mbox->children().push_back(Element(*tbox, false, false));
-
+
// accelerators
Gtk::AccelGroup * accel = Gtk::AccelGroup::create();
button_unselect_->clicked.connect(SigC::slot(this, &FormCitation::removeCitation));
button_up_->clicked.connect(SigC::slot(this, &FormCitation::moveCitationUp));
- button_down_->clicked.connect(SigC::slot(this, &FormCitation::moveCitationDown));
+ button_down_->clicked.connect(SigC::slot(this, &FormCitation::moveCitationDown));
clist_selected_->select_row.connect(SigC::bind(SigC::slot(this, &FormCitation::selectionToggled),
true, true));
// don't change the order of these first two items:
// callback functions depend on the data stored in the first column (its hided)
// and in the second column (shown to user)
- r.push_back( tostr(i) );
+ r.push_back( tostr(i) );
r.push_back( key );
-
+
// this can be changed (configured by user?)
parseBibTeX( info, "author", val); r.push_back(val);
parseBibTeX( info, "title", val); r.push_back(val);
parseBibTeX( info, "year", val); r.push_back(val);
parseBibTeX( info, "journal", val); r.push_back(val);
-
+
clist_bib_->rows().push_back(r);
}
{
bool keyfound = false;
string info;
-
+
// the first column in clist_bib_ contains the index
keyfound = true;
info = bibkeysInfo[ strToInt(clist_bib_->cell(row,0).get_text()) ];
string contents = frontStrip( strip(params.getContents()) );
if (!contents.empty()) contents += ", ";
-
+
int sz = clist_bib_->selection().size();
for (int i=0; i < sz; ++i)
{
if (i > 0) contents += ", ";
contents += clist_bib_->selection()[i][1].get_text();
}
-
+
params.setContents( contents );
params.setOptions( text_after_->get_entry()->get_text() );
lv_->getLyXFunc()->Dispatch( LFUN_CITATION_INSERT,
params.getAsString() );
}
-
+
// close dialog
storeWidgets();
hide();
{
string rexptxt(search_string_);
rexptxt = frontStrip( strip( rexptxt ) );
-
+
LRegex reg(rexptxt);
// populating clist_bib_
if (rexptxt.empty()) additem = true;
else additem = (reg.exec(data).size() > 0);
-
+
if ( additem ) addItemToBibList(i);
}
searchwords.push_back(tmp);
stext = frontStrip( split(stext, tmp, ' ') );
}
-
+
// populating clist_bib_
clist_bib_->rows().clear();
for (int j = 0; additem && j < szs; ++j)
if (data.find(searchwords[j]) == string::npos)
additem = false;
-
+
if (additem) addItemToBibList(i);
}
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
void moveFromActionToSearch();
/// moves from Action to Edit "stage"
void moveFromActionToEdit();
-
+
/// sort biblist
void sortBibList(gint);
/// update state of the buttons
void initWidgets();
/// stores configuration of all non-0 member widgets
void storeWidgets();
-
+
/** Which LyXFunc do we use?
We could modify Dialogs to have a visible LyXFunc* instead and
save a couple of bytes per dialog.
Gnome::PixButton * button_up_;
Gnome::PixButton * button_down_;
Gtk::CheckButton * button_regexp_;
-
+
Gtk::CList * clist_selected_;
Gtk::CList * clist_bib_;
-
+
Gtk::Paned * paned_info_;
-
+
std::vector<string> bibkeys;
///
std::vector<string> bibkeysInfo;
/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995-2000 The LyX Team.
*
- * =================================================
+ * =================================================
*
* \author Michael Koziarski <michael@koziarski.org>
*/
// -*- C++ -*-
/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich.
* Copyright 1995-2000 The LyX Team.
*
- * =================================================
+ * =================================================
*
* \author Michael Koziarski <michael@koziarski.org>
* */
///
~FormCopyright() {};
- void apply() {};
+ void apply() {};
void update() {};
-
+
private:
-
+
/// Build the dialog
void build();
Gtk::Button * ok();
Gtk::Label * copyright();
Gtk::Label * license();
/// The ok button
-
+
};
#endif
/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995-2000 The LyX Team.
*
- * =================================================
+ * =================================================
*
* \author Michael Koziarski <michael@koziarski.org>
*/
// Do not update the dialog when we insert the text
text()->freeze();
-
+
// Get the credits into the string stream
stringstream ss;
string credits = controller().getCredits(ss).str();
string const r("R-");
index = italic.find(r);
italic.replace(index, r.size()-1, "i");
-
+
//lyxerr << "Bold: " << bold << "\nItalic: " << italic << std::endl;
c_bold.set_font(Gdk_Font(bold));
c_italic.set_font(Gdk_Font(italic));
std::string::size_type end = credits.find('\n');
string const line = credits.substr(0, ++end);
credits = credits.substr(end);
-
+
// lyxerr << "Line got: '" << line << "'\nend = " << end << std::endl;
-
+
string const prefix = line.substr(0, 2);
if (prefix == bold) {
text()->insert(c_bold, line.substr(2));
text()->insert(line);
}
}
-
+
// Allow the text area to be drawn.
text()->thaw();
}
// -*- C++ -*-
/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich.
* Copyright 1995-2000 The LyX Team.
*
- * =================================================
+ * =================================================
*
* \author Michael Koziarski <michael@koziarski.org>
* */
void apply() {};
void update() {};
-
+
private:
-
+
/// Build the dialog
void build();
/// The ok button
Gtk::Button * ok();
-
+
Gtk::Text * text();
};
/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995-2000 The LyX Team.
*
- * =================================================
+ * =================================================
*
* \author Michael Koziarski <michael@koziarski.org>
*/
// Make sure everything is in the correct state.
bc().refresh();
-
+
// Manage the read-only aware widgets.
bc().addReadOnly(open());
bc().addReadOnly(inlined());
controller().params().status = InsetERT::Open;
else if (collapsed()->get_active())
controller().params().status = InsetERT::Collapsed;
- else
+ else
controller().params().status = InsetERT::Inlined;
}
}
-Gtk::Button * FormERT::ok_btn() const
+Gtk::Button * FormERT::ok_btn() const
{
- return getWidget<Gtk::Button>("r_ok_btn");
+ return getWidget<Gtk::Button>("r_ok_btn");
}
-Gtk::Button * FormERT::apply_btn() const
+Gtk::Button * FormERT::apply_btn() const
{
- return getWidget<Gtk::Button>("r_apply_btn");
+ return getWidget<Gtk::Button>("r_apply_btn");
}
-Gtk::Button * FormERT::cancel_btn() const
+Gtk::Button * FormERT::cancel_btn() const
{
- return getWidget<Gtk::Button>("r_cancel_btn");
+ return getWidget<Gtk::Button>("r_cancel_btn");
}
-Gtk::RadioButton * FormERT::open() const
+Gtk::RadioButton * FormERT::open() const
{
- return getWidget<Gtk::RadioButton>("r_open");
+ return getWidget<Gtk::RadioButton>("r_open");
}
-Gtk::RadioButton * FormERT::collapsed() const
+Gtk::RadioButton * FormERT::collapsed() const
{
- return getWidget<Gtk::RadioButton>("r_collapsed");
+ return getWidget<Gtk::RadioButton>("r_collapsed");
}
-Gtk::RadioButton * FormERT::inlined() const
+Gtk::RadioButton * FormERT::inlined() const
{
- return getWidget<Gtk::RadioButton>("r_inlined");
+ return getWidget<Gtk::RadioButton>("r_inlined");
}
// -*- C++ -*-
/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich.
* Copyright 1995-2000 The LyX Team.
*
- * =================================================
+ * =================================================
*
* \author Michael Koziarski <michael@koziarski.org>
* */
void apply();
void update();
-
+
private:
/// Build the dialog
void build();
Gtk::RadioButton * collapsed() const;
/// generated by accessors.py
Gtk::RadioButton * inlined() const;
-
+
/// do input validation
SigC::Connection slot_open;
/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995-2000 The LyX Team.
*
- * =================================================
+ * =================================================
*
* \author Baruch Even
*/
textarea()->insert(controller().params());
}
-Gtk::Button * FormError::button_close() const
+Gtk::Button * FormError::button_close() const
{
- return getWidget<Gtk::Button>("r_button_close");
+ return getWidget<Gtk::Button>("r_button_close");
}
-Gtk::Text * FormError::textarea() const
+Gtk::Text * FormError::textarea() const
{
- return getWidget<Gtk::Text>("r_textarea");
+ return getWidget<Gtk::Text>("r_textarea");
}
// -*- C++ -*-
/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich.
* Copyright 1995-2000 The LyX Team.
*
- * =================================================
+ * =================================================
*
* \author Baruch Even
* */
void apply() {}
///
void update();
-
+
private:
/// Build the dialog
void build();
///
void CloseClicked() { CancelButton(); }
-
+
/// generated by accessors.py
Gtk::Button * button_close() const;
/// generated by accessors.py
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
void FormIndex::showInset( InsetCommand * const inset )
{
if( dialog_!=0 || inset == 0 ) return;
-
+
inset_ = inset;
ih_ = inset_->hideDialog.connect(slot(this, &FormIndex::hide));
-
+
params = inset->params();
show();
}
void FormIndex::createInset( string const & arg )
{
if( dialog_!=0 ) return;
-
+
params.setFromString( arg );
show();
}
if (!dialog_)
{
using namespace Gtk::Box_Helpers;
-
+
Gtk::Label * label = manage( new Gtk::Label(_("Keyword")) );
Gtk::Box * mbox = manage( new Gtk::HBox() );
Gtk::ButtonBox * bbox = manage( new Gtk::HButtonBox() );
Gtk::Separator * sep = manage( new Gtk::VSeparator() );
keyword_ = manage( new Gnome::Entry() );
-
+
b_ok = Gtk::wrap( GTK_BUTTON( gnome_stock_button(GNOME_STOCK_BUTTON_OK) ) );
b_cancel = Gtk::wrap( GTK_BUTTON( gnome_stock_button(GNOME_STOCK_BUTTON_CANCEL) ) );
-
+
// set up spacing
mbox->set_spacing(2);
bbox->set_spacing(4);
keyword_->set_max_saved(10);
keyword_->load_history();
keyword_->set_use_arrows_always(true);
-
+
// packing
bbox->children().push_back(Element(*b_ok, false, false));
bbox->children().push_back(Element(*b_cancel, false, false));
hide();
return;
}
-
+
if (dialog_ != 0 &&
lv_->view()->available())
{
keyword_->get_entry()->set_text(params.getContents().c_str());
-
+
bool sens = (!(lv_->buffer()->isReadonly()));
-
+
keyword_->set_sensitive(sens);
b_ok->set_sensitive(sens);
}
}
-
+
void FormIndex::hide()
{
if (dialog_!=0) mainAppWin->remove_action();
// hide the dialog
hide();
}
-
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
void createInset( string const & );
/// Slot launching dialog to an existing inset
void showInset( InsetCommand * const );
-
+
/// Update dialog before showing it
virtual void update() { }
virtual void updateSlot(bool = false);
void show();
/// Hide the dialog.
void hide();
-
+
/** Which LyXFunc do we use?
We could modify Dialogs to have a visible LyXFunc* instead and
save a couple of bytes per dialog.
/* FormPrint.C
* FormPrint Interface Class Implementation
* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
from = print_from_->get_text();
to = print_to_->get_value_as_int();
}
-
+
PrinterParams::Target t(PrinterParams::PRINTER);
if (printto_file_->get_active()) t = PrinterParams::FILE;
-
+
// we really should use the return value here I think.
if (!printBuffer(lv_->buffer(),
PrinterParams(t,
case PrinterParams::ODD:
print_odd_->set_active(true);
break;
-
+
case PrinterParams::EVEN:
print_even_->set_active(true);
break;
-
+
case PrinterParams::ALL:
default:
print_all_->set_active(true);
break;
}
-
+
// hmmm... maybe a bit weird but maybe not
// we might just be remembering the last
// time this was printed.
// -*- C++ -*-
/* This file is part of
- * ======================================================
- *
+ * ======================================================
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 2000 The LyX Team.
*
* ====================================================== */
///
~FormPrint();
//@}
-
+
private:
/**@name Slot Methods */
/// Free memory
void free();
//@}
-
+
/**@name Dialog internal methods */
//@{
/// Apply from dialog
void apply();
//@}
-
+
/**@name Private Data */
//@{
/// Real GUI implementation.
Gtk::Widget * dialog_;
-
+
Gtk::RadioButton * print_all_;
Gtk::RadioButton * print_odd_;
Gtk::RadioButton * print_even_;
Gtk::SpinButton * print_from_;
Gtk::SpinButton * print_to_;
-
+
Gtk::RadioButton * order_normal_;
Gtk::RadioButton * order_reverse_;
Gnome::Entry * printto_printcommand_;
Gnome::FileEntry * printto_fileentry_;
-
+
/// Which LyXView do we belong to?
LyXView * lv_;
Dialogs * d_;
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
void FormRef::showInset( InsetCommand * const inset )
{
if( dialog_!=0 || inset == 0 ) return;
-
+
inset_ = inset;
ih_ = inset_->hideDialog.connect(slot(this, &FormRef::hide));
acttype_ = EDIT;
-
+
params = inset->params();
showStageAction();
}
void FormRef::createInset( string const & arg )
{
if( dialog_!=0 ) return;
-
+
acttype_ = INSERT;
params.setFromString( arg );
h_ = d_->hideBufferDependent.connect(slot(this, &FormRef::hide));
}
}
-
+
void FormRef::showStageSelect()
{
list_->rows().push_back(r);
}
list_->rows()[0].select(); // there is always at least one item. otherwise we go to stateError
-
+
b_ok = Gtk::wrap( GTK_BUTTON( gnome_stock_button(GNOME_STOCK_BUTTON_OK) ) );
b_cancel = Gtk::wrap( GTK_BUTTON( gnome_stock_button(GNOME_STOCK_BUTTON_CANCEL) ) );
bbox->children().push_back(Element(*b_cancel, false, false));
alig->add( *bbox );
-
+
mbox->children().push_back(Element(*sw, true, true));
mbox->children().push_back(Element(*manage(new Gtk::VSeparator()), false, false));
mbox->children().push_back(Element(*alig, false, false));
-
+
// packing dialog to main window
dialog_ = mbox;
mainAppWin->add_action(*dialog_, _(" Reference: Select reference "), true);
b_goto = manage(new Gnome::PixButton(GOTO_REF_LABEL, GNOME_STOCK_PIXMAP_JUMP_TO));
gototype_ = GOREF;
-
+
name_ = manage( new Gnome::Entry() );
choice_ = manage( new Gtk::OptionMenu() );
-
+
b_ok = Gtk::wrap( GTK_BUTTON( gnome_stock_button(GNOME_STOCK_BUTTON_OK) ) );
b_cancel = Gtk::wrap( GTK_BUTTON( gnome_stock_button(GNOME_STOCK_BUTTON_CANCEL) ) );
-
+
// set up spacing
table->set_row_spacings(4);
table->set_col_spacings(4);
// fill choice
Gtk::Menu * menu = manage( new Gtk::Menu() );
Gtk::MenuItem * e;
-
+
e = manage( new Gtk::MenuItem(_("Ref")) );
e->activate.connect(bind<Type>(slot(this, &FormRef::changeType), REF));
e->show();
choice_-> set_menu ( *menu );
switch ( getType() ) {
- case REF: { choice_-> set_history(0); break; }
+ case REF: { choice_-> set_history(0); break; }
case PAGEREF: { choice_-> set_history(1); break; }
case VREF: { choice_-> set_history(2); break; }
case VPAGEREF: { choice_-> set_history(3); break; }
}
changeType( getType() );
-
+
// filling widgets with data
name_->get_entry()->set_text(params.getOptions());
-
+
// pack widgets
bbox->children().push_back(Element(*b_goto, false, false));
bbox->children().push_back(Element(*b_ok, false, false));
bbox->children().push_back(Element(*b_cancel, false, false));
-
+
table->attach( *manage( new Gtk::Label(_("Type:")) ), 0, 1, 0, 1, 0, 0 );
table->attach( *manage( new Gtk::Label(_("Name:")) ), 0, 1, 1, 2, 0, 0 );
table->attach( *choice_, 1, 2, 0, 1 );
{
if ( lv_->buffer()->isReadonly() )
return;
-
+
params.setCmdName(getName(reftype_));
params.setOptions(name_->get_entry()->get_text());
-
+
if (inset_ != 0)
{
// Only update if contents have changed
// save configuration
name_->save_history();
-
+
// hide the dialog
hide();
}
FormRef::Type FormRef::getType() const
{
Type type;
-
+
if( params.getCmdName() == "ref" )
type = REF;
-
+
else if( params.getCmdName() == "pageref" )
type = PAGEREF;
-
+
else if( params.getCmdName() == "vref" )
type = VREF;
-
+
else if( params.getCmdName() == "vpageref" )
type = VPAGEREF;
-
+
else
type = PRETTYREF;
-
+
return type;
}
string FormRef::getName( Type type ) const
{
string name;
-
+
switch( type ) {
case REF:
name = "ref";
name = "prettyref";
break;
}
-
+
return name;
}
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
void createInset( string const & );
/// Slot launching dialog to an existing inset
void showInset( InsetCommand * const );
-
+
/// Update dialog before showing it (not used in this implementation)
- virtual void update() { }
+ virtual void update() { }
virtual void updateSlot(bool = false);
/// Apply from dialog (modify or create inset)
virtual void apply();
void hide();
/// Go to reference or return back
void gotoRef();
-
+
/// moves from Search to Select "stage"
void moveFromSelectToAction();
SigC::Connection h_;
/// inset::hide connection.
SigC::Connection ih_;
- ///
+ ///
std::vector<string> refs;
///
Type reftype_;
Goto gototype_;
///
ActionType acttype_;
-
+
/// Real GUI implementation.
Gtk::Container * dialog_;
Gtk::CList * list_;
/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995-2000 The LyX Team.
*
- * =================================================
+ * =================================================
*
* \author Michael Koziarski <michael@koziarski.org>
*/
void FormTabularCreate::build()
{
// Connect the buttons.
- ok_btn()->clicked.connect(SigC::slot(this,
- &FormTabularCreate::OKClicked));
- cancel_btn()->clicked.connect(SigC::slot(this,
- &FormTabularCreate::CancelClicked));
- apply_btn()->clicked.connect(SigC::slot(this,
- &FormTabularCreate::ApplyClicked));
-
+ ok_btn()->clicked.connect(SigC::slot(this,
+ &FormTabularCreate::OKClicked));
+ cancel_btn()->clicked.connect(SigC::slot(this,
+ &FormTabularCreate::CancelClicked));
+ apply_btn()->clicked.connect(SigC::slot(this,
+ &FormTabularCreate::ApplyClicked));
+
// Manage the buttons state
bc().setOK(ok_btn());
bc().setCancel(cancel_btn());
bool FormTabularCreate::validate() const
{
- return ( rows()->get_value_as_int() > 0 ) &&
+ return ( rows()->get_value_as_int() > 0 ) &&
( cols()->get_value_as_int() > 0 );
}
-Gtk::Button * FormTabularCreate::ok_btn() const
+Gtk::Button * FormTabularCreate::ok_btn() const
{
- return getWidget<Gtk::Button>("r_ok_btn");
+ return getWidget<Gtk::Button>("r_ok_btn");
}
-Gtk::Button * FormTabularCreate::apply_btn() const
+Gtk::Button * FormTabularCreate::apply_btn() const
{
- return getWidget<Gtk::Button>("r_apply_btn");
+ return getWidget<Gtk::Button>("r_apply_btn");
}
-Gtk::Button * FormTabularCreate::cancel_btn() const
+Gtk::Button * FormTabularCreate::cancel_btn() const
{
- return getWidget<Gtk::Button>("r_cancel_btn");
+ return getWidget<Gtk::Button>("r_cancel_btn");
}
-Gtk::SpinButton * FormTabularCreate::rows() const
+Gtk::SpinButton * FormTabularCreate::rows() const
{
- return getWidget<Gtk::SpinButton>("r_rows");
+ return getWidget<Gtk::SpinButton>("r_rows");
}
-Gtk::SpinButton * FormTabularCreate::cols() const
+Gtk::SpinButton * FormTabularCreate::cols() const
{
- return getWidget<Gtk::SpinButton>("r_cols");
+ return getWidget<Gtk::SpinButton>("r_cols");
}
-
// -*- C++ -*-
/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich.
* Copyright 1995-2000 The LyX Team.
*
- * =================================================
+ * =================================================
*
* \author Michael Koziarski <michael@koziarski.org>
* */
~FormTabularCreate();
void apply();
-
+
private:
/// Build the dialog
void build();
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
void FormToc::showInset( InsetCommand * const inset )
{
if ( dialog_!=0 || inset == 0 ) return;
-
+
inset_ = inset;
ih_ = inset_->hideDialog.connect(SigC::slot(this, &FormToc::hide));
-
+
params = inset->params();
show();
}
void FormToc::createInset( string const & arg )
{
if( dialog_!=0 ) return;
-
+
params.setFromString( arg );
show();
}
Gtk::MenuItem * e;
choice_->get_menu()->items().clear();
-
+
e = manage( new Gtk::MenuItem(_("Table of Contents")) );
e->activate.connect(SigC::bind<Buffer::TocType>(SigC::slot(this, &FormToc::changeList), Buffer::TOC_TOC));
choice_->get_menu()->append( *e );
// wrap buttons and connect slots
b_refresh = Gtk::wrap( GTK_BUTTON( lookup_widget(pd, "button_refresh") ) );
b_close = Gtk::wrap( GTK_BUTTON( lookup_widget(pd, "button_close") ) );
-
+
b_refresh->clicked.connect(SigC::bind<bool>(SigC::slot(this, &FormToc::updateSlot),false));
b_close->clicked.connect(dialog_->destroy.slot());
dialog_->destroy.connect(SigC::slot(this, &FormToc::free));
list_->items().push_back( *l );
return;
}
-
-
+
+
if (dialog_ != 0 &&
lv_->view()->available())
{
int selection = 0;
-
+
if( params.getCmdName() == "tableofcontents" )
{
type = Buffer::TOC_TOC;
ignore_callback_ = true;
choice_->set_history(selection);
ignore_callback_ = false;
-
+
list_->items().clear();
dialog_->set_title(wintitle);
void FormToc::apply(Buffer::TocItem tg)
{
-#if 0
+#if 0
// Doesn't compile anymore...
if (!lv_->view()->available()) return;
ih_.disconnect();
}
}
-
// #if 0
// // -*- C++ -*-
// /* This file is part of
-// * ======================================================
+// * ======================================================
// *
// * LyX, The Document Processor
// *
// void createInset( string const & );
// /// Slot launching dialog to an existing inset
// void showInset( InsetCommand * const );
-
+
// /// Update dialog before showing it
-// virtual void update() { }
+// virtual void update() { }
// virtual void updateSlot(bool = false);
// /// Explicitly free the dialog.
// void free();
// void apply(Buffer::TocItem);
// /// change type of the list
// void changeList(Buffer::TocType);
-
+
// /** Which LyXFunc do we use?
// We could modify Dialogs to have a visible LyXFunc* instead and
// save a couple of bytes per dialog.
/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995-2000 The LyX Team.
*
- * =================================================
+ * =================================================
*
* \author Baruch Even
*/
// Make sure everything is in the correct state.
bc().refresh();
-
+
// Manage the read-only aware widgets.
bc().addReadOnly(html_cb());
bc().addReadOnly(name());
// This avoids the problem of having the buttons enabled when the dialog
// starts.
disconnect_signals();
-
+
url()->set_text(controller().params().getContents());
name()->set_text(controller().params().getOptions());
return !url()->get_text().empty() && !name()->get_text().empty();
}
-Gtk::Button * FormUrl::restore_btn() const
+Gtk::Button * FormUrl::restore_btn() const
{
- return getWidget<Gtk::Button>("r_restore_btn");
+ return getWidget<Gtk::Button>("r_restore_btn");
}
-Gtk::Button * FormUrl::ok_btn() const
+Gtk::Button * FormUrl::ok_btn() const
{
- return getWidget<Gtk::Button>("r_ok_btn");
+ return getWidget<Gtk::Button>("r_ok_btn");
}
-Gtk::Button * FormUrl::apply_btn() const
+Gtk::Button * FormUrl::apply_btn() const
{
- return getWidget<Gtk::Button>("r_apply_btn");
+ return getWidget<Gtk::Button>("r_apply_btn");
}
-Gtk::Button * FormUrl::cancel_btn() const
+Gtk::Button * FormUrl::cancel_btn() const
{
- return getWidget<Gtk::Button>("r_cancel_btn");
+ return getWidget<Gtk::Button>("r_cancel_btn");
}
-Gtk::Entry * FormUrl::url() const
+Gtk::Entry * FormUrl::url() const
{
- return getWidget<Gtk::Entry>("r_url");
+ return getWidget<Gtk::Entry>("r_url");
}
-Gtk::Entry * FormUrl::name() const
+Gtk::Entry * FormUrl::name() const
{
- return getWidget<Gtk::Entry>("r_name");
+ return getWidget<Gtk::Entry>("r_name");
}
-Gtk::CheckButton * FormUrl::html_cb() const
+Gtk::CheckButton * FormUrl::html_cb() const
{
- return getWidget<Gtk::CheckButton>("r_html_cb");
+ return getWidget<Gtk::CheckButton>("r_html_cb");
}
-
-
// -*- C++ -*-
/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich.
* Copyright 1995-2000 The LyX Team.
*
- * =================================================
+ * =================================================
*
* \author Baruch Even
* */
void apply();
void update();
-
+
private:
/// Build the dialog
void build();
Gtk::Entry * name() const;
/// generated by accessors.py
Gtk::CheckButton * html_cb() const;
-
+
/// Keeps the connection to the input validator.
SigC::Connection slot_url_;
SigC::Connection slot_name_;
-
/* This file is part of
* ======================================================
- *
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 2000 The LyX Team.
*
*======================================================*/
return 0;
}
-void GUIRunTime::processEvents()
+void GUIRunTime::processEvents()
{
while (Gnome::Main::instance()->events_pending())
Gnome::Main::instance()->iteration(FALSE);
{
using namespace grfx;
using SigC::slot;
-
+
#if defined(HAVE_FLIMAGE_DUP) && defined(HAVE_FLIMAGE_TO_PIXMAP)
// connect the image loader based on the xforms library
GImage::newImage.connect(slot(&xformsGImage::newImage));
/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich.
* Copyright 1995-2000 The LyX Team.
#include <gnome--/dialog.h>
-GnomeBase::GnomeBase(ControlButtons & c,
+GnomeBase::GnomeBase(ControlButtons & c,
string const & name)
: ViewBC<gnomeBC>(c)
, file_(name + ".glade"), widget_name_(name), xml_(0)
, dialog_(0)
{}
-
+
GnomeBase::~GnomeBase()
{
if (xml_)
gtk_object_unref(GTK_OBJECT(xml_));
}
-
+
void GnomeBase::loadXML() const
{
#ifdef WITH_WARNINGS
lyxerr << "Cannot find glade file. Aborting." << std::endl;
lyx::Assert(true);
}
-
+
lyxerr[Debug::GUI] << "Glade file to open is " << file << '\n';
-
+
xml_ = glade_xml_new(file.c_str(), widget_name_.c_str());
}
return true;
}
-void GnomeBase::OKClicked()
-{
+void GnomeBase::OKClicked()
+{
lyxerr[Debug::GUI] << "OKClicked()\n";
- OKButton();
+ OKButton();
}
-void GnomeBase::CancelClicked()
-{
- CancelButton();
+void GnomeBase::CancelClicked()
+{
+ CancelButton();
}
-void GnomeBase::ApplyClicked()
-{
- ApplyButton();
+void GnomeBase::ApplyClicked()
+{
+ ApplyButton();
}
-void GnomeBase::RestoreClicked()
-{
- RestoreButton();
+void GnomeBase::RestoreClicked()
+{
+ RestoreButton();
}
-void GnomeBase::InputChanged()
-{
- bc().valid(validate());
+void GnomeBase::InputChanged()
+{
+ bc().valid(validate());
}
Gnome::Dialog * GnomeBase::dialog()
{
- if (!dialog_)
+ if (!dialog_)
dialog_ = getWidget<Gnome::Dialog>(widget_name_.c_str());
-
+
return dialog_;
}
// -*- C++ -*-
/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995-2000 The LyX Team.
*
- * =================================================
+ * =================================================
*
* \author Baruch Even
**/
*/
class GnomeBase : public ViewBC<gnomeBC>, public SigC::Object {
public:
- ///
+ ///
GnomeBase(ControlButtons & c, string const & name);
///
virtual ~GnomeBase();
protected:
/// Get the widget named 'name' from the xml representation.
template <class T>
- T* getWidget(char const * name) const;
+ T* getWidget(char const * name) const;
/// Get the dialog we use.
Gnome::Dialog * dialog();
/**
* This class is used to provide a simple automatic casting of the controller.
- * We chose not to make GnomeBase a template since it has some size and we
+ * We chose not to make GnomeBase a template since it has some size and we
* have no reason to duplicate it by making it a template.
*
* Basically the FormCB<Controller> template instantiates GnomeBase and passes
bool Timeout::Pimpl::running() const
{
- return running_;
+ return running_;
}
-
+
void Timeout::Pimpl::start()
{
if (conn_.connected()) {
lyxerr << "Timeout::start: already running!" << std::endl;
stop();
}
-
+
conn_ = Gnome::Main::timeout.connect(
SigC::slot(this, &Timeout::Pimpl::timeoutEvent),
owner_->timeout_ms
/// stop the timer
void stop();
/// reset
- void reset();
- /// Is the timer running?
- bool running() const;
-
+ void reset();
+ /// Is the timer running?
+ bool running() const;
+
public:
/// The timeout signal, this gets called when the timeout passed.
Timeout * owner_;
/// Timer connection
SigC::Connection conn_;
- /// Used for running as SigC::Connection::connected() isn't const
- bool running_;
+ /// Used for running as SigC::Connection::connected() isn't const
+ bool running_;
};
#endif
}
-void gnomeBC::setButtonEnabled(Gtk::Button * btn, bool enabled)
+void gnomeBC::setButtonEnabled(Gtk::Button * btn, bool enabled)
{
if (btn)
btn->set_sensitive(enabled);
/* This file is part of
- * ======================================================
- *
+ * ======================================================
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 2000 The LyX Team.
*
* ====================================================== */
#endif
status = XGetFontProperty (font_structs[0], font_atom, &atom);
} else {
- status = XGetFontProperty (
+ status = XGetFontProperty (
static_cast<XFontStruct*>(GDK_FONT_XFONT (font))
, font_atom, &atom);
}
// -*- C++ -*-
/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995-2000 The LyX Team.
*
#include <glade/glade-xml.h>
#include <glib.h>
-// Glade Helper Function.
+// Glade Helper Function.
/** This function will get a widget from the glade XML representation and
*/
template<class T>
T* getWidgetPtr(GladeXML* xml, char const * name)
-{
+{
T* result = static_cast<T*>(Gtk::wrap_auto((GtkObject*)glade_xml_get_widget(xml, name)));
if (result == NULL)
{
// -*- C++ -*-
/* This file is part of
- * ======================================================
- *
+ * ======================================================
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 2000 The LyX Team.
*
* ====================================================== */
add(*b);
accelkey_ = l->parse_uline(label);
-
+
l->show();
p->show();
b->show();
}
#endif
-
* you want returned.
*/
GtkWidget* lookup_widget (GtkWidget *widget,
- const gchar *widget_name);
+ const gchar *widget_name);
/* get_widget() is deprecated. Use lookup_widget instead. */
#define get_widget lookup_widget
/* This is used to create the pixmaps in the interface. */
GtkWidget* create_pixmap (GtkWidget *widget,
- const gchar *filename,
- gboolean gnome_pixmap);
+ const gchar *filename,
+ gboolean gnome_pixmap);
GdkImlibImage* create_image (const gchar *filename);
-
#include <qlabel.h>
#include <qlineedit.h>
#include "ui/QAskForTextDialog.h"
-
+
#include FORMS_H_LOCATION
-
+
#include <algorithm>
-
+
#include <gettext.h>
-
+
#include "Alert.h"
-#include "Alert_pimpl.h"
+#include "Alert_pimpl.h"
#include "xforms_helpers.h"
-
+
using std::pair;
using std::make_pair;
{
string title = _("LyX: ");
title += msg;
-
- QAskForTextDialog d(0, msg.c_str(), true);
+
+ QAskForTextDialog d(0, msg.c_str(), true);
// less than ideal !
d.askLA->setText((string("&") + msg).c_str());
d.askLE->setText(dflt.c_str());
int ret = d.exec();
d.hide();
-
+
if (ret)
return make_pair<bool, string>(true, d.askLE->text().latin1());
else
+2002-03-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * most files: ws cleanup
+
2002-03-11 Lars Gullik Bjønnes <larsbj@birdstep.com>
* docygen fixes.
* ui/moc/Makefile.am: fix compile
* xforms/: compile the necessary files via symlinks
-
+
* QPreambleDialog.C: new systemcall interface
* Timeout_pimpl.h:
* Timeout_pimpl.C: add running()
- * Dialogs.C: add init graphics, and doc/par xforms forms
-
+ * Dialogs.C: add init graphics, and doc/par xforms forms
+
2002-02-06 John Levon <moz@compsoc.man.ac.uk>
* QToc.C: fix crash
-
+
2002-02-06 Edwin Leuven <leuven@fee.uva.nl>
-
+
* QGraphics.C: compilation fix
* QTexinfoDialog.C:
* QTexinfoDialog.h:
* Makefile.am:
* Makefile.dialogs: don't compile QPar/Doc
for now, as they cause problems
-
+
2002-01-20 John Levon <moz@compsoc.man.ac.uk>
* Makefile.am:
* QTocDialog.h:
* QTocDialog.C:
* ui/QTocDialog.ui: resuscitate TOC dialog
-
+
2002-01-20 John Levon <moz@compsoc.man.ac.uk>
* QCitation.h:
2002-01-15 John Levon <moz@compsoc.man.ac.uk>
- * Makefile.am:
+ * Makefile.am:
* FileDialog_private.h: fix compile
* QThesaurus.h:
* QThesaurus.C:
* QThesaurusDialog.h:
* QThesaurusDialog.C:
- * ui/QThesaurusDialog.ui: new thesaurus code
-
+ * ui/QThesaurusDialog.ui: new thesaurus code
+
2002-01-14 Angus Leeming <a.leeming@ic.ac.uk>
* QMinipage.C (apply, update_contents): MinipageParams::width renamed
2002-01-04 John Levon <moz@compsoc.man.ac.uk>
* QParagraph.C: add needed include
-
+
2001-12-08 John Levon <moz@compsoc.man.ac.uk>
* Makefile.am:
* Dialogs.C: bring back unconverted dialogs
-
+
2001-12-05 John Levon <moz@compsoc.man.ac.uk>
* QParagraph.C:
* QParagraphDialog.C: use new vspace API
* QTocDialog.C: silence warnings
-
+
2001-12-05 Lars Gullik Bjønnes <larsbj@birdstep.com>
- * qttableview.C: change "while(" to "while ("
+ * qttableview.C: change "while(" to "while ("
2001-12-05 Allan Rae <rae@lyx.org>
- * QParagraph.C (apply):
+ * QParagraph.C (apply):
(update): Use the right LyXText -- extending John's fix
2001-12-01 Maks Orlovich <mo002j@mail.rochester.edu>
* ui/moc/Makefile.am: remove unportable # at beginning of
declaration.
- * ui/Makefile.am:
+ * ui/Makefile.am:
* Makefile.am: remove extra DISTCLEANFILES declaration
2001-10-07 Adrien Rebollo <adrien.rebollo@gmx.fr>
- * ui/QDocumentDialog.ui:
+ * ui/QDocumentDialog.ui:
* QDocument.C (build_dialog): support latin4
2001-10-05 Adrien Rebollo <adrien.rebollo@gmx.fr>
- * ui/QDocumentDialog.ui:
+ * ui/QDocumentDialog.ui:
* QDocument.C (build_dialog): support latin3
2001-09-27 Angus Leeming <a.leeming@ic.ac.uk>
* QRef.C: fix compile
* README: update
-
+
2001-09-09 Lars Gullik Bjønnes <larsbj@birdstep.com>
* Makefile.am (libqt2_la_LIBADD): rename from OBJADD, depend on
2001-09-06 John Levon <moz@compsoc.man.ac.uk>
* ui/QMinipageDialog.ui: fix layout, remove old slot
-
+
* QRefDialog.C: fix warning
-
+
2001-09-02 Edwin Leuven <leuven@fee.uva.nl>
* ui/QSpellcheckerDialog.ui: reworded layout
* QSpellchecker.[Ch]:
* QSpellcheckerDialog.[Ch]:
* ui/QSpellcheckerDialog.ui: add spellchecker dialog
-
+
2001-08-31 Edwin Leuven <leuven@fee.uva.nl>
* ui/QMinipageDialog.ui: layout tweak again (but it's getting better)
* emptytable.C:
* ui/QTabularCreateDialog.ui: fix layout
when table size is changed
-
+
2001-08-31 John Levon <moz@compsoc.man.ac.uk>
* Dialogs.C:
* QSearch.[Ch]:
* QSearchDialog.[Ch]:
* ui/QSearchDialog.ui: add search back
-
+
2001-08-29 John Levon <moz@compsoc.man.ac.uk>
* Dialogs.C:
* QPrint.[Ch]:
* QPrintDialog.[Ch]:
* ui/QPrintDialog.ui: add print dialog back
-
+
2001-08-29 John Levon <moz@compsoc.man.ac.uk>
* Makefile.am:
* QIndexDialog.C: add QWhatsThis in C source
* README: document this restriction
-
+
2001-08-29 John Levon <moz@compsoc.man.ac.uk>
* QMinipage.[Ch]:
* QVCLog.[Ch]:
* QVCLogDialog.[Ch]:
* ui/QVCLogDialog.ui:
- * Dialogs.C:
+ * Dialogs.C:
* Makefile.am:
* Makefile.dialogs: add log and vclog dialogs
* ui/Makefile.am:
* ui/QTabularCreateDialog.ui: bring back
tabcreate
-
+
2001-08-28 John Levon <moz@compsoc.man.ac.uk>
* ui/QCharacterDialog.ui:
* Makefile.am:
* Makefile.dialogs:
* Dialogs.C: add graphics dialog
-
+
2001-08-28 John Levon <moz@compsoc.man.ac.uk>
* QThesaurus.C: clear selection on update
* Makefile.am:
* Makefile.dialogs:
* Dialogs.C: add Include dialog
-
+
* README: add note about crashes
-
+
2001-08-27 John Levon <moz@compsoc.man.ac.uk>
* QThesaurusDialog.C: whoops, forgot to clear before update
-
+
2001-08-27 John Levon <moz@compsoc.man.ac.uk>
* QBibtex.C:
delete button
* QExternalDialog.C: fix file dialog thing
-
- * QThesaurus.h:
- * QThesaurus.C:
+
+ * QThesaurus.h:
+ * QThesaurus.C:
* QThesaurusDialog.h:
- * QThesaurusDialog.C:
+ * QThesaurusDialog.C:
* ui/QThesaurusDialog.ui: fix compile, get working
-
+
* moc/Makefile.am: fix builddir != srcdir
-
+
2001-08-27 John Levon <moz@compsoc.man.ac.uk>
* GUIRunTime.C: fix argc handling
-
+
2001-08-27 John Levon <moz@compsoc.man.ac.uk>
- * ui/*.ui:
+ * ui/*.ui:
* ui/Makefile.am: add some sed magic to replace tr() with _()
-
+
2001-08-27 John Levon <moz@compsoc.man.ac.uk>
* Makefile.am: remove accidentally committed xforms file
-
+
2001-08-27 John Levon <moz@compsoc.man.ac.uk>
* Dialogs.C:
- * Makefile.dialogs:
+ * Makefile.dialogs:
* QThesaurus.[Ch]:
* QThesaurusDialog.[Ch]:
* ui/QThesaurusDialog.ui: add thesaurus dialog
-
+
2001-08-27 John Levon <moz@compsoc.man.ac.uk>
* Dialogs.C:
* QExternal.[Ch]:
* QExternalDialog.[Ch]:
* ui/QExternalDialog.ui: add external dialog
-
+
2001-08-26 John Levon <moz@compsoc.man.ac.uk>
* Dialogs.C:
* QERT.[Ch]:
* QERTDialog.[Ch]:
* ui/QERTDialog.ui: add ERT dialog
-
+
2001-08-26 John Levon <moz@compsoc.man.ac.uk>
* Dialogs.C:
* Makefile.am:
- * Makefile.dialogs:
+ * Makefile.dialogs:
* QError.[Ch]:
* QErrorDialog.[Ch]:
* ui/QErrorDialog.ui: add LaTeX error dialog
* QCharacterDialog.[Ch]:
* ui/QcharacterDialog.ui: make work again,
add auto-apply feature
-
+
2001-08-26 John Levon <moz@compsoc.man.ac.uk>
* Dialogs.C:
* QBibitem.[Ch]:
* QBibitemDialog.[Ch]:
* ui/QBibitemDialog.ui: add Bibitem dialog
-
+
2001-08-26 John Levon <moz@compsoc.man.ac.uk>
* Dialogs.C:
* ui/QBibtexDialog.ui: added BibTeX dialog.
* README: update
-
+
2001-08-26 John Levon <moz@compsoc.man.ac.uk>
* Qt2BC.C: whoops, reversed sense of setReadOnly()
-
+
2001-08-26 John Levon <moz@compsoc.man.ac.uk>
- * Dialogs.C:
+ * Dialogs.C:
* QRef.[Ch]:
* ui/QRefDialog.ui: add Ref dialog back
* QAbout.[Ch]:
- * QCitation.[Ch]:
- * QDocument.[Ch]:
- * QIndex.[Ch]:
+ * QCitation.[Ch]:
+ * QDocument.[Ch]:
+ * QIndex.[Ch]:
* QURL.[Ch]:
- * Qt2Base.h: protect build() with updating_ too
+ * Qt2Base.h: protect build() with updating_ too
* QCitationDialog.C: use Qt2Base::readOnly
* README: update
-
+
2001-08-25 John Levon <moz@compsoc.man.ac.uk>
* Dialogs.C: add URL
-
+
* QAbout.h:
* QCitation.h:
- * QDocument.h:
- * QIndex.C:
+ * QDocument.h:
+ * QIndex.C:
* Qt2Base.h:
* Qt2Base.C: add an updating_ variable to prevent
bc() breakage.
* QURLDialog.h:
* QURLDialog.C:
* ui/QURLDialog.ui: make alive again
-
- * Qt2BC.C: make lineedits ReadOnly not disabled
-
+
+ * Qt2BC.C: make lineedits ReadOnly not disabled
+
* README: update
-
+
* ui/QCitationDialog.ui: small cleanups
* ui/QIndexDialog.ui: add a what's this
-
+
2001-08-24 John Levon <moz@compsoc.man.ac.uk>
* Dialogs.C: include the right files
* QCitation.C: closePB not cancelPB
-
+
* QCitationDialog.C:
* QCitationDialog.h:
* ui/QCitationDialog.ui: small fixes
* QIndex.h:
* QIndex.C:
* QIndexDialog.C:
- * QIndexDialog.h:
+ * QIndexDialog.h:
* ui/QIndexDialog.ui: more fixes
-
+
* Qt2Base.h:
- * Qt2Base.C: add reset() to workaround problem.
+ * Qt2Base.C: add reset() to workaround problem.
* README: update
- * Makefile.am:
+ * Makefile.am:
* Timeout_pimpl.h:
* Timeout_pimpl.C: add the timer
* Makefile.am:
* Qt2BC.h:
* Qt2BC.C:
- * QAbout.C:
+ * QAbout.C:
* QCitation.C:
- * QDocument.h:
+ * QDocument.h:
* Qt2Base.C:
* Qt2Base.h: rename qt2BC -> Qt2BC, set focus for widget enable
* Qt2Base.h:
* Qt2Base.C: add a virtual isValid(), and predicate what changed()
tells the BC on the return value
-
+
* README: update
-
+
2001-08-21 John Levon <moz@compsoc.man.ac.uk>
* Dialogs.C: add QIndex
* ui/Makefile.am:
* Makefile.am: fix build
-
+
* ui/QAboutDialog.ui:
* QAbout.C: finish dialog
* ui/QCitationDialog.ui:
* QCitationDialog.C: BC fixes
-
- * ui/QIndexDialog.ui:
+
+ * ui/QIndexDialog.ui:
* QIndex.h:
- * QIndex.C:
+ * QIndex.C:
* QIndexDialog.h:
* QIndexDialog.C: got index dialog working
2001-08-19 John Levon <moz@compsoc.man.ac.uk>
* all files: enormous naming re-jig and tidy
-
+
2001-07-13 Angus Leeming <a.leeming@ic.ac.uk>
Consistent use of Lsstream.h:
* FormCitationDialogImpl.C: added using directive.
* qt2BC.[Ch]: qt2BC now derives from GuiBC<QButton, QWidget>.
- No idea why this wasn't done ages ago!
+ No idea why this wasn't done ages ago!
2001-06-15 Angus Leeming <a.leeming@ic.ac.uk>
* <various>: fix random space pepper to use
hard tabs. Also add <config.h> where necessitated
by using LString.h
-
+
2001-05-22 Adrien Rebollo <rebollo@iaf.cnrs-gif.fr>
* FormDocument.C (build): add iso8859-15 support.
* Qt2Base.h:
* Qt2Base.C: s/ControlButton/ControlButtons/
-
+
2001-04-02 Kalle Dalheimer <kalle@klaralvdalens-datakonsult.se>
* Makefile.am: Simplified Makefile.am
* Makefile.am: added missing xform dialogs
* FormParagraph.C: only extra setting if wanted
* FormParagraph.h: add namespace to connection
-
+
2001-03-16 Kalle Dalheimer <kalle@klaralvdalens-datakonsult.se>
* FormParagraph.C (apply): Only call SetParagraphExtraOpt() when
* Makefile.am: updated
* FormSplash.[Ch]: added
* FormSplashImpl.[Ch]: added
-
+
2001-03-09 Edwin Leuven <leuven@fee.uva.nl>
* Makefile.am: updated
* chardlg.ui
* chardlg.[Ch]
* chardlgimpl.[Ch]
-
+
2001-02-16 John Levon <moz@compsoc.man.ac.uk>
* FormParagraph.C: fix bview->update()
#include "xforms/FormPreferences.h"
#include "xforms/FormShowFile.h"
#include "xforms/FormTabular.h"
-
+
#include "GUI.h"
Dialogs::Dialogs(LyXView * lv)
add(new GUIIndex<QIndex, Qt2BC>(*lv, *this));
add(new GUILog<QLog, Qt2BC>(*lv, *this));
add(new GUIMinipage<QMinipage, Qt2BC>(*lv, *this));
- add(new GUIPreamble<QPreamble, Qt2BC>(*lv, *this));
+ add(new GUIPreamble<QPreamble, Qt2BC>(*lv, *this));
add(new GUIPrint<QPrint, Qt2BC>(*lv, *this));
add(new GUIRef<QRef, Qt2BC>(*lv, *this));
- add(new GUISearch<QSearch, Qt2BC>(*lv, *this));
+ add(new GUISearch<QSearch, Qt2BC>(*lv, *this));
add(new GUIShowFile<QShowFile, Qt2BC>(*lv, *this));
add(new GUISpellchecker<QSpellchecker, Qt2BC>(*lv, *this));
add(new GUITabularCreate<QTabularCreate, Qt2BC>(*lv, *this));
// dialogs not yet MVCd
add(new FormDocument(lv, this));
- add(new FormMathsPanel(lv, this));
+ add(new FormMathsPanel(lv, this));
add(new FormParagraph(lv, this));
add(new FormPreferences(lv, this));
add(new FormTabular(lv, this));
-
+
// reduce the number of connections needed in
// dialogs by a simple connection here.
hideAll.connect(hideBufferDependent.slot());
#endif
#include <config.h>
-#include <gettext.h>
+#include <gettext.h>
#include <utility>
-
+
#include "commandtags.h"
#include "LString.h"
#include "frontends/FileDialog.h"
-#include "FileDialog_private.h"
+#include "FileDialog_private.h"
#include "debug.h"
using std::make_pair;
string filter = mask;
if (mask.empty())
filter = _("*|All files");
-
+
LyXFileDialog * dlg = new LyXFileDialog(lv_, success_, path, filter, title_);
lyxerr[Debug::GUI] << "Select with path \"" << path << "\", mask \"" << filter << "\", suggested \"" << suggested << endl;
if (!suggested.empty())
dlg->setSelection(suggested.c_str());
-
+
if (success_ == LFUN_SELECT_FILE_SYNC) {
FileDialog::Result result;
lyxerr[Debug::GUI] << "Synchronous FileDialog : " << endl;
if (res == QDialog::Accepted)
result.second = string(dlg->selectedFile().data());
delete dlg;
- return result;
+ return result;
}
dlg->show();
return make_pair(FileDialog::Later, string());
} else if (what == QDialog::Accepted) {
lv_->getLyXFunc()->dispatch(action_, selectedFile().data());
}
-
+
delete this;
}
#define FILEDIALOG_PRIVATE_H
#include <config.h>
-
+
#include <qfiledialog.h>
#include "LString.h"
-#include "lyxfunc.h"
+#include "lyxfunc.h"
#include "frontends/FileDialog.h"
#include <qapplication.h>
#include <qpainter.h>
-
-#include "QtLyXView.h"
+
+#include "QtLyXView.h"
#include "XFormsView.h"
#include "GUIRunTime.h"
#include "debug.h"
int GUIRunTime::initApplication(int & argc, char * argv[])
{
int const xforms_include_version = FL_INCLUDE_VERSION;
-
+
// Check the XForms version in the forms.h header against
// the one in the libforms. If they don't match quit the
// execution of LyX. Better with a clean fast exit than
return 0;
}
-
-void GUIRunTime::processEvents()
+
+void GUIRunTime::processEvents()
{
qApp->processEvents();
}
return new XFormsView(w, h);
}
-
+
// Called by the graphics cache to connect the appropriate frontend
// image loading routines to the LyX kernel.
void GUIRunTime::initialiseGraphics()
{
using namespace grfx;
using SigC::slot;
-
+
#if defined(HAVE_FLIMAGE_DUP) && defined(HAVE_FLIMAGE_TO_PIXMAP)
// connect the image loader based on the xforms library
GImage::newImage.connect(slot(&xformsGImage::newImage));
int GUIRunTime::x11Screen()
{
- //return p.device()->x11Screen();
+ //return p.device()->x11Screen();
return fl_screen;
}
Colormap GUIRunTime::x11Colormap()
{
- //return p.device()->x11Colormap();
+ //return p.device()->x11Colormap();
return fl_state[fl_get_vclass()].colormap;
}
-
-int GUIRunTime::x11VisualDepth()
+
+int GUIRunTime::x11VisualDepth()
{
//return p.device()->x11Depth();
return fl_get_visual_depth();
}
-
+
float GUIRunTime::getScreenDPI()
{
Screen * scr = ScreenOfDisplay(fl_get_display(), fl_screen);
(WidthOfScreen(scr) * 25.4 / WidthMMOfScreen(scr))) / 2;
}
-
-void GUIRunTime::setDefaults()
+
+void GUIRunTime::setDefaults()
{
FL_IOPT cntl;
cntl.buttonFontSize = FL_NORMAL_SIZE;
#include "debug.h"
#include "gettext.h"
#include "QAboutDialog.h"
-
+
#include <qlabel.h>
#include <qpushbutton.h>
#include <qtextview.h>
#include "QtLyXView.h"
-
+
#include "ButtonControllerBase.h"
#include "Qt2BC.h"
#include "ControlAboutlyx.h"
typedef Qt2CB<ControlAboutlyx, Qt2DB<QAboutDialog> > base_class;
-QAbout::QAbout(ControlAboutlyx & c)
+QAbout::QAbout(ControlAboutlyx & c)
: base_class(c, _("About LyX"))
{
}
dialog_->copyright->append("\n");
dialog_->copyright->append(controller().getDisclaimer().c_str());
- dialog_->versionLA->setText(controller().getVersion().c_str());
-
+ dialog_->versionLA->setText(controller().getVersion().c_str());
+
stringstream in;
controller().getCredits(in);
istringstream ss(in.str().c_str());
-
+
string s;
string out;
-
+
while (getline(ss, s)) {
if (prefixIs(s, "@b"))
out += "<b>" + s.substr(2) + "</b>";
out += s;
out += "<br>";
}
-
+
dialog_->creditsTV->setText(out.c_str());
-
+
// Manage the cancel/close button
bc().setCancel(dialog_->closePB);
bc().refresh();
class QAbout
: public Qt2CB<ControlAboutlyx, Qt2DB<QAboutDialog> >
{
-public:
+public:
QAbout(ControlAboutlyx &);
-private:
+private:
/// not needed
virtual void apply() {}
/// not needed
{
}
-
+
QAboutDialog::~QAboutDialog()
{
}
#include "ui/QAboutDialogBase.h"
class QAboutDialog : public QAboutDialogBase
-{
+{
Q_OBJECT
public:
QAboutDialog(QWidget * parent = 0, const char * name = 0, bool modal = FALSE, WFlags fl = 0);
#include "QBibitem.h"
#include "Qt2BC.h"
#include "gettext.h"
-#include "debug.h"
+#include "debug.h"
#include <qlineedit.h>
#include <qpushbutton.h>
void QBibitem::apply()
{
- controller().params().setContents(dialog_->keyED->text().latin1());
- controller().params().setOptions(dialog_->labelED->text().latin1());
+ controller().params().setContents(dialog_->keyED->text().latin1());
+ controller().params().setOptions(dialog_->labelED->text().latin1());
}
class QBibitemDialog;
class QBibitem :
- public Qt2CB<ControlBibitem, Qt2DB<QBibitemDialog> >
+ public Qt2CB<ControlBibitem, Qt2DB<QBibitemDialog> >
{
friend class QBibitemDialog;
-
-public:
+
+public:
QBibitem(ControlBibitem &);
protected:
virtual bool isValid();
-
-private:
+
+private:
/// Apply changes
virtual void apply();
/// update
#include <qpushbutton.h>
#include <qlineedit.h>
-
+
#include "QBibitemDialog.h"
#include "QBibitem.h"
#include "Dialogs.h"
-#include "ControlBibitem.h"
+#include "ControlBibitem.h"
QBibitemDialog::QBibitemDialog(QBibitem * form)
: QBibitemDialogBase(0, 0, false, 0),
form, SLOT(slotClose()));
}
-
+
void QBibitemDialog::change_adaptor()
{
form_->changed();
#ifndef QBIBITEMDIALOG_H
#define QBIBITEMDIALOG_H
-
+
#include "ui/QBibitemDialogBase.h"
class QBibitem;
protected slots:
virtual void change_adaptor();
-
+
protected:
virtual void closeEvent(QCloseEvent * e);
#include "QBibtex.h"
#include "Qt2BC.h"
#include "gettext.h"
-#include "debug.h"
+#include "debug.h"
#include <qlineedit.h>
#include <qcombobox.h>
bc().addReadOnly(dialog_->stylePB);
bc().addReadOnly(dialog_->bibtocCB);
bc().addReadOnly(dialog_->databasePB);
- bc().addReadOnly(dialog_->deletePB);
+ bc().addReadOnly(dialog_->deletePB);
}
dialog_->databaseLB->inSort(bib.c_str());
}
- string bibtotoc = "bibtotoc";
+ string bibtotoc = "bibtotoc";
string bibstyle(controller().params().getOptions().c_str());
// bibtotoc exists?
dialog_->deletePB->setEnabled(false);
dialog_->styleED->setEnabled(false);
dialog_->stylePB->setEnabled(false);
-
+
if (bibstyle == "plain" || bibstyle.empty())
dialog_->styleCO->setCurrentItem(0);
else if (bibstyle == "unsrt")
bibstyle = dialog_->styleED->text().latin1();
bool const bibtotoc(dialog_->bibtocCB->isChecked());
-
+
if (bibtotoc && (!bibstyle.empty())) {
// both bibtotoc and style
controller().params().setOptions("bibtotoc," + bibstyle);
class QBibtexDialog;
class QBibtex :
- public Qt2CB<ControlBibtex, Qt2DB<QBibtexDialog> >
+ public Qt2CB<ControlBibtex, Qt2DB<QBibtexDialog> >
{
friend class QBibtexDialog;
-
-public:
+
+public:
QBibtex(ControlBibtex &);
protected:
virtual bool isValid();
-
-private:
+
+private:
/// Apply changes
virtual void apply();
/// update
#include <qlineedit.h>
#include <qcheckbox.h>
#include <qfiledialog.h>
-
+
#include "QBibtexDialog.h"
#include "QBibtex.h"
#include "Dialogs.h"
-#include "ControlBibtex.h"
-#include "gettext.h"
+#include "ControlBibtex.h"
+#include "gettext.h"
#include "debug.h"
#include "support/filetools.h"
form, SLOT(slotClose()));
}
-
+
void QBibtexDialog::change_adaptor()
{
form_->changed();
void QBibtexDialog::browsePressed()
{
- QString file = QFileDialog::getOpenFileName(QString::null,
+ QString file = QFileDialog::getOpenFileName(QString::null,
_("BibTeX style files (*.bst)"), this, 0, _("Select a BibTeX style"));
if (!file.isNull()) {
styleED->setText(ChangeExtension(OnlyFilename(file.latin1()), "").c_str());
}
}
-
+
void QBibtexDialog::addPressed()
{
- QString file = QFileDialog::getOpenFileName(QString::null,
- _("BibTeX database files (*.bib)"), this, 0, _("Select a BibTeX database to add"));
+ QString file = QFileDialog::getOpenFileName(QString::null,
+ _("BibTeX database files (*.bib)"), this, 0, _("Select a BibTeX database to add"));
if (!file.isNull()) {
// FIXME: check duplicates
databaseLB->insertItem(ChangeExtension(file.latin1(), "").c_str());
}
}
-
+
void QBibtexDialog::deletePressed()
{
databaseLB->removeItem(databaseLB->currentItem());
}
-
+
void QBibtexDialog::styleChanged(const QString & sel)
{
if (form_->readOnly())
return;
-
+
if (string(_("Other ...")) == sel.latin1()) {
styleED->setEnabled(true);
stylePB->setEnabled(true);
}
}
-
+
void QBibtexDialog::databaseChanged()
{
deletePB->setEnabled(!form_->readOnly() && databaseLB->currentItem() != -1);
}
-
+
void QBibtexDialog::closeEvent(QCloseEvent *e)
{
form_->slotWMHide();
#ifndef QBIBTEXDIALOG_H
#define QBIBTEXDIALOG_H
-
+
#include <config.h>
-
+
#include "ui/QBibtexDialogBase.h"
class QBibtex;
virtual void addPressed();
virtual void deletePressed();
virtual void styleChanged(const QString &);
- virtual void databaseChanged();
+ virtual void databaseChanged();
+
-
protected:
virtual void closeEvent(QCloseEvent * e);
using namespace character;
using std::vector;
-
+
typedef Qt2CB<ControlCharacter, Qt2DB<QCharacterDialog> > base_class;
-
+
QCharacter::QCharacter(ControlCharacter & c)
: base_class(c, _("Character"))
{
cit != language.end(); ++cit) {
dialog_->langCO->insertItem(cit->c_str(), -1);
}
-
+
bc().setOK(dialog_->okPB);
bc().setApply(dialog_->applyPB);
bc().setCancel(dialog_->closePB);
namespace {
-
+
template<class A, class B>
int findPos2nd(vector<std::pair<A,B> > const & vec, B const & val)
{
vector<std::pair<A,B> >::const_iterator cit = vec.begin();
for (; cit != vec.end(); ++cit) {
if (cit->second == val)
- return int(cit - vec.begin());
+ return int(cit - vec.begin());
}
return 0;
}
-
+
} // namespace anon
-
-
+
+
void QCharacter::update_contents()
{
dialog_->familyCO->setCurrentItem(findPos2nd(family, controller().getFamily()));
dialog_->colorCO->setCurrentItem(findPos2nd(color, controller().getColor()));
dialog_->toggleallCB->setChecked(controller().getToggleAll());
-
+
string const thelanguage(controller().getLanguage());
- int i = 0;
+ int i = 0;
for (vector<string>::const_iterator cit = language.begin();
cit != language.end(); ++i, ++cit) {
if (*cit == thelanguage) {
}
}
-
+
void QCharacter::apply()
{
controller().setFamily(family[dialog_->familyCO->currentItem()].second);
controller().setSize(size[dialog_->sizeCO->currentItem()].second);
controller().setBar(bar[dialog_->miscCO->currentItem()].second);
controller().setColor(color[dialog_->colorCO->currentItem()].second);
-
+
controller().setLanguage(dialog_->langCO->currentText().latin1());
-
+
controller().setToggleAll(dialog_->toggleallCB->isChecked());
}
#include <config.h>
#include <vector>
-
-#include "LString.h"
+
+#include "LString.h"
#include "Qt2Base.h"
-#include "controllers/character.h"
-
+#include "controllers/character.h"
+
class ControlCharacter;
class QCharacterDialog;
class QCharacter :
- public Qt2CB<ControlCharacter, Qt2DB<QCharacterDialog> >
+ public Qt2CB<ControlCharacter, Qt2DB<QCharacterDialog> >
{
friend class QCharacterDialog;
-
-public:
+
+public:
QCharacter(ControlCharacter &);
-private:
+private:
/// Apply changes
virtual void apply();
/// update
virtual void update_contents();
/// build the dialog
virtual void build_dialog();
-
+
std::vector<character::FamilyPair> family;
std::vector<character::SeriesPair> series;
std::vector<character::ShapePair> shape;
#include <qgroupbox.h>
QCharacterDialog::QCharacterDialog(QCharacter * form)
- : QCharacterDialogBase(0, 0, false, 0),
+ : QCharacterDialogBase(0, 0, false, 0),
form_(form)
{
connect(okPB, SIGNAL(clicked()),
connect(closePB, SIGNAL(clicked()),
form_, SLOT(slotClose()));
}
-
+
void QCharacterDialog::change_adaptor()
{
form_->changed();
-
+
if (!autoapplyCB->isChecked())
return;
shapeCO->setCurrentItem(0);
miscCO->setCurrentItem(0);
langCO->setCurrentItem(0);
- colorCO->setCurrentItem(0);
+ colorCO->setCurrentItem(0);
}
-
+
void QCharacterDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
#include <qcombobox.h>
class LyXFont;
-
+
class QCharacterDialog : public QCharacterDialogBase
{ Q_OBJECT
public:
QCharacterDialog(QCharacter * form);
-
+
protected:
void closeEvent(QCloseEvent * e);
#include "QCitationDialog.h"
#include "QCitation.h"
-
+
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qlineedit.h>
#include <qmultilineedit.h>
#include <qpushbutton.h>
-#include "QtLyXView.h"
+#include "QtLyXView.h"
#include "Qt2BC.h"
#include "ControlCitation.h"
#include "debug.h"
{
vector<biblio::CiteStyle> const & styles =
ControlCitation::getCiteStyles();
-
+
int const choice = dialog_->citationStyleCO->currentItem();
bool const full = dialog_->fulllistCB->isChecked();
bool const force = dialog_->forceuppercaseCB->isChecked();
-
- string const command =
- biblio::getCiteCommand(styles[choice], full, force);
-
+
+ string const command =
+ biblio::getCiteCommand(styles[choice], full, force);
+
controller().params().setCmdName(command);
controller().params().setContents(getStringFromVector(citekeys));
-
+
string const after = dialog_->textAfterED->text().latin1();
controller().params().setOptions(after);
}
{
citekeys.clear();
bibkeys.clear();
-
+
Qt2Base::hide();
}
bc().addReadOnly(dialog_->citationStyleCO);
bc().addReadOnly(dialog_->forceuppercaseCB);
bc().addReadOnly(dialog_->fulllistCB);
- // add when enabled !
+ // add when enabled !
//bc().addReadOnly(dialog_->textBeforeED);
bc().addReadOnly(dialog_->textAfterED);
}
if (!citekeys.empty())
key = citekeys[0];
-
+
dialog_->citationStyleCO->clear();
vector<string> const & sty = controller().getCiteStrings(key);
-
+
for (vector<string>::const_iterator it = sty.begin();
it != sty.end(); ++it) {
dialog_->citationStyleCO->insertItem(it->c_str());
}
}
-
+
void QCitation::updateStyle()
{
string const & command = controller().params().getCmdName();
-
+
// Find the style of the citekeys
vector<biblio::CiteStyle> const & styles =
ControlCitation::getCiteStyles();
- biblio::CitationStyle cs = biblio::getCitationStyle(command);
-
+ biblio::CitationStyle cs = biblio::getCitationStyle(command);
+
vector<biblio::CiteStyle>::const_iterator cit =
find(styles.begin(), styles.end(), cs.style);
-
+
dialog_->citationStyleCO->setCurrentItem(0);
- dialog_->fulllistCB->setChecked(false);
- dialog_->forceuppercaseCB->setChecked(false);
-
+ dialog_->fulllistCB->setChecked(false);
+ dialog_->forceuppercaseCB->setChecked(false);
+
if (cit != styles.end()) {
int const i = int(cit - styles.begin());
dialog_->citationStyleCO->setCurrentItem(i);
dialog_->fulllistCB->setChecked(cs.full);
dialog_->forceuppercaseCB->setChecked(cs.forceUCase);
- }
+ }
bool const natbib = controller().usingNatbib();
- dialog_->citationStyleCO->setEnabled(natbib);
- dialog_->fulllistCB->setEnabled(natbib);
- dialog_->forceuppercaseCB->setEnabled(natbib);
+ dialog_->citationStyleCO->setEnabled(natbib);
+ dialog_->fulllistCB->setEnabled(natbib);
+ dialog_->forceuppercaseCB->setEnabled(natbib);
}
-
+
void QCitation::update_contents()
{
dialog_->textAfterED->setText(controller().params().getOptions().c_str());
fillStyles();
-
+
updateStyle();
}
-
+
void QCitation::updateBrowser(QListBox* browser,
vector<string> const & keys) const
class ControlCitation;
class QCitationDialog;
-class QCitation : public Qt2CB<ControlCitation, Qt2DB<QCitationDialog> >
+class QCitation : public Qt2CB<ControlCitation, Qt2DB<QCitationDialog> >
{
friend class QCitationDialog;
-
+
public:
///
QCitation(ControlCitation &);
/// fill the styles combo
void fillStyles();
-
+
/// set the styles combo
void updateStyle();
-
+
void updateBrowser(QListBox *, std::vector<string> const &) const;
///
void setBibButtons(State) const;
void QCitationDialog::slotBibSelected(int sel)
{
slotBibHighlighted(sel);
-
- if (form_->readOnly())
+
+ if (form_->readOnly())
return;
-
+
slotAddClicked();
}
-
+
void QCitationDialog::slotBibHighlighted(int sel)
{
biblio::InfoMap const & theMap = form_->controller().bibkeysInfo();
start -= 1;
bool const caseSensitive = searchCaseCB->isChecked();
-
+
vector<string>::const_iterator cit =
biblio::searchKeys(theMap, form_->bibkeys, str,
start, type, dir, caseSensitive);
- // FIXME: should work ...
+ // FIXME: should work ...
if (cit == form_->bibkeys.end()) {
// not found. let's loop round
if (dir == biblio::FORWARD)
start = form_->bibkeys.begin();
else
start = form_->bibkeys.end();
-
+
cit = biblio::searchKeys(theMap, form_->bibkeys, str,
start, type, dir, caseSensitive);
-
+
if (cit == form_->bibkeys.end())
return;
}
#include <config.h>
#include "support/lstrings.h"
-
+
#include "ui/QCitationDialogBase.h"
#include "QCitation.h"
#include "controllers/biblio.h"
virtual void changed_adaptor() {
form_->changed();
}
-
+
private:
void doFind(biblio::Direction dir);
-
+
private:
QCitation * form_;
};
typedef Qt2CB<ControlDocument, Qt2DB<QDocumentDialog> > base_class;
-#if 0
+#if 0
QDocument::QDocument(ControlDocument & c)
: base_class(c, _("Document Settings"))
{
QDocument::QDocument(LyXView *, Dialogs *)
{
}
-#endif
+#endif
void QDocument::build_dialog()
// the tabbed folder
//dialog_.reset(new QDocumentDialog());
-#if 0
+#if 0
// Manage the restore, ok, apply, restore and cancel/close buttons
bc().setOK(dialog_->okPB);
bc().setApply(dialog_->applyPB);
bc().addReadOnly (dialog->bulletPanelBG);
bc().addReadOnly (dialog->bulletSizeCO);
bc().addReadOnly (dialog->bulletLatexED);
-#endif
+#endif
}
//if (!lv_->view()->available() || !dialog_.get())
// return;
-#if 0
+#if 0
bool redo = class_apply();
paper_apply();
redo = language_apply() || redo;
}
lv_->buffer()->markDirty();
setMinibuffer(lv_, _("Document layout set"));
-#endif
+#endif
}
void QDocument::cancel()
{
-#if 0
+#if 0
// this avoids confusion when reopening
BufferParams & param = lv_->buffer()->params;
param.temp_bullets[0] = param.user_defined_bullets[0];
param.temp_bullets[2] = param.user_defined_bullets[2];
param.temp_bullets[3] = param.user_defined_bullets[3];
hide();
-#endif
+#endif
}
if (!dialog_.get())
return;
-#if 0
+#if 0
checkReadOnly();
BufferParams const & params = lv_->buffer()->params;
language_update(params);
options_update(params);
bullets_update(params);
-#endif
+#endif
}
params.fonts = dialog_->docFontsCO->currentText();
params.fontsize = dialog_->docFontSizeCO->currentText();
params.pagestyle = dialog->docPagestyleCO->currentText();
-
+
unsigned int const new_class = dialog_->docClassCO->currentItem();
-
+
if (params.textclass != new_class) {
// try to load new_class
if (textclasslist.Load(new_class)) {
&& old_language->RightToLeft() == new_language->RightToLeft()
&& !lv_->buffer()->isMultiLingual())
lv_->buffer()->ChangeLanguage(old_language, new_language);
-
+
if (old_language != new_language)
redo = true;
void QDocument::BulletDepth(FL_OBJECT * ob, State cb)
{
/* Should I do the following:
- * 1. change to the panel that the current bullet belongs in
+ * 1. change to the panel that the current bullet belongs in
* 2. show that bullet as selected
* 3. change the size setting to the size of the bullet in Q.
* 4. display the latex equivalent in the latex box
*
* I'm inclined to just go with 3 and 4 at the moment and
* maybe try to support the others later
- */
+ */
BufferParams & param = lv_->buffer()->params;
int data = 0;
options_update(params);
bullets_update(params);
}
-#endif // 0
+#endif // 0
* \author Kalle Dalheimer <kalle@klaralvdalens-datakonsult.se>
*/
-
+
#ifndef QDOCUMENT_H
#define QDOCUMENT_H
#include "Qt2Base.h"
#include "Qt2BC.h"
-#include "QtLyXView.h"
+#include "QtLyXView.h"
#ifdef __GNUG_
#pragma interface
//FIXME !!!!! : public Qt2CB<ControlDocument, Qt2DB<QDocumentDialog> >
{
public:
- // FIXME!!!!!!!
+ // FIXME!!!!!!!
QDocument(LyXView *, Dialogs *);
private:
///
virtual Qt2BC & bc();
/// Build the dialog
virtual void build_dialog();
-// /// Filter the inputs
-// virtual bool input( FL_OBJECT *, long );
+// /// Filter the inputs
+// virtual bool input( FL_OBJECT *, long );
/// Update the dialog.
virtual void update_contents();
/// Apply from dialog
/// Cancel from dialog
virtual void cancel();
-// ///
-// virtual QDialog* form() const;
+// ///
+// virtual QDialog* form() const;
#if 0
///
int current_bullet_panel;
///
int current_bullet_depth;
-// ///
-// FL_OBJECT * fbullet;
-// ///
-// boost::scoped_ptr<Combox> combo_language;
-// ///
-// boost::scoped_ptr<Combox> combo_doc_class;
+// ///
+// FL_OBJECT * fbullet;
+// ///
+// boost::scoped_ptr<Combox> combo_language;
+// ///
+// boost::scoped_ptr<Combox> combo_doc_class;
/// The ButtonController
ButtonController<NoRepeatedApplyReadOnlyPolicy, Qt2BC> bc_;
};
*/
#include <config.h>
-
+
#include "QDocumentDialog.h"
#include "Dialogs.h"
#include "QDocument.h"
: QDocumentDialogBase(parent, name, modal, fl),
form_(form)
{
-#if 0
+#if 0
// Copy the pointers to the bullet buttons into an array so that
// they can all be manipulated together.
bulletbuttons[0] = bullet00PB;
bulletbuttons[33] = bullet53PB;
bulletbuttons[34] = bullet54PB;
bulletbuttons[35] = bullet55PB;
-#endif
+#endif
}
-
+
QDocumentDialog::~QDocumentDialog()
{
}
-#if 0
+#if 0
void QDocumentDialog::slotApply()
{
form->apply();
form->checkDocumentInput( amsMathCB );
}
-
+
void QDocumentDialog::slotBulletDepth1()
{
form->bulletDepth( 0 );
form->bulletDepth( 1 );
}
-
+
void QDocumentDialog::slotBulletDepth3()
{
form->bulletDepth( 2 );
form->checkDocumentInput( quoteStyleTypeCO );
}
-
+
void QDocumentDialog::slotQuoteType(int)
{
// Intentionally left blank
form->checkDocumentInput( CheckBox1 );
}
-
+
void QDocumentDialog::slotWidth(const QString&)
{
form->checkDocumentInput( customWidthED );
}
-#endif
+#endif
void QDocumentDialog::closeEvent( QCloseEvent* e )
#ifndef QDOCUMENTDIALOG_H
#define QDOCUMENTDIALOG_H
-
+
#include "ui/QDocumentDialogBase.h"
class QDocument;
~QDocumentDialog();
public slots:
-#if 0
+#if 0
void slotApply();
void slotBulletLaTeX(const QString&);
void slotAMSMath(bool);
void slotTOCDepth(int);
void slotUseGeometryPackage(bool);
void slotWidth(const QString&);
-#endif
+#endif
protected:
void closeEvent(QCloseEvent *);
#include <qpushbutton.h>
typedef Qt2CB<ControlERT, Qt2DB<QERTDialog> > base_class;
-
+
QERT::QERT(ControlERT & c)
: base_class(c, _("LaTeX ERT"))
{
bc().setCancel(dialog_->closePB);
}
-
+
void QERT::apply()
{
if (dialog_->openRB->isChecked())
controller().params().status = InsetERT::Collapsed;
}
-
+
void QERT::update_contents()
{
QRadioButton * rb;
-
+
switch (controller().params().status) {
case InsetERT::Open: rb = dialog_->openRB; break;
case InsetERT::Inlined: rb = dialog_->inlineRB; break;
case InsetERT::Collapsed: rb = dialog_->collapsedRB; break;
- }
-
+ }
+
rb->setChecked(true);
}
class QERTDialog;
class QERT :
- public Qt2CB<ControlERT, Qt2DB<QERTDialog> >
+ public Qt2CB<ControlERT, Qt2DB<QERTDialog> >
{
friend class QERTDialog;
-
-public:
+
+public:
QERT(ControlERT &);
-private:
+private:
/// Apply changes
virtual void apply();
/// update
form, SLOT(slotClose()));
}
-
+
void QERTDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
#ifndef QERTDIALOG_H
#define QERTDIALOG_H
-
+
#include <config.h>
-
+
#include "ui/QERTDialogBase.h"
#include "QERT.h"
void change_adaptor() {
form_->changed();
}
-
+
protected:
virtual void closeEvent(QCloseEvent * e);
#include <qpushbutton.h>
typedef Qt2CB<ControlError, Qt2DB<QErrorDialog> > base_class;
-
+
QError::QError(ControlError & c)
: base_class(c, _("LaTeX Error"))
{
bc().setCancel(dialog_->closePB);
}
-
+
void QError::update_contents()
{
dialog_->errorTV->setText(controller().params().c_str());
class QErrorDialog;
class QError :
- public Qt2CB<ControlError, Qt2DB<QErrorDialog> >
+ public Qt2CB<ControlError, Qt2DB<QErrorDialog> >
{
friend class QErrorDialog;
-
-public:
+
+public:
QError(ControlError &);
-private:
+private:
/// Apply changes
virtual void apply() {};
/// update
form, SLOT(slotClose()));
}
-
+
void QErrorDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
#ifndef QERRORDIALOG_H
#define QERRORDIALOG_H
-
+
#include <config.h>
-
+
#include "ui/QErrorDialogBase.h"
class QError;
*/
#include <config.h>
-#include <vector>
+#include <vector>
#include "QExternalDialog.h"
#include "ControlExternal.h"
#include <qlineedit.h>
#include <qpushbutton.h>
-#include <qcombobox.h>
+#include <qcombobox.h>
#include <qtextview.h>
typedef Qt2CB<ControlExternal, Qt2DB<QExternalDialog> > base_class;
-
+
QExternal::QExternal(ControlExternal & c)
: base_class(c, _("External"))
{
bc().addReadOnly(dialog_->browsePB);
std::vector<string> templates(controller().getTemplates());
-
+
for (std::vector<string>::const_iterator cit = templates.begin();
cit != templates.end(); ++cit) {
dialog_->externalCO->insertItem(cit->c_str(), -1);
}
}
-
+
void QExternal::update_contents()
{
InsetExternal::Params const & params = controller().params();
dialog_->fileED->setText(params.filename.c_str());
dialog_->paramsED->setText(params.parameters.c_str());
-
+
dialog_->externalCO->setCurrentItem(controller().getTemplateNumber(params.templ.lyxName));
- dialog_->externalTV->setText(controller().params().templ.helpText.c_str());
+ dialog_->externalTV->setText(controller().params().templ.helpText.c_str());
isValid();
}
string const & QExternal::helpText()
{
controller().params().templ = controller().getTemplate(dialog_->externalCO->currentItem() + 1);
- return controller().params().templ.helpText;
+ return controller().params().templ.helpText;
}
-
+
void QExternal::apply()
{
controller().params().filename =
bool QExternal::isValid()
{
bool const valid = !string(dialog_->fileED->text()).empty();
- dialog_->viewPB->setEnabled(valid);
- dialog_->editPB->setEnabled(valid);
- dialog_->updatePB->setEnabled(valid);
+ dialog_->viewPB->setEnabled(valid);
+ dialog_->editPB->setEnabled(valid);
+ dialog_->updatePB->setEnabled(valid);
return valid;
}
class QExternalDialog;
class QExternal :
- public Qt2CB<ControlExternal, Qt2DB<QExternalDialog> >
+ public Qt2CB<ControlExternal, Qt2DB<QExternalDialog> >
{
friend class QExternalDialog;
-
-public:
+
+public:
QExternal(ControlExternal &);
protected:
virtual bool isValid();
-
-private:
+
+private:
/// Apply changes
virtual void apply();
/// update
virtual void update_contents();
/// build the dialog
virtual void build_dialog();
-
+
/// get the right helptext
string const & helpText();
};
*/
#include <config.h>
-
+
#include <qwidget.h>
#include <qpushbutton.h>
#include <qfiledialog.h>
#include <qcombobox.h>
#include <qtextview.h>
-#include <qlineedit.h>
+#include <qlineedit.h>
-#include "gettext.h"
+#include "gettext.h"
#include "QExternalDialog.h"
-#include "ControlExternal.h"
+#include "ControlExternal.h"
#include "Dialogs.h"
#include "QExternal.h"
form, SLOT(slotClose()));
}
-
+
void QExternalDialog::change_adaptor()
{
form_->changed();
}
-
+
void QExternalDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
e->accept();
}
-
+
void QExternalDialog::editClicked()
{
form_->changed();
form_->controller().editExternal();
}
-
+
void QExternalDialog::viewClicked()
{
form_->changed();
form_->controller().viewExternal();
}
-
+
void QExternalDialog::updateClicked()
{
form_->changed();
form_->controller().updateExternal();
}
-
+
void QExternalDialog::browseClicked()
{
- QString file = QFileDialog::getOpenFileName(QString::null,
- _("External material (*)"), this, 0, _("Select external material"));
+ QString file = QFileDialog::getOpenFileName(QString::null,
+ _("External material (*)"), this, 0, _("Select external material"));
if (!file.isNull()) {
fileED->setText(file.latin1());
form_->changed();
}
}
-
+
void QExternalDialog::templateChanged()
{
externalTV->setText(form_->helpText().c_str());
#ifndef QEXTERNALDIALOG_H
#define QEXTERNALDIALOG_H
-
+
#include <config.h>
-
+
#include "ui/QExternalDialogBase.h"
class QExternal;
virtual void updateClicked();
virtual void browseClicked();
virtual void templateChanged();
-
+
protected:
virtual void closeEvent(QCloseEvent * e);
#include <qcheckbox.h>
typedef Qt2CB<ControlFloat, Qt2DB<QFloatDialog> > base_class;
-
+
QFloat::QFloat(ControlFloat & c)
: base_class(c, _("LaTeX Information"))
{
bc().setRestore(dialog_->restorePB);
}
-
+
void QFloat::update_contents()
{
bool top = false;
void QFloat::apply()
{
string placement;
-
+
if (dialog_->forcehere->isChecked()) {
placement += "H";
} else {
///
class QFloat
- : public Qt2CB<ControlFloat, Qt2DB<QFloatDialog> >
+ : public Qt2CB<ControlFloat, Qt2DB<QFloatDialog> >
{
public:
///
private:
/// Apply changes
virtual void apply();
- /// update
+ /// update
virtual void update_contents();
/// build the dialog
virtual void build_dialog();
};
#endif // QFLOAT_H
-
-
-
-
#include <qpushbutton.h>
-#include "LString.h"
-
-#include "ControlFloat.h"
+#include "LString.h"
+
+#include "ControlFloat.h"
#include "QFloatDialog.h"
#include "Dialogs.h"
#include "QFloat.h"
form, SLOT(slotClose()));
}
-
+
void QFloatDialog::change_adaptor()
{
form_->changed();
}
-
+
void QFloatDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
e->accept();
}
-
#ifndef QFLOATDIALOG_H
#define QFLOATDIALOG_H
-
+
#include <config.h>
-
+
#include "ui/QFloatDialogBase.h"
class QFloat;
};
#endif // QFLOATDIALOG_H
-
-
-
#include "QGraphics.h"
#include "Qt2BC.h"
#include "gettext.h"
-#include "debug.h"
+#include "debug.h"
#include "QtLyXView.h"
#include "ControlGraphics.h"
#include "support/filetools.h" // for MakeAbsPath etc
#include "insets/insetgraphicsParams.h"
#include "lyxrc.h" // for lyxrc.display_graphics
-
+
typedef Qt2CB<ControlGraphics, Qt2DB<QGraphicsDialog> > base_class;
bc().setApply(dialog_->applyPB);
bc().setCancel(dialog_->closePB);
bc().setRestore(dialog_->restorePB);
-
+
bc().addReadOnly(dialog_->rotateGB);
bc().addReadOnly(dialog_->latexoptionsGB);
bc().addReadOnly(dialog_->bbGB);
void QGraphics::update_contents()
{
InsetGraphicsParams & igp = controller().params();
-
+
string unit = "cm";
if (lyxrc.default_papersize < 3)
unit = "in";
string const defaultUnit = string(unit);
-
+
// Update dialog with details from inset
dialog_->filename->setText(igp.filename.c_str());
// path, because the controller knows nothing about the doc-dir
controller().bbChanged = false;
if (igp.bb.empty()) {
- string const fileWithAbsPath = MakeAbsPath(igp.filename, OnlyPath(igp.filename));
+ string const fileWithAbsPath = MakeAbsPath(igp.filename, OnlyPath(igp.filename));
string bb = controller().readBB(fileWithAbsPath);
if (!bb.empty()) {
// get the values from the file
dialog_->rtX->setText(token(igp.bb,' ',2).c_str());
dialog_->rtY->setText(token(igp.bb,' ',3).c_str());
}
-
+
// Update the draft and clip mode
dialog_->draft->setChecked(igp.draft);
dialog_->clip->setChecked(igp.clip);
-
+
// Update the subcaption check button and input field
dialog_->subfigure->setChecked(igp.subcaption);
dialog_->subcaption->setText(igp.subcaptionText.c_str());
break;
}
}
-
+
dialog_->widthUnit->setCurrentItem(igp.width.unit());
dialog_->heightUnit->setCurrentItem(igp.height.unit());
-
+
switch (igp.size_type) {
case InsetGraphicsParams::DEFAULT_SIZE: {
dialog_->defaultRB->setChecked(TRUE);
// aspect ratio
dialog_->aspectratio->setChecked(igp.keepAspectRatio);
-
+
// now the lyx-internally viewsize
dialog_->displaywidthUnit->setCurrentItem(igp.lyxwidth.unit());
dialog_->displayheightUnit->setCurrentItem(igp.lyxheight.unit());
-
+
// Update the rotate angle
dialog_->angle->setText(tostr(igp.rotateAngle).c_str());
-
+
if (igp.rotateOrigin.empty()) {
dialog_->origin->setCurrentItem(0);
} else {
{
// Create the parameters structure and fill the data from the dialog.
InsetGraphicsParams & igp = controller().params();
-
+
igp.filename = dialog_->filename->text();
-
+
if (!controller().bbChanged) // different to the original one?
- igp.bb = string(); // don't write anything
+ igp.bb = string(); // don't write anything
else {
string bb;
string lbX(dialog_->lbX->text());
string lbY(dialog_->lbY->text());
string rtX(dialog_->rtX->text());
string rtY(dialog_->rtY->text());
-
+
if (lbX.empty())
bb = "0 ";
else
igp.bb = bb;
}
-
+
igp.draft = dialog_->draft->isChecked();
-
+
igp.clip = dialog_->clip->isChecked();
-
+
igp.subcaption = dialog_->subfigure->isChecked();
-
+
igp.subcaptionText = dialog_->subcaption->text();
switch(dialog_->show->currentItem()) {
case 3: igp.display = InsetGraphicsParams::NONE; break;
default:;
}
-
+
if (dialog_->defaultRB->isChecked())
igp.size_type = InsetGraphicsParams::DEFAULT_SIZE;
else if (dialog_->customRB->isChecked())
igp.keepAspectRatio = dialog_->aspectratio->isChecked();
igp.rotateAngle = strToDbl(string(dialog_->angle->text()));
-
+
while (igp.rotateAngle < 0.0 || igp.rotateAngle > 360.0) {
if (igp.rotateAngle < 0.0) {
igp.rotateAngle += 360.0;
igp.rotateAngle -= 360.0;
}
}
-
+
if ((dialog_->origin->currentItem()) > 0)
igp.rotateOrigin = dialog_->origin->currentText();
else
igp.rotateOrigin = string();
-
+
igp.special = dialog_->latexoptions->text();
-
+
}
{
string const & name = controller().Browse(dialog_->filename->text().latin1());
if (!name.empty())
- dialog_->filename->setText(name.c_str());
+ dialog_->filename->setText(name.c_str());
}
void QGraphics::get()
{
string const filename(dialog_->filename->text());
if (!filename.empty()) {
- string const fileWithAbsPath = MakeAbsPath(filename, OnlyPath(filename));
+ string const fileWithAbsPath = MakeAbsPath(filename, OnlyPath(filename));
string bb = controller().readBB(fileWithAbsPath);
- if (!bb.empty()) {
+ if (!bb.empty()) {
dialog_->lbX->setText(token(bb,' ',0).c_str());
dialog_->lbY->setText(token(bb,' ',1).c_str());
dialog_->rtX->setText(token(bb,' ',2).c_str());
{
return !string(dialog_->filename->text().latin1()).empty();
}
-
-
#endif
#include "Qt2Base.h"
-#include "insets/insetgraphics.h"
+#include "insets/insetgraphics.h"
class ControlGraphics;
class QGraphicsDialog;
///
class QGraphics
- : public Qt2CB<ControlGraphics, Qt2DB<QGraphicsDialog> >
+ : public Qt2CB<ControlGraphics, Qt2DB<QGraphicsDialog> >
{
public:
///
protected:
virtual bool isValid();
-
+
private:
/// Apply changes
virtual void apply();
virtual void build_dialog();
/// browse for a file
- void browse();
+ void browse();
/// get bounding box from file
- void get();
+ void get();
};
#endif // QGRAPHICS_H
-
-
-
-
-
-
#include <qpushbutton.h>
#include <qcheckbox.h>
-#include "LString.h"
-
+#include "LString.h"
+
#include "QGraphicsDialog.h"
-#include "ControlGraphics.h"
+#include "ControlGraphics.h"
#include "Dialogs.h"
#include "QGraphics.h"
-#include "debug.h"
+#include "debug.h"
QGraphicsDialog::QGraphicsDialog(QGraphics * form)
: QGraphicsDialogBase(0, 0, false, 0),
form, SLOT(slotRestore()));
}
-
+
void QGraphicsDialog::change_adaptor()
{
form_->changed();
}
-
+
void QGraphicsDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
{
form_->get();
}
-
#ifndef QGRAPHICSDIALOG_H
#define QGRAPHICSDIALOG_H
-
+
#include <config.h>
-
+
#include "ui/QGraphicsDialogBase.h"
class QGraphics;
#include "QInclude.h"
#include "Qt2BC.h"
#include "gettext.h"
-#include "debug.h"
+#include "debug.h"
#include <qlineedit.h>
#include <qpushbutton.h>
dialog_->visiblespaceCB->setChecked(cmdname == "verbatiminput*");
dialog_->visiblespaceCB->setEnabled(true);
}
-
+
if (cmdname.empty())
dialog_->includeRB->setChecked(true);
}
string const & name = controller().Browse(dialog_->filenameED->text().latin1(), type);
if (!name.empty())
- dialog_->filenameED->setText(name.c_str());
+ dialog_->filenameED->setText(name.c_str());
}
///
class QInclude
- : public Qt2CB<ControlInclude, Qt2DB<QIncludeDialog> >
+ : public Qt2CB<ControlInclude, Qt2DB<QIncludeDialog> >
{
public:
///
protected:
virtual bool isValid();
-
+
private:
/// Apply changes
virtual void apply();
virtual void build_dialog();
/// load the file
- void load();
+ void load();
/// browse for a file
- void browse();
+ void browse();
};
#endif // QINCLUDE_H
#include <qpushbutton.h>
#include <qcheckbox.h>
-#include "LString.h"
-
+#include "LString.h"
+
#include "QIncludeDialog.h"
-#include "ControlInclude.h"
+#include "ControlInclude.h"
#include "Dialogs.h"
#include "QInclude.h"
-#include "debug.h"
+#include "debug.h"
QIncludeDialog::QIncludeDialog(QInclude * form)
: QIncludeDialogBase(0, 0, false, 0),
form, SLOT(slotClose()));
}
-
+
void QIncludeDialog::change_adaptor()
{
form_->changed();
}
-
+
void QIncludeDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
visiblespaceCB->setEnabled(false);
visiblespaceCB->setChecked(false);
break;
- default:
+ default:
visiblespaceCB->setEnabled(true);
break;
- }
+ }
}
-
+
void QIncludeDialog::loadClicked()
{
form_->load();
}
-
+
void QIncludeDialog::browseClicked()
{
form_->browse();
#ifndef QINCLUDEDIALOG_H
#define QINCLUDEDIALOG_H
-
+
#include <config.h>
-
+
#include "ui/QIncludeDialogBase.h"
class QInclude;
QIncludeDialog(QInclude * form);
void updateLists();
-
+
protected slots:
virtual void change_adaptor();
virtual void loadClicked();
#include <qpushbutton.h>
typedef Qt2CB<ControlIndex, Qt2DB<QIndexDialog> > base_class;
-
+
QIndex::QIndex(ControlIndex & c)
: base_class(c, _("Index"))
{
bc().addReadOnly(dialog_->keywordED);
}
-
+
void QIndex::update_contents()
{
dialog_->keywordED->setText(controller().params().getContents().c_str());
}
-
+
void QIndex::apply()
{
controller().params().setContents(dialog_->keywordED->text().latin1());
class QIndexDialog;
class QIndex :
- public Qt2CB<ControlIndex, Qt2DB<QIndexDialog> >
+ public Qt2CB<ControlIndex, Qt2DB<QIndexDialog> >
{
friend class QIndexDialog;
-
-public:
+
+public:
QIndex(ControlIndex &);
protected:
virtual bool isValid();
-
-private:
+
+private:
/// Apply changes
virtual void apply();
/// update
"documentation.\n"));
}
-
+
void QIndexDialog::change_adaptor()
{
form_->changed();
}
-
+
void QIndexDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
#ifndef QINDEXDIALOG_H
#define QINDEXDIALOG_H
-
+
#include <config.h>
-
+
#include "ui/QIndexDialogBase.h"
class QIndex;
protected slots:
virtual void change_adaptor();
-
+
protected:
virtual void closeEvent(QCloseEvent * e);
*/
#include <config.h>
-#include <fstream>
+#include <fstream>
#ifdef __GNUG__
#pragma implementation
#include <qtextview.h>
#include <qpushbutton.h>
-
+
#include "QLogDialog.h"
#include "QLog.h"
#include "Qt2BC.h"
#include "gettext.h"
-
+
#include "QtLyXView.h"
#include "ControlLog.h"
while (getline(ifstr, line))
text += line + "\n";
-
+
dialog_->logTV->setText(text.c_str());
}
///
class QLog
- : public Qt2CB<ControlLog, Qt2DB<QLogDialog> >
+ : public Qt2CB<ControlLog, Qt2DB<QLogDialog> >
{
public:
///
#include "QLog.h"
#include "QtLyXView.h"
-#include "ControlLog.h"
+#include "ControlLog.h"
QLogDialog::QLogDialog(QLog * form)
: QLogDialogBase(0, 0, false, 0),
form, SLOT(slotClose()));
}
-
+
void QLogDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
#ifndef QLOGDIALOG_H
#define QLOGDIALOG_H
-
+
#include <config.h>
-
+
#include "ui/QLogDialogBase.h"
class QLog;
#include <qcombobox.h>
#include <qlineedit.h>
#include "lengthcombo.h"
-
+
#include "QMinipageDialog.h"
#include "QMinipage.h"
#include "Qt2BC.h"
#include "gettext.h"
#include "support/lstrings.h"
-
+
#include "QtLyXView.h"
#include "ControlMinipage.h"
bc().addReadOnly(dialog_->widthED);
bc().addReadOnly(dialog_->unitsLC);
- bc().addReadOnly(dialog_->valignCO);
+ bc().addReadOnly(dialog_->valignCO);
}
}
}
-
+
namespace {
string const numtostr(double val) {
string a(tostr(val));
return a;
}
} // namespace anon
-
-
+
+
void QMinipage::update_contents()
{
LyXLength len(controller().params().pageWidth);
dialog_->widthED->setText(numtostr(len.value()).c_str());
dialog_->unitsLC->setCurrentItem(len.unit());
lyxerr << "width " << numtostr(len.value()).c_str() << " units " << len.unit() << std::endl;
-
+
int item = 0;
switch (controller().params().pos) {
case InsetMinipage::center:
item = 2;
break;
}
- dialog_->valignCO->setCurrentItem(item);
+ dialog_->valignCO->setCurrentItem(item);
}
///
class QMinipage
- : public Qt2CB<ControlMinipage, Qt2DB<QMinipageDialog> >
+ : public Qt2CB<ControlMinipage, Qt2DB<QMinipageDialog> >
{
public:
///
#include <qpushbutton.h>
#include <qtextview.h>
#include "lengthcombo.h"
-
+
#include "QMinipageDialog.h"
#include "Dialogs.h"
#include "QMinipage.h"
#include "QtLyXView.h"
-#include "ControlMinipage.h"
+#include "ControlMinipage.h"
QMinipageDialog::QMinipageDialog(QMinipage * form)
: QMinipageDialogBase(0, 0, false, 0),
form, SLOT(slotClose()));
}
-
+
void QMinipageDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
#ifndef QMINIPAGEDIALOG_H
#define QMINIPAGEDIALOG_H
-
+
#include <config.h>
-
+
#include "ui/QMinipageDialogBase.h"
class QMinipage;
class QParagraphDialog;
class QParagraph : public DialogBase {
-public:
+public:
QParagraph(LyXView *, Dialogs *);
~QParagraph();
void update(bool switched = false);
/// Close the connections
void close();
-
-private:
+
+private:
/// Create the dialog if necessary, update it and display it.
void show();
/// Hide the dialog.
/// the LyXView we belong to
LyXView * lv_;
-
+
/// Used so we can get at the signals we have to connect to.
Dialogs * d_;
-
+
/// Hide connection.
SigC::Connection h_;
-
+
/// readonly file or not
- bool readonly;
+ bool readonly;
};
#endif // QPARAGRAPH_H
#include "QParagraphDialog.h"
#include "QParagraph.h"
-#include "support/lstrings.h"
+#include "support/lstrings.h"
#include "debug.h"
#include <qlineedit.h>
QParagraphDialog::QParagraphDialog(QParagraph * form, QWidget * parent,
char const * name, bool modal, WFlags fl)
- : QParagraphDialogBase(parent, name, modal, fl),
+ : QParagraphDialogBase(parent, name, modal, fl),
form_(form)
{
setCaption(name);
bool keepabove, bool keepbelow)
{
int item = 0;
-
+
switch (kindabove) {
case VSpace::NONE: item = 0; break;
case VSpace::DEFSKIP: item = 1; break;
case VSpace::LENGTH: item = 6; break;
}
spacingAbove->setCurrentItem(item);
-
+
switch (kindbelow) {
case VSpace::NONE: item = 0; break;
case VSpace::DEFSKIP: item = 1; break;
case VSpace::LENGTH: item = 6; break;
}
spacingBelow->setCurrentItem(item);
-
+
spacingAboveValue->setEnabled(kindabove == VSpace::LENGTH);
spacingAbovePlus->setEnabled(kindabove == VSpace::LENGTH);
spacingAboveMinus->setEnabled(kindabove == VSpace::LENGTH);
spacingBelowValue->setEnabled(kindbelow == VSpace::LENGTH);
spacingBelowPlus->setEnabled(kindbelow == VSpace::LENGTH);
spacingBelowMinus->setEnabled(kindbelow == VSpace::LENGTH);
-
+
spacingAboveKeep->setChecked(keepabove);
spacingBelowKeep->setChecked(keepbelow);
}
-void QParagraphDialog::setAboveLength(float val, float plus, float minus,
+void QParagraphDialog::setAboveLength(float val, float plus, float minus,
LyXLength::UNIT vunit,
LyXLength::UNIT punit,
LyXLength::UNIT munit)
spacingAbovePlus->setText(tostr(plus).c_str());
spacingAboveMinus->setText(tostr(minus).c_str());
}
-
+
spacingAboveValueUnit->setCurrentItem(getItem(vunit));
spacingAbovePlusUnit->setCurrentItem(getItem(punit));
spacingAboveMinusUnit->setCurrentItem(getItem(munit));
}
-void QParagraphDialog::setBelowLength(float val, float plus, float minus,
+void QParagraphDialog::setBelowLength(float val, float plus, float minus,
LyXLength::UNIT vunit,
LyXLength::UNIT punit,
LyXLength::UNIT munit)
spacingBelowPlus->setText(tostr(plus).c_str());
spacingBelowMinus->setText(tostr(minus).c_str());
}
-
+
spacingBelowValueUnit->setCurrentItem(getItem(vunit));
spacingBelowPlusUnit->setCurrentItem(getItem(punit));
spacingBelowMinusUnit->setCurrentItem(getItem(munit));
void QParagraphDialog::setExtra(float widthval, LyXLength::UNIT units,
- string const & percent, int align,
+ string const & percent, int align,
bool hfill, bool startminipage,
Paragraph::PEXTRA_TYPE type)
{
}
} else
extraWidth->setText("");
-
+
switch (type) {
- case Paragraph::PEXTRA_NONE:
- extraType->setCurrentItem(0);
+ case Paragraph::PEXTRA_NONE:
+ extraType->setCurrentItem(0);
break;
- case Paragraph::PEXTRA_MINIPAGE:
- extraType->setCurrentItem(1);
- enable_extraOptions(1);
- enable_minipageOptions(1);
+ case Paragraph::PEXTRA_MINIPAGE:
+ extraType->setCurrentItem(1);
+ enable_extraOptions(1);
+ enable_minipageOptions(1);
break;
- case Paragraph::PEXTRA_FLOATFLT:
- extraType->setCurrentItem(2);
- enable_extraOptions(2);
+ case Paragraph::PEXTRA_FLOATFLT:
+ extraType->setCurrentItem(2);
+ enable_extraOptions(2);
break;
- case Paragraph::PEXTRA_INDENT:
- extraType->setCurrentItem(3);
- enable_extraOptions(3);
+ case Paragraph::PEXTRA_INDENT:
+ extraType->setCurrentItem(3);
+ enable_extraOptions(3);
break;
}
-
+
switch (align) {
- case Paragraph::MINIPAGE_ALIGN_TOP:
- minipageValign->setCurrentItem(0);
+ case Paragraph::MINIPAGE_ALIGN_TOP:
+ minipageValign->setCurrentItem(0);
break;
- case Paragraph::MINIPAGE_ALIGN_MIDDLE:
- minipageValign->setCurrentItem(1);
+ case Paragraph::MINIPAGE_ALIGN_MIDDLE:
+ minipageValign->setCurrentItem(1);
break;
- case Paragraph::MINIPAGE_ALIGN_BOTTOM:
- minipageValign->setCurrentItem(2);
+ case Paragraph::MINIPAGE_ALIGN_BOTTOM:
+ minipageValign->setCurrentItem(2);
break;
}
-
+
minipageHfill->setChecked(hfill);
minipageStart->setChecked(startminipage);
}
return len;
}
-
+
LyXGlueLength QParagraphDialog::getBelowLength() const
{
LyXGlueLength len(
LyXLength QParagraphDialog::getExtraWidth() const
{
if (extraUnit->currentItem() != 11) {
- LyXLength len(
- (extraWidth->text()).toDouble(),
+ LyXLength len(
+ (extraWidth->text()).toDouble(),
getLyXLength(extraUnit->currentItem())
);
return len;
}
}
-
+
string QParagraphDialog::getExtraWidthPercent() const
{
double val = (extraWidth->text()).toDouble();
}
-char const * QParagraphDialog::getLabelWidth() const
+char const * QParagraphDialog::getLabelWidth() const
{
- return labelWidth->text();
+ return labelWidth->text();
}
-LyXAlignment QParagraphDialog::getAlign() const
+LyXAlignment QParagraphDialog::getAlign() const
{
switch (alignment->currentItem()) {
case 0: return LYX_ALIGN_BLOCK;
default: return LYX_ALIGN_CENTER;
}
}
-
-
-bool QParagraphDialog::getAboveKeep() const
-{
- return spacingAboveKeep->isChecked();
+
+
+bool QParagraphDialog::getAboveKeep() const
+{
+ return spacingAboveKeep->isChecked();
}
-
-bool QParagraphDialog::getBelowKeep() const
-{
- return spacingBelowKeep->isChecked();
+
+bool QParagraphDialog::getBelowKeep() const
+{
+ return spacingBelowKeep->isChecked();
}
-
-bool QParagraphDialog::getLineAbove() const
-{
- return lineAbove->isChecked();
+
+bool QParagraphDialog::getLineAbove() const
+{
+ return lineAbove->isChecked();
}
-
-bool QParagraphDialog::getLineBelow() const
-{
- return lineBelow->isChecked();
+
+bool QParagraphDialog::getLineBelow() const
+{
+ return lineBelow->isChecked();
}
-
-bool QParagraphDialog::getPagebreakAbove() const
-{
- return pagebreakAbove->isChecked();
+
+bool QParagraphDialog::getPagebreakAbove() const
+{
+ return pagebreakAbove->isChecked();
}
-
-bool QParagraphDialog::getPagebreakBelow() const
+
+bool QParagraphDialog::getPagebreakBelow() const
{
- return pagebreakBelow->isChecked();
+ return pagebreakBelow->isChecked();
}
-
-bool QParagraphDialog::getNoIndent() const
+
+bool QParagraphDialog::getNoIndent() const
{
- return noIndent->isChecked();
+ return noIndent->isChecked();
}
-
-VSpace::vspace_kind QParagraphDialog::getSpaceAboveKind() const
+
+VSpace::vspace_kind QParagraphDialog::getSpaceAboveKind() const
{
return getSpaceKind(spacingAbove->currentItem());
}
-
-VSpace::vspace_kind QParagraphDialog::getSpaceBelowKind() const
+
+VSpace::vspace_kind QParagraphDialog::getSpaceBelowKind() const
{
return getSpaceKind(spacingBelow->currentItem());
}
-Paragraph::PEXTRA_TYPE QParagraphDialog::getExtraType() const
+Paragraph::PEXTRA_TYPE QParagraphDialog::getExtraType() const
{
switch (extraType->currentItem()) {
case 0: return Paragraph::PEXTRA_NONE;
return Paragraph::PEXTRA_NONE;
}
-
-Paragraph::MINIPAGE_ALIGNMENT QParagraphDialog::getExtraAlign() const
+
+Paragraph::MINIPAGE_ALIGNMENT QParagraphDialog::getExtraAlign() const
{
switch (minipageValign->currentItem()) {
case 0: return Paragraph::MINIPAGE_ALIGN_TOP;
}
}
-
-bool QParagraphDialog::getHfillBetween() const
+
+bool QParagraphDialog::getHfillBetween() const
{
return minipageHfill->isChecked();
}
-bool QParagraphDialog::getStartNewMinipage() const
+bool QParagraphDialog::getStartNewMinipage() const
{
return minipageStart->isChecked();
}
-VSpace::vspace_kind QParagraphDialog::getSpaceKind(int val) const
+VSpace::vspace_kind QParagraphDialog::getSpaceKind(int val) const
{
switch (val) {
case 0: return VSpace::NONE;
}
-LyXLength::UNIT QParagraphDialog::getLyXLength(int val) const
+LyXLength::UNIT QParagraphDialog::getLyXLength(int val) const
{
switch (val) {
case 0: return LyXLength::CM;
return LyXLength::UNIT_NONE;
}
-
-int QParagraphDialog::getItem(LyXLength::UNIT unit) const
+
+int QParagraphDialog::getItem(LyXLength::UNIT unit) const
{
int item = 0;
switch (unit) {
}
-void QParagraphDialog::cancel_adaptor()
+void QParagraphDialog::cancel_adaptor()
{
form_->close();
hide();
#define QPARAGRAPHDIALOG_H
#include <config.h>
-
+
#include "ui/QParagraphDialogBase.h"
#include "vspace.h"
#include "paragraph.h"
class QParagraphDialog : public QParagraphDialogBase
{ Q_OBJECT
-
+
public:
QParagraphDialog(QParagraph * form, QWidget * parent = 0,
char const * name = 0, bool modal = FALSE,
WFlags fl = 0);
~QParagraphDialog();
-
+
void setReadOnly(bool);
void setLabelWidth(char const *);
void setAlign(int);
LyXGlueLength getBelowLength() const;
LyXLength getExtraWidth() const;
string getExtraWidthPercent() const;
- // FIXME: return a std::string !
+ // FIXME: return a std::string !
char const * getLabelWidth() const;
LyXAlignment getAlign() const;
bool getAboveKeep() const;
*/
#include <config.h>
-#include <fstream>
+#include <fstream>
#ifdef __GNUG__
#pragma implementation
#include <qmultilineedit.h>
#include <qpushbutton.h>
-
+
#include "QPreambleDialog.h"
#include "QPreamble.h"
#include "Qt2BC.h"
#include "gettext.h"
-
+
#include "QtLyXView.h"
#include "ControlPreamble.h"
///
class QPreamble
- : public Qt2CB<ControlPreamble, Qt2DB<QPreambleDialog> >
+ : public Qt2CB<ControlPreamble, Qt2DB<QPreambleDialog> >
{
public:
///
#include "support/lyxlib.h"
#include "support/forkedcall.h"
#include "support/filetools.h"
-#include "gettext.h"
-
+#include "gettext.h"
+
#include "QtLyXView.h"
-#include "ControlPreamble.h"
+#include "ControlPreamble.h"
using std::getline;
form, SLOT(slotClose()));
}
-
+
void QPreambleDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
form_->changed();
}
-
+
void QPreambleDialog::editClicked()
{
// find an editor
if (editor.empty()) {
static string lastentry = "";
editor = QInputDialog::getText(
- _("Enter editor program"), _("Editor"), QLineEdit::Normal,
+ _("Enter editor program"), _("Editor"), QLineEdit::Normal,
lastentry.c_str()).latin1();
if (editor.empty())
return;
- lastentry = editor;
+ lastentry = editor;
}
string const text(preambleLE->text().latin1());
file.close();
editor += " " + filename;
-
+
Forkedcall call;
// FIXME: make async
string newtext;
string line;
-
+
while (getline(in, line)) {
- newtext += line + "\n";
+ newtext += line + "\n";
}
in.close();
#ifndef QPreambleDIAPreamble_H
#define QPreambleDIAPreamble_H
-
+
#include <config.h>
-
+
#include "ui/QPreambleDialogBase.h"
class QPreamble;
protected slots:
virtual void editClicked();
- virtual void change_adaptor();
+ virtual void change_adaptor();
protected:
virtual void closeEvent(QCloseEvent * e);
#include <qradiobutton.h>
#include <qspinbox.h>
#include <qpushbutton.h>
-
+
#include "QPrintDialog.h"
#include "QPrint.h"
#include "Qt2BC.h"
#include "gettext.h"
-
+
#include "QtLyXView.h"
#include "ControlPrint.h"
#include "support/lstrings.h"
-
+
typedef Qt2CB<ControlPrint, Qt2DB<QPrintDialog> > base_class;
QPrint::QPrint(ControlPrint & c)
{
dialog_.reset(new QPrintDialog(this));
- bc().setOK(dialog_->printPB);
+ bc().setOK(dialog_->printPB);
bc().setCancel(dialog_->closePB);
}
dialog_->printerED->setText(pp.printer_name.c_str());
dialog_->fileED->setText(pp.file_name.c_str());
-
+
dialog_->printerRB->setChecked(true);
if (pp.target == PrinterParams::FILE)
dialog_->fileRB->setChecked(true);
-
+
dialog_->reverseCB->setChecked(pp.reverse_order);
QRadioButton * button;
case PrinterParams::EVEN: button = dialog_->evenRB; break;
}
button->setChecked(true);
-
+
// hmmm... maybe a bit weird but maybe not
// we might just be remembering the last
// time this was printed.
dialog_->fromED->setText(pp.from_page.c_str());
dialog_->toED->setText("");
- if (pp.to_page)
+ if (pp.to_page)
dialog_->toED->setText(tostr(pp.to_page).c_str());
} else {
dialog_->fromED->setText("");
dialog_->reverseCB->isChecked(),
!dialog_->collateCB->isChecked(),
strToInt(dialog_->copiesSB->text().latin1()));
-
+
controller().params() = pp;
}
///
class QPrint
- : public Qt2CB<ControlPrint, Qt2DB<QPrintDialog> >
+ : public Qt2CB<ControlPrint, Qt2DB<QPrintDialog> >
{
public:
///
{
form_->changed();
}
-
-
+
+
void QPrintDialog::browseClicked()
{
- QString file = QFileDialog::getOpenFileName(QString::null,
+ QString file = QFileDialog::getOpenFileName(QString::null,
_("PostScript files (*.ps)"), this, 0, _("Select a file to print to"));
if (!file.isNull()) {
fileED->setText(file);
}
}
-
+
void QPrintDialog::fileChanged()
{
if (!fileED->text().isEmpty())
form_->changed();
}
-
+
void QPrintDialog::copiesChanged(int i)
{
collateCB->setEnabled(i != 1);
form_->changed();
}
-
+
void QPrintDialog::printerChanged()
{
printerRB->setChecked(true);
form_->changed();
}
-
+
void QPrintDialog::pagerangeChanged()
{
int from = strToUnsignedInt(fromED->text().latin1());
int to = strToUnsignedInt(toED->text().latin1());
-
+
if (!toED->text().isEmpty() && from > to)
fromED->setText(toED->text());
-
+
form_->changed();
}
#define QPRINTDIALOG_H
#include <config.h>
-
+
#include "ui/QPrintDialogBase.h"
-#include "lyxrc.h"
+#include "lyxrc.h"
#include "PrinterParams.h"
class QPrint;
public:
QPrintDialog(QPrint * f);
-
+
protected slots:
virtual void change_adaptor();
virtual void browseClicked();
#include <config.h>
#include "support/lstrings.h"
-
+
#include "QRefDialog.h"
#include "ControlRef.h"
#include "QRef.h"
-#include "Qt2BC.h"
+#include "Qt2BC.h"
#include "gettext.h"
#include "insets/insetref.h"
using std::endl;
typedef Qt2CB<ControlRef, Qt2DB<QRefDialog> > base_class;
-
+
QRef::QRef(ControlRef & c)
: base_class(c, _("Cross Reference")),
sort_(false), at_ref_(false)
{
dialog_.reset(new QRefDialog(this));
- bc().setOK(dialog_->okPB);
- bc().setCancel(dialog_->closePB);
+ bc().setOK(dialog_->okPB);
+ bc().setCancel(dialog_->closePB);
bc().addReadOnly(dialog_->refsLB);
bc().addReadOnly(dialog_->sortCB);
bc().addReadOnly(dialog_->nameED);
bc().addReadOnly(dialog_->typeCO);
}
-
+
void QRef::update_contents()
{
dialog_->referenceED->setText(controller().params().getContents().c_str());
controller().docType() != ControlRef::LITERATE;
}
-
+
bool QRef::typeAllowed()
{
return controller().docType() == ControlRef::LINUXDOC ||
controller().docType() == ControlRef::DOCBOOK;
}
-
+
void QRef::setGoBack()
{
dialog_->gotoPB->setText(_("&Go back"));
QToolTip::add(dialog_->gotoPB, _("Go back"));
}
-
+
void QRef::setGotoRef()
{
dialog_->gotoPB->setText(_("&Goto"));
QToolTip::add(dialog_->gotoPB, _("Go to reference"));
}
-
+
void QRef::gotoRef()
{
string ref(dialog_->referenceED->text());
at_ref_ = !at_ref_;
}
-
+
void QRef::redoRefs()
{
dialog_->refsLB->setAutoUpdate(false);
dialog_->refsLB->clear();
refs_ = controller().getLabelList(string());
dialog_->sortCB->setEnabled(!refs_.empty());
- dialog_->refsLB->setEnabled(!refs_.empty());
+ dialog_->refsLB->setEnabled(!refs_.empty());
redoRefs();
}
#include <config.h>
#include <vector>
#include "LString.h"
-
+
#include "Qt2Base.h"
class ControlRef;
public Qt2CB<ControlRef, Qt2DB<QRefDialog> >
{
friend class QRefDialog;
-
-public:
+
+public:
QRef(ControlRef & c);
private:
- /// apply changes
- virtual void apply();
+ /// apply changes
+ virtual void apply();
/// build dialog
virtual void build_dialog();
/// update dialog
virtual void update_contents();
- /// is name allowed for this ?
+ /// is name allowed for this ?
bool nameAllowed();
/// is type allowed for this ?
bool typeAllowed();
-
+
/// go to current reference
void gotoRef();
/// set go back button
void setGoBack();
-
+
/// set goto ref button
void setGotoRef();
-
+
/// re-enter references
void redoRefs();
-
+
/// update references
void updateRefs();
-
+
/// sort or not persistent state
- bool sort_;
+ bool sort_;
- /// at a reference ?
+ /// at a reference ?
bool at_ref_;
-
+
/// the references
std::vector<string> refs_;
};
#include <config.h>
#include <qpushbutton.h>
-#include <qlineedit.h>
+#include <qlineedit.h>
#include <qcombobox.h>
-#include <qlistbox.h>
-
+#include <qlistbox.h>
+
#include "QRefDialog.h"
-#include "ControlRef.h"
+#include "ControlRef.h"
#include "Dialogs.h"
#include "QRef.h"
#include "debug.h"
if (form_->readOnly())
return;
- referenceED->setText(sel);
- if (form_->at_ref_)
+ referenceED->setText(sel);
+ if (form_->at_ref_)
form_->gotoRef();
gotoPB->setEnabled(true);
if (form_->typeAllowed())
nameED->setEnabled(true);
}
-
+
void QRefDialog::refSelected(const QString &)
{
form_->gotoRef();
#ifndef QREFDIALOG_H
#define QREFDIALOG_H
-
+
#include <config.h>
-
+
#include "ui/QRefDialogBase.h"
class QRef;
*/
#include <config.h>
-#include <fstream>
+#include <fstream>
#ifdef __GNUG__
#pragma implementation
#include <qpushbutton.h>
#include <qcheckbox.h>
#include <qcombobox.h>
-
+
#include "QSearchDialog.h"
#include "QSearch.h"
#include "Qt2BC.h"
#include "gettext.h"
-
+
#include "QtLyXView.h"
#include "ControlSearch.h"
dialog_.reset(new QSearchDialog(this));
bc().setCancel(dialog_->closePB);
- bc().addReadOnly(dialog_->replaceCO);
- bc().addReadOnly(dialog_->replacePB);
- bc().addReadOnly(dialog_->replaceallPB);
+ bc().addReadOnly(dialog_->replaceCO);
+ bc().addReadOnly(dialog_->replacePB);
+ bc().addReadOnly(dialog_->replaceallPB);
bc().addReadOnly(dialog_->caseCB);
bc().addReadOnly(dialog_->wordsCB);
bc().addReadOnly(dialog_->backwardsCB);
- dialog_->replacePB->setEnabled(false);
- dialog_->replaceallPB->setEnabled(false);
+ dialog_->replacePB->setEnabled(false);
+ dialog_->replaceallPB->setEnabled(false);
}
-
+
void QSearch::find(string const & str, bool casesens, bool words, bool backwards)
{
controller().find(str, casesens, words, !backwards);
}
-
+
void QSearch::replace(string const & findstr, string const & replacestr,
bool casesens, bool words, bool all)
{
///
class QSearch
- : public Qt2CB<ControlSearch, Qt2DB<QSearchDialog> >
+ : public Qt2CB<ControlSearch, Qt2DB<QSearchDialog> >
{
public:
///
form_(form)
{
connect(closePB, SIGNAL(clicked()),
- form_, SLOT(slotClose()));
+ form_, SLOT(slotClose()));
}
-
+
void QSearchDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
findPB->setEnabled(true);
replacePB->setEnabled(!form_->readOnly());
replaceallPB->setEnabled(!form_->readOnly());
- }
+ }
}
-
+
void QSearchDialog::findClicked()
{
string const find(findCO->currentText().latin1());
form_->replace(find, replace,
caseCB->isChecked(),
wordsCB->isChecked(),
- false);
+ false);
}
-
+
void QSearchDialog::replaceallClicked()
{
#define QSEARCHDIALOG_H
#include <config.h>
-
+
#include "ui/QSearchDialogBase.h"
#include "QSearch.h"
public:
QSearchDialog(QSearch * form);
-
+
protected slots:
void findChanged();
void findClicked();
void replaceClicked();
void replaceallClicked();
-
+
protected:
void closeEvent(QCloseEvent * e);
private:
// add a string to the combo if needed
void remember(string const & find, QComboBox & combo);
-
+
QSearch * form_;
};
#include <qpushbutton.h>
typedef Qt2CB<ControlShowFile, Qt2DB<QShowFileDialog> > base_class;
-
+
QShowFile::QShowFile(ControlShowFile & c)
: base_class(c, _("ShowFile"))
{
bc().setCancel(dialog_->closePB);
}
-
+
void QShowFile::update_contents()
{
dialog_->setName(controller().getFileName().c_str());
dialog_->text->setText(contents.c_str());
}
-
-
class QShowFileDialog;
class QShowFile :
- public Qt2CB<ControlShowFile, Qt2DB<QShowFileDialog> >
+ public Qt2CB<ControlShowFile, Qt2DB<QShowFileDialog> >
{
friend class QShowFileDialog;
-
-public:
+
+public:
QShowFile(ControlShowFile &);
-private:
+private:
/// Apply changes
virtual void apply() {};
/// update
form, SLOT(slotClose()));
}
-
+
void QShowFileDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
#ifndef QSHOWFILEDIALOG_H
#define QSHOWFILEDIALOG_H
-
+
#include <config.h>
-
+
#include "ui/QShowFileDialogBase.h"
class QShowFile;
*/
#include <config.h>
-
+
#include "ControlSpellchecker.h"
#include "QSpellcheckerDialog.h"
#include "QSpellchecker.h"
#include "gettext.h"
#include <qprogressbar.h>
-#include <qmessagebox.h>
+#include <qmessagebox.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qlistbox.h>
#include <qcombobox.h>
typedef Qt2CB<ControlSpellchecker, Qt2DB<QSpellcheckerDialog> > base_class;
-
+
QSpellchecker::QSpellchecker(ControlSpellchecker & c)
: base_class(c, _("Spellchecker"))
{
dialog_->wordED->setReadOnly(true);
}
-
+
void QSpellchecker::update_contents()
{
dialog_->wordED->setText("");
dialog_->replaceCO->clear();
dialog_->suggestionsLB->clear();
}
-
-
+
+
void QSpellchecker::accept()
{
controller().ignoreAll();
void QSpellchecker::add()
{
- controller().insert();
+ controller().insert();
}
void QSpellchecker::spellcheck()
{
- controller().check();
+ controller().check();
dialog_->spellcheckPB->setEnabled(false);
}
{
controller().stop();
dialog_->spellcheckPB->setEnabled(true);
- hide();
+ hide();
}
-
+
void QSpellchecker::partialUpdate(int id)
{
switch (id) {
{
dialog_->wordED->setText(controller().getWord().c_str());
dialog_->suggestionsLB->clear();
-
+
string w;
while (!(w = controller().getSuggestion()).empty()) {
dialog_->suggestionsLB->insertItem(w.c_str());
#include "Qt2Base.h"
-
-class ControlSpellchecker;
+
+class ControlSpellchecker;
class QSpellcheckerDialog;
class QSpellchecker :
- public Qt2CB<ControlSpellchecker, Qt2DB<QSpellcheckerDialog> >
+ public Qt2CB<ControlSpellchecker, Qt2DB<QSpellcheckerDialog> >
{
friend class QSpellcheckerDialog;
-
-public:
+
+public:
QSpellchecker(ControlSpellchecker &);
- /// update from controller
+ /// update from controller
void partialUpdate(int id);
-
+
private:
- void stop();
+ void stop();
void accept();
void add();
void ignore();
void replace();
void options();
void spellcheck();
-
+
/// Apply changes
virtual void apply() {};
/// update
this, SLOT(stop()));
}
-
+
void QSpellcheckerDialog:: suggestionChanged(const QString & str)
{
if (replaceCO->count() != 0)
replaceCO->changeItem(str, 0);
else
replaceCO->insertItem(str);
-
+
replaceCO->setCurrentItem(0);
}
if (i != suggestionsLB->count())
suggestionsLB->setCurrentItem(i);
}
-
-
+
+
void QSpellcheckerDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
#ifndef QSPELLCHECKERDIALOG_H
#define QSPELLCHECKERDIALOG_H
-
+
#include <config.h>
-
+
#include "ui/QSpellcheckerDialogBase.h"
#include "QSpellchecker.h"
virtual void stop() {
form_->stop();
}
-
+
virtual void acceptClicked() {
form_->accept();
}
form_->options();
}
virtual void suggestionChanged(const QString &);
- virtual void replaceChanged(const QString &);
-
+ virtual void replaceChanged(const QString &);
+
protected:
virtual void closeEvent(QCloseEvent * e);
#include "QTabularCreate.h"
#include "Qt2BC.h"
#include "gettext.h"
-#include "debug.h"
+#include "debug.h"
#include <qspinbox.h>
#include <qpushbutton.h>
///
class QTabularCreate
- : public Qt2CB<ControlTabularCreate, Qt2DB<QTabularCreateDialog> >
+ : public Qt2CB<ControlTabularCreate, Qt2DB<QTabularCreateDialog> >
{
public:
///
#include "QTabularCreateDialog.h"
#include "QTabularCreate.h"
-
+
#include "support/lstrings.h"
#include <qpushbutton.h>
form_, SLOT(slotClose()));
}
-
+
void QTabularCreateDialog::columnsChanged(int)
{
form_->changed();
}
-
+
void QTabularCreateDialog::rowsChanged(int)
{
form_->changed();
#ifndef QTABULARCREATEDIALOG_H
#define QTABULARCREATEDIALOG_H
-
+
#include "ui/QTabularCreateDialogBase.h"
class QTabularCreate;
protected slots:
virtual void columnsChanged(int);
virtual void rowsChanged(int);
-
+
private:
QTabularCreate * form_;
};
using std::vector;
typedef Qt2CB<ControlTexinfo, Qt2DB<QTexinfoDialog> > base_class;
-
+
QTexinfo::QTexinfo(ControlTexinfo & c)
: base_class(c, _("LaTeX Information")), warningPosted(false), activeStyle(ControlTexinfo::cls)
void QTexinfo::updateStyles(ControlTexinfo::texFileSuffix whichStyle)
{
bool const withFullPath = dialog_->path->isChecked();
-
+
string const str = controller().getContents(whichStyle, withFullPath);
std::vector<string> flist = getVectorFromString(str,"\n");
-
+
dialog_->fileList->clear();
-
+
for (vector<string>::const_iterator fitem = flist.begin();
fitem != flist.end(); ++fitem) {
dialog_->fileList->insertItem((*fitem).c_str());
}
-
+
activeStyle = whichStyle;
}
-
+
void QTexinfo::updateStyles()
{
updateStyles(activeStyle);
///
class QTexinfo
- : public Qt2CB<ControlTexinfo, Qt2DB<QTexinfoDialog> >
+ : public Qt2CB<ControlTexinfo, Qt2DB<QTexinfoDialog> >
{
public:
///
#include <config.h>
#include <vector>
-#include "LString.h"
-
-#include "ControlTexinfo.h"
+#include "LString.h"
+
+#include "ControlTexinfo.h"
#include "QTexinfoDialog.h"
#include "Dialogs.h"
#include "QTexinfo.h"
form, SLOT(slotClose()));
}
-
+
void QTexinfoDialog::change_adaptor()
{
form_->changed();
}
-
+
void QTexinfoDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
default:
break;
}
-
+
}
#ifndef QTEXINFODIALOG_H
#define QTEXINFODIALOG_H
-
+
#include <config.h>
-
+
#include "ui/QTexinfoDialogBase.h"
class QTexinfo;
#include <qlistbox.h>
typedef Qt2CB<ControlThesaurus, Qt2DB<QThesaurusDialog> > base_class;
-
+
QThesaurus::QThesaurus(ControlThesaurus & c)
: base_class(c, _("Thesaurus"))
{
bc().addReadOnly(dialog_->replacePB);
}
-
+
void QThesaurus::update_contents()
{
dialog_->entryED->setText(controller().text().c_str());
dialog_->replaceED->setText("");
- dialog_->updateLists();
+ dialog_->updateLists();
}
-
+
void QThesaurus::replace()
{
controller().replace(dialog_->replaceED->text().latin1());
///
class QThesaurus
- : public Qt2CB<ControlThesaurus, Qt2DB<QThesaurusDialog> >
+ : public Qt2CB<ControlThesaurus, Qt2DB<QThesaurusDialog> >
{
public:
///
virtual void build_dialog();
/// replace the word
- void replace();
+ void replace();
};
#endif // QTHESAURUS_H
#include <config.h>
#include <vector>
-#include "LString.h"
-
-#include "ControlThesaurus.h"
+#include "LString.h"
+
+#include "ControlThesaurus.h"
#include "QThesaurusDialog.h"
#include "Dialogs.h"
#include "QThesaurus.h"
#include <qpushbutton.h>
#include <qlistview.h>
-#include <qlineedit.h>
+#include <qlineedit.h>
QThesaurusDialog::QThesaurusDialog(QThesaurus * form)
: QThesaurusDialogBase(0, 0, false, 0),
form, SLOT(slotClose()));
}
-
+
void QThesaurusDialog::change_adaptor()
{
form_->changed();
}
-
+
void QThesaurusDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
updateLists();
}
-
+
void QThesaurusDialog::replaceClicked()
{
form_->replace();
}
-
+
void QThesaurusDialog::selectionChanged(QListViewItem * item)
{
if (form_->readOnly())
return;
-
+
string const entry(item->text(0).latin1());
replaceED->setText(entry.c_str());
replacePB->setEnabled(true);
form_->changed();
}
-
+
void QThesaurusDialog::selectionClicked(QListViewItem * item)
{
entryED->setText(item->text(0));
updateLists();
}
-
+
void QThesaurusDialog::updateLists()
{
meaningsLV->clear();
-
+
std::vector<string> matches;
meaningsLV->setUpdatesEnabled(false);
-
+
Thesaurus::Meanings meanings = form_->controller().getMeanings(entryED->text().latin1());
-
+
for (Thesaurus::Meanings::const_iterator cit = meanings.begin();
cit != meanings.end(); ++cit) {
QListViewItem * i = new QListViewItem(meaningsLV);
i2->setOpen(true);
}
}
-
+
meaningsLV->setUpdatesEnabled(true);
meaningsLV->update();
}
#ifndef QTHESAURUSDIALOG_H
#define QTHESAURUSDIALOG_H
-
+
#include <config.h>
-
+
#include "ui/QThesaurusDialogBase.h"
class QThesaurus;
QThesaurusDialog(QThesaurus * form);
void updateLists();
-
+
protected slots:
virtual void change_adaptor();
virtual void entryChanged();
#include <qlistview.h>
#include <qpushbutton.h>
#include <qcombobox.h>
-
+
#include "QTocDialog.h"
#include "QToc.h"
-#include "Qt2BC.h"
+#include "Qt2BC.h"
#include "gettext.h"
#include "support/lstrings.h"
#include "debug.h"
#include "QtLyXView.h"
-
+
using std::endl;
using std::pair;
using std::stack;
using std::vector;
-
+
typedef Qt2CB<ControlToc, Qt2DB<QTocDialog> > base_class;
-
+
QToc::QToc(ControlToc & c)
: base_class(c, _("Table of contents"))
{}
-
-
+
+
void QToc::build_dialog()
{
dialog_.reset(new QTocDialog(this));
- // Manage the cancel/close button
+ // Manage the cancel/close button
bc().setCancel(dialog_->closePB);
}
void QToc::updateType()
-{
+{
dialog_->typeCO->clear();
-
+
vector<string> const & choice = controller().getTypes();
string const & type = toc::getType(controller().params().getCmdName());
dialog_->setCaption(type.c_str());
}
}
-}
-
-
+}
+
+
void QToc::update_contents()
{
updateType();
updateToc(depth_);
}
-
+
void QToc::updateToc(int newdepth)
{
char const * str = dialog_->typeCO->currentText().latin1();
string type (str ? str : "");
-
+
Buffer::SingleList const & contents = controller().getContents(type);
-
+
// Check if all elements are the same.
if (newdepth == depth_ && toclist == contents) {
return;
}
dialog_->tocLV->clear();
-
+
depth_ = newdepth;
toclist = contents;
else
item = (last) ? (new QListViewItem(parent,last)) : (new QListViewItem(parent));
}
-
+
lyxerr[Debug::GUI] << "Table of contents" << endl << "Added item " << iter->str.c_str()
<< " at depth " << iter->depth << ", previous sibling \"" << (last ? last->text(0).latin1() : "0")
<< "\", parent \"" << (parent ? parent->text(0).latin1() : "0") << "\"" << endl;
void QToc::select(string const & text)
{
Buffer::SingleList::const_iterator iter = toclist.begin();
-
+
for (; iter != toclist.end(); ++iter) {
if (iter->str == text)
break;
}
-
+
if (iter == toclist.end()) {
- lyxerr[Debug::GUI] << "Couldn't find highlighted TOC entry : "
+ lyxerr[Debug::GUI] << "Couldn't find highlighted TOC entry : "
<< text << endl;
return;
}
* Read the file COPYING
*
* \author John Levon
- * \author Kalle Dalheimer <kalle@klaralvdalens-datakonsult.se>
+ * \author Kalle Dalheimer <kalle@klaralvdalens-datakonsult.se>
*/
#ifndef QTOC_H
#include "Qt2Base.h"
#include "ControlToc.h"
-
+
class ControlToc;
class QTocDialog;
-class QToc :
- public Qt2CB<ControlToc, Qt2DB<QTocDialog> >
+class QToc :
+ public Qt2CB<ControlToc, Qt2DB<QTocDialog> >
{
public:
QToc(ControlToc &);
friend class QTocDialog;
-
+
private:
/// update the listview
void updateToc(int newdepth);
/// select an entry
void select(string const & text);
-
+
/// set the depth
void set_depth(int depth);
-
+
virtual void apply() {};
-
- /// update dialog
+
+ /// update dialog
virtual void update_contents();
/// build dialog
connect(closePB, SIGNAL(clicked()),
form, SLOT(slotClose()));
}
-
+
QTocDialog::~QTocDialog()
{
}
-
+
void QTocDialog::activate_adaptor(int)
{
form_->updateToc(form_->depth_);
}
-
-
+
+
void QTocDialog::depth_adaptor(int depth)
{
form_->set_depth(depth);
form_->update();
}
-
+
void QTocDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
#ifndef QTOCDIALOG_H
#define QTOCDIALOG_H
-
+
#include "ui/QTocDialogBase.h"
class QToc;
#include <qcheckbox.h>
#include <qpushbutton.h>
#include <qlineedit.h>
-
+
#include "ControlUrl.h"
#include "Qt2BC.h"
#include "QURL.h"
#include "gettext.h"
typedef Qt2CB<ControlUrl, Qt2DB<QURLDialog> > base_class;
-
+
QURL::QURL(ControlUrl & c)
: base_class(c, _("URL"))
{
bc().addReadOnly(dialog_->hyperlinkCB);
}
-
+
void QURL::update_contents()
{
dialog_->urlED->setText(controller().params().getContents().c_str());
dialog_->hyperlinkCB->setChecked(controller().params().getCmdName() != "url");
}
-
+
void QURL::apply()
{
controller().params().setContents(dialog_->urlED->text().latin1());
string const u(dialog_->urlED->text().latin1());
string const n(dialog_->nameED->text().latin1());
- return !u.empty() && !n.empty();
-}
+ return !u.empty() && !n.empty();
+}
#define QURL_H
#include "Qt2Base.h"
-
+
class ControlUrl;
class QURLDialog;
class QURL :
- public Qt2CB<ControlUrl, Qt2DB<QURLDialog> >
+ public Qt2CB<ControlUrl, Qt2DB<QURLDialog> >
{
- friend class QURLDialog;
-public:
+ friend class QURLDialog;
+public:
QURL(ControlUrl & c);
protected:
virtual bool isValid();
-
-private:
+
+private:
/// apply dialog
virtual void apply();
/// build dialog
*/
#include <config.h>
-
+
#include <qpushbutton.h>
-
+
#include "QURLDialog.h"
#include "Dialogs.h"
#include "QURL.h"
form_, SLOT(slotClose()));
}
-
+
QURLDialog::~QURLDialog()
{
}
-
+
void QURLDialog::changed_adaptor()
{
form_->changed();
#ifndef QURLDIALOG_H
#define QURLDIALOG_H
-
+
#include "ui/QURLDialogBase.h"
class QURL;
#include <qtextview.h>
#include <qpushbutton.h>
-
+
#include "QVCLogDialog.h"
#include "QVCLog.h"
#include "Qt2BC.h"
#include "gettext.h"
-
+
#include "QtLyXView.h"
#include "ControlVCLog.h"
void QVCLog::update_contents()
{
- dialog_->setCaption(string(_("Version control log for ") + controller().getBufferFileName()).c_str());
+ dialog_->setCaption(string(_("Version control log for ") + controller().getBufferFileName()).c_str());
dialog_->vclogTV->setText("");
stringstream ss;
-
+
dialog_->vclogTV->setText(controller().getVCLogFile(ss).str().c_str());
}
///
class QVCLog
- : public Qt2CB<ControlVCLog, Qt2DB<QVCLogDialog> >
+ : public Qt2CB<ControlVCLog, Qt2DB<QVCLogDialog> >
{
public:
///
#include "QVCLog.h"
#include "QtLyXView.h"
-#include "ControlVCLog.h"
+#include "ControlVCLog.h"
QVCLogDialog::QVCLogDialog(QVCLog * form)
: QVCLogDialogBase(0, 0, false, 0),
form, SLOT(slotClose()));
}
-
+
void QVCLogDialog::closeEvent(QCloseEvent * e)
{
form_->slotWMHide();
#ifndef QVCLOGDIALOG_H
#define QVCLOGDIALOG_H
-
+
#include <config.h>
-
+
#include "ui/QVCLogDialogBase.h"
class QVCLog;
{
// yuck, rtti, but the user comes first
if (obj->inherits("QLineEdit")) {
- QLineEdit * le(static_cast<QLineEdit*>(obj));
+ QLineEdit * le(static_cast<QLineEdit*>(obj));
le->setReadOnly(!enabled);
} else {
obj->setEnabled(enabled);
}
-
+
QWidget::FocusPolicy const p =
- (enabled) ? QWidget::StrongFocus : QWidget::NoFocus;
+ (enabled) ? QWidget::StrongFocus : QWidget::NoFocus;
obj->setFocusPolicy(p);
}
#endif
#include <qdialog.h>
-#include <qapplication.h>
+#include <qapplication.h>
-#include "debug.h"
-#include "QtLyXView.h"
+#include "debug.h"
+#include "QtLyXView.h"
#include "Dialogs.h"
#include "Qt2Base.h"
#include "Qt2BC.h"
return true;
}
-
+
void Qt2Base::changed()
{
if (updating_)
return;
-
+
if (isValid())
- bc().valid();
+ bc().valid();
else
bc().invalid();
}
#ifndef QT2BASE_H
#define QT2BASE_H
-#include <config.h>
-
+#include <config.h>
+
#include <qfont.h>
#include <qdialog.h>
#include <qobject.h>
/// Create the dialog if necessary, update it and display it.
virtual void show();
/// update the dialog's contents
- virtual void update_contents() = 0;
+ virtual void update_contents() = 0;
/// the dialog has changed contents
- virtual void changed();
+ virtual void changed();
- /// is the dialog currently valid ?
+ /// is the dialog currently valid ?
virtual bool isValid();
/// are we updating ?
- bool updating_;
-
+ bool updating_;
+
protected slots:
// dialog closed from WM
void slotWMHide();
// Restore button clicked
void slotRestore();
-
+
// OK button clicked
void slotOK();
private:
/// dialog title, displayed by WM.
- QString title_;
+ QString title_;
};
{
protected:
Qt2DB(ControlButtons &, QString const &);
-
- /// update the dialog
+
+ /// update the dialog
virtual void update();
-
+
/// Build the dialog
virtual void build();
-
+
/// Pointer to the actual instantiation of the Qt dialog
virtual QDialog * form() const;
-
+
/// Real GUI implementation.
boost::scoped_ptr<Dialog> dialog_;
void Qt2DB<Dialog>::update()
{
form()->setUpdatesEnabled(false);
-
+
// protect the BC from unwarranted state transitions
-
+
qApp->processEvents();
updating_ = true;
update_contents();
qApp->processEvents();
updating_ = false;
-
+
form()->setUpdatesEnabled(true);
form()->update();
}
-
+
template <class Dialog>
void Qt2DB<Dialog>::build()
{
// protect the BC from unwarranted state transitions
-
+
qApp->processEvents();
updating_ = true;
build_dialog();
updating_ = false;
}
-
+
template <class Controller, class Base>
class Qt2CB: public Base
{
{
owner_->emit();
}
-
+
void Timeout::Pimpl::reset()
{
return timeout_id != -1;
}
-
+
void Timeout::Pimpl::start()
{
if (running())
lyxerr << "Timeout::start: already running!" << endl;
timeout_id = startTimer(owner_->timeout_ms);
}
-
+
void Timeout::Pimpl::stop()
{
#include <sigc++/signal_system.h>
-#include <qobject.h>
+#include <qobject.h>
// stupid Qt
#undef emit
-
+
/**
* This class executes the callback when the timeout expires
* using Qt mechanisms
/// reset
void reset();
/// is the timer running ?
- bool running() const;
+ bool running() const;
protected:
/// slot
return QSize(cellsize * numCols(), cellsize * numRows());
}
-
+
void EmptyTable::paintCell(QPainter *p, int row, int col)
{
int const x2 = cellWidth(col) - 1;
int const x = ev->pos().x();
int const y = ev->pos().y();
- if (x > 0)
+ if (x > 0)
setNumberColumns(x / cellsize + leftCell());
- if (y > 0)
+ if (y > 0)
setNumberRows(y / cellsize + topCell());
}
#ifndef EMPTYTABLE_H
#define EMPTYTABLE_H
-#include <qpainter.h>
+#include <qpainter.h>
#include "qttableview.h"
/**
Q_OBJECT
public:
EmptyTable(QWidget * parent = 0, const char * name = 0);
-
+
~EmptyTable() {};
virtual QSize sizeHint() const;
-
+
public slots:
- /// set the number of columns in the table and emit colsChanged() signal
+ /// set the number of columns in the table and emit colsChanged() signal
void setNumberColumns(int nr_cols);
- /// set the number of rows in the table and emit rowsChanged() signal
+ /// set the number of rows in the table and emit rowsChanged() signal
void setNumberRows(int nr_rows);
-
+
signals:
/// the number of columns changed
void colsChanged(int);
/// fill in a cell
virtual void paintCell(class QPainter *, int, int);
virtual void mouseMoveEvent(QMouseEvent *);
-
+
private:
- /// number of current columns
+ /// number of current columns
unsigned int cols;
/// number of current rows
unsigned int rows;
#include <config.h>
#include "gettext.h"
-
+
#include "lengthcombo.h"
-
-#include <qwhatsthis.h>
+
+#include <qwhatsthis.h>
LengthCombo::LengthCombo(QWidget * parent, char * name)
: QComboBox(parent, name)
LyXLength::UNIT LengthCombo::currentLengthItem() const
-{
+{
LyXLength::UNIT unit;
int i = currentItem();
switch (i) {
// FIXME: LyXLength::PE ?
};
return unit;
-}
-
+}
+
void LengthCombo::has_activated(int)
{
emit selectionChanged(currentLengthItem());
}
-
+
void LengthCombo::setCurrentItem(LyXLength::UNIT unit)
{
int i;
#define LENGTHCOMBO_H
#include <config.h>
-
-#include <qcombobox.h>
-
-#include "vspace.h"
+
+#include <qcombobox.h>
+
+#include "vspace.h"
/**
* A combo box for selecting LyXLength::UNIT types.
/// set the current item
virtual void setCurrentItem(LyXLength::UNIT unit);
-
+
/// get the current item
LyXLength::UNIT currentLengthItem() const;
-
+
protected slots:
virtual void has_activated(int index);
/**********************************************************************
-** $Id: qttableview.C,v 1.2 2001/12/05 08:04:18 larsbj Exp $
+** $Id: qttableview.C,v 1.3 2002/03/21 21:19:37 larsbj Exp $
**
** Implementation of QtTableView class
**
#endif
#ifndef Q_ASSERT
#define Q_ASSERT ASSERT
-#endif
+#endif
enum ScrollBarDirtyFlags {
verGeometry = 0x01,
Q_CHECK_PTR( cornerSquare );
cornerSquare->setGeometry( maxViewX() + frameWidth() + 1,
maxViewY() + frameWidth() + 1,
- VSBEXT,
- HSBEXT);
+ VSBEXT,
+ HSBEXT);
}
if ( autoUpdate() && cornerSquare ) {
if ( enable )
if ( !contentsRect().contains( updateR, TRUE ) ) {// update frame ?
drawFrame( &paint );
- if ( updateR.left() < frameWidth() ) //###
+ if ( updateR.left() < frameWidth() ) //###
updateR.setLeft( frameWidth() );
if ( updateR.top() < frameWidth() )
updateR.setTop( frameWidth() );
#ifndef QT_NO_CURSOR
sb->setCursor( arrowCursor );
#endif
- sb->resize( sb->sizeHint() ); // height is irrelevant
+ sb->resize( sb->sizeHint() ); // height is irrelevant
Q_CHECK_PTR(sb);
sb->setTracking( FALSE );
sb->setFocusPolicy( NoFocus );
int QtTableView::maxViewX() const
{
return width() - 1 - frameWidth()
- - (tFlags & Tbl_vScrollBar ? VSBEXT
- : 0);
+ - (tFlags & Tbl_vScrollBar ? VSBEXT
+ : 0);
}
int QtTableView::maxViewY() const
{
return height() - 1 - frameWidth()
- - (tFlags & Tbl_hScrollBar ? HSBEXT
- : 0);
+ - (tFlags & Tbl_hScrollBar ? HSBEXT
+ : 0);
}
if ( testTableFlags(Tbl_hScrollBar) && (sbDirty & horMask) != 0 ) {
if ( sbDirty & horGeometry )
hScrollBar->setGeometry( 0,height() - HSBEXT,
- viewWidth() + frameWidth()*2,
- HSBEXT);
+ viewWidth() + frameWidth()*2,
+ HSBEXT);
if ( sbDirty & horSteps ) {
if ( cellW )
if ( testTableFlags(Tbl_vScrollBar) && (sbDirty & verMask) != 0 ) {
if ( sbDirty & verGeometry )
vScrollBar->setGeometry( width() - VSBEXT, 0,
- VSBEXT,
- viewHeight() + frameWidth()*2 );
+ VSBEXT,
+ viewHeight() + frameWidth()*2 );
if ( sbDirty & verSteps ) {
if ( cellH )
void QtTableView::updateFrameSize()
{
int rw = width() - ( testTableFlags(Tbl_vScrollBar) ?
- VSBEXT : 0 );
+ VSBEXT : 0 );
int rh = height() - ( testTableFlags(Tbl_hScrollBar) ?
- HSBEXT : 0 );
+ HSBEXT : 0 );
if ( rw < 0 )
rw = 0;
if ( rh < 0 )
rh = 0;
if ( autoUpdate() ) {
- int fh = frameRect().height();
+ int fh = frameRect().height();
int fw = frameRect().width();
setFrameRect( QRect(0,0,rw,rh) );
#endif
#include "Alert.h"
-#include "Alert_pimpl.h"
+#include "Alert_pimpl.h"
#include "xforms_helpers.h"
#include "gettext.h"
#include <algorithm>
#include FORMS_H_LOCATION
-
+
using std::pair;
using std::make_pair;
fl_set_choices_shortcut(scex(_("Yes|Yy#y")),
scex(_("No|Nn#n")),
scex(_("Cancel|^[")));
- return fl_show_choice(s1.c_str(), s2.c_str(), s3.c_str(),
+ return fl_show_choice(s1.c_str(), s2.c_str(), s3.c_str(),
3, idex(_("Yes|Yy#y")),
idex(_("No|Nn#n")),
- idex(_("Cancel|^[")), 3);
+ idex(_("Cancel|^[")), 3);
}
+2002-03-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * several files: ws cleanup
+
2002-03-20 Angus Leeming <a.leeming@ic.ac.uk>
* lots: whitespace changes.
only if the dialog is visible.
(getTooltip): renamed get.
(toggleTooltips): renamed set and made public,
-
+
* FormBase.C (show):
* FormBaseDeprecated.C (show): move tooltip-inards into Tooltip.
2002-03-14 John Levon <moz@compsoc.man.ac.uk>
* GUIRunTime.C: add spaces to error messages
-
+
2002-03-13 Angus Leeming <a.leeming@ic.ac.uk>
* FormBase.C (show):
2. Rename all button_cancel as button_close.
3. Ensure that all objects follow the naming scheme outlined in
forms/README
-
+
class | prefix
------------------+-------
FL_BROWSER | browser
2002-03-10 John Levon <moz@compsoc.man.ac.uk>
* FormToc.C: make goto not reset the dialog
-
+
2002-03-08 Angus Leeming <a.leeming@ic.ac.uk>
* FeedbackController.[Ch]: new files, providing a standard interface to
2002-02-11 John Levon <moz@compsoc.man.ac.uk>
* FormMinipage.C: return SMI_VALID on other form changes
-
+
2002-02-11 Juergen Spitzmueller <j.spitzmueller@gmx.de>
* FormParagraph.C (update): [VSpace:] Delete the special method
and updateWidgetsFromLength.
2002-02-10 Rob Lahaye <lahaye@users.sourceforge.net>
-
+
* forms/form_external.fd:
* form_external.C: change color2 of a few buttons into the
proper grey color.
* FormGraphics.C:
* form_graphics.[Ch]: simplify the bounding box folder
of the Graphic GUI
-
+
2002-02-08 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* Menubar_pimpl.C (create_submenu): work around an xforms bug (?)
* FormCitation.[Ch]:
* FormTexinfo.[Ch]:
* Makefile.am: altered appropriately.
-
+
2002-02-06 Juergen Spitzmueller <j.spitzmueller@gmx.de>
* forms/form_texinfo.fd:
2002-02-05 Herbert Voss <voss@lyx.org>
- * forms/form_graphics.fd: Noew the same view of the
+ * forms/form_graphics.fd: Noew the same view of the
buttons as in preferences (LyXView). Make some things clear
with better names.
* FormGraphic.C: cosmetic changes to the layout. Delete
* forms/form.citation.fd,form.bibtex.fd: add text_info
* FormTexinfo.[Ch]: Delete Help mechanism, add tooltips and help messages.
* FormCitation.[Ch],FormBibtex.[Ch]: add tooltips and help messages (actually
- no tooltips in Bibtex).
+ no tooltips in Bibtex).
2002-02-05 Angus Leeming <a.leeming@ic.ac.uk>
2002-02-03 Herbert Voss <voss@lyx.org>
- * xforms_helpers.C: fix bug with unit "%" in
+ * xforms_helpers.C: fix bug with unit "%" in
updateWidgetsFromLengthString(...)
2002-02-02 Herbert Voss <voss@lyx.org>
2002-01-27 Herbert Voss <voss@lyx.org>
- * FormGraphic.[Ch]:
- * form_graphic.[Ch]:
+ * FormGraphic.[Ch]:
+ * form_graphic.[Ch]:
* forms/form_graphic.fd: rewritten to support graphicx with
all options and to be sure that the old figinsets are correct
converted.
* Toolbar_pimpl.C (update): disable layout combox when LFUN_LAYOUT
is disabled
- * combox.C (activate):
+ * combox.C (activate):
(deactivate): change color of labels to reflect the state of the
combox
2002-01-17 John Levon <moz@compsoc.man.ac.uk>
* FormDocument.C: enable line spacing input properly
-
+
2002-01-17 John Levon <moz@compsoc.man.ac.uk>
* forms/form_preferences.fd:
* form_preferences.C:
* FormPreferences.h:
* FormPreferences.C: use better variable name
-
+
2002-01-17 John Levon <moz@compsoc.man.ac.uk>
* forms/form_preferences.fd: change "Use Scalable Fonts"
to "Rescale bitmap fonts"
-
+
2002-01-16 Angus Leeming <a.leeming@ic.ac.uk>
* FormMathsPanel.C:
* xformsBC.C: #include ButtonController.tmpl, containing the
instatiation of the button controller.
-
+
2002-01-15 John Levon <moz@compsoc.man.ac.uk>
* FormThesaurus.C: fix a crash
2002-1-15 Martin Vermeer <martin.vermeer@hut.fi>
- * FormMathsDelim.C:
- * form_maths_delim_C:
- * form_maths_delim.h:
- * form_maths_delin.fd:
- Put three radio buttons on the delimiters pop-up. It works as follows:
-
- left mouse middle mouse right mouse
- ----------------------------------------------------------------------
- Left radio button | ( () )
- Middle radio button | () () )
- Right radio button | ) ) )
- ----------------------------------------------------------------------
-
- Where
+ * FormMathsDelim.C:
+ * form_maths_delim_C:
+ * form_maths_delim.h:
+ * form_maths_delin.fd:
+ Put three radio buttons on the delimiters pop-up. It works as follows:
+
+ left mouse middle mouse right mouse
+ ----------------------------------------------------------------------
+ Left radio button | ( () )
+ Middle radio button | () () )
+ Right radio button | ) ) )
+ ----------------------------------------------------------------------
+
+ Where
( left-side delimiter selected
) right-side delimiter selected
() "symmnetric pair" selected, of which the clicked delimiter is
- the left one.
+ the left one.
So, if the middle radio button is activated ("()\nBoth")
and you click on "[" with the default (left) mouse button, you
get the delimiter pair "[]".
2002-01-14 John Levon <moz@compsoc.man.ac.uk>
* FormSpellchecker.C: disable resizing due to xforms bug
-
+
2002-01-13 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* FormFiledialog.C (Reread): skip broken symlinks
* MathsSymbols.C (get_pixmap_from_symbol): add a default statement
in the switch.
- * FormPreferences.C (Interface::input):
- (Language::input):
+ * FormPreferences.C (Interface::input):
+ (Language::input):
(Paths::input): add shortcuts to file dialogs directory buttons
-
+
* FormPreference.h (browse): add default empty parameters for
buttons descriptions.
* form_thesaurus.h:
* form_thesaurus.C:
* forms/form_thesaurus.fd: update to Aiksaurus 0.14
-
+
2002-01-12 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* Toolbar_pimpl.C (setPixmap): simplify a bit
2002-01-10 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
- * Toolbar_pimpl.C (ToolbarCB):
+ * Toolbar_pimpl.C (ToolbarCB):
* Menubar_pimpl.C (MenuCallback): use verboseDispatch instead of
dispatch.
* FormTabular.C (FormTabular): Fix Purify UMR.
- * FormPreferences.C (build): "Conversion" is a better name.
+ * FormPreferences.C (build): "Conversion" is a better name.
2002-01-10 Martin Vermeer <martin.vermeer@hut.fi>
2002-01-09 Martin Vermeer <martin.vermeer@hut.fi>
* forms/form_maths_style.fd:
- * FormMathsStyle.[Ch]: New files, Implementing a mathed pop-up for math
+ * FormMathsStyle.[Ch]: New files, Implementing a mathed pop-up for math
size "styles" and font types.
* FormMathsPanel.[Ch]:
* MathsSymbols.C:
2002-01-08 Martin Vermeer <martin.vermeer@hut.fi>
- * Menubar_pimpl.C (create_submenu):
+ * Menubar_pimpl.C (create_submenu):
* Toolbar_pimpl.C (update): use FuncStatus.
2002-01-08 Angus Leeming <a.leeming@ic.ac.uk>
* form_*:
* forms/form_*: change radio buttons to round3dbutton
-
+
2002-01-05 John Levon <moz@compsoc.man.ac.uk>
* FormFiledialog.C: add FIXME
-
+
* xforms_helpers.C: fix use of FileInfo
-
+
2002-01-07 John Levon <moz@compsoc.man.ac.uk>
* FormTabular.h:
* form_tabular.C:
* forms/form_tabular.fd: ugly fix to get around
some of the UI problems (bug #110).
-
+
2002-01-04 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* FormDocument.C: Recognize the default paper settings too
* DropDown.C: always include <config.h> in sources.
- * xforms_helpers.h:
- * FormFiledialog.h:
- * Timeout_pimpl.h:
+ * xforms_helpers.h:
+ * FormFiledialog.h:
+ * Timeout_pimpl.h:
* DropDown.h: do not include <config.h> in headers
2001-12-20 Juergen Vigna <jug@sad.it>
* FormToc.C: fix crash when no entries, and
update types properly
-
+
2001-12-11 Ben Stanley <bds02@uow.edu.au>
* Menubar_pimpl.C: Fixed a crashing bug when document has more
2001-12-05 John Levon <moz@compsoc.man.ac.uk>
- * FormParagraph.C (getCurrentParagraph):
+ * FormParagraph.C (getCurrentParagraph):
(apply): get the right LyXText !
-
+
2001-11-29 John Levon <moz@compsoc.man.ac.uk>
* FormParagraph.C: disallow page breaks in insets
-
+
2001-11-23 John Levon <moz@compsoc.man.ac.uk>
* FormParagraph.C: allow signed space above/below, actually
2001-11-04 John Levon <moz@compsoc.man.ac.uk>
* FormToc.C: fixes to make floatlists work
-
+
2001-11-23 John Levon <moz@compsoc.man.ac.uk>
* Makefile.am:
* forms/fdfix.sh: move idex etc. to here
* GUIRunTime.C: move getScreenDPI() to here
-
+
2001-11-20 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* forms/form_ref.fd, form_preferences.fd, form_citation.fd,
* FormFiledialog.C: don't reset path if new dir
doesn't exist.
-
+
2001-11-12 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* forms/form_document.fd: Renamed "Save as Class Defaults"
2001-11-07 John Levon <moz@compsoc.man.ac.uk>
* DropDown.C: fix crash, improve behaviour a bit
-
+
2001-11-07 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
- * FormDocument.C (class_apply):
- (paper_apply):
- (language_apply):
- (options_apply):
+ * FormDocument.C (class_apply):
+ (paper_apply):
+ (language_apply):
+ (options_apply):
(bullets_apply): add a version of these methods taking a
BufferParams& parameters. The original versions are now wrappers
- around these.
+ around these.
(saveParamsAsDefault): new function, moved from old
LFUN_LAYOUT_SAVE_DEFAULT code.
* Makefile.am:
* DropDown.h:
* DropDown.C: drop-down completion
-
+
2001-11-04 John Levon <moz@compsoc.man.ac.uk>
* forms/form_graphics.fd: change clashing shortcut
-
+
2001-10-24 Juergen Vigna <jug@sad.it>
* FormTabular.C: changed calls for footer/headers of longtabulars.
2001-10-19 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* forms/form_document.fd:
- Class: add a value choice for Default Skip.
- Some rearrangements (minor tweaks).
+ Class: add a value choice for Default Skip.
+ Some rearrangements (minor tweaks).
* FormDocument.C: Handle that choice, minor tweaks.
* forms/form_paragraph.fd: Add value choices
* FormParagraph.C: Handle that choices.
* FormTexinfo.[Ch]: some changes to the code
2001-10-10 André Pönitz <poenitz@htwm.de>
-
+
* FormsMathMatrix.C: add missing space between v- and h-alignment
parameters
* FormPreferences.[Ch] (connect, disconnect): removed (redundant).
* FormMaths*.C (c-tor): prohibit resizing of the dialog.
-
+
2001-09-07 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
- * Toolbar_pimpl.C (setLayout):
+ * Toolbar_pimpl.C (setLayout):
(layoutSelected): make them work even when gettext has been
translating the interface.
2001-09-02 John Levon <moz@compsoc.man.ac.uk>
* FormParagraph.C: fix default line spacing case
-
+
2001-08-31 John Levon <moz@compsoc.man.ac.uk>
* FormParagraph.C: disable space inputs when != Length
* form_preferences.h:
* form_preferences.C:
* forms/form_preferences.fd: add view_dvi_paper_option
-
+
2001-08-31 John Levon <moz@compsoc.man.ac.uk>
* FormMathsPanel.h: sub dialogs must be Ignorant.
-
+
2001-08-31 John Levon <moz@compsoc.man.ac.uk>
* FormParagraph.C: fix to not allow 0 linespacing
-
+
2001-08-29 Angus Leeming <a.leeming@ic.ac.uk>
* FormCitation.C (c-tor): prevent re-sizing of the dialog.
2001-08-27 John Levon <moz@compsoc.man.ac.uk>
* GUIRunTime.C: initApplication() should take a int & argc
-
+
2001-08-24 John Levon <moz@compsoc.man.ac.uk>
* FormCitation.h:
* FormCitation.C: tidy code a little
-
+
* GUIRunTime.C: more informative error
-
+
2001-08-23 Angus Leeming <a.leeming@ic.ac.uk>
* forms/form_preferences.fd: order the items "logically" so that
* combox.h: fix source doc
- * form_math_matrix.C:
+ * form_math_matrix.C:
* forms/form_math_matrix.fd: new layout
-
+
2001-08-16 John Levon <moz@compsoc.man.ac.uk>
* form_paragraph.h:
* form_paragraph.C:
* forms/form_paragraph.fd:
* FormParagraph.C: support per-para linespacing
-
+
* forms/form_float.fd:
* form_float.C: fix shortcut typo
-
+
2001-08-15 Angus Leeming <a.leeming@ic.ac.uk>
* forms/form_character.fd: small adjustment to the position of John's
* form_maths_panel.C:
* form_maths_panel.h:
* forms/form_maths_panel.fd: re-add dots bitmaps
-
+
* FormRef.C: "Goto" -> "Go to"
2001-07-29 John Levon <moz@compsoc.man.ac.uk>
* FormGraphics.C:
* forms/form_graphics.fd: Removed inline option, all InsetGraphics figures
are inlined.
-
+
2001-07-23 John Levon <moz@compsoc.man.ac.uk>
* FormInclude.C: add load file facility back
-
+
2001-07-23 John Levon <moz@compsoc.man.ac.uk>
* FormCharacter.C: disable resizing as it doesn't work
2001-07-03 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
- * GUIRunTime.C (x11Display):
- (x11Screen):
- (x11Colormap):
+ * GUIRunTime.C (x11Display):
+ (x11Screen):
+ (x11Colormap):
(x11VisualDepth): new methods
2001-07-03 Lars Gullik Bjønnes <larsbj@birdstep.com>
* FormDocument.C (class_apply): call CutAndPaste::'s staitc method
- directly.
+ directly.
* Toolbar_pimpl.h: make owner be a XFormsView, small changes
because of this.
* FormPrint.C (input): modify to select radio_file
when the user uses the filename input
-
+
2001-06-26 The LyX Project <lyx@violet.home.sad.it>
* combox.C (remove): send debug output to Debug::GUI.
2001-06-26 The LyX Project <lyx@rose.home.sad.it>
- * Menubar_pimpl.C (create_submenu):
+ * Menubar_pimpl.C (create_submenu):
* Toolbar_pimpl.C (update): update to use func_status
2001-06-25 The LyX Project <lyx@tulip.home.sad.it>
2001-06-01 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
- * MathsSymbols.C:
+ * MathsSymbols.C:
* FormMathsMatrix.C: bring C functions into global namespace if
- necessary.
+ necessary.
2001-05-31 Lars Gullik Bjønnes <larsbj@birdstep.com>
2001-04-16 Allan Rae <rae@lyx.org>
- * xforms_helpers.C (formatted):
+ * xforms_helpers.C (formatted):
* Menubar_pimpl.C (add_toc): #warning triggers an error on Sun CC 6.0
- as an unrecognised preprocessor directive. So ensure they're wrapped.
+ as an unrecognised preprocessor directive. So ensure they're wrapped.
2001-04-06 John Levon <moz@compsoc.man.ac.uk>
Squashed bug when creating a new inset, the keys field contained
one (empty) key. No more; thanks, Dekel.
- * FormExternal.C:
+ * FormExternal.C:
* forms/form_external.fd: added Apply button.
2001-03-30 Angus Leeming <a.leeming@ic.ac.uk>
2001-03-19 Angus Leeming <a.leeming@ic.ac.uk>
* FormBaseDeprecated.[Ch]: rename title as title_.
-
+
* FormBaseDeprecated.C: restore John's trick to give the dialog a border
with limited functionality. It got lost in the MVC merge.
* FormTabularCreate.C (build):
* FormToc.C (build):
* FormUrl.C (build): removed initialisation of minw_, minh_.
-
+
* The Maths Panel stuff no longer causes a crash on exit from LyX.
* FormMaths.[Ch]:
* Dialogs.C (Dialogs): create minipage options dialog.
- * forms/form_minipage.fd:
- * form_minipage.C:
- * form_minipage.h:
- * FormMinipage.C:
+ * forms/form_minipage.fd:
+ * form_minipage.C:
+ * form_minipage.h:
+ * FormMinipage.C:
* FormMinipage.h: new files for the minipage options dialog.
2001-03-16 Angus Leeming <a.leeming@ic.ac.uk>
2001-03-16 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* FormMaths.C (C_FormMathsDelimCB): add usual .c_str() for lyxstring
- compatibility.
+ compatibility.
2001-03-16 Angus Leeming <a.leeming@ic.ac.uk>
* Makefile.am: added FormCredits.[Ch] and form_credits.[Ch]
* forms/makefile: added form_credits.fd
-
+
* Dialogs.C: added FormCredits and removed ShowCredits.
-
+
* FormCredits.[Ch]:
* forms/form_credits.fd:
* forms/form_search.fd: ported to the MVC way.
-
+
2001-03-07 Angus Leeming <a.leeming@ic.ac.uk>
* xforms_helpers.h (formatted): now has default arguments for size and
* FormCitation.[Ch]: moved code out of this class and into
ControlCitation and associated helper funcs.
-
+
2001-03-05 Angus Leeming <a.leeming@ic.ac.uk>
* FormBase.[Ch]: (InputCB): use ButtonController::input() rather than
* forms/form_splash.fd:
* FormSplash.h:
* FormSplash.C: make independent of FormBase, tidy
-
+
* Menubar_pimpl.C: destroy splash on interaction
2001-03-12 John Levon <moz@compsoc.man.ac.uk>
2001-03-07 Edwin Leuven <leuven@fee.uva.nl>
- * added credits:
+ * added credits:
* Dialogs.C:
* Makefile.am:
* FormCredits.[Ch]:
* Menubar_pimpl.h: make Pipl::ItemInfo::item_ a boost::shared_ptr,
make ButtonList contain boost::shared_ptr<ItemInfo>
- * Menubar_pimpl.C (~Pimpl): remove destructor
+ * Menubar_pimpl.C (~Pimpl): remove destructor
2001-03-06 John Levon <moz@compsoc.man.ac.uk>
* form_character.C: added
* form_character.h: added
* forms/form_character.fd: added
-
+
2001-02-23 Dekel Tsur <dekelts@tau.ac.il>
-
+
* FormPreferences.C: Handle lyxrc.language_use_babel and
lyxrc.language_global_options.
2001-02-21 Dekel Tsur <dekelts@tau.ac.il>
- * FormDocument.C (checkMarginValues): Activate "use geometry" button
+ * FormDocument.C (checkMarginValues): Activate "use geometry" button
if using custom paper size/margin.
2001-02-21 Allan Rae <rae@lyx.org>
2001-02-20 Edwin Leuven <leuven@fee.uva.nl>
- * src/frontends/xforms/Dialogs.C: added preamble
- * src/frontends/xforms/FormPreamble.C: added
- * src/frontends/xforms/FormPreamble.h: added
- * src/frontends/xforms/Makefile.am: added
- * src/frontends/xforms/form_preamble.C: added
- * src/frontends/xforms/form_preamble.h: added
- * src/frontends/xforms/form_preamble.fd: added
+ * src/frontends/xforms/Dialogs.C: added preamble
+ * src/frontends/xforms/FormPreamble.C: added
+ * src/frontends/xforms/FormPreamble.h: added
+ * src/frontends/xforms/Makefile.am: added
+ * src/frontends/xforms/form_preamble.C: added
+ * src/frontends/xforms/form_preamble.h: added
+ * src/frontends/xforms/form_preamble.fd: added
2001-02-19 Angus Leeming <a.leeming@ic.ac.uk>
2001-01-25 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* FormPreferences.C (GetFrom): fix crash when there is no format
- defined.
+ defined.
(GetTo): ditto.
2001-01-23 Angus Leeming <a.leeming@ic.ac.uk>
2001-01-21 Dekel Tsur <dekelts@tau.ac.il>
* FormRef.C (update): Do not update dialog_->{ref,name,type}
- if inset_ == 0.
+ if inset_ == 0.
Deactivate the type button when buffer is LinuxDoc/Docbook
(build): Uncomment calls to addReadOnly().
- (updateBrowser) Do not disable the update button when there are no
+ (updateBrowser) Do not disable the update button when there are no
keys.
(build, getType, getName): Use InsetRef::types.
2001-01-17 Dekel Tsur <dekelts@tau.ac.il>
* FormRef.C (input): Fix the behavior of goto reference button.
-
double h = hsv.h;
double const s = hsv.s;
double const v = hsv.v;
-
+
double rd, gd, bd;
-
+
if (h == nohue || s == 0.0) {
rd = gd = bd = v;
} else {
#include "FormShowFile.h"
#include "FormSpellchecker.h"
#include "FormTabularCreate.h"
-#include "FormTexinfo.h"
-#include "FormThesaurus.h"
+#include "FormTexinfo.h"
+#include "FormThesaurus.h"
#include "FormToc.h"
#include "FormUrl.h"
#include "FormVCLog.h"
add(new GUIVCLog<FormVCLog, xformsBC>(*lv, *this));
add(new FormDocument(lv, this));
- add(new FormMathsPanel(lv, this));
+ add(new FormMathsPanel(lv, this));
add(new FormParagraph(lv, this));
add(new FormPreferences(lv, this));
add(new FormTabular(lv, this));
-
+
// reduce the number of connections needed in
// dialogs by a simple connection here.
hideAll.connect(hideBufferDependent.slot());
namespace {
-
+
extern "C" void C_CompletedCB(FL_OBJECT * ob, long)
{
DropDown * d = static_cast<DropDown*>(ob->u_vdata);
d->completed();
}
-
+
extern "C" int C_PeekCB(FL_FORM * form, void *xev)
{
DropDown * d = static_cast<DropDown*>(form->u_vdata);
return d->peek(static_cast<XEvent*>(xev));
}
-
+
} // namespace anon
-
+
DropDown::DropDown(LyXView * lv, FL_OBJECT * ob)
: lv_(lv)
{
fl_add_box(FL_UP_BOX, 0, 0, ob->w, 100, "");
browser_ = fl_add_browser(FL_SELECT_BROWSER, 0, 0, ob->w, 100, "");
form_->u_vdata = this;
- browser_->u_vdata = this;
+ browser_->u_vdata = this;
fl_set_object_callback(browser_, C_CompletedCB, 0);
fl_register_raw_callback(form_, KeyPressMask|ButtonPressMask, C_PeekCB);
fl_end_form();
}
-
+
DropDown::~DropDown()
{
- if (form_->visible)
+ if (form_->visible)
fl_hide_form(form_);
fl_free_form(form_);
}
-
+
void DropDown::select(vector<string> const & choices, int x, int y, int w)
{
if (fl_get_browser(browser_) < fl_get_browser_topline(browser_))
fl_set_browser_topline(browser_, fl_get_browser(browser_));
}
-
+
int DropDown::peek(XEvent * xev)
{
unsigned int keymask;
fl_get_mouse(&x, &y, &keymask);
-
+
if (xev->type == ButtonPress) {
if (!(x >= form_->x && x <= (form_->x + form_->w) &&
y >= form_->y && y << (form_->y + form_->h))) {
line_up();
return 1;
case XK_Return:
- completed();
+ completed();
return 1;
case XK_Escape:
fl_deselect_browser(browser_);
// FIXME: if someone has a got a way to
// convince the event to fall back to the
// minibuffer, I'm glad to hear it.
- // fl_XPutBackEvent() doesn't work.
+ // fl_XPutBackEvent() doesn't work.
// This is a bit less elegant perhaps, but works
// well enough. Angus 11 Jan 2002
}
}
}
- return 0;
+ return 0;
}
#ifndef DROPDOWN_H
#define DROPDOWN_H
-
+
#ifdef __GNUG_
#pragma interface
#endif
#include "LyXView.h"
-#include <sigc++/signal_system.h>
+#include <sigc++/signal_system.h>
#include "LString.h"
#include FORMS_H_LOCATION
#include <vector>
-
+
class DropDown {
public:
/// constructor
DropDown(LyXView * lv, FL_OBJECT * ob);
/// destructor
~DropDown();
-
+
/// choose from the list of choices.
void select(std::vector<string> const & choices, int x, int y, int w);
/// signal for completion
SigC::Signal1<void, string const &> result;
-
+
/// signal that a key was pressed
SigC::Signal1<void, char> keypress;
-
+
/// X event
int peek(XEvent *);
private:
- /// move up a browser line
+ /// move up a browser line
void line_up();
/// move down a browser line
void line_down();
-
+
/// owning lyxview
LyXView * lv_;
-
+
/// our form
FL_FORM * form_;
lyx::Assert(ob);
switch (event) {
- case FL_ENTER:
+ case FL_ENTER:
{
string const feedback = getFeedback(ob);
if (feedback.empty() && warning_posted_)
warning_posted_ = false;
postMessage(getFeedback(ob));
break;
- }
+ }
case FL_LEAVE:
if (!warning_posted_)
#include "frontends/FileDialog.h"
// temp. hack until Allow/prohibitInput is not
// needed any more in src/ - for now it's simplest
-// to leave it there
-#include "LyXView.h"
+// to leave it there
+#include "LyXView.h"
#include "bufferview_funcs.h"
#include "gettext.h"
#include "commandtags.h"
#include "debug.h"
-#include "support/lstrings.h"
+#include "support/lstrings.h"
#include <utility>
{
private_ = new FileDialog::Private();
- private_->SetButton(0, b1.first, b1.second);
+ private_->SetButton(0, b1.first, b1.second);
private_->SetButton(1, b2.first, b2.second);
}
result.first = FileDialog::Chosen;
result.second = private_->Select(title_, path, filter, suggested);
-
+
lv_->allowInput();
-
+
return result;
}
// create version tab
version_.reset(build_tab_version());
- fl_set_object_label(version_->text_version,
+ fl_set_object_label(version_->text_version,
controller().getVersion().c_str());
- fl_set_object_label(version_->text_copyright,
+ fl_set_object_label(version_->text_copyright,
controller().getCopyright().c_str());
// create license and warranty tab
license_.reset(build_tab_license());
-
+
string str = formatted(controller().getLicense(),
license_->text_license->w-10);
fl_set_object_label(license_->text_license, str.c_str());
// create credits
credits_.reset(build_tab_credits());
stringstream ss;
- fl_add_browser_line(credits_->browser_credits,
+ fl_add_browser_line(credits_->browser_credits,
controller().getCredits(ss).str().c_str());
// stack tabs
if (!ob->form) return 0;
FormBase * ptr = static_cast<FormBase *>(ob->form->u_vdata);
-
+
if (ptr)
ptr->PrehandlerCB(ob, event, key);
return 0;
}
-
+
} // extern "C"
private:
/// Pointer to the actual instantiation of xform's form
virtual FL_FORM * form() const = 0;
- /// Filter the inputs on callback from xforms
+ /// Filter the inputs on callback from xforms
virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
/** Redraw the form (on receipt of a Signal indicating, for example,
/// Can the dialog be resized after it has been created?
bool allow_resize_;
/// dialog title, displayed by WM.
- string title_;
+ string title_;
///
Tooltips * tooltips_;
};
build();
bc().refresh();
-
+
// work around dumb xforms sizing bug
minw_ = form()->w;
minh_ = form()->h;
if (form()->visible) {
fl_raise_form(form());
- /* This XMapWindow() will hopefully ensure that
- * iconified dialogs are de-iconified. Mad props
- * out to those crazy Xlib guys for forgetting a
- * XDeiconifyWindow(). At least WindowMaker, when
- * being notified of the redirected MapRequest will
- * specifically de-iconify. From source, fvwm2 seems
- * to do the same.
- */
- XMapWindow(fl_get_display(), form()->window);
+ /* This XMapWindow() will hopefully ensure that
+ * iconified dialogs are de-iconified. Mad props
+ * out to those crazy Xlib guys for forgetting a
+ * XDeiconifyWindow(). At least WindowMaker, when
+ * being notified of the redirected MapRequest will
+ * specifically de-iconify. From source, fvwm2 seems
+ * to do the same.
+ */
+ XMapWindow(fl_get_display(), form()->window);
} else {
connect();
/// Redraw connection.
SigC::Connection r_;
/// dialog title, displayed by WM.
- string title_;
+ string title_;
private:
/// The dialog's minimum allowable dimensions.
* Copyright 2001 the LyX Team
* Read the file COPYING
*
- * \author Angus Leeming, a.leeming@ic.ac.uk
+ * \author Angus Leeming, a.leeming@ic.ac.uk
* \author John Levon, moz@compsoc.man.ac.uk
*/
setPrehandler(dialog_->input_key);
setPrehandler(dialog_->input_label);
- // Manage the ok, apply, restore and cancel/close buttons
+ // Manage the ok, apply, restore and cancel/close buttons
bc().setOK(dialog_->button_ok);
bc().setCancel(dialog_->button_close);
ButtonPolicy::SMInput FormBibitem::input(FL_OBJECT *, long)
{
- // minimal validation
+ // minimal validation
if (!compare(fl_get_input(dialog_->input_key), ""))
return ButtonPolicy::SMI_NOOP;
setPrehandler(dialog_->input_database);
setPrehandler(dialog_->input_style);
- // Manage the ok, apply, restore and cancel/close buttons
+ // Manage the ok, apply, restore and cancel/close buttons
bc().setOK(dialog_->button_ok);
bc().setCancel(dialog_->button_close);
ButtonPolicy::SMInput FormBibtex::input(FL_OBJECT * ob, long)
{
if (ob == dialog_->button_database_browse) {
- // When browsing, take the first file only
+ // When browsing, take the first file only
string const in_name = fl_get_input(dialog_->input_database);
- string out_name =
+ string out_name =
controller().Browse("",
"Select Database",
"*.bib| BibTeX Databases (*.bib)");
if (!in_name.empty())
out_name = in_name + ", " + out_name;
- fl_freeze_form(form());
+ fl_freeze_form(form());
fl_set_input(dialog_->input_database, out_name.c_str());
- fl_unfreeze_form(form());
+ fl_unfreeze_form(form());
}
}
if (ob == dialog_->button_style_browse) {
string const in_name = fl_get_input(dialog_->input_style);
- string out_name =
+ string out_name =
controller().Browse(in_name,
"Select BibTeX-Style",
"*.bst| BibTeX Styles (*.bst)");
if (!out_name.empty()) {
- fl_freeze_form(form());
+ fl_freeze_form(form());
fl_set_input(dialog_->input_style, out_name.c_str());
- fl_unfreeze_form(form());
+ fl_unfreeze_form(form());
}
}
-
+
if (!compare(fl_get_input(dialog_->input_database),"")) {
return ButtonPolicy::SMI_NOOP;
}
{
fl_set_input(dialog_->input_database,
controller().params().getContents().c_str());
- string bibtotoc = "bibtotoc";
+ string bibtotoc = "bibtotoc";
string bibstyle (controller().params().getOptions().c_str());
if (prefixIs(bibstyle,bibtotoc)) { // bibtotoc exists?
fl_set_button(dialog_->check_bibtotoc,1);
eliminate_duplicates(dbase);
return subst(getStringFromVector(dbase),",",", ");
}
-
+
} // namespace anon
controller().params().setOptions("");
return;
}
-
+
controller().params().setContents(unique_and_no_extensions(db));
// empty is valid!
}
bool const bibtotoc = fl_get_button(dialog_->check_bibtotoc);
-
+
if (bibtotoc && (!bibstyle.empty())) {
// both bibtotoc and style
controller().params().setOptions("bibtotoc,"+bibstyle);
FormBrowser::FormBrowser(ControlButtons & c, string const & t, bool allowResize)
: FormDB<FD_form_browser>(c, t, allowResize)
{}
-
+
void FormBrowser::build()
{
fl_end_form();
// build up the combox entries
- for (vector<string>::const_iterator cit = language.begin();
+ for (vector<string>::const_iterator cit = language.begin();
cit != language.end(); ++cit) {
combo_language2_->addto(*cit);
}
pos = fl_get_choice(dialog_->choice_series);
controller().setSeries(series_[pos-1]);
-
+
pos = fl_get_choice(dialog_->choice_shape);
controller().setShape(shape_[pos-1]);
pos = fl_get_choice(dialog_->choice_size);
controller().setSize(size_[pos-1]);
-
+
pos = fl_get_choice(dialog_->choice_bar);
controller().setBar(bar_[pos-1]);
-
+
pos = fl_get_choice(dialog_->choice_color);
controller().setColor(color_[pos-1]);
{
int pos = int(findPos(family_, controller().getFamily()));
fl_set_choice(dialog_->choice_family, pos+1);
-
+
pos = int(findPos(series_, controller().getSeries()));
fl_set_choice(dialog_->choice_series, pos+1);
int pos = fl_get_choice(dialog_->choice_family);
if (family_[pos-1] != LyXFont::IGNORE_FAMILY)
activate = ButtonPolicy::SMI_VALID;
-
+
pos = fl_get_choice(dialog_->choice_series);
if (series_[pos-1] != LyXFont::IGNORE_SERIES)
activate = ButtonPolicy::SMI_VALID;
// -*- C++ -*-
-/**
+/**
* \file FormCharacter.h
* Copyright 2001 The LyX Team.
* See the file COPYING.
- *
+ *
* \author Edwin Leuven, leuven@fee.uva.nl
* \author Angus Leeming, a.leeming@ic.ac.uk
*/
class Combox;
struct FD_form_character;
-/**
+/**
* This class provides an XForms implementation of the Character Dialog.
* The character dialog allows users to change the character settings
* in their documents.
/// Apply from dialog
virtual void apply();
-
+
/// Build the dialog
virtual void build();
-
+
/// Update the dialog.
virtual void update();
/// Fdesign generated method
FD_form_character * build_character();
-
+
///
boost::scoped_ptr<Combox> combo_language2_;
///
namespace {
// shamelessly stolen from Menubar_pimpl.C
-int string_width(string const & str)
+int string_width(string const & str)
{
return fl_get_string_widthTAB(FL_NORMAL_STYLE, FL_NORMAL_SIZE,
str.c_str(),
setPrehandler(dialog_->input_before);
setPrehandler(dialog_->input_after);
- // Manage the ok, apply, restore and cancel/close buttons
+ // Manage the ok, apply, restore and cancel/close buttons
bc().setOK(dialog_->button_ok);
bc().setApply(dialog_->button_apply);
bc().setCancel(dialog_->button_close);
fl_select_browser_line(dialog_->browser_bib, found);
input(dialog_->browser_bib, 0);
}
-
+
ButtonPolicy::SMInput FormCitation::input(FL_OBJECT * ob, long)
{
setEnabled(dialog_->check_full_author_list, natbib);
setEnabled(dialog_->check_force_uppercase, natbib);
setEnabled(dialog_->choice_style, natbib);
-
+
// No keys have been selected yet, so...
fl_clear_browser(dialog_->browser_info);
setBibButtons(OFF);
#include "Liason.h"
#include "CutAndPaste.h"
#include "bufferview_funcs.h"
-#include "xforms_helpers.h"
+#include "xforms_helpers.h"
#include "debug.h"
#include "input_validators.h" // fl_unsigned_float_filter
-#include "helper_funcs.h"
+#include "helper_funcs.h"
#include "lyx_main.h" // for user_lyxdir
#include "insets/insetquotes.h"
setPrehandler(class_->input_doc_extra);
setPrehandler(class_->input_doc_skip);
setPrehandler(class_->input_doc_spacing);
-
+
// Set input filters on doc spacing to make it accept only
// unsigned numbers.
fl_set_input_filter(class_->input_doc_spacing, fl_unsigned_float_filter);
_("for the document layout as default?"),
_("(they will be valid for any new document)")))
return false;
-
+
string const fname = AddName(AddPath(user_lyxdir, "templates/"),
"defaults.lyx");
Buffer defaults = Buffer(fname);
defaults.params = params;
-
+
// add an empty paragraph. Is this enough?
defaults.paragraph = new Paragraph;
-
+
return defaults.writeFile(defaults.fileName(), false);
}
params.pagestyle = fl_get_choice_text(class_->choice_doc_pagestyle);
params.textclass = combo_doc_class->get() - 1;
-
+
BufferParams::PARSEP tmpsep = params.paragraph_separation;
if (fl_get_button(class_->radio_doc_indent))
params.paragraph_separation = BufferParams::PARSEP_INDENT;
params.paragraph_separation = BufferParams::PARSEP_SKIP;
if (tmpsep != params.paragraph_separation)
redo = true;
-
+
VSpace tmpdefskip = params.getDefSkip();
switch (fl_get_choice (class_->choice_doc_skip)) {
case 1:
case 2:
params.setDefSkip(VSpace(VSpace::MEDSKIP));
break;
- case 3:
+ case 3:
params.setDefSkip(VSpace(VSpace::BIGSKIP));
break;
case 4:
}
if (!(tmpdefskip == params.getDefSkip()))
redo = true;
-
+
if (fl_get_button(class_->radio_doc_columns_two))
params.columns = 2;
else
params.sides = LyXTextClass::TwoSides;
else
params.sides = LyXTextClass::OneSide;
-
+
Spacing tmpSpacing = params.spacing;
switch (fl_get_choice(class_->choice_doc_spacing)) {
case 1:
break;
case 4:
lyxerr[Debug::INFO] << "Spacing: OTHER\n";
- params.spacing.set(Spacing::Other,
+ params.spacing.set(Spacing::Other,
fl_get_input(class_->input_doc_spacing));
break;
}
if (tmpSpacing != params.spacing)
redo = true;
-
+
params.options = fl_get_input(class_->input_doc_extra);
-
+
return redo;
}
Alert::alert(_("Conversion Errors!"),s,
_("into chosen document class"));
}
-
+
} else {
// problem changing class -- warn user and retain old style
Alert::alert(_("Conversion Errors!"),
combo_doc_class->select(int(old_class) + 1);
}
}
-
+
return redo;
}
break;
}
params.quotes_language = lga;
- if (fl_get_button(language_->radio_single))
+ if (fl_get_button(language_->radio_single))
params.quotes_times = InsetQuotes::SingleQ;
else
params.quotes_times = InsetQuotes::DoubleQ;
Language const * old_language = params.language;
- Language const * new_language =
+ Language const * new_language =
languages.getLanguage(combo_language->getline());
if (!new_language)
new_language = default_language;
if (params.secnumdepth != tmpchar)
redo = true;
params.secnumdepth = tmpchar;
-
+
params.tocdepth = int(fl_get_counter_value(options_->counter_tocdepth));
params.float_placement =
setEnabled(class_->input_doc_skip, input_length);
switch (params.getDefSkip().kind()) {
- case VSpace::SMALLSKIP:
+ case VSpace::SMALLSKIP:
fl_set_choice (class_->choice_doc_skip, 1);
break;
- case VSpace::MEDSKIP:
+ case VSpace::MEDSKIP:
fl_set_choice (class_->choice_doc_skip, 2);
break;
- case VSpace::BIGSKIP:
+ case VSpace::BIGSKIP:
fl_set_choice (class_->choice_doc_skip, 3);
break;
case VSpace::LENGTH:
fl_set_button(class_->radio_doc_columns_two, 1);
else
fl_set_button(class_->radio_doc_columns_one, 1);
-
+
fl_set_input(class_->input_doc_spacing, "");
setEnabled(class_->input_doc_spacing, false);
{
fl_set_choice(class_->choice_doc_spacing, 4);
char sval[20];
- sprintf(sval,"%g",params.spacing.getValue());
+ sprintf(sval,"%g",params.spacing.getValue());
fl_set_input(class_->input_doc_spacing, sval);
setEnabled(class_->input_doc_spacing, true);
break;
if (!ok) {
postWarning(_("Invalid Length (valid example: 10mm)"));
return false;
- } else {
+ } else {
clearMessage();
return true;
}
{
BufferParams & param = lv_->buffer()->params;
- // convert from 1-6 range to -1-4
+ // convert from 1-6 range to -1-4
param.temp_bullets[current_bullet_depth].setSize(fl_get_choice(ob) - 2);
fl_set_input(bullets_->input_bullet_latex,
param.temp_bullets[current_bullet_depth].getText().c_str());
{
/* Here we have to change the background pixmap to that selected */
/* by the user. (eg. standard.xpm, psnfss1.xpm etc...) */
-
+
int data = 0;
if (cb == BULLETPANEL1)
data = 0;
/* handle the user input by setting the current bullet depth's pixmap */
/* to that extracted from the current chosen position of the BMTable */
/* Don't forget to free the button's old pixmap first. */
-
+
BufferParams & param = lv_->buffer()->params;
int bmtable_button = fl_get_bmtable(ob);
-
+
/* try to keep the button held down till another is pushed */
/* fl_set_bmtable(ob, 1, bmtable_button); */
param.temp_bullets[current_bullet_depth].setFont(current_bullet_panel);
{
dialog_.reset(build_error());
- // Manage the cancel/close button
+ // Manage the cancel/close button
bc().setCancel(dialog_->button_close);
}
long const ONE_HOUR_SEC = 60L * 60L;
extern "C" {
-
+
static
int C_LyXFileDlg_CancelCB(FL_FORM *fl, void *xev)
{
return FileDialog::Private::CancelCB(fl, xev);
}
-
+
static
void C_LyXFileDlg_DoubleClickCB(FL_OBJECT * ob, long data)
{
{
string pszNewName;
struct passwd * pEntry;
-
+
// gets user name
if ((pEntry = getpwuid(ID)))
pszNewName = pEntry->pw_name;
else {
pszNewName = tostr(ID);
}
-
+
// adds new node
users[ID] = pszNewName;
-}
+}
/// Group cache class definition
{
string pszNewName;
struct group * pEntry;
-
+
// gets user name
if ((pEntry = getgrgid(ID))) pszNewName = pEntry->gr_name;
else {
File = split(File, Temp, '/');
}
while (!File.empty() || !Temp.empty()) {
- string dline = "@b"+line + Temp + '/';
+ string dline = "@b"+line + Temp + '/';
fl_add_browser_line(pFileDlgForm->List, dline.c_str());
File = split(File, Temp, '/');
line += ' ';
// If the pattern doesn't start with a dot, skip hidden files
if (!pszMask.empty() && pszMask[0] != '.' &&
pDirEntry->d_name[0] == '.')
- continue;
+ continue;
// Gets filename
string fname = pDirEntry->d_name;
// can this really happen?
if (!fileInfo.isOK())
continue;
-
+
fileInfo.modeString(szMode);
unsigned int nlink = fileInfo.getNumberOfLinks();
- string user = lyxUserCache.find(fileInfo.getUid());
+ string user = lyxUserCache.find(fileInfo.getUid());
string group = lyxGroupCache.find(fileInfo.getGid());
time_t modtime = fileInfo.getModificationTime();
string Time = ctime(&modtime);
-
+
if (curTime > modtime + SIX_MONTH_SEC
|| curTime < modtime + ONE_HOUR_SEC) {
// The file is fairly old or in the future. POSIX says
// Sort the names
sort(direntries.begin(), direntries.end(), comp_direntry());
-
+
// Add them to directory box
for (DirEntries::const_iterator cit = direntries.begin();
cit != direntries.end(); ++cit) {
// SetDirectory: sets dialog current directory
void FileDialog::Private::SetDirectory(string const & Path)
{
-
+
string tmp;
- if (Path.empty())
+ if (Path.empty())
tmp = lyx::getcwd();
else
tmp = MakeAbsPath(ExpandPath(Path), pszDirectory);
-
+
// must check the directory exists
DIR * pDirectory = ::opendir(tmp.c_str());
if (!pDirectory) {
// Make sure pressing the close box doesn't crash LyX. (RvdK)
fl_set_form_atclose(pFileDlgForm->form,
C_LyXFileDlg_CancelCB, 0);
- // Register doubleclick callback
+ // Register doubleclick callback
fl_set_browser_dblclick_callback(pFileDlgForm->List,
C_LyXFileDlg_DoubleClickCB,
0);
if (iIndex == 0) {
pObject = pFileDlgForm->User1;
pTemp = &pszUserPath1;
- } else if (iIndex == 1) {
+ } else if (iIndex == 1) {
pObject = pFileDlgForm->User2;
pTemp = &pszUserPath2;
} else return;
}
namespace {
- bool x_sync_kludge(bool ret)
+ bool x_sync_kludge(bool ret)
{
XSync(fl_get_display(), false);
return ret;
force_cancel = false;
force_ok = false;
- // event loop
- while (true) {
- FL_OBJECT * pObject = fl_do_forms();
+ // event loop
+ while (true) {
+ FL_OBJECT * pObject = fl_do_forms();
- if (pObject == pFileDlgForm->Ready) {
+ if (pObject == pFileDlgForm->Ready) {
if (HandleOK())
return x_sync_kludge(true);
case 2: // list
pCurrentDlg->HandleListHit();
- break;
+ break;
case 10: // rescan
pCurrentDlg->SetDirectory(fl_get_input(pFileDlgForm->DirBox));
Reread();
return false;
}
-
+
// Handle return from list
int const select = fl_get_browser(pFileDlgForm->List);
if (select > iDepth) {
{
// Simulate a click on the cancel button
pCurrentDlg->Force(true);
- return FL_IGNORE;
+ return FL_IGNORE;
}
}
}
}
-
+
if (sel != 0) fl_select_browser_line(pFileDlgForm->List, sel);
int const top = max(sel - 5, 1);
fl_set_browser_topline(pFileDlgForm->List, top);
title.c_str());
isOk = RunDialog();
-
+
fl_hide_form(pFileDlgForm->form);
fl_activate_all_forms();
pCurrentDlg = 0;
bool here_definitely = false;
string placement(controller().params().placement);
-
+
if (contains(placement, "H")) {
here_definitely = true;
} else {
fl_clear_browser(dialog_->browser_children);
fl_clear_browser(dialog_->browser_kill);
- // Manage the ok, apply, restore and cancel/close buttons
+ // Manage the ok, apply, restore and cancel/close buttons
bc().setOK(dialog_->button_ok);
bc().setApply(dialog_->button_apply);
bc().setCancel(dialog_->button_close);
if (ob == dialog_->browser_children) {
activate = input_browser_children();
-
+
} else if (ob == dialog_->browser_kill) {
activate = input_browser_kill();
string pid_str;
split(selection, pid_str, '\t');
- vector<string> const kill_vec =
+ vector<string> const kill_vec =
getVectorFromBrowser(dialog_->browser_kill);
vector<string>::const_iterator it =
private:
string pid_;
};
-
+
} // namespace anon
fl_select_browser_line(dialog_->browser_children, n+1);
fl_set_browser_topline(dialog_->browser_children, n+1);
}
-
+
setEnabled(dialog_->button_remove, true);
setEnabled(dialog_->button_add, false);
return vec;
}
-
+
} // namespace anon
// to resolve a warning about comparison between signed and unsigned.
int const pid_vec_size = int(pid_vec.size());
-
+
if (fl_get_browser_maxline(dialog_->browser_kill) != pid_vec_size) {
activate = ButtonPolicy::SMI_VALID;
string pid_str;
split(selection, pid_str, '\t');
- vector<string> const kill_vec =
+ vector<string> const kill_vec =
getVectorFromBrowser(dialog_->browser_kill);
vector<string>::const_iterator it =
* \author Herbert Voss, voss@perce.de
*/
-#include <config.h>
+#include <config.h>
#ifdef __GNUG__
#pragma implementation
-#endif
+#endif
#include "xformsBC.h"
#include "ControlGraphics.h"
int const HEIGHT_MAXDIGITS = 10;
int const ROTATE_MAXCHARS = 4;
int const FILENAME_MAXCHARS = 1024;
-string defaultUnit("cm");
-
+string defaultUnit("cm");
+
/// Given input and choice widgets, create a LyXLength
LyXLength getLyXLengthFromWidgets(FL_OBJECT * input, FL_OBJECT * choice)
{
// Allow the base class to control messages
setMessageWidget(dialog_->text_warning);
- // Manage the ok, apply, restore and cancel/close buttons
+ // Manage the ok, apply, restore and cancel/close buttons
bc().setOK(dialog_->button_ok);
bc().setApply(dialog_->button_apply);
bc().setCancel(dialog_->button_close);
setPrehandler(file_->input_filename);
setPrehandler(file_->input_subcaption);
setPrehandler(file_->input_rotate_angle);
-
- string const choice_origin =
+
+ string const choice_origin =
"center|" // c
"leftTop|leftBottom|leftBaseline|" // lt lb lB
"centerTop|centerBottom|centerBaseline|" // ct cb cB
fl_addto_tabfolder(dialog_->tabfolder, _("Extras"), special_->form);
// set the right default unit
if (lyxrc.default_papersize < 3)
- defaultUnit = "in";
+ defaultUnit = "in";
}
else
igp.size_type = InsetGraphicsParams::SCALE;
- igp.width = getLyXLengthFromWidgets(size_->input_width,
+ igp.width = getLyXLengthFromWidgets(size_->input_width,
size_->choice_width_units);
igp.height = getLyXLengthFromWidgets(size_->input_height,
// the bb section
if (!controller().bbChanged) // different to the original one?
- igp.bb = string(); // don't write anything
+ igp.bb = string(); // don't write anything
else {
string bb;
if (getStringFromInput(bbox_->input_bb_x0).empty())
}
-void FormGraphics::update() {
+void FormGraphics::update() {
// Update dialog with details from inset
InsetGraphicsParams & igp = controller().params();
fl_get_button(file_->check_subcaption));
fl_set_button(file_->check_rotate, igp.rotate);
fl_set_input(file_->input_rotate_angle,
- tostr(igp.rotateAngle).c_str());
+ tostr(igp.rotateAngle).c_str());
if (igp.rotateOrigin.empty())
fl_set_choice(file_->choice_origin,1);
else
case InsetGraphicsParams::NONE:
fl_set_button(lyxview_->radio_nodisplay, 1);
break;
- }
+ }
updateWidgetsFromLength(lyxview_->input_lyxwidth,
lyxview_->choice_width_lyxwidth, igp.lyxwidth, defaultUnit);
updateWidgetsFromLength(lyxview_->input_lyxheight,
}
}
fl_set_button(size_->check_aspectratio, igp.keepAspectRatio);
-
- // the bb section
+
+ // the bb section
// set the bounding box values, if exists. First we need the whole
// path, because the controller knows nothing about the doc-dir
controller().bbChanged = false;
if (igp.bb.empty()) {
lyxerr[Debug::GRAPHICS] << "update:: no BoundingBox" << endl;
- string const fileWithAbsPath =
- MakeAbsPath(igp.filename, OnlyPath(igp.filename));
- string const bb = controller().readBB(fileWithAbsPath);
- if (!bb.empty()) {
+ string const fileWithAbsPath =
+ MakeAbsPath(igp.filename, OnlyPath(igp.filename));
+ string const bb = controller().readBB(fileWithAbsPath);
+ if (!bb.empty()) {
// get the values from the file
// in this case we always have the point-unit
fl_set_input(bbox_->input_bb_x0, token(bb,' ',0).c_str());
fl_set_input(bbox_->input_bb_y1, bb.c_str());
}
fl_set_choice(bbox_->choice_bb_units, 1); // "pt"
- } else { // get the values from the inset
+ } else { // get the values from the inset
lyxerr[Debug::GRAPHICS] << "update:: igp has BoundingBox" << endl;
controller().bbChanged = true;
LyXLength anyLength;
} // namespace anon
-
-
+
+
ButtonPolicy::SMInput FormGraphics::input(FL_OBJECT * ob, long)
{
// the file section
fl_set_input(file_->input_filename, out_name.c_str());
}
} else if (ob == file_->check_subcaption) {
- setEnabled(file_->input_subcaption,
+ setEnabled(file_->input_subcaption,
fl_get_button(file_->check_subcaption));
} else if (ob == file_->check_rotate) {
- setEnabled(file_->input_rotate_angle,
+ setEnabled(file_->input_rotate_angle,
fl_get_button(file_->check_rotate));
- setEnabled(file_->choice_origin,
+ setEnabled(file_->choice_origin,
fl_get_button(file_->check_rotate));
// the lyxview section
} else if (ob == lyxview_->radio_lyxasis) {
- setEnabled(lyxview_->input_lyxwidth, 0);
- setEnabled(lyxview_->choice_width_lyxwidth, 0);
- setEnabled(lyxview_->input_lyxheight, 0);
- setEnabled(lyxview_->choice_width_lyxheight, 0);
- setEnabled(lyxview_->input_lyxscale, 0);
+ setEnabled(lyxview_->input_lyxwidth, 0);
+ setEnabled(lyxview_->choice_width_lyxwidth, 0);
+ setEnabled(lyxview_->input_lyxheight, 0);
+ setEnabled(lyxview_->choice_width_lyxheight, 0);
+ setEnabled(lyxview_->input_lyxscale, 0);
} else if (ob == lyxview_->radio_lyxwh) {
- setEnabled(lyxview_->input_lyxwidth, 1);
- setEnabled(lyxview_->choice_width_lyxwidth, 1);
- setEnabled(lyxview_->input_lyxheight, 1);
- setEnabled(lyxview_->choice_width_lyxheight, 1);
- setEnabled(lyxview_->input_lyxscale, 0);
+ setEnabled(lyxview_->input_lyxwidth, 1);
+ setEnabled(lyxview_->choice_width_lyxwidth, 1);
+ setEnabled(lyxview_->input_lyxheight, 1);
+ setEnabled(lyxview_->choice_width_lyxheight, 1);
+ setEnabled(lyxview_->input_lyxscale, 0);
} else if (ob == lyxview_->radio_lyxscale) {
- setEnabled(lyxview_->input_lyxwidth, 0);
- setEnabled(lyxview_->choice_width_lyxwidth, 0);
- setEnabled(lyxview_->input_lyxheight, 0);
- setEnabled(lyxview_->choice_width_lyxheight, 0);
- setEnabled(lyxview_->input_lyxscale, 1);
+ setEnabled(lyxview_->input_lyxwidth, 0);
+ setEnabled(lyxview_->choice_width_lyxwidth, 0);
+ setEnabled(lyxview_->input_lyxheight, 0);
+ setEnabled(lyxview_->choice_width_lyxheight, 0);
+ setEnabled(lyxview_->input_lyxscale, 1);
} else if (ob == lyxview_->button_latex_values) {
- if (contains(fl_get_choice_text(size_->choice_width_units),'%'))
+ if (contains(fl_get_choice_text(size_->choice_width_units),'%'))
Alert::alert(_("Warning!"),
_("The units t%, p%, c% and l% are not allowed here."),
_("Cannot use the values from LaTeX size!"));
else {
- LyXLength dummy =
+ LyXLength dummy =
getLyXLengthFromWidgets(size_->input_width,
size_->choice_width_units);
- updateWidgetsFromLength(lyxview_->input_lyxwidth,
+ updateWidgetsFromLength(lyxview_->input_lyxwidth,
lyxview_->choice_width_lyxwidth,
dummy, defaultUnit);
- dummy = getLyXLengthFromWidgets(size_->input_height,
+ dummy = getLyXLengthFromWidgets(size_->input_height,
size_->choice_height_units);
- updateWidgetsFromLength(lyxview_->input_lyxheight,
+ updateWidgetsFromLength(lyxview_->input_lyxheight,
lyxview_->choice_width_lyxheight,
dummy, defaultUnit);
- string const scale = getStringFromInput(size_->input_scale);
- fl_set_input(lyxview_->input_lyxscale, scale.c_str());
- if (fl_get_button (size_->radio_asis) == 1) {
- fl_set_button (lyxview_->radio_lyxasis, 1);
+ string const scale = getStringFromInput(size_->input_scale);
+ fl_set_input(lyxview_->input_lyxscale, scale.c_str());
+ if (fl_get_button (size_->radio_asis) == 1) {
+ fl_set_button (lyxview_->radio_lyxasis, 1);
+ setEnabled(lyxview_->input_lyxwidth, 0);
+ setEnabled(lyxview_->choice_width_lyxwidth, 0);
+ setEnabled(lyxview_->input_lyxheight, 0);
+ setEnabled(lyxview_->choice_width_lyxheight, 0);
+ setEnabled(lyxview_->input_lyxscale, 0);
+ } else if (fl_get_button (size_->radio_wh) == 1) {
+ fl_set_button (lyxview_->radio_lyxwh, 1);
+ setEnabled(lyxview_->input_lyxwidth, 1);
+ setEnabled(lyxview_->choice_width_lyxwidth, 1);
+ setEnabled(lyxview_->input_lyxheight, 1);
+ setEnabled(lyxview_->choice_width_lyxheight, 1);
+ setEnabled(lyxview_->input_lyxscale, 0);
+ } else if (fl_get_button (size_->radio_scale) ==1) {
+ fl_set_button (lyxview_->radio_lyxscale, 1);
setEnabled(lyxview_->input_lyxwidth, 0);
- setEnabled(lyxview_->choice_width_lyxwidth, 0);
- setEnabled(lyxview_->input_lyxheight, 0);
- setEnabled(lyxview_->choice_width_lyxheight, 0);
- setEnabled(lyxview_->input_lyxscale, 0);
- } else if (fl_get_button (size_->radio_wh) == 1) {
- fl_set_button (lyxview_->radio_lyxwh, 1);
- setEnabled(lyxview_->input_lyxwidth, 1);
- setEnabled(lyxview_->choice_width_lyxwidth, 1);
- setEnabled(lyxview_->input_lyxheight, 1);
- setEnabled(lyxview_->choice_width_lyxheight, 1);
- setEnabled(lyxview_->input_lyxscale, 0);
- } else if (fl_get_button (size_->radio_scale) ==1) {
- fl_set_button (lyxview_->radio_lyxscale, 1);
- setEnabled(lyxview_->input_lyxwidth, 0);
- setEnabled(lyxview_->choice_width_lyxwidth, 0);
- setEnabled(lyxview_->input_lyxheight, 0);
- setEnabled(lyxview_->choice_width_lyxheight, 0);
- setEnabled(lyxview_->input_lyxscale, 1);
- }
+ setEnabled(lyxview_->choice_width_lyxwidth, 0);
+ setEnabled(lyxview_->input_lyxheight, 0);
+ setEnabled(lyxview_->choice_width_lyxheight, 0);
+ setEnabled(lyxview_->input_lyxscale, 1);
+ }
}
// the bb section
- } else if (!controller().bbChanged &&
+ } else if (!controller().bbChanged &&
(ob == bbox_->choice_bb_units ||
ob == bbox_->input_bb_x0 || ob == bbox_->input_bb_y0 ||
ob == bbox_->input_bb_x1 || ob == bbox_->input_bb_y1)) {
- controller().bbChanged = true;
+ controller().bbChanged = true;
} else if (ob == bbox_->button_getBB) {
string const filename = getStringFromInput(file_->input_filename);
if (!filename.empty()) {
- string const fileWithAbsPath = MakeAbsPath(filename, OnlyPath(filename));
+ string const fileWithAbsPath = MakeAbsPath(filename, OnlyPath(filename));
string bb = controller().readBB(fileWithAbsPath);
if (!bb.empty()) {
fl_set_input(bbox_->input_bb_x0, token(bb,' ',0).c_str());
// the size section
} else if (ob == size_->radio_asis) {
- setEnabled(size_->input_width, 0);
- setEnabled(size_->choice_width_units, 0);
- setEnabled(size_->input_height, 0);
- setEnabled(size_->choice_height_units, 0);
+ setEnabled(size_->input_width, 0);
+ setEnabled(size_->choice_width_units, 0);
+ setEnabled(size_->input_height, 0);
+ setEnabled(size_->choice_height_units, 0);
setEnabled(size_->check_aspectratio, 0);
- setEnabled(size_->input_scale, 0);
+ setEnabled(size_->input_scale, 0);
} else if (ob == size_->radio_wh) {
- setEnabled(size_->input_width, 1);
- setEnabled(size_->choice_width_units, 1);
- setEnabled(size_->input_height, 1);
- setEnabled(size_->choice_height_units, 1);
+ setEnabled(size_->input_width, 1);
+ setEnabled(size_->choice_width_units, 1);
+ setEnabled(size_->input_height, 1);
+ setEnabled(size_->choice_height_units, 1);
setEnabled(size_->check_aspectratio, 1);
- setEnabled(size_->input_scale, 0);
+ setEnabled(size_->input_scale, 0);
} else if (ob == size_->radio_scale) {
- setEnabled(size_->input_width, 0);
- setEnabled(size_->choice_width_units, 0);
- setEnabled(size_->input_height, 0);
- setEnabled(size_->choice_height_units, 0);
+ setEnabled(size_->input_width, 0);
+ setEnabled(size_->choice_width_units, 0);
+ setEnabled(size_->input_height, 0);
+ setEnabled(size_->choice_height_units, 0);
setEnabled(size_->check_aspectratio, 0);
- setEnabled(size_->input_scale, 1);
+ setEnabled(size_->input_scale, 1);
} else if (ob == size_->button_lyx_values) {
LyXLength dummy = getLyXLengthFromWidgets(lyxview_->input_lyxwidth,
lyxview_->choice_width_lyxwidth);
// deactivate OK/ Apply buttons and
// spit out warnings if invalid
- if (ob == bbox_->input_bb_x0 || ob == bbox_->input_bb_x1 ||
- ob == bbox_->input_bb_y0 || ob == bbox_->input_bb_y1 ||
- ob == size_->input_width || ob == size_->input_height ||
+ if (ob == bbox_->input_bb_x0 || ob == bbox_->input_bb_x1 ||
+ ob == bbox_->input_bb_y0 || ob == bbox_->input_bb_y1 ||
+ ob == size_->input_width || ob == size_->input_height ||
ob == lyxview_->input_lyxwidth || ob == lyxview_->input_lyxheight) {
if (invalid) {
postWarning(_("Invalid Length!"));
#ifdef __GNUG__
#pragma interface
-#endif
+#endif
#include "FormBase.h"
#include "RadioButtonGroup.h"
fl_set_button(dialog_->check_visiblespace, 0);
setEnabled(dialog_->check_visiblespace, false);
}
-
+
if (cmdname.empty())
fl_set_button(dialog_->radio_useinclude, 1);
}
type = ControlInclude::INCLUDE;
string const in_name = fl_get_input(dialog_->input_filename);
- fl_freeze_form(form());
+ fl_freeze_form(form());
string const out_name = controller().Browse(in_name, type);
fl_set_input(dialog_->input_filename, out_name.c_str());
- fl_unfreeze_form(form());
+ fl_unfreeze_form(form());
} else if (ob == dialog_->button_load) {
string const in_name = fl_get_input(dialog_->input_filename);
if (strip(in_name).empty())
action = ButtonPolicy::SMI_INVALID;
}
-
+
return action;
}
fl_set_input_return(dialog_->input_key, FL_RETURN_CHANGED);
setPrehandler(dialog_->input_key);
- // Manage the ok, apply, restore and cancel/close buttons
+ // Manage the ok, apply, restore and cancel/close buttons
bc().setOK(dialog_->button_ok);
bc().setApply(dialog_->button_apply);
bc().setCancel(dialog_->button_close);
FormInset::disconnect();
}
-
+
void FormCommand::showInset(InsetCommand * inset)
{
if (inset == 0) return; // maybe we should Assert this?
/// pointer to the inset passed through showInset
InsetCommand * inset_;
/// the nitty-griity. What is modified and passed back
- InsetCommandParams params;
+ InsetCommandParams params;
};
#endif
#include <config.h>
#include <algorithm>
#include <iomanip>
-
+
#include XPM_H_LOCATION
#ifdef __GNUG__
extern "C" void C_FormBaseDeprecatedCancelCB(FL_OBJECT *, long);
extern "C" void C_FormBaseDeprecatedInputCB(FL_OBJECT *, long);
-FormMathsBitmap::FormMathsBitmap(LyXView * lv, Dialogs * d,
+FormMathsBitmap::FormMathsBitmap(LyXView * lv, Dialogs * d,
FormMathsPanel const & p, string const & t,
vector<string> const & l)
: FormMathsSub(lv, d, p, t, false),
y_ = max(y_, obj->y + obj->h);
}
-
+
char const * const label = N_("Close|^[");
x_ = (form_->w - 90) / 2;
y_ += 10;
unsigned char const * data, bool vert)
{
// Add a bitmap to a button panel: one bitmap per panel.
- // nt is the number of buttons and nx, ny the nr. of buttons
+ // nt is the number of buttons and nx, ny the nr. of buttons
// in x and y direction.
// bw, bh and data are the bitmap dimensions width, height and
// bit pattern; these come directly from an .xbm file included
// vert indicates whether the next button panel within this
// window will be below (true, default) or next to this one.
//
- // The scaling of the bitmap on top of the buttons will be
+ // The scaling of the bitmap on top of the buttons will be
// correct if the nx, ny values are given correctly.
int wx = bw + ww_ / 2;
int wy = bh + ww_ / 2;
{
int const i = GetIndex(ob);
- if (i < 0)
+ if (i < 0)
return false;
latex_chosen_ = latex_[i];
#include "LString.h"
#include "FormMathsPanel.h"
-/**
+/**
* This class provides an XForms implementation of a maths bitmap form.
*/
class FormMathsBitmap : public FormMathsSub {
typedef lyx::shared_c_ptr<FL_OBJECT> bm_ptr;
///
typedef lyx::shared_c_ptr<FL_FORM> fl_ptr;
-
+
///
FormMathsBitmap(LyXView *, Dialogs * d, FormMathsPanel const &,
string const &, std::vector<string> const &);
static char const * decoration_names[] = {
- "widehat", "widetilde", "overbrace", "overleftarrow", "overrightarrow",
+ "widehat", "widetilde", "overbrace", "overleftarrow", "overrightarrow",
"overline", "underbrace", "underline", "underleftarrow", "underrightarrow",
"underleftrightarrow", "overleftrightarrow",
"hat", "acute", "bar", "dot",
- "check", "grave", "vec", "ddot",
+ "check", "grave", "vec", "ddot",
"breve", "tilde"
};
static int const nr_decoration_names = sizeof(decoration_names) / sizeof(char const *);
-
+
FormMathsDeco::FormMathsDeco(LyXView * lv, Dialogs * d,
FormMathsPanel const & p)
: FormMathsSub(lv, d, p, _("Maths Decorations & Accents"), false)
FL_FORM * FormMathsDeco::form() const
{
if (dialog_.get())
- return dialog_->form;
+ return dialog_->form;
return 0;
}
if (deco_ < 0)
return false;
//if (ob == dialog_->bmtable_deco1)
- // deco_ += 0;
+ // deco_ += 0;
if (ob == dialog_->bmtable_deco2)
deco_ += 10;
apply();
// -*- C++ -*-
-/**
+/**
* \file FormMathsDeco.h
* Copyright 2001 The LyX Team.
* See the file COPYING.
- *
- * \author Alejandro Aguilar Sierra
+ *
+ * \author Alejandro Aguilar Sierra
* \author John Levon, moz@compsoc.man.ac.uk
* \author Angus Leeming, a.leeming@ic.ac.uk
*/
struct FD_form_maths_deco;
-/**
+/**
* This class provides an XForms implementation of the maths deco.
*/
class FormMathsDeco : public FormMathsSub {
// build the form
FD_form_maths_deco * build_maths_deco();
-
+
// Real GUI implementation
boost::scoped_ptr<FD_form_maths_deco> dialog_;
#include "delim.xbm"
#include "delim0.xpm"
-static int const delim_rversion[] = {
+static int const delim_rversion[] = {
1,1,3,3,4,5,7,7,9,9,10,11,
13,13,14,15,16,17,19,19,20,21,22,23 };
-
+
static char const * delim_values[] = {
"(", ")", "lceil", "rceil", "uparrow", "Uparrow",
"[", "]", "lfloor", "rfloor", "updownarrow", "Updownarrow",
using std::endl;
-FormMathsDelim::FormMathsDelim(LyXView * lv, Dialogs * d,
+FormMathsDelim::FormMathsDelim(LyXView * lv, Dialogs * d,
FormMathsPanel const & p)
: FormMathsSub(lv, d, p, _("Maths Delimiters"), false)
{}
FL_FORM * FormMathsDelim::form() const
{
if (dialog_.get())
- return dialog_->form;
+ return dialog_->form;
return 0;
}
void FormMathsDelim::build()
{
dialog_.reset(build_maths_delim());
-
+
fl_set_button(dialog_->radio_left, 1);
fl_set_pixmap_data(dialog_->button_pix, const_cast<char**>(delim0));
dialog_->radio_left->u_ldata = 0;
dialog_->radio_right->u_ldata = 1;
dialog_->radio_both->u_ldata = 2;
-
+
fl_set_bmtable_data(dialog_->bmtable, 6, 4,
delim_width, delim_height, delim_bits);
fl_set_bmtable_maxitems(dialog_->bmtable, 23);
int const button = fl_get_bmtable_numb(dialog_->bmtable);
bool const both = (button == FL_MIDDLE_MOUSE ||
fl_get_button(dialog_->radio_both) != 0);
-
+
if (i >= 0) {
if (side || (button == FL_RIGHT_MOUSE))
right = i;
right = delim_rversion[i];
}
}
-
+
Pixmap p1, p2;
-
+
p1 = fl_get_pixmap_pixmap(dialog_->button_pix, &p1, &p2);
fl_draw_bmtable_item(dialog_->bmtable, left, p1, 0, 0);
fl_draw_bmtable_item(dialog_->bmtable, right, p1, 16, 0);
fl_redraw_object(dialog_->button_pix);
-
+
dialog_->radio_left->u_ldata = left;
dialog_->radio_right->u_ldata = right;
// -*- C++ -*-
-/**
+/**
* \file FormMathsDelim.h
* Copyright 2001 The LyX Team.
* See the file COPYING.
- *
- * \author Alejandro Aguilar Sierra
+ *
+ * \author Alejandro Aguilar Sierra
* \author John Levon, moz@compsoc.man.ac.uk
* \author Angus Leeming, a.leeming@ic.ac.uk
*/
struct FD_form_maths_delim;
-/**
+/**
* This class provides an XForms implementation of the maths delim.
*/
class FormMathsDelim : public FormMathsSub {
// build the form
FD_form_maths_delim * build_maths_delim();
-
+
// Real GUI implementation
boost::scoped_ptr<FD_form_maths_delim> dialog_;
};
extern "C" {
-
+
static
int C_FormMathsMatrixAlignFilter(FL_OBJECT * ob, char const *,
char const * cur, int c)
lyx::Assert(pre);
return pre->AlignFilter(cur, c);
}
-
+
}
FL_FORM * FormMathsMatrix::form() const
{
if (dialog_.get())
- return dialog_->form;
+ return dialog_->form;
return 0;
}
char const * sh = fl_get_input(dialog_->input_halign);
int const nx = int(fl_get_slider_value(dialog_->slider_columns) + 0.5);
int const ny = int(fl_get_slider_value(dialog_->slider_rows) + 0.5);
-
+
ostringstream ost;
ost << nx << ' ' << ny << ' ' << c << ' ' << sh;
-
+
lv_->getLyXFunc()->dispatch(LFUN_INSERT_MATRIX, ost.str().c_str());
}
int const nx = int(fl_get_slider_value(dialog_->slider_columns)+0.5);
for (int i = 0; i < nx; ++i)
h_align_str[i] = 'c';
-
+
h_align_str[nx] = '\0';
fl_set_input(dialog_->input_halign, h_align_str);
int FormMathsMatrix::AlignFilter(char const * cur, int c)
{
size_t len = strlen(cur);
-
+
int const n = int(fl_get_slider_value(dialog_->slider_columns) + 0.5) -
int(len) +
int(lyx::count(cur, cur + len, '|'));
if (c == 'c' || c == 'l' || c == 'r' || c == '|')
return FL_VALID;
-
+
return FL_INVALID;
}
// -*- C++ -*-
-/**
+/**
* \file FormMathsMatrix.h
* Copyright 2001 The LyX Team.
* See the file COPYING.
- *
- * \author Alejandro Aguilar Sierra
+ *
+ * \author Alejandro Aguilar Sierra
* \author John Levon, moz@compsoc.man.ac.uk
* \author Angus Leeming, a.leeming@ic.ac.uk
*/
struct FD_form_maths_matrix;
-/**
+/**
* This class provides an XForms implementation of the maths matrix.
*/
class FormMathsMatrix : public FormMathsSub {
// build the form
FD_form_maths_matrix * build_maths_matrix();
-
+
// Real GUI implementation
boost::scoped_ptr<FD_form_maths_matrix> dialog_;
};
style_.reset( new FormMathsStyle( lv, d, *this));
typedef vector<string> StringVec;
-
+
StringVec latex(nr_latex_arrow);
for (StringVec::size_type i = 0; i < latex.size(); ++i) {
latex[i] = latex_arrow[i];
FL_FORM * FormMathsPanel::form() const
{
if (dialog_.get())
- return dialog_->form;
+ return dialog_->form;
return 0;
}
void FormMathsPanel::build()
{
dialog_.reset(build_maths_panel());
-
+
for (int i = 0; i < nr_function_names; ++i)
fl_add_browser_line(dialog_->browser_funcs,
function_names[i]);
-
+
fl_set_pixmap_data(dialog_->button_sqrt,
const_cast<char**>(sqrt_xpm));
fl_set_pixmap_data(dialog_->button_frac,
arrow_->addBitmap(7, 2, 4, larrow_width, larrow_height, larrow_bits,
false);
arrow_->addBitmap(4, 2, 2, darrow_width, darrow_height, darrow_bits);
-
+
boperator_->addBitmap(31, 4, 8, bop_width, bop_height, bop_bits);
brelats_->addBitmap(35, 4, 9, brel_width, brel_height, brel_bits);
misc_->addBitmap(5, 5, 1, misc4_width, misc4_height, misc4_bits);
misc_->addBitmap(6, 3, 2, misc2_width, misc2_height, misc2_bits, false);
misc_->addBitmap(4, 2, 2, misc3_width, misc3_height, misc3_bits);
-
+
dots_->addBitmap(4, 4, 1, dots_width, dots_height, dots_bits);
varsize_->addBitmap(14, 3, 5, varsz_width, varsz_height, varsz_bits);
ams_misc_->addBitmap(9, 5, 2, ams1_width, ams1_height, ams1_bits);
ams_misc_->addBitmap(26, 3, 9, ams7_width, ams7_height, ams7_bits);
-
+
ams_arrows_->addBitmap(32, 3, 11, ams2_width, ams2_height, ams2_bits);
ams_arrows_->addBitmap(6, 3, 2, ams3_width, ams3_height, ams3_bits);
ams_rel_->addBitmap(66, 6, 11, ams_rel_width, ams_rel_height, ams_rel_bits);
ams_nrel_->addBitmap(51, 6, 9, ams_nrel_width, ams_nrel_height, ams_nrel_bits);
-
+
ams_ops_->addBitmap(23, 3, 8, ams_ops_width, ams_ops_height, ams_ops_bits);
bc().setCancel(dialog_->button_close);
active_->hide();
dots_->show();
break;
-
+
case MM_VARSIZE:
if (active_ && active_ != varsize_.get())
active_->hide();
active_->hide();
ams_misc_->show();
break;
-
+
case MM_AMS_ARROWS:
if (active_ && active_ != ams_arrows_.get())
active_->hide();
void FormMathsPanel::insertSymbol(string const & sym, bool bs) const
{
- if (bs)
+ if (bs)
lv_->getLyXFunc()->dispatch(LFUN_INSERT_MATH, '\\' + sym);
- else
+ else
lv_->getLyXFunc()->dispatch(LFUN_INSERT_MATH, sym);
}
// -*- C++ -*-
-/**
+/**
* \file FormMathsPanel.h
* Copyright 2001 The LyX Team.
* See the file COPYING.
- *
- * \author Alejandro Aguilar Sierra
+ *
+ * \author Alejandro Aguilar Sierra
* \author John Levon, moz@compsoc.man.ac.uk
* \author Angus Leeming, a.leeming@ic.ac.uk
*/
class FormMathsSub;
struct FD_form_maths_panel;
-/// values used by the xforms callbacks
+/// values used by the xforms callbacks
enum MathsCallbackValues {
MM_GREEK,
MM_ARROW,
MM_AMS_OPS,
MM_FUNC
};
-
-/**
+
+/**
* This class provides an XForms implementation of the maths panel.
*/
class FormMathsPanel : public FormBaseBD {
FormMathsPanel(LyXView *, Dialogs *);
///
void setActive(FormMathsSub *) const;
- /// dispatch a symbol insert
+ /// dispatch a symbol insert
void insertSymbol(string const & sym, bool bs = true) const;
/// dispatch an LFUN:
void dispatchFunc(kb_action action) const;
private:
/// Pointer to the actual instantiation of the ButtonController.
virtual xformsBC & bc();
-
+
/// Build the dialog
virtual void build();
/// input handler
virtual bool input(FL_OBJECT *, long);
-
+
/// Pointer to the actual instantiation of the xforms form
virtual FL_FORM * form() const;
// build the panels
FD_form_maths_panel * build_maths_panel();
-
+
/// send LFUN_MATH_DISPLAY
void mathDisplay() const;
FL_FORM * FormMathsSpace::form() const
{
if (dialog_.get())
- return dialog_->form;
+ return dialog_->form;
return 0;
}
bool FormMathsSpace::input(FL_OBJECT *, long data)
{
space_ = -1;
-
+
if (data >= 0 && data < 6) {
space_ = short(data);
apply();
// -*- C++ -*-
-/**
+/**
* \file FormMathsSpace.h
* Copyright 2001 The LyX Team.
* See the file COPYING.
- *
- * \author Alejandro Aguilar Sierra
+ *
+ * \author Alejandro Aguilar Sierra
* \author John Levon, moz@compsoc.man.ac.uk
* \author Angus Leeming, a.leeming@ic.ac.uk
*/
struct FD_form_maths_space;
-/**
+/**
* This class provides an XForms implementation of the maths space.
*/
class FormMathsSpace : public FormMathsSub {
// build the form
FD_form_maths_space * build_maths_space();
-
+
// Real GUI implementation
boost::scoped_ptr<FD_form_maths_space> dialog_;
FL_FORM * FormMathsStyle::form() const
{
if (dialog_.get())
- return dialog_->form;
+ return dialog_->form;
return 0;
}
void FormMathsStyle::apply()
{
- if ((style_ >= 0) && (style_ < 4))
+ if ((style_ >= 0) && (style_ < 4))
parent_.insertSymbol(latex_mathstyle[style_]);
- else if ((style_ >= 4) && (style_ < 14))
+ else if ((style_ >= 4) && (style_ < 14))
parent_.dispatchFunc(latex_mathfontcmds[style_ - 4]);
}
{
style_ = fl_get_bmtable(ob);
if (style_ < 0) return false;
- //if (ob == dialog_->bmtable_style1) style_ += 0;
+ //if (ob == dialog_->bmtable_style1) style_ += 0;
if (ob == dialog_->bmtable_style2) style_ += 1;
if (ob == dialog_->bmtable_font1) style_ += 4;
if (ob == dialog_->bmtable_font2) style_ += 9;
// -*- C++ -*-
-/**
+/**
* \file FormMathsStyle.h
* Copyright 2001 The LyX Team.
* See the file COPYING.
- *
- * \author Alejandro Aguilar Sierra
+ *
+ * \author Alejandro Aguilar Sierra
* \author John Levon, moz@compsoc.man.ac.uk
* \author Angus Leeming, a.leeming@ic.ac.uk
*/
struct FD_form_maths_style;
-/**
+/**
* This class provides an XForms implementation of the maths style.
*/
class FormMathsStyle : public FormMathsSub {
// build the form
FD_form_maths_style * build_maths_style();
-
+
// Real GUI implementation
boost::scoped_ptr<FD_form_maths_style> dialog_;
ButtonPolicy::SMInput action = ButtonPolicy::SMI_NOOP;
- if (ob == dialog_->radio_top ||
+ if (ob == dialog_->radio_top ||
ob == dialog_->radio_middle ||
ob == dialog_->radio_bottom ||
ob == dialog_->choice_width_units)
"| Medskip | Bigskip | VFill | Length "));
fl_addto_choice(dialog_->choice_space_below,
_(" None | Defskip | Smallskip "
- "| Medskip | Bigskip | VFill | Length "));
+ "| Medskip | Bigskip | VFill | Length "));
fl_addto_choice(dialog_->choice_linespacing,
_(" Default | Single | OneHalf | Double | Other "));
bc_.addReadOnly(dialog_->input_space_below);
bc_.addReadOnly(dialog_->check_space_below);
bc_.addReadOnly(dialog_->choice_linespacing);
- bc_.addReadOnly(dialog_->input_linespacing);
+ bc_.addReadOnly(dialog_->input_linespacing);
bc_.addReadOnly(dialog_->check_noindent);
bc_.addReadOnly(dialog_->input_labelwidth);
}
fl_set_choice(choice_type, 1);
}
-} // namespace anon
+} // namespace anon
void FormParagraph::apply()
align = LYX_ALIGN_RIGHT;
else if (fl_get_button(dialog_->radio_align_center))
align = LYX_ALIGN_CENTER;
- else
+ else
align = LYX_ALIGN_BLOCK;
string const labelwidthstring =
align, labelwidthstring, noindent);
// Actually apply these settings
- lv_->view()->update(text,
+ lv_->view()->update(text,
BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE);
lv_->buffer()->markDirty();
setMinibuffer(lv_, _("Paragraph layout set"));
fl_set_button(check_keep, space.keep());
}
-} // namespace anon
+} // namespace anon
void FormParagraph::update()
dialog_->input_space_above,
dialog_->choice_value_space_above,
dialog_->check_space_above);
-
+
setWidgetsFromVSpace(par_->params().spaceBottom(),
dialog_->choice_space_below,
dialog_->input_space_below,
dialog_->choice_value_space_below,
dialog_->check_space_below);
-
+
fl_set_button(dialog_->check_noindent,
par_->params().noindent());
}
}
}
}
-
+
bool validSpaceWidgets(FL_OBJECT * choice_type, FL_OBJECT * input_length)
{
// Paranoia check!
} // namespace anon
-
+
bool FormParagraph::input(FL_OBJECT * ob, long)
{
clearMessage();
Paragraph const * getCurrentParagraph() const;
///
virtual FL_FORM * form() const;
-
+
/// Fdesign generated method
FD_form_paragraph * build_paragraph();
///
FormPreamble(ControlPreamble &);
private:
- /// Apply from dialog
+ /// Apply from dialog
virtual void apply();
/// Build the dialog
virtual void build();
/// Update the dialog
virtual void update();
-
+
/// Fdesign generated method
FD_form_preamble * build_preamble();
};
FormPreferences::FormPreferences(LyXView * lv, Dialogs * d)
: FormBaseBI(lv, d, _("Preferences"), false),
colors_(*this), converters_(*this), inputs_misc_(*this),
- formats_(*this), interface_(*this), language_(*this),
+ formats_(*this), interface_(*this), language_(*this),
lnf_misc_(*this), outputs_misc_(*this), paths_(*this),
printer_(*this), screen_fonts_(*this), spelloptions_(*this)
{
AddName(user_lyxdir, "preferences.xform");
colors_.modifiedXformsPrefs = !XformsColor::write(filename);
}
-
+
lv_->getLyXFunc()->dispatch(LFUN_SAVEPREFERENCES);
}
// 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());
bool FormPreferences::input(FL_OBJECT * ob, long)
{
lyx::Assert(ob);
-
+
// whatever checks you need to ensure the user hasn't entered
// some totally ridiculous value somewhere. Change activate to suit.
// comments before each test describe what is _valid_
void FormPreferences::update()
{
if (!dialog_.get()) return;
-
+
// read lyxrc entries
colors_.update();
formats_.update(); // Must be before converters_.update()
if (modifiedXformsPrefs) {
for (vector<XformsColor>::const_iterator cit =
- xformsColorDB.begin();
+ xformsColorDB.begin();
cit != xformsColorDB.end(); ++cit) {
fl_mapcolor(cit->colorID, cit->r, cit->g, cit->b);
// Create a valid X11 name of the form "#rrggbb"
string const hexname = X11hexname(cit->color());
-
+
if (lcolor.getX11Name(lc) != hexname) {
lyxerr[Debug::GUI]
<< "FormPreferences::Colors::apply: "
fl_set_slider_bounds(dialog_->slider_value, 0.0, 1.0);
fl_set_slider_step(dialog_->slider_value, 0.01);
fl_set_slider_return(dialog_->slider_value, FL_RETURN_CHANGED);
-
+
fl_set_slider_bounds(dialog_->slider_red, 0.0, 255.0);
fl_set_slider_step(dialog_->slider_red, 1.0);
fl_set_slider_return(dialog_->slider_red, FL_RETURN_CHANGED);
-
+
fl_set_slider_bounds(dialog_->slider_green, 0.0, 255.0);
fl_set_slider_step(dialog_->slider_green, 1.0);
fl_set_slider_return(dialog_->slider_green, FL_RETURN_CHANGED);
-
+
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);
{
if (ob == dialog_->browser_lyx_objs) {
InputBrowserLyX();
-
+
} else if (ob == dialog_->dial_hue ||
ob == dialog_->slider_saturation ||
ob == dialog_->slider_value) {
// Display either RGB or HSV but not both!
SwitchColorSpace();
-
+
// Deactivate the modify button to begin with...
setEnabled(dialog_->button_modify, false);
-
+
fl_unfreeze_form(dialog_->form);
}
int const h = int(hue);
int const s = int(100.0 * sat);
int const v = int(100.0 * val);
-
+
string const label = tostr(h) + string(", ") + tostr(s) + string(", ") +
tostr(v);
fl_set_object_label(dialog_->text_color_values, label.c_str());
RGBColor col = HSVColor(hue, sat, val);
-
+
fl_freeze_form(dialog_->form);
fl_mapcolor(GUI_COLOR_CHOICE, col.r, col.g, col.b);
fl_unfreeze_form(dialog_->form);
if (selLyX < 1) return;
-
+
fl_getmcolor(GUI_COLOR_CHOICE, &col.r, &col.g, &col.b);
bool modify = false;
-
+
// Is the choice an Xforms color...
if (selLyX - 1 < xformsColorDB.size()) {
vector<XformsColor>::size_type const i = selLyX - 1;
string const label = tostr(red) + string(", ") + tostr(green) +
string(", ") + tostr(blue);
fl_set_object_label(dialog_->text_color_values, label.c_str());
-
+
fl_freeze_form(dialog_->form);
RGBColor col = RGBColor(red, green, blue);
fl_unfreeze_form(dialog_->form);
if (selLyX < 1) return;
-
+
bool modify = false;
-
+
// Is the choice an Xforms color...
if (selLyX - 1 < xformsColorDB.size()) {
vector<XformsColor>::size_type const i = selLyX - 1;
}
fl_freeze_form(dialog_->form);
- setEnabled(dialog_->button_modify, false);
+ setEnabled(dialog_->button_modify, false);
fl_unfreeze_form(dialog_->form);
}
HSVColor hsv = HSVColor(col);
hsv.h = max(hsv.h, 0.0);
-
+
fl_set_dial_value(dialog_->dial_hue, hsv.h);
fl_set_slider_value(dialog_->slider_saturation, hsv.s);
fl_set_slider_value(dialog_->slider_value, hsv.v);
string const label = tostr(h) + string(", ") + tostr(s) +
string(", ") + tostr(v);
fl_set_object_label(dialog_->text_color_values, label.c_str());
-
+
} else {
fl_show_object(dialog_->slider_red);
fl_show_object(dialog_->slider_blue);
string(", ") + tostr(b);
fl_set_object_label(dialog_->text_color_values, label.c_str());
}
-
+
fl_unfreeze_form(dialog_->form);
}
}
-bool FormPreferences::Converters::Browser()
+bool FormPreferences::Converters::Browser()
{
int const i = fl_get_browser(dialog_->browser_all);
if (i <= 0) return false;
setEnabled(dialog_->button_add, false);
setEnabled(dialog_->button_delete, true);
-
+
fl_unfreeze_form(dialog_->form);
return false;
}
string const from = GetFrom();
string const to = GetTo();
int const sel = local_converters.getNumber(from, to);
-
+
fl_freeze_form(dialog_->form);
if (sel < 0) {
fl_set_object_label(dialog_->button_add, idex(_("Add|#A")));
- fl_set_button_shortcut(dialog_->button_add,
+ fl_set_button_shortcut(dialog_->button_add,
scex(_("Add|#A")), 1);
fl_deselect_browser(dialog_->browser_all);
fl_set_object_label(dialog_->button_add, idex(_("Modify|#M")));
fl_set_button_shortcut(dialog_->button_add,
scex(_("Modify|#M")), 1);
-
+
int top = max(sel-5, 0);
fl_set_browser_topline(dialog_->browser_all, top);
fl_select_browser_line(dialog_->browser_all, sel+1);
}
-bool FormPreferences::Formats::Browser()
+bool FormPreferences::Formats::Browser()
{
int const i = fl_get_browser(dialog_->browser_all);
if (i <= 0) return false;
setEnabled(dialog_->button_add, false);
setEnabled(dialog_->button_delete, true);
-
+
fl_unfreeze_form(dialog_->form);
return false;
}
parent_.browse(dialog_->input_bind_file,
N_("Bind file"), "*.bind", dir1, dir2);
-
+
} else if (ob == dialog_->button_ui_file_browse) {
string dir = AddName(system_lyxdir, "ui");
string name = N_("Sys UI|#S#s");
parent_.browse(dialog_->input_ui_file,
N_("UI file"), "*.ui", dir1, dir2);
}
-
+
return true;
}
lyxrc.primary_kbmap = name_1;
lyxrc.secondary_kbmap = name_2;
}
-
+
button = fl_get_button(dialog_->check_rtl_support);
lyxrc.rtl_support = static_cast<bool>(button);
// to use its address in a block-if statement.
// No it's not! Leads to crash.
// setPrehandler(
- // reinterpret_cast<FL_OBJECT *>(combo_default_lang),
+ // reinterpret_cast<FL_OBJECT *>(combo_default_lang),
// C_FormPreferencesFeedbackCB);
setPrehandler(dialog_->input_kbmap1);
fl_set_input(dialog_->input_kbmap1, "");
fl_set_input(dialog_->input_kbmap2, "");
}
-
+
fl_set_button(dialog_->check_rtl_support, lyxrc.rtl_support);
fl_set_button(dialog_->check_mark_foreign,
lyxrc.mark_foreign_language);
void FormPreferences::LnFmisc::update()
{
fl_set_button(dialog_->check_banner, lyxrc.show_banner);
- fl_set_button(dialog_->check_auto_region_delete,
+ fl_set_button(dialog_->check_auto_region_delete,
lyxrc.auto_region_delete);
fl_set_button(dialog_->check_exit_confirm, lyxrc.exit_confirmation);
fl_set_button(dialog_->check_display_shrtcuts, lyxrc.display_shortcuts);
fl_set_input(dialog_->input_checktex,
lyxrc.chktex_command.c_str());
fl_set_input(dialog_->input_paperoption,
- lyxrc.view_dvi_paper_option.c_str());
+ lyxrc.view_dvi_paper_option.c_str());
fl_set_button(dialog_->check_autoreset_classopt,
lyxrc.auto_reset_options);
button = fl_get_button(dialog_->check_last_files);
str = fl_get_input(dialog_->input_lastfiles);
if (!button) str.erase();
-
+
lyxrc.check_lastfiles = button;
lyxrc.lastfiles = str;
lyxrc.num_lastfiles = static_cast<unsigned int>
bool FormPreferences::Paths::input(FL_OBJECT const * const ob)
{
bool activate = true;
-
+
// !ob if function is called from Paths::update() to de/activate
// objects,
// otherwise the function is called by an xforms CB via input().
parent_.browse(dialog_->input_serverpipe,
N_("LyX Server pipes"), string());
}
-
+
return activate;
}
if (lyxrc.check_lastfiles) str = lyxrc.lastfiles;
fl_set_button(dialog_->check_last_files,
- lyxrc.check_lastfiles);
+ lyxrc.check_lastfiles);
fl_set_input(dialog_->input_lastfiles, str.c_str());
fl_set_counter_value(dialog_->counter_lastfiles,
lyxrc.num_lastfiles);
changed = true;
lyxrc.dpi = ivalue;
}
-
+
double dvalue = strToDbl(fl_get_input(dialog_->input_tiny));
if (lyxrc.font_sizes[LyXFont::SIZE_TINY] != dvalue) {
changed = true;
setPrehandler(dialog_->input_huger);
}
-
+
string const
FormPreferences::ScreenFonts::feedback(FL_OBJECT const * const ob) const
{
str = lyxrc.getDescription(LyXRC::RC_SCREEN_FONT_ENCODING);
else if (ob == dialog_->counter_zoom)
str = lyxrc.getDescription(LyXRC::RC_SCREEN_ZOOM);
- else if (ob == dialog_->counter_dpi)
+ else if (ob == dialog_->counter_dpi)
str = lyxrc.getDescription(LyXRC::RC_SCREEN_DPI);
else if (ob == dialog_->input_tiny
|| ob == dialog_->input_script
if (!activate)
parent_.postWarning(str);
-
+
return activate;
}
string choice = fl_get_choice_text(dialog_->choice_spell_command);
choice = strip(frontStrip(choice));
-
+
lyxrc.isp_command = choice;
#if 0
choice = fl_get_input(dialog_->input_escape_chars);
if (button && choice.empty()) button = 0;
if (!button) choice.erase();
-
+
lyxrc.isp_use_esc_chars = static_cast<bool>(button);
lyxrc.isp_esc_chars = choice;
parent_.browse(dialog_->input_personal_dict,
N_("Personal dictionary"), "*.ispell");
}
-
+
return true; // All input is valid!
}
choice = 2;
#endif
fl_set_choice(dialog_->choice_spell_command, choice);
-
+
string str;
if (lyxrc.isp_use_alt_lang) str = lyxrc.isp_alt_lang;
fl_set_button(dialog_->check_alt_lang,
lyxrc.isp_use_alt_lang);
fl_set_input(dialog_->input_alt_lang, str.c_str());
-
+
str.erase();
if (lyxrc.isp_use_esc_chars) str = lyxrc.isp_esc_chars;
void FormPreferences::browse(FL_OBJECT * inpt,
string const & title,
- string const & pattern,
+ string const & pattern,
pair<string,string> const & dir1,
pair<string,string> const & dir2)
{
virtual void build();
/// Pointer to the actual instantiation of the xforms form.
virtual FL_FORM * form() const;
- /// control which feedback message is output
- string const getFeedback(FL_OBJECT *);
+ /// 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()),
+ string const & title, string const & pattern,
+ std::pair<string,string> const & dir1= std::make_pair(string(),string()),
std::pair<string,string> const & dir2 = std::make_pair(string(),string()));
-
+
/// Fdesign generated methods
FD_form_preferences * build_preferences();
///
void input(FL_OBJECT const * const);
///
void update() { LoadBrowserLyX(); }
-
+
/// Flag whether Xforms colors have changed since last file save
bool modifiedXformsPrefs;
};
///
friend class InputsMisc;
-
+
///
class Interface {
public:
};
///
friend class Language;
-
+
///
class LnFmisc {
public:
/** The tab folders.
*/
-
+
///
Colors colors_;
///
fl_set_button(dialog_->radio_printer, 0);
}
}
-
+
// if we type into file, select that as a target
- if (ob == dialog_->input_file && fl_get_button(dialog_->radio_printer)
+ if (ob == dialog_->input_file && fl_get_button(dialog_->radio_printer)
&& strlen(fl_get_input(dialog_->input_file))) {
fl_set_button(dialog_->radio_file, 1);
fl_set_button(dialog_->radio_printer, 0);
fl_set_button(dialog_->radio_file, 0);
fl_set_button(dialog_->radio_printer, 1);
}
-
+
return activate;
}
*/
class FormPrint : public FormCB<ControlPrint, FormDB<FD_form_print> > {
public:
- ///
+ ///
FormPrint(ControlPrint &);
private:
{
dialog_.reset(build_ref());
- for (int i = 0; !InsetRef::types[i].latex_name.empty(); ++i)
+ for (int i = 0; !InsetRef::types[i].latex_name.empty(); ++i)
fl_addto_choice(dialog_->choice_type,
_(InsetRef::types[i].gui_name.c_str()));
controller().params().getContents().c_str());
fl_set_input(dialog_->input_name,
controller().params().getOptions().c_str());
- fl_set_choice(dialog_->choice_type,
+ fl_set_choice(dialog_->choice_type,
InsetRef::getType(controller().params().getCmdName()) + 1);
at_ref_ = false;
vector<string> const buffers = controller().getBufferList();
vector<string> const choice_buffers =
getVectorFromChoice(dialog_->choice_buffer);
-
+
// If different from the current contents of the choice, then update it
if (buffers != choice_buffers) {
// create a string of entries " entry1 | entry2 | entry3 "
if (keys.empty()) {
fl_add_browser_line(dialog_->browser_refs,
_("*** No labels found in document ***"));
-
+
setEnabled(dialog_->browser_refs, false);
setEnabled(dialog_->check_sort, false);
at_ref_ = !at_ref_;
if (at_ref_) {
controller().gotoRef(fl_get_input(dialog_->input_ref));
- fl_set_object_label(dialog_->button_go, _("Go back"));
+ fl_set_object_label(dialog_->button_go, _("Go back"));
} else {
controller().gotoBookmark();
fl_set_object_label(dialog_->button_go,
setEnabled(dialog_->button_go, true);
fl_set_object_lcol(dialog_->input_ref, FL_BLACK);
- } else if (ob == dialog_->button_update ||
+ } else if (ob == dialog_->button_update ||
ob == dialog_->check_sort ||
ob == dialog_->choice_buffer) {
///
bool at_ref_;
- ///
+ ///
std::vector<string> refs_;
};
void FormSearch::build()
{
dialog_.reset(build_search());
-
+
// Manage the ok, apply and cancel/close buttons
bc().setCancel(dialog_->button_close);
bc().addReadOnly(dialog_->input_replace);
if (obj == dialog_->button_findnext ||
obj == dialog_->button_findprev) {
bool const forward = (obj == dialog_->button_findnext);
-
+
controller().find(fl_get_input(dialog_->input_search),
fl_get_button(dialog_->check_casesensitive),
fl_get_button(dialog_->check_matchword),
} else if (obj == dialog_->button_replace ||
obj == dialog_->button_replaceall) {
bool const all = (obj == dialog_->button_replaceall);
-
+
controller().replace(fl_get_input(dialog_->input_search),
fl_get_input(dialog_->input_replace),
fl_get_button(dialog_->check_casesensitive),
fl_get_button(dialog_->check_matchword),
all);
}
-
+
return ButtonPolicy::SMI_VALID;
}
public:
///
FormSearch(ControlSearch &);
-
+
private:
/// not needed.
virtual void apply() {}
/// Filter the inputs
virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
-
+
/// Fdesign generated method
FD_form_search * build_search();
};
fl_set_input_return(dialog_->input_command, FL_RETURN_CHANGED);
setPrehandler(dialog_->input_command);
- // Manage the ok, apply, restore and cancel/close buttons
+ // Manage the ok, apply, restore and cancel/close buttons
bc().setOK(dialog_->button_ok);
bc().setApply(dialog_->button_apply);
bc().setCancel(dialog_->button_close);
void FormSpellchecker::build()
{
dialog_.reset(build_spellchecker());
-
+
fl_set_slider_bounds(dialog_->slider, 0.0, 100.0);
fl_set_slider_step(dialog_->slider, 1.0);
fl_show_messages(controller().getMessage().c_str());
hide();
}
-
+
}
-
+
void FormSpellchecker::showMessage(const char * msg)
{
fl_show_message(msg, "", "");
public:
///
FormSpellchecker(ControlSpellchecker &);
-
+
private:
/// not needed.
void apply() {}
/// Build the dialog
void build();
- ///
+ ///
void update();
/// enable/disable widgets when start/stop
void stop(bool);
-
+
/// update progress bar, set suggestions, exit message
void partialUpdate(int);
/// Filter the inputs
virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
-
+
/// Fdesign generated method
FD_form_spellchecker * build_spellchecker();
};
longtable_options_.reset(build_longtable_options());
fl_set_input_return(column_options_->input_column_width,
- FL_RETURN_END);
+ FL_RETURN_END);
fl_set_input_return(column_options_->input_special_alignment,
- FL_RETURN_END);
+ FL_RETURN_END);
setPrehandler(column_options_->input_column_width);
setPrehandler(column_options_->input_special_alignment);
-
+
fl_set_input_return(cell_options_->input_mcolumn_width,
- FL_RETURN_END);
+ FL_RETURN_END);
fl_set_input_return(cell_options_->input_special_multialign,
- FL_RETURN_END);
+ FL_RETURN_END);
setPrehandler(cell_options_->input_mcolumn_width);
setPrehandler(cell_options_->input_special_multialign);
fl_addto_tabfolder(dialog_->tabfolder, _("Tabular"),
- tabular_options_->form);
+ tabular_options_->form);
fl_addto_tabfolder(dialog_->tabfolder, _("Column/Row"),
- column_options_->form);
+ column_options_->form);
fl_addto_tabfolder(dialog_->tabfolder, _("Cell"),
- cell_options_->form);
+ cell_options_->form);
fl_addto_tabfolder(dialog_->tabfolder, _("LongTable"),
- longtable_options_->form);
+ longtable_options_->form);
// Create the contents of the unit choices
// Don't include the "%" terms...
#else
vector<string>::iterator ret =
remove_if(units_vec.begin(), units_vec.end(),
- bind2nd(contains_functor(), "%"));
+ bind2nd(contains_functor(), "%"));
units_vec.erase(ret, units_vec.end());
#endif
-
+
string units = getStringFromVector(units_vec, "|");
fl_addto_choice(column_options_->choice_value_column_width,
- units.c_str());
+ units.c_str());
fl_addto_choice(cell_options_->choice_value_mcolumn_width,
- units.c_str());
+ units.c_str());
}
{
if (closing_)
return;
-
+
if (!inset_ || !inset_->tabular.get())
return;
if (tabular->IsMultiColumn(cell)) {
fl_set_button(cell_options_->check_multicolumn, 1);
fl_set_button(cell_options_->check_border_top,
- tabular->TopLine(cell)?1:0);
+ tabular->TopLine(cell)?1:0);
setEnabled(cell_options_->check_border_top, true);
fl_set_button(cell_options_->check_border_bottom,
- tabular->BottomLine(cell)?1:0);
+ tabular->BottomLine(cell)?1:0);
setEnabled(cell_options_->check_border_bottom, true);
// pay attention to left/right lines they are only allowed
// to set if we are in first/last cell of row or if the left/right
bool const metric = lyxrc.default_papersize > 3;
string const default_unit = metric ? "cm" : "in";
updateWidgetsFromLength(cell_options_->input_mcolumn_width,
- cell_options_->choice_value_mcolumn_width,
- pwidth, default_unit);
+ cell_options_->choice_value_mcolumn_width,
+ pwidth, default_unit);
if (!lv_->buffer()->isReadonly()) {
setEnabled(cell_options_->input_special_multialign, true);
setEnabled(cell_options_->radio_valign_top, !pwidth.zero());
setEnabled(cell_options_->radio_valign_bottom, !pwidth.zero());
setEnabled(cell_options_->radio_valign_center, !pwidth.zero());
-
+
setEnabled(cell_options_->radio_align_left, pwidth.zero());
setEnabled(cell_options_->radio_align_right, pwidth.zero());
setEnabled(cell_options_->radio_align_center, pwidth.zero());
bool const metric = lyxrc.default_papersize > 3;
string const default_unit = metric ? "cm" : "in";
updateWidgetsFromLength(column_options_->input_column_width,
- column_options_->choice_value_column_width,
- pwidth, default_unit);
+ column_options_->choice_value_column_width,
+ pwidth, default_unit);
setEnabled(column_options_->input_column_width, !isReadonly);
setEnabled(column_options_->choice_value_column_width, !isReadonly);
setEnabled(column_options_->radio_align_left, pwidth.zero());
setEnabled(column_options_->radio_align_right, pwidth.zero());
setEnabled(column_options_->radio_align_center, pwidth.zero());
-
+
setEnabled(column_options_->radio_valign_top, !pwidth.zero());
setEnabled(column_options_->radio_valign_bottom, !pwidth.zero());
setEnabled(column_options_->radio_valign_center, !pwidth.zero());
fl_set_button(tabular_options_->check_longtable,
- tabular->IsLongTabular());
+ tabular->IsLongTabular());
bool const enable = tabular->IsLongTabular();
-
+
setEnabled(longtable_options_->check_lt_firsthead, enable);
setEnabled(longtable_options_->check_1head_2border_above, enable);
setEnabled(longtable_options_->check_1head_2border_below, enable);
fl_set_button(longtable_options_->check_lt_head, row_set);
if (ltt.set) {
fl_set_button(longtable_options_->check_head_2border_above,
- ltt.topDL);
+ ltt.topDL);
fl_set_button(longtable_options_->check_head_2border_above,
- ltt.topDL);
+ ltt.topDL);
use_empty = true;
} else {
setEnabled(longtable_options_->check_head_2border_above, 0);
fl_set_button(longtable_options_->check_lt_firsthead, row_set);
if (ltt.set && (!ltt.empty || !use_empty)) {
fl_set_button(longtable_options_->check_1head_2border_above,
- ltt.topDL);
+ ltt.topDL);
fl_set_button(longtable_options_->check_1head_2border_above,
- ltt.topDL);
+ ltt.topDL);
} else {
setEnabled(longtable_options_->check_1head_2border_above, 0);
setEnabled(longtable_options_->check_1head_2border_below, 0);
fl_set_button(longtable_options_->check_lt_foot, row_set);
if (ltt.set) {
fl_set_button(longtable_options_->check_foot_2border_above,
- ltt.topDL);
+ ltt.topDL);
fl_set_button(longtable_options_->check_foot_2border_above,
- ltt.topDL);
+ ltt.topDL);
use_empty = true;
} else {
setEnabled(longtable_options_->check_foot_2border_above, 0);
fl_set_button(longtable_options_->check_lt_lastfoot, row_set);
if (ltt.set && (!ltt.empty || !use_empty)) {
fl_set_button(longtable_options_->check_lastfoot_2border_above,
- ltt.topDL);
+ ltt.topDL);
fl_set_button(longtable_options_->check_lastfoot_2border_above,
- ltt.topDL);
+ ltt.topDL);
} else {
setEnabled(longtable_options_->check_lastfoot_2border_above,0);
setEnabled(longtable_options_->check_lastfoot_2border_below,0);
fl_set_button(longtable_options_->check_lastfoot_2border_above, 0);
if (use_empty) {
fl_set_button(longtable_options_->check_lastfoot_empty,
- ltt.empty);
+ ltt.empty);
if (ltt.empty)
setEnabled(longtable_options_->check_lt_lastfoot, 0);
}
}
fl_set_button(longtable_options_->check_lt_newpage,
- tabular->GetLTNewPage(row));
+ tabular->GetLTNewPage(row));
} else {
fl_set_button(longtable_options_->check_lt_firsthead, 0);
fl_set_button(longtable_options_->check_1head_2border_above, 0);
fl_set_button(longtable_options_->check_lt_newpage, 0);
}
fl_set_button(tabular_options_->check_rotate_tabular,
- tabular->GetRotateTabular());
+ tabular->GetRotateTabular());
}
if (str1 != str2)
input(column_options_->input_column_width, 0);
str1 = getLengthFromWidgets(cell_options_->input_mcolumn_width,
- cell_options_->choice_value_mcolumn_width);
+ cell_options_->choice_value_mcolumn_width);
llen = tabular->GetMColumnPWidth(cell);
if (llen.zero())
str2 = "";
ok();
return true;
}
-
+
if (actCell_ != cell) {
update();
postWarning(_("Wrong Cursor position, updated window"));
update(); // update for alignment
return true;
}
-
+
if ((ob == cell_options_->input_mcolumn_width) ||
(ob == cell_options_->choice_value_mcolumn_width)) {
string const str =
num = LyXTabular::SET_USEBOX;
special = "2";
} else if ((ob == longtable_options_->check_lt_firsthead) ||
- (ob == longtable_options_->check_1head_2border_above) ||
- (ob == longtable_options_->check_1head_2border_below) ||
- (ob == longtable_options_->check_1head_empty) ||
- (ob == longtable_options_->check_lt_head) ||
- (ob == longtable_options_->check_head_2border_above) ||
- (ob == longtable_options_->check_head_2border_below) ||
- (ob == longtable_options_->check_lt_foot) ||
- (ob == longtable_options_->check_foot_2border_above) ||
- (ob == longtable_options_->check_foot_2border_below) ||
- (ob == longtable_options_->check_lt_lastfoot) ||
- (ob == longtable_options_->check_lastfoot_2border_above) ||
- (ob == longtable_options_->check_lastfoot_2border_below) ||
- (ob == longtable_options_->check_lastfoot_empty)) {
+ (ob == longtable_options_->check_1head_2border_above) ||
+ (ob == longtable_options_->check_1head_2border_below) ||
+ (ob == longtable_options_->check_1head_empty) ||
+ (ob == longtable_options_->check_lt_head) ||
+ (ob == longtable_options_->check_head_2border_above) ||
+ (ob == longtable_options_->check_head_2border_below) ||
+ (ob == longtable_options_->check_lt_foot) ||
+ (ob == longtable_options_->check_foot_2border_above) ||
+ (ob == longtable_options_->check_foot_2border_below) ||
+ (ob == longtable_options_->check_lt_lastfoot) ||
+ (ob == longtable_options_->check_lastfoot_2border_above) ||
+ (ob == longtable_options_->check_lastfoot_2border_below) ||
+ (ob == longtable_options_->check_lastfoot_empty)) {
num = static_cast<LyXTabular::Feature>(checkLongtableOptions(ob, special));
} else if (ob == longtable_options_->check_lt_newpage) {
num = LyXTabular::SET_LTNEWPAGE;
num = LyXTabular::M_VALIGN_CENTER;
else
return false;
-
+
inset_->tabularFeatures(lv_->view(), num, special);
update();
fl_set_slider_precision(dialog_->slider_rows, 0);
fl_set_slider_precision(dialog_->slider_columns, 0);
- // Manage the ok, apply and cancel/close buttons
+ // Manage the ok, apply and cancel/close buttons
bc().setOK(dialog_->button_ok);
bc().setApply(dialog_->button_apply);
bc().setCancel(dialog_->button_close);
class FormTabularCreate :
public FormCB<ControlTabularCreate, FormDB<FD_form_tabular_create> > {
public:
- ///
+ ///
FormTabularCreate(ControlTabularCreate &);
private:
#include "debug.h"
#include "xforms_helpers.h"
#include "support/LAssert.h"
-
+
typedef FormCB<ControlTexinfo, FormDB<FD_form_texinfo> > base_class;
FormTexinfo::FormTexinfo(ControlTexinfo & c)
updateStyles(ControlTexinfo::cls);
} else if (ob == dialog_->radio_sty) {
- updateStyles(ControlTexinfo::sty);
+ updateStyles(ControlTexinfo::sty);
} else if (ob == dialog_->radio_bst) {
- updateStyles(ControlTexinfo::bst);
+ updateStyles(ControlTexinfo::bst);
} else if (ob == dialog_->button_rescan) {
// build new *Files.lst
void FormTexinfo::updateStyles(ControlTexinfo::texFileSuffix whichStyle)
{
- fl_clear_browser(dialog_->browser);
+ fl_clear_browser(dialog_->browser);
bool const withFullPath = fl_get_button(dialog_->check_fullpath);
- string const str =
+ string const str =
controller().getContents(whichStyle, withFullPath);
fl_add_browser_line(dialog_->browser, str.c_str());
setPrehandler(dialog_->input_entry);
setPrehandler(dialog_->input_replace);
-
+
// Manage the ok, apply and cancel/close buttons
bc().setCancel(dialog_->button_close);
bc().addReadOnly(dialog_->input_replace);
void FormThesaurus::updateMeanings(string const & str)
{
fl_clear_browser(dialog_->browser_meanings);
-
+
fl_set_input(dialog_->input_entry, str.c_str());
fl_set_browser_topline(dialog_->browser_meanings, 1);
for (; cit != end; ++cit) {
fl_add_browser_line(dialog_->browser_meanings,
cit->first.c_str());
-
+
vector<string> const & tmpvec = cit->second;
vector<string>::const_iterator cit2 = tmpvec.begin();
vector<string>::const_iterator end2 = tmpvec.end();
ent.c_str());
}
}
-
+
fl_unfreeze_form(form());
fl_redraw_form(form());
}
} else if (templ.size() > 0 && isupper(templ[0])) {
bool rest_lower = true;
string::const_iterator cit2 = beg + 1;
-
+
for (; cit2 != end; ++cit2) {
if (isupper(*cit2))
rest_lower = false;
}
-
+
if (rest_lower) {
str = lowercase(nstr);
str[0] = uppercase(nstr[0]);
{
if (obj == dialog_->input_entry) {
string s = strip(frontStrip(fl_get_input(dialog_->input_entry)));
-
+
updateMeanings(s);
if (s.empty()) {
public:
///
FormThesaurus(ControlThesaurus &);
-
+
private:
/// not needed.
virtual void apply() {}
/// Filter the inputs
virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
-
+
/// for double click handling
int clickline_;
" " + getStringFromVector(controller().getTypes(), " | ") + " ";
fl_addto_choice(dialog_->choice_toc_type, choice.c_str());
- // Manage the cancel/close button
+ // Manage the cancel/close button
bc().setCancel(dialog_->button_close);
}
if (ob != dialog_->choice_toc_type) {
updateType();
}
-
+
updateContents();
return ButtonPolicy::SMI_VALID;
// And select the correct one
string const type = toc::getType(controller().params().getCmdName());
-
+
fl_set_choice(dialog_->choice_toc_type, 1);
for (int i = 1;
i <= fl_get_choice_maxitems(dialog_->choice_toc_type); ++i) {
void FormToc::updateContents()
{
char const * tmp = fl_get_choice_text(dialog_->choice_toc_type);
-
+
if (!tmp) {
fl_clear_browser(dialog_->browser_toc);
fl_add_browser_line(dialog_->browser_toc,
_("*** No Lists ***"));
return;
}
-
+
string const type = frontStrip(strip(tmp));
Buffer::SingleList const contents = controller().getContents(type);
fl_add_browser_line(dialog_->browser_toc,
_("*** No Lists ***"));
}
-
+
// Check if all elements are the same.
if (toclist_ == contents) {
return;
}
-
+
// List has changed. Update browser
toclist_ = contents;
Buffer::SingleList::const_iterator cit = toclist_.begin();
Buffer::SingleList::const_iterator end = toclist_.end();
-
+
for (; cit != end; ++cit) {
string const line = string(4 * cit->depth, ' ') + cit->str;
fl_add_browser_line(dialog_->browser_toc, line.c_str());
}
-
+
fl_set_browser_topline(dialog_->browser_toc, topline);
fl_select_browser_line(dialog_->browser_toc, line);
}
setPrehandler(dialog_->input_name);
setPrehandler(dialog_->input_url);
- // Manage the ok, apply, restore and cancel/close buttons
+ // Manage the ok, apply, restore and cancel/close buttons
bc().setOK(dialog_->button_ok);
bc().setApply(dialog_->button_apply);
bc().setCancel(dialog_->button_close);
fl_clear_browser(dialog_->browser);
stringstream ss;
-
+
fl_add_browser_line(dialog_->browser,
controller().getVCLogFile(ss).str().c_str());
}
}
-void GUIRunTime::processEvents()
+void GUIRunTime::processEvents()
{
if (fl_do_forms() == FL_EVENT) {
XEvent ev;
{
using namespace grfx;
using SigC::slot;
-
+
#if defined(HAVE_FLIMAGE_DUP) && defined(HAVE_FLIMAGE_TO_PIXMAP)
// connect the image loader based on the xforms library
GImage::newImage.connect(slot(&xformsGImage::newImage));
#include <config.h>
#include <algorithm>
-
+
#include XPM_H_LOCATION
#ifdef __GNUG__
#pragma implementation
#endif
-#include "support/LAssert.h"
+#include "support/LAssert.h"
#include "support/lstrings.h"
#include "debug.h"
#include "MathsSymbols.h"
#include "FormMathsPanel.h"
-
+
using std::max;
using std::endl;
using std::ostream;
"Re", "Im", "aleph", "wp", "hbar",
"angle", "top", "bot", "Vert", "neg",
"flat", "natural", "sharp", "surd", "triangle",
- "diamondsuit", "heartsuit", "clubsuit", "spadesuit",
- "textrm Å", "textrm Ø", "mathcircumflex", "_",
+ "diamondsuit", "heartsuit", "clubsuit", "spadesuit",
+ "textrm Å", "textrm Ø", "mathcircumflex", "_",
"mathrm T",
- "mathbb N", "mathbb Z", "mathbb Q",
+ "mathbb N", "mathbb Z", "mathbb Q",
"mathbb R", "mathbb C", "mathbb H",
- "mathcal F", "mathcal L",
+ "mathcal F", "mathcal L",
"mathcal H", "mathcal O", ""
};
"rightleftarrows", "rightrightarrows", "rightleftarrows",
"twoheadrightarrow", "rightarrowtail", "looparrowright",
"rightleftharpoons", "curvearrowright", "circlearrowright",
- "Rsh", "downdownarrows", "upharpoonright",
+ "Rsh", "downdownarrows", "upharpoonright",
"downharpoonright", "rightsquigarrow",
"nleftarrow", "nrightarrow", "nLeftarrow",
"nRightarrow", "nleftrightarrow", "nLeftrightarrow"
"lvertneqq", "lnsim", "lnapprox", "gnapprox", "nsucc", "nsucceq",
"nprec", "npreceq", "precnsim","succnsim", "succnapprox", "ncong",
"precnapprox", "nsim", "nshortmid", "nshortparallel", "nparallel", "nvDash",
-
+
"nmid", "nvdash", "nvDash","nVDash", "ntriangleright", "ntrianglerighteq",
"ntriangleleft", "ntrianglelefteq", "nsubseteq", "nsupseteq", "nsupseteqq", "supsetneq",
"subsetneq", "varsubsetneq", "subsetneqq", "varsupsetneq", "supsetneqq", "varsupsetneqq",
default: return 0;
}
}
-
+
static char const ** pixmapFromBitmapData(char const * s, int wx, int hx)
{
char const ** data = 0;
return data;
}
-
+
char const ** get_pixmap_from_symbol(char const * arg, int wx, int hx)
{
lyx::Assert(arg);
-
+
char const ** data = 0;
latexkeys const * l = in_word_set(arg);
if (!l)
char const ** get_pixmap_from_symbol(char const *, int, int);
-
+
#endif /* MATHS_SYMBOLS_H */
// where to place the menubar?
int const yloc = (mheight - mbheight)/2; //air + bw;
int const mbadd = 20; // menu button add (to width)
-// Some space between buttons on the menubar
+// Some space between buttons on the menubar
int const air = 2;
char const * menu_tabstop = "aa";
char const * default_tabstop = "aaaaaaaa";
// We do not want to mix position values in a menu (like the index of
// a submenu) with the action numbers which convey actual information.
// Therefore we offset all the action values by an arbitrary large
-// constant.
+// constant.
int const action_offset = 1000;
// This is used a few times below.
inline
-int string_width(string const & str)
+int string_width(string const & str)
{
return fl_get_string_widthTAB(MENU_LABEL_STYLE, MENU_LABEL_SIZE,
str.c_str(),
{
Menubar::Pimpl::MenuCallback(ob, button);
}
-
+
}
-Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mb)
+Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mb)
: owner_(view), menubackend_(&mb), current_group_(0)
{
for (MenuBackend::const_iterator menu = menubackend_->begin();
void Menubar::Pimpl::makeMenubar(Menu const & menu)
{
- FL_FORM * form = static_cast<XFormsView *>(owner_)->getForm();
+ FL_FORM * form = static_cast<XFormsView *>(owner_)->getForm();
int moffset = 0;
// Create menu frame if there is non yet.
FL_OBJECT * frame = fl_add_frame(FL_UP_FRAME, 0, 0,
form->w, mheight, "");
fl_set_object_resize(frame, FL_RESIZE_ALL);
- fl_set_object_gravity(frame, NorthWestGravity,
+ fl_set_object_gravity(frame, NorthWestGravity,
NorthEastGravity);
Menu::const_iterator i = menu.begin();
obj = fl_add_button(FL_MENU_BUTTON,
air + moffset, yloc,
width + mbadd,
- mbheight,
+ mbheight,
label.c_str());
fl_set_object_boxtype(obj, FL_FLAT_BOX);
fl_set_object_color(obj, FL_MCOL, FL_MCOL);
fl_set_object_lsize(obj, MENU_LABEL_SIZE);
fl_set_object_lstyle(obj, MENU_LABEL_STYLE);
fl_set_object_resize(obj, FL_RESIZE_ALL);
- fl_set_object_gravity(obj, NorthWestGravity,
+ fl_set_object_gravity(obj, NorthWestGravity,
NorthWestGravity);
moffset += obj->w + air;
fl_set_object_shortcut(obj, shortcut.c_str(), 1);
}
-void Menubar::Pimpl::set(string const & menu_name)
+void Menubar::Pimpl::set(string const & menu_name)
{
- lyxerr[Debug::GUI] << "Entering Menubar::Pimpl::set "
+ lyxerr[Debug::GUI] << "Entering Menubar::Pimpl::set "
<< "for menu `" << menu_name << "'" << endl;
if (menu_name != current_menu_name_) {
<< current_group_ << endl;
fl_hide_object(current_group_);
}
-
+
lyxerr[Debug::GUI] << " showing group "
<< mbit->second << endl;
fl_show_object(mbit->second);
} else
lyxerr [Debug::GUI] << "Menubar::Pimpl::set: Nothing to do."
<< endl;
-}
+}
void Menubar::Pimpl::openByName(string const & name)
string const m = floatList[cit->first]->second.name() + "%m";
fl_addtopup(menu, m.c_str(), menu_first_sub);
}
-
-
+
+
// Handle normal TOC
cit = toc_list.find("TOC");
if (cit == end) {
}
-int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
- string const & menu_name,
- vector<int> & smn)
+int Menubar::Pimpl::create_submenu(Window win, LyXView * view,
+ string const & menu_name,
+ vector<int> & smn)
{
- if (!menubackend_->hasMenu(menu_name)) {
- lyxerr << "ERROR:create_submenu: Unknown menu `"
+ if (!menubackend_->hasMenu(menu_name)) {
+ lyxerr << "ERROR:create_submenu: Unknown menu `"
<< menu_name << "'" << endl;
return -1;
}
int const menu = get_new_submenu(smn, win);
fl_setpup_softedge(menu, true);
fl_setpup_bw(menu, -1);
- lyxerr[Debug::GUI] << "Adding menu " << menu
+ lyxerr[Debug::GUI] << "Adding menu " << menu
<< " in deletion list" << endl;
// Compute the size of the largest label (because xforms is
}
}
}
- lyxerr[Debug::GUI] << "max_width=" << max_width
- << ", widest_label=`" << widest_label
+ lyxerr[Debug::GUI] << "max_width=" << max_width
+ << ", widest_label=`" << widest_label
<< "'" << endl;
// Compute where to put separators
switch (item.kind()) {
case MenuItem::Command: {
- FuncStatus const flag =
- view->getLyXFunc()->getStatus(item.action());
+ FuncStatus const flag =
+ view->getLyXFunc()->getStatus(item.action());
// handle optional entries.
- if (item.optional()
+ if (item.optional()
&& (flag.disabled())) {
- lyxerr[Debug::GUI]
- << "Skipping optional item "
- << item.label() << endl;
+ lyxerr[Debug::GUI]
+ << "Skipping optional item "
+ << item.label() << endl;
break;
}
if (!accel.empty()) {
// Try to be clever and add just enough
// tabs to align shortcuts.
- do
+ do
label += '\t';
while (string_width(label) < max_width + 5);
label += accel.substr(1,accel.find(']') - 1);
}
label += "%x" + tostr(item.action() + action_offset)
+ extra_label;
-
+
// Modify the entry using the function status
string pupmode;
if (flag.onoff(true))
if (!shortcut.empty()) {
shortcut += lowercase(shortcut[0]);
label += "%h";
- fl_addtopup(menu, label.c_str(),
+ fl_addtopup(menu, label.c_str(),
shortcut.c_str());
} else
fl_addtopup(menu, label.c_str());
-
- lyxerr[Debug::GUI] << "Command: \""
+
+ lyxerr[Debug::GUI] << "Command: \""
<< lyxaction.getActionName(item.action())
<< "\", binding \"" << accel
- << "\", shortcut \"" << shortcut
+ << "\", shortcut \"" << shortcut
<< "\"" << endl;
break;
}
case MenuItem::Submenu: {
- int submenu = create_submenu(win, view,
+ int submenu = create_submenu(win, view,
item.submenu(), smn);
if (submenu == -1)
return -1;
add_toc(menu, extra_label, smn, win);
break;
- case MenuItem::Documents:
- case MenuItem::Lastfiles:
+ case MenuItem::Documents:
+ case MenuItem::Lastfiles:
case MenuItem::ViewFormats:
case MenuItem::UpdateFormats:
case MenuItem::ExportFormats:
void Menubar::Pimpl::MenuCallback(FL_OBJECT * ob, long button)
{
ItemInfo * iteminfo = static_cast<ItemInfo *>(ob->u_vdata);
-// lyxerr << "MenuCallback: ItemInfo address=" << iteminfo
-// << "Val=(pimpl_=" << iteminfo->pimpl_
-// << ", item_=" << iteminfo->item_
-// << ", obj_=" << iteminfo->obj_ << ")" <<endl;
+// lyxerr << "MenuCallback: ItemInfo address=" << iteminfo
+// << "Val=(pimpl_=" << iteminfo->pimpl_
+// << ", item_=" << iteminfo->item_
+// << ", obj_=" << iteminfo->obj_ << ")" <<endl;
LyXView * view = iteminfo->pimpl_->owner_;
MenuItem const * item = iteminfo->item_.get();
// Paranoia check
lyx::Assert(item->kind() == MenuItem::Submenu);
-
+
// set tabstop length
fl_set_tabstop(menu_tabstop);
vector<int> submenus;
int menu = iteminfo->pimpl_->
- create_submenu(FL_ObjWin(ob), view,
+ create_submenu(FL_ObjWin(ob), view,
item->submenu(), submenus);
if (menu != -1) {
// place popup
fl_setpup_position(static_cast<XFormsView *>(view)->getForm()->x + ob->x,
- static_cast<XFormsView *>(view)->getForm()->y + ob->y + ob->h + 10);
+ static_cast<XFormsView *>(view)->getForm()->y + ob->y + ob->h + 10);
int choice = fl_dopup(menu);
-
+
if (button == 1) {
// set the pseudo menu-button back
fl_set_object_boxtype(ob, FL_FLAT_BOX);
} else {
lyxerr << "Error in MenuCallback" << endl;
}
-
+
for_each(submenus.begin(), submenus.end(), fl_freepup);
// restore tabstop length
fl_set_tabstop(default_tabstop);
class LyXView;
/** The LyX GUI independent menubar class
- The GUI interface is implemented in the corresponding Menubar_pimpl class.
+ The GUI interface is implemented in the corresponding Menubar_pimpl class.
*/
struct Menubar::Pimpl {
public:
std::vector<int> & smn, Window win);
///
int create_submenu(Window win, LyXView * view,
- string const & menuname,
- std::vector<int> & smn);
+ string const & menuname,
+ std::vector<int> & smn);
- /// update the state of the menuitems
- void update() {}
+ /// update the state of the menuitems
+ void update() {}
private:
//
void makeMenubar(Menu const &menu);
- ///
+ ///
LyXView * owner_;
///
MenuBackend const * menubackend_;
///
struct ItemInfo {
///
- ItemInfo(Menubar::Pimpl * p, MenuItem const * i,
+ ItemInfo(Menubar::Pimpl * p, MenuItem const * i,
FL_OBJECT * o)
-
+
: pimpl_(p), obj_(o) { item_.reset(i); }
///
Menubar::Pimpl * pimpl_;
* \author Baruch Even, baruch.even@writeme.com
*/
-#include <config.h>
+#include <config.h>
#ifdef __GNUG__
#pragma implementation
-#endif
+#endif
#include "RadioButtonGroup.h"
find_if(map.begin(), map.end(),
lyx::equal_2nd_in_pair<ButtonValuePair>(value));
#endif
-
+
// If we found nothing, report it and return
if (it == map.end()) {
lyxerr << "BUG: Requested value in RadioButtonGroup doesn't exists"
// Else return 0.
return 0;
}
-
#ifdef __GNUG__
#pragma interface
-#endif
+#endif
/** This class simplifies the work with a group of radio buttons,
ButtonValueMap map;
};
-#endif
+#endif
namespace {
extern "C" {
-
+
static
void C_intern_timeout_cb(int, void * data)
{
#include "buffer.h"
#include "lyxtextclasslist.h"
#include "LyXAction.h"
-#include "MathsSymbols.h"
+#include "MathsSymbols.h"
#include "gettext.h"
#include "Tooltips.h"
#include "support/LAssert.h"
#include "support/filetools.h"
-#include "support/lstrings.h"
+#include "support/lstrings.h"
using std::endl;
}
-Toolbar::Pimpl::toolbarItem &
+Toolbar::Pimpl::toolbarItem &
Toolbar::Pimpl::toolbarItem::operator=(toolbarItem const & ti)
{
// Are we assigning the object onto itself?
// If we already have an icon, release it.
clean();
-
+
// do we have to check icon too?
action = ti.action;
icon = 0; // locally we need to get the icon anew
-
+
return *this;
}
string const & layoutguiname = combox->getline();
LyXTextClass const & tc =
textclasslist[owner->buffer()->params.textclass];
-
+
LyXTextClass::const_iterator end = tc.end();
for (LyXTextClass::const_iterator cit = tc.begin();
cit != end; ++cit) {
lyxerr << "ERROR (Toolbar::Pimpl::layoutSelected): layout not found!"
<< endl;
}
-
+
void Toolbar::Pimpl::setLayout(string const & layout)
{
void ToolbarCB(FL_OBJECT * ob, long ac)
{
XFormsView * owner = static_cast<XFormsView *>(ob->u_vdata);
-
+
owner->getLyXFunc()->verboseDispatch(int(ac), true);
}
extern "C" {
-
+
static
void C_Toolbar_ToolbarCB(FL_OBJECT * ob, long data)
{
ToolbarCB(ob, data);
}
-
+
}
string const name = lyxaction.getActionName(act);
if (!arg.empty())
xpm_name = subst(name + ' ' + arg, ' ','_');
- else
+ else
xpm_name = name;
string fullname = LibFileSearch("images", xpm_name, "xpm");
if (!fullname.empty()) {
- lyxerr[Debug::GUI] << "Full icon name is `"
+ lyxerr[Debug::GUI] << "Full icon name is `"
<< fullname << "'" << endl;
fl_set_pixmapbutton_file(obj, fullname.c_str());
return;
return;
}
}
-
+
lyxerr << "Unable to find icon `" << xpm_name << "'" << endl;
fullname = LibFileSearch("images", "unknown", "xpm");
if (!fullname.empty()) {
- lyxerr[Debug::GUI] << "Using default `unknown' icon"
+ lyxerr[Debug::GUI] << "Using default `unknown' icon"
<< endl;
fl_set_pixmapbutton_file(obj, fullname.c_str());
}
{
// we shouldn't set if we have not cleaned
if (!cleaned) return;
-
+
FL_OBJECT * obj;
-
+
if (!doingmain) {
fl_freeze_form(owner->getForm());
fl_addto_form(owner->getForm());
break;
default:
xpos += standardspacing;
- item->icon = obj =
+ item->icon = obj =
fl_add_pixmapbutton(FL_NORMAL_BUTTON,
xpos, ypos,
buttonwidth,
// initialise the tooltip
string const tip = _(lyxaction.helpText(obj->argument));
tooltip_->init(obj, tip);
-
+
// The view that this object belongs to.
obj->u_vdata = owner;
if (!doclean && owner) {
// first "hide" the toolbar buttons. This is not a real hide
// actually it deletes and frees the button altogether.
- lyxerr << "Toolbar::add: \"hide\" the toolbar buttons."
+ lyxerr << "Toolbar::add: \"hide\" the toolbar buttons."
<< endl;
lightReset();
-
+
fl_freeze_form(owner->getForm());
ToolbarList::iterator p = toollist.begin();
fl_unfreeze_form(owner->getForm());
cleaned = true; // this is not completely true, but OK anyway
}
-
+
// there exist some special actions not part of
// kb_action: SEPARATOR, LAYOUTS
{
lyxerr[Debug::GUI] << "Toolbar::push: trying to trigger no `"
<< nth << '\'' << endl;
-
+
if (nth <= 0 || nth >= int(toollist.size())) {
// item nth not found...
return;
}
-void Toolbar::Pimpl::reset()
+void Toolbar::Pimpl::reset()
{
//toollist = 0; // what is this supposed to do?
cleaned = false;
Pimpl(LyXView * o, int x, int y);
///
~Pimpl();
-
+
/// (re)sets the toolbar
void set(bool doingmain = false);
*/
void edit();
/// add a new button to the toolbar.
- void add(int, bool doclean = true);
+ void add(int, bool doclean = true);
/// invokes the n'th icon in the toolbar
void push(int);
/// activates the toolbar
- void activate();
+ void activate();
/// deactivates the toolbar
- void deactivate();
+ void deactivate();
/// update the state of the icons
void update();
/// Erase the layout list
void clearLayoutList();
/// the non-static version of layoutSelectedCB
- void layoutSelected();
+ void layoutSelected();
///
struct toolbarItem
int TooltipHandler(FL_OBJECT *ob, int event);
void TooltipTimerCB(FL_OBJECT * timer, long data);
-
+
}
extern "C" {
}
}
-
+
Tooltips::Tooltips()
: tooltip_timer_(0)
}
-string const Tooltips::get(FL_OBJECT * ob) const
+string const Tooltips::get(FL_OBJECT * ob) const
{
TooltipsMap::const_iterator it = tooltipsMap.find(ob);
if (it == tooltipsMap.end())
* \author Alejandro Aguilar Sierra
*/
-/* A bitmap table uses a single bitmap to simulate a 2d array
+/* A bitmap table uses a single bitmap to simulate a 2d array
* of bitmap buttons. It can be used to build bitmap menus.
*/
#ifndef BMTABLE_H
-#define BMTABLE_H
+#define BMTABLE_H
#ifdef __GNUG__
#pragma interface
/**/
-FL_OBJECT *fl_create_bmtable(int, FL_Coord, FL_Coord,
+FL_OBJECT *fl_create_bmtable(int, FL_Coord, FL_Coord,
FL_Coord, FL_Coord, char const *);
/**/
-FL_OBJECT *fl_add_bmtable(int, FL_Coord, FL_Coord,
+FL_OBJECT *fl_add_bmtable(int, FL_Coord, FL_Coord,
FL_Coord, FL_Coord, char const *);
/** Same as fl_get_button_numb() */
/** The number of items is by default nc x nr, but you can change it */
void fl_set_bmtable_maxitems(FL_OBJECT *, int);
/**/
-int fl_get_bmtable_maxitems(FL_OBJECT *);
+int fl_get_bmtable_maxitems(FL_OBJECT *);
/** Returns the index of the selected item or -1 if none was selected */
int fl_get_bmtable(FL_OBJECT *);
/** Replace an item's sub_bitmap at id position */
-void fl_replace_bmtable_item(FL_OBJECT *ob, int id, int cw, int ch, char *data);
+void fl_replace_bmtable_item(FL_OBJECT *ob, int id, int cw, int ch, char *data);
-/** Get the sub_bitmap from id position. You must alloc memory for the data. */
+/** Get the sub_bitmap from id position. You must alloc memory for the data. */
void fl_get_bmtable_item(FL_OBJECT *ob, int id, int *cw, int *ch, char *data);
/** Returns a pixmap from the table, if available. */
Pixmap fl_get_bmtable_pixmap(FL_OBJECT *);
-/** Draws a single item on a drawable */
+/** Draws a single item on a drawable */
void fl_draw_bmtable_item(FL_OBJECT *ob, int i, Drawable d, int xx, int yy);
/** Free the current bitmap in preparation for installing a new one */
#endif
#endif /* BMTABLE_H */
-
*/
/* A combination of two objects (a button and a browser) is encapsulated to
- * get a combobox-like object. All XForms functions are hidden.
- *
- */
+ * get a combobox-like object. All XForms functions are hidden.
+ *
+ */
/* Change log:
- *
- * 2/06/1996, Alejandro Aguilar Sierra
+ *
+ * 2/06/1996, Alejandro Aguilar Sierra
* Created and tested.
- *
- * 4/06/1996, Alejandro Aguilar Sierra
+ *
+ * 4/06/1996, Alejandro Aguilar Sierra
* Added droplist mode (a button with a black down arrow at right)
* and support for middle and right buttons, as XForms choice object.
*
* 6/06/1996, Lars Gullik Bjønnes
* Added a combox with an input object. and a pre and a post handle.
- *
- * 22/07/96, Alejandro Aguilar Sierra
+ *
+ * 22/07/96, Alejandro Aguilar Sierra
* Assigned to the browser its own popup window. No more need of
* external pre and post handlers to simulate the wanted behaviour.
- *
- */
+ *
+ */
#include <config.h>
// These are C wrappers around static members of Combox, used as
// callbacks for xforms.
extern "C" {
-
+
static
void C_Combox_input_cb(FL_OBJECT * ob, long data)
{
Combox::input_cb(ob, data);
}
-
+
static
- void C_Combox_combo_cb(FL_OBJECT * ob, long data)
+ void C_Combox_combo_cb(FL_OBJECT * ob, long data)
{
Combox::combo_cb(ob, data);
}
-
+
static
int C_Combox_peek_event(FL_FORM * form, void *xev)
{
void Combox::clear()
{
- if (browser) fl_clear_browser(browser);
+ if (browser) fl_clear_browser(browser);
sel = 0;
if (type == FL_COMBOX_INPUT)
fl_set_input(label, "");
lyxerr[Debug::GUI] << "Button: " << button << endl;
if (button) {
fl_delete_object(button);
- fl_free_object(button);
+ fl_free_object(button);
}
-
+
lyxerr[Debug::GUI] << "Label: " << label << endl;
if (label && label != button) {
fl_delete_object(label);
- fl_free_object(label);
+ fl_free_object(label);
}
-
+
lyxerr[Debug::GUI] << "Form: " << form << endl;
lyxerr[Debug::GUI] << "Browser: " << browser << endl;
if (form && browser) {
fl_free_object(browser);
fl_free_form(form);
}
- button = 0;
- browser = 0;
+ button = 0;
+ browser = 0;
label = 0;
form = 0;
sel = 0;
{
if (!browser) return;
fl_add_browser_line(browser, text.c_str());
-
+
// By default the first item is selected
if (!sel) {
sel = 1;
if (type == FL_COMBOX_INPUT)
fl_set_input(label, text.c_str());
else
- fl_set_object_label(label, text.c_str());
+ fl_set_object_label(label, text.c_str());
}
is_empty = false;
}
{
if (!browser || t.empty()) return false;
int const maxline = fl_get_browser_maxline(browser);
-
+
for (int i = 1; i <= maxline; ++i) {
if (t == fl_get_browser_line(browser, i)) {
select(i);
void Combox::select(int i)
{
if (!browser || !button) return;
- if (i > 0 && i <= fl_get_browser_maxline(browser)) sel = i;
+ if (i > 0 && i <= fl_get_browser_maxline(browser)) sel = i;
fl_deactivate_object(button);
-
+
if (type == FL_COMBOX_INPUT)
fl_set_input(label, fl_get_browser_line(browser, sel));
else
- fl_set_object_label(label, fl_get_browser_line(browser, sel));
- fl_activate_object(button);
+ fl_set_object_label(label, fl_get_browser_line(browser, sel));
+ fl_activate_object(button);
}
tabfolder2 = tabfolder2_;
FL_OBJECT * obj;
-
+
switch (type) {
case FL_COMBOX_DROPLIST:
{
fl_set_object_color(obj, FL_MCOL, FL_MCOL);
fl_set_object_dblbuffer(obj, 1);
fl_set_object_callback(obj, C_Combox_combo_cb, 0);
- label = obj = fl_add_button(FL_NORMAL_TEXT, x, y, w-22, hmin, "");
+ label = obj = fl_add_button(FL_NORMAL_TEXT, x, y, w-22, hmin, "");
fl_set_object_boxtype(obj, FL_DOWN_BOX);
fl_set_object_color(obj, FL_MCOL, FL_BLACK);
fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
fl_end_form();
browser->u_vdata = this;
form->u_vdata = browser;
- fl_register_raw_callback(form,
+ fl_register_raw_callback(form,
ButtonPressMask|KeyPressMask,
C_Combox_peek_event);
if (button) fl_redraw_object(button);
if (label) fl_redraw_object(label);
}
-
+
void Combox::show()
{
if (_pre) _pre();
-
+
int tmp;
XGetInputFocus(fl_get_display(), &save_window, &tmp); //BUG-Fix Dietmar
XFlush(fl_get_display());
if (button && type != FL_COMBOX_NORMAL) {
- fl_set_object_label(button, "@2<-");
+ fl_set_object_label(button, "@2<-");
fl_redraw_object(button);
}
x += tabfolder1->form->x;
y += tabfolder1->form->y;
}
-
+
} else {
x += label->form->x;
y += label->form->y;
fl_set_form_position(form, x, y);
fl_show_form(form, FL_PLACE_POSITION, FL_NOBORDER, "");
- if (sel > 0) {
+ if (sel > 0) {
fl_set_browser_topline(browser, sel);
fl_select_browser_line(browser, sel);
}
}
void Combox::hide(int who)
-{
+{
if (!who && browser && label) {
sel = fl_get_browser(browser);
-
+
if (type == FL_COMBOX_INPUT)
fl_set_input(label, fl_get_browser_line(browser, sel));
else
fl_set_object_label(label,
- fl_get_browser_line(browser, sel));
+ fl_get_browser_line(browser, sel));
// if (callback) callback(sel, cb_arg);
}
- XUngrabPointer(fl_get_display(), 0);
+ XUngrabPointer(fl_get_display(), 0);
XFlush(fl_get_display());
- if (form) {
+ if (form) {
fl_hide_form(form);
XSetInputFocus(fl_get_display(), save_window,
RevertToParent, CurrentTime); // BUG-FIX-Dietmar
XFlush(fl_get_display());
- }
+ }
if (button) {
- if (type != FL_COMBOX_NORMAL) {
+ if (type != FL_COMBOX_NORMAL) {
fl_set_object_label(button, "@2->");
fl_redraw_object(button);
}
- }
+ }
if (!who && browser && label && callback)
callback(sel, cb_arg, this);
- if (_post) _post();
+ if (_post) _post();
}
Combox * combo = static_cast<Combox*>(ob->u_vdata);
switch (data) {
case 0:
- {
+ {
int const i = combo->get();
switch (fl_get_button_numb(ob)) {
- case 2:
+ case 2:
{
- combo->select(i - 1);
+ combo->select(i - 1);
if (combo->callback)
combo->callback(combo->sel,
combo->cb_arg, combo);
break;
}
- case 3:
+ case 3:
{
- combo->select(i + 1);
+ combo->select(i + 1);
if (combo->callback)
combo->callback(combo->sel,
combo->cb_arg, combo);
{
FL_OBJECT * ob = static_cast<FL_OBJECT *>(form->u_vdata);
Combox * combo = static_cast<Combox*>(ob->u_vdata);
-
- // below mouse does not work like we need it
+
+ // below mouse does not work like we need it
if (static_cast<XEvent *>(xev)->type == ButtonPress && (
static_cast<XEvent *>(xev)->xbutton.x - ob->x < 0 ||
static_cast<XEvent *>(xev)->xbutton.x - ob->x > ob->w ||
static_cast<XEvent *>(xev)->xbutton.y - ob->y < 0 ||
static_cast<XEvent *>(xev)->xbutton.y - ob->y > ob->h)) {
- combo->hide(1);
+ combo->hide(1);
return 1;
}
-
+
if (static_cast<XEvent*>(xev)->type != KeyPress) return 0;
-
+
char s_r[10]; s_r[9] = '\0';
KeySym keysym_return;
- XLookupString(&static_cast<XEvent*>(xev)->xkey, s_r, 10,
+ XLookupString(&static_cast<XEvent*>(xev)->xkey, s_r, 10,
&keysym_return, 0);
XFlush(fl_get_display());
switch (keysym_return) {
fl_get_browser_maxline(combo->browser))
fl_select_browser_line(combo->browser,
fl_get_browser(combo->browser)+1);
- if (fl_get_browser(combo->browser)>=
+ if (fl_get_browser(combo->browser)>=
fl_get_browser_topline(combo->browser) +
fl_get_browser_screenlines(combo->browser))
fl_set_browser_topline(combo->browser,
fl_get_browser_topline(combo->browser))
fl_set_browser_topline(combo->browser,
fl_get_browser(combo->browser));
- return 1;
+ return 1;
case XK_Up:
if (fl_get_browser(combo->browser) > 1)
fl_select_browser_line(combo->browser,
fl_get_browser(combo->browser)-1);
- if (fl_get_browser(combo->browser)>=
+ if (fl_get_browser(combo->browser)>=
fl_get_browser_topline(combo->browser) +
fl_get_browser_screenlines(combo->browser))
fl_set_browser_topline(combo->browser,
combo->hide(1);
return 1;
}
- return 0;
+ return 0;
}
Combox combo(FL_COMBOX_INPUT);
FD_test *fd_test;
-
+
FD_test *create_form_test(void)
{
FL_OBJECT *obj;
FD_test *fdui = (FD_test *) fl_calloc(1, sizeof(*fdui));
-
+
fdui->test = fl_bgn_form(FL_NO_BOX, 320, 190);
obj = fl_add_box(FL_UP_BOX, 0, 0, 320, 190, "");
obj = fl_add_box(FL_DOWN_BOX, 10, 50, 300, 110, "");
obj = fl_add_button(FL_NORMAL_BUTTON, 250, 10, 50, 30, _("Done"));
- combo.add(10, 15, 120, 25, 135);
+ combo.add(10, 15, 120, 25, 135);
fl_end_form();
return fdui;
int main(int argc, char *argv[])
{
//int n1;
-
- // Same defaults as in lyx
+
+ // Same defaults as in lyx
FL_IOPT cntl;
cntl.buttonFontSize = FL_NORMAL_SIZE;
cntl.browserFontSize = FL_NORMAL_SIZE;
cntl.choiceFontSize = FL_NORMAL_SIZE;
cntl.inputFontSize = FL_NORMAL_SIZE;
cntl.borderWidth = -2;
- fl_set_defaults(FL_PDButtonFontSize, &cntl);
- fl_set_defaults(FL_PDBrowserFontSize, &cntl);
- fl_set_defaults(FL_PDLabelFontSize, &cntl);
- fl_set_defaults(FL_PDChoiceFontSize, &cntl);
- fl_set_defaults(FL_PDInputFontSize, &cntl);
+ fl_set_defaults(FL_PDButtonFontSize, &cntl);
+ fl_set_defaults(FL_PDBrowserFontSize, &cntl);
+ fl_set_defaults(FL_PDLabelFontSize, &cntl);
+ fl_set_defaults(FL_PDChoiceFontSize, &cntl);
+ fl_set_defaults(FL_PDInputFontSize, &cntl);
fl_set_defaults(FL_PDBorderWidth, &cntl);
fl_initialize(&argc, argv, 0, 0, 0);
-
+
fd_test = create_form_test();
/* fill-in form initialization code */
combo.addline("Verbatim");
combo.setcallback(combo_cb);
// combo.select(4);
-
+
/* show the first form */
fl_show_form(fd_test->test, FL_PLACE_CENTER, FL_FULLBORDER, "test");
fl_do_forms();
* get a combobox-like object. All XForms functions are hidden.
*
* Change log:
- *
- * 2/06/1996, Alejandro Aguilar Sierra
+ *
+ * 2/06/1996, Alejandro Aguilar Sierra
* Created and tested.
- *
- * 4/06/1996, Alejandro Aguilar Sierra
+ *
+ * 4/06/1996, Alejandro Aguilar Sierra
* Added droplist mode (a button with a black down arrow at right)
* and support for middle and right buttons, as XForms choice object.
- */
+ */
#ifndef COMBOX_H
#define COMBOX_H
*/
void add(int x, int y, int w, int hmin, int hmax,
FL_OBJECT * tabfolder1_ = 0, FL_OBJECT * tabfolder2_ = 0);
-
+
/// Add lines. Same as for fl_browser object
void addline(string const &);
/// Add lines. Same as for fl_browser object
void addto(string const &);
-
+
/// Returns the selected item
int get() const;
-
+
/// Returns a pointer to the selected line of text
string const getline() const;
-
+
/// Select an arbitrary item
void select(int);
///
- bool select(string const &);
-
+ bool select(string const &);
+
/// Clear all the list
void clear();
/// Is the combox cleared (empty)
bool empty() const { return is_empty; }
-
- /// Remove the objects from the form they are in.
+
+ /// Remove the objects from the form they are in.
void remove();
- /**
+ /**
* Assign a callback to this object. The callback should be a void
- * function with a int, a void pointer, and a Combox pointer as
+ * function with a int, a void pointer, and a Combox pointer as
* parameters.
*/
void setcallback(FL_COMBO_CB, void *);
-
- /// Pre handler
+
+ /// Pre handler
void setpre(FL_COMBO_PRE_POST);
/// Post handler
void setpost(FL_COMBO_PRE_POST);
-
+
/// XForms attributes
void resize(unsigned);
///
///
void deactivate();
///
- void shortcut(string const &, int);
+ void shortcut(string const &, int);
///
void redraw();
///
///
static void input_cb(FL_OBJECT *, long);
///
- static int peek_event(FL_FORM *, void *);
+ static int peek_event(FL_FORM *, void *);
protected:
- /// At least Hide should not be public
+ /// At least Hide should not be public
void hide(int who = 0);
///
FL_OBJECT * browser;
///
combox_type type;
///
- int bw;
+ int bw;
///
int bh;
///
///
FL_OBJECT * label;
///
- FL_FORM* form;
+ FL_FORM* form;
///
FL_OBJECT * tabfolder1;
///
-//----------------- Inline methods ---------------------------
+//----------------- Inline methods ---------------------------
inline
void Combox::addto(string const & text)
void Combox::resize(unsigned r)
{
fl_set_object_resize(button, r);
- if (label!= button) fl_set_object_resize(label, r);
+ if (label!= button) fl_set_object_resize(label, r);
}
void Combox::gravity(unsigned g1, unsigned g2)
{
fl_set_object_gravity(button, g1, g2);
- if (label!= button) fl_set_object_gravity(label, g1, g2);
+ if (label!= button) fl_set_object_gravity(label, g1, g2);
}
inline
string const Combox::getline() const
{
- if (type == FL_COMBOX_INPUT)
+ if (type == FL_COMBOX_INPUT)
return fl_get_input(label);
else
return (browser && sel > 0) ?
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
return fdui;
}
/*---------------------------------------*/
-
That might be acceptable if there was a "to_page"
entry however if you start making a page range in the "from"
field you can do it all in the "from" field. That is, a
- range in the "from" field immmediately blanks the "to"
+ range in the "from" field immmediately blanks the "to"
field. */
}
return FL_INVALID|FL_RINGBELL;
}
}
}
-#endif
+#endif
#if defined(__cplusplus)
}
/// Get the image width
unsigned int getWidth() const;
-
+
/// Get the image height
unsigned int getHeight() const;
/// Clip the image using params.
void clip(GParams const & params);
-
+
/// Rotate the image using params.
void rotate(GParams const & params);
-
+
/// Scale the image using params.
void scale(GParams const & params);
///
PIXMAP_SUCCESS
};
-
+
PixmapStatus pixmap_status_;
/// Emit this signal when the loading process is finished.
#ifdef __GNUG_
#pragma implementation
#endif
-
+
#include "xforms_helpers.h"
#include "lyxlex.h"
#include "gettext.h"
while (se[0]!= 0 && se[0] != '|') ++se;
if (se[0] == 0) return sc;
-
+
char * sb = new char[se - sc + 1];
int index = 0;
register char const * sd = sc;
}
}
-
+
// Given an fl_choice, create a vector of its entries
vector<string> const getVectorFromChoice(FL_OBJECT * ob)
{
// Given an fl_browser, return the contents of line
string const getStringFromBrowser(FL_OBJECT * ob, int line)
{
- if (!ob || ob->objclass != FL_BROWSER ||
+ if (!ob || ob->objclass != FL_BROWSER ||
line < 1 || line > fl_get_browser_maxline(ob))
return string();
return length + unit;
}
-
+
#if 0
// old code which can be deleted if the new one, now enabled,
}
}
}
-
+
fl_set_input(input, len.c_str());
fl_set_choice(choice, unitpos);
}
ostringstream buffer;
buffer << len.value();
fl_set_input(input, buffer.str().c_str());
- fl_set_choice_text(choice,
+ fl_set_choice_text(choice,
subst(stringFromUnit(len.unit()),"%","%%").c_str());
}
}
word.erase();
}
if ((*sit) == '\n') word += '\n';
-
+
} else {
word += (*sit);
}
line += ' ';
line += word;
}
-
+
if (nxtpos == string::npos) {
if (!line.empty())
sout += line;
curpos = nxtpos+1;
}
#endif
-
+
return sout;
}
{ "\\gui_inactive", FL_INACTIVE },
{ "\\gui_pointer", FL_FREE_COL16 },
{ "\\gui_push_button", FL_YELLOW },
- { "\\gui_selected", FL_MCOL },
+ { "\\gui_selected", FL_MCOL },
{ "\\gui_text", FL_BLACK }
};
switch (le) {
case LyXLex::LEX_UNDEF:
lexrc.printError("Unknown tag `$$Token'");
- continue;
+ continue;
case LyXLex::LEX_FEOF:
continue;
default: break;
error_message = N_("Directory does not exist.");
return false;
}
-
+
if (!d.writable()) {
error_message = N_("Cannot write to this directory.");
return false;
error_message = N_("Cannot write to this file.");
return false;
}
-
+
return true;
}
error_message = N_("Directory does not exist.");
return false;
}
-
+
if (!d.readable()) {
error_message = N_("Cannot read from this directory.");
return false;
error_message = N_("File does not exist.");
return false;
}
-
+
if (!f.readable()) {
error_message = N_("Cannot read from this file.");
return false;
#endif
#include FORMS_H_LOCATION
-
+
#include "Color.h"
#include "LString.h"
-
+
#include <vector>
class LyXLength;
string const choice_Length_All =
"cm|mm|in|t%%|c%%|p%%|l%%|ex|em|pt|sp|bp|dd|pc|cc|mu";
string const choice_Length_WithUnit =
- "cm|mm|in|ex|em|pt|sp|bp|dd|pc|cc|mu"; // all with a Unit
+ "cm|mm|in|ex|em|pt|sp|bp|dd|pc|cc|mu"; // all with a Unit
/// Extract shortcut from <ident>|<shortcut> string
char const * flyx_shortcut_extract(char const * sc);