]> git.lyx.org Git - features.git/commitdiff
Angus insetindex patch + protect patch from Dekel
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 3 Aug 2000 12:56:25 +0000 (12:56 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 3 Aug 2000 12:56:25 +0000 (12:56 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@950 a592a061-630c-0410-9148-cb99ea01b6c8

33 files changed:
ChangeLog
lib/ui/default.ui
po/POTFILES.in
src/LyXAction.C
src/buffer.C
src/commandtags.h
src/frontends/Dialogs.h
src/frontends/xforms/Dialogs.C
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormCitation.h
src/frontends/xforms/FormCommand.C
src/frontends/xforms/FormCommand.h
src/frontends/xforms/FormIndex.C [new file with mode: 0644]
src/frontends/xforms/FormIndex.h [new file with mode: 0644]
src/frontends/xforms/FormToc.C
src/frontends/xforms/FormToc.h
src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormUrl.h
src/frontends/xforms/Makefile.am
src/frontends/xforms/form_index.C [new file with mode: 0644]
src/frontends/xforms/form_index.h [new file with mode: 0644]
src/frontends/xforms/forms/form_index.fd [new file with mode: 0644]
src/frontends/xforms/forms/makefile
src/insets/insetcite.C
src/insets/insetcite.h
src/insets/insetindex.C
src/insets/insetindex.h
src/insets/insettoc.h
src/insets/inseturl.h
src/lyx_gui_misc.C
src/lyxfunc.C
src/mathed/math_write.C
src/menus.C

index 503fd4ec519a7b86bfa9a48b51b9fe901ceb5d29..d165bb87ef6ca718078a213b260b7e260a067d5b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2000-08-03  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * src/commandtags.h: renamed, created some flags for citation
+       and index
+
+       * src/lyx_gui_misc.C: stripped out old FD_index_form code
+
+       * src/lyxfunc.C (dispatch): use signals to insert index entry
+       
+       * src/frontends/Dialogs.h: new signal createIndex
+
+       * src/frontends/xforms/FormCommand.[Ch],
+       src/frontends/xforms/FormCitation.[Ch],
+       src/frontends/xforms/FormToc.[Ch],
+       src/frontends/xforms/FormUrl.[Ch]: clean up and comment better
+
+       * src/insets/insetindex.[Ch]: GUI-independent
+
+       * src/frontends/xforms/FormIndex.[Ch],
+       * src/frontends/xforms/forms/form_index.fd: xforms implementation
+       of the Index dialog
+       
+  2000-08-02  Lars Gullik Bjønnes  <larsbj@lyx.org>
+  
+       * src/insets/insetref.C (Latex): rewrite so that there is now
+2000-08-01  Dekel Tsur  <dekel@math.tau.ac.il>
+
+       * src/mathed/math_write.C (MathDecorationInset::Write) Put \protect 
+       before \overbrace, \underbrace, \overleftarrow, or \overrightarrow.
+       
 2000-08-02  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * src/insets/insetref.C (Latex): rewrite so that there is now
index 16d00dd0c235fa21e085a757c15597ccfc0d0911..fcdf30416513822fccf7b1817d4bf806598eb30e 100644 (file)
@@ -72,7 +72,7 @@ Menuset
        OptItem "as LinuxDoc|L" "buffer-export linuxdoc"
        OptItem "as DocBook|B" "buffer-export docbook"
        Item "as DVI|D" "buffer-export dvi"
-       Item "as Postscript|P" "buffer-export postscript"
+#      Item "as Postscript|P" "buffer-export postscript"
        Item "as Ascii|A" "buffer-export ascii"
        Item "as HTML|H" "buffer-export html"
        OptItem "Custom...|C" "buffer-export custom"
index 8e277b5b4c433f7a10e09aaa09511e2370319764..5c8546de1a340ae88a22e9b5303eb2fd925a34e1 100644 (file)
@@ -32,6 +32,8 @@ src/frontends/xforms/FormCopyright.C
 src/frontends/xforms/form_copyright.C
 src/frontends/xforms/FormGraphics.C
 src/frontends/xforms/form_graphics.C
+src/frontends/xforms/FormIndex.C
+src/frontends/xforms/form_index.C
 src/frontends/xforms/FormPreferences.C
 src/frontends/xforms/form_preferences.C
 src/frontends/xforms/FormPrint.C
index b27dcbe828607bddec9d9a742809123065a3b588..6c52cc69233de38621c76f4a465c472b085e064c 100644 (file)
@@ -164,7 +164,7 @@ void LyXAction::init()
                  ReadOnly },
                { LFUN_RIGHT, "char-forward", N_("Go one char forward"),
                  ReadOnly },
-               { LFUN_CREATE_CITATION, "citation-insert",
+               { LFUN_CITATION_CREATE, "citation-insert",
                  N_("Insert citation"), Noop },
                { LFUN_EXEC_COMMAND, "command-execute", "", NoBuffer },
                { LFUN_PREFIX, "command-prefix",
@@ -247,9 +247,9 @@ void LyXAction::init()
                { LFUN_HTMLURL, "html-insert", "", Noop },
                { LFUN_HYPHENATION, "hyphenation-point-insert",
                  N_("Insert hyphenation point"), Noop },
-               { LFUN_INDEX_INSERT, "index-insert",
+               { LFUN_INDEX_CREATE, "index-insert",
                  N_("Insert index item"), Noop },
-               { LFUN_INDEX_INSERT_LAST, "index-insert-last",
+               { LFUN_INDEX_CREATE_LAST, "index-insert-last",
                  N_("Insert last index item"), Noop },
                { LFUN_INDEX_PRINT, "index-print", N_("Insert index list"),
                  Noop },
index 51d923fc03bb61f6ce779f9933d49e712e5904ed..9284be47bdd80f5b0517cf2734eef1cd96e93345 100644 (file)
@@ -962,7 +962,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                        } else if (inscmd.getCmdName() == "BibTeX") {
                                inset = new InsetBibtex(inscmd.getContents(), inscmd.getOptions(), this);
                        } else if (inscmd.getCmdName() == "index") {
-                               inset = new InsetIndex(inscmd.getContents());
+                               inset = new InsetIndex(inscmd.params());
                        } else if (inscmd.getCmdName() == "include") {
                                inset = new InsetInclude(inscmd.getContents(), this);
                        } else if (inscmd.getCmdName() == "label") {
@@ -984,7 +984,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                                   || inscmd.getCmdName() == "listoftables") {
                                inset = new InsetTOC(inscmd.params());
                        } else if (inscmd.getCmdName() == "printindex") {
-                               inset = new InsetPrintIndex(this);
+                               inset = new InsetPrintIndex(inscmd.params());
                        } else if (inscmd.getCmdName() == "lyxparent") {
                                inset = new InsetParent(inscmd.getContents(), this);
                        }
@@ -1193,7 +1193,7 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par,
                        inset = new InsetBibtex(inscmd.getContents(),
                                                inscmd.getOptions(), this);
                } else if (inscmd.getCmdName() == "index") {
-                       inset = new InsetIndex(inscmd.getContents());
+                       inset = new InsetIndex(inscmd.params());
                } else if (inscmd.getCmdName() == "include") {
                        inset = new InsetInclude(inscmd.getContents(), this);
                } else if (inscmd.getCmdName() == "label") {
@@ -1216,7 +1216,7 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par,
                           || inscmd.getCmdName() == "listoftables") {
                        inset = new InsetTOC(inscmd.params());
                } else if (inscmd.getCmdName() == "printindex") {
-                       inset = new InsetPrintIndex(this);
+                       inset = new InsetPrintIndex(inscmd.params());
                } else if (inscmd.getCmdName() == "lyxparent") {
                        inset = new InsetParent(inscmd.getContents(), this);
                }
index 61cfebcf0081a8c044f225481a459f3070cac540..902f2ab7f9dbefafb65125fe2e0b93d34ef023c3 100644 (file)
@@ -196,10 +196,10 @@ enum kb_action {
        LFUN_MENURELOAD,                // Asger 1997-02-02
        LFUN_FAX,                       // Asger 1997-02-10
        LFUN_RECONFIGURE,               // Asger 1997-02-14
-       LFUN_INSERT_CITATION,           // AAS 97-02-23
+       LFUN_CITATION_INSERT,           // AAS 97-02-23
        LFUN_INSERT_BIBTEX,             // AAS 97-02-23
-       LFUN_INDEX_INSERT,              // Lgb 97-02-27
-       LFUN_INDEX_INSERT_LAST, // 180  // Reh 98-09-17
+       LFUN_INDEX_CREATE,              // Lgb 97-02-27
+       LFUN_INDEX_CREATE_LAST, // 180  // Reh 98-09-17
        LFUN_INDEX_PRINT,               // Lgb 97-02-27
        LFUN_APROPOS,                   // Asger 1997-02-27
        LFUN_LATEX_LOG,                 // Lgb 97-04-05
@@ -267,12 +267,13 @@ enum kb_action {
        LFUN_INSET_FLOAT,               // Lgb 20000627
        LFUN_INSET_LIST,                // Lgb 20000627
        LFUN_INSET_THEOREM,             // Lgb 20000630
-       LFUN_CREATE_CITATION,           // Angus 20000705
+       LFUN_CITATION_CREATE,           // Angus 20000705
        LFUN_INSET_CAPTION,             // Lgb 20000718
        LFUN_SWITCHBUFFER,  // and where is this comming from?
        LFUN_INSERT_URL,                // Angus 20000726
        LFUN_TABULAR_FEATURE,           // Jug 20000728
        LFUN_LAYOUT_TABULAR,            // Jug 20000731
+       LFUN_INDEX_INSERT,              // Angus 20000803
        LFUN_LASTACTION  /* this marks the end of the table */
 };
 
index df2715107f5b7bae593e86bfc51850db08347e98..6d3ac5c90652cad761fa103bacb3ce4cf6976719 100644 (file)
@@ -33,7 +33,6 @@ class InsetGraphics;
 class InsetBibKey;
 class InsetBibtex;
 class InsetInclude;
-class InsetIndex;
 class InsetInfo;
 class InsetTabular;
 class InsetCommand;
@@ -109,7 +108,9 @@ public:
        ///
        Signal1<void, InsetInclude *> showInclude;
        ///
-       Signal1<void, InsetIndex *> showIndex;
+       Signal1<void, InsetCommand *> showIndex;
+       ///
+       Signal1<void, string const &> createIndex;
        ///
        Signal1<void, InsetBibKey *> showBibkey;
        ///
index d58f906a00a7bbc4d23a016050e1e7c0b4f4909e..e193eecc06a5968ae36e89cafc0a10c17d4a6afd 100644 (file)
@@ -2,10 +2,11 @@
 #include FORMS_H_LOCATION
 
 #include "Dialogs.h"
+#include "FormCitation.h"
 #include "FormCopyright.h"
-#include "FormPreferences.h"
 #include "FormGraphics.h"
-#include "FormCitation.h"
+#include "FormIndex.h"
+#include "FormPreferences.h"
 #include "FormPrint.h"
 #include "FormTabular.h"
 #include "FormToc.h"
 
 Dialogs::Dialogs(LyXView * lv)
 {
+       dialogs_.push_back(new FormCitation(lv, this));
        dialogs_.push_back(new FormCopyright(lv, this));
-       dialogs_.push_back(new FormPreferences(lv, this));
        dialogs_.push_back(new FormGraphics(lv, this));
-       dialogs_.push_back(new FormCitation(lv, this));
+       dialogs_.push_back(new FormIndex(lv, this));
+       dialogs_.push_back(new FormPreferences(lv, this));
        dialogs_.push_back(new FormPrint(lv, this));
        dialogs_.push_back(new FormTabular(lv, this));
        dialogs_.push_back(new FormToc(lv, this));
index c09e26a4a993ae0761680b73ca35e1371ebc8a10..cee0946f1ee733df9179f03a56ecd8b8523790da 100644 (file)
@@ -40,7 +40,7 @@ static vector<string> bibkeys;
 static vector<string> bibkeysInfo;
 
 FormCitation::FormCitation(LyXView * lv, Dialogs * d)
-  : FormCommand(lv, d, _("Citation")), dialog_(0)
+       : FormCommand(lv, d, _("Citation")), dialog_(0)
 {
        // let the dialog be shown
        // These are permanent connections so we won't bother
@@ -52,11 +52,18 @@ FormCitation::FormCitation(LyXView * lv, Dialogs * d)
 
 FormCitation::~FormCitation()
 {
-       free();
        delete dialog_;
 }
 
 
+void FormCitation::clearStore()
+{
+       citekeys.clear();
+       bibkeys.clear();
+       bibkeysInfo.clear();
+}
+
+
 void FormCitation::build()
 {
        dialog_ = build_citation();
@@ -416,7 +423,7 @@ void FormCitation::apply()
                        lv_->view()->updateInset( inset_, true );
                }
        } else {
-               lv_->getLyXFunc()->Dispatch( LFUN_INSERT_CITATION,
+               lv_->getLyXFunc()->Dispatch( LFUN_CITATION_INSERT,
                                             params.getAsString().c_str() );
        }
 }
index 76781bac88592fafa53430a3145f3df9d897ac8f..cf542c1703feef7fe2fae34080fac9c9b9ea1f3f 100644 (file)
@@ -43,17 +43,19 @@ public:
        //@}
 
 private:
-       /**@name Slot Methods */
-       //@{
-       virtual void update();
-       /// Apply from dialog
-       virtual void apply();
-       /// Filter the inputs
-       virtual void input( long );
        /// Build the dialog
        virtual void build();
-       ///
+       /// Filter the inputs
+       virtual void input( long );
+       /// Update dialog before showing it
+       virtual void update();
+       /// Apply from dialog (modify or create inset)
+       virtual void apply();
+       /// delete derived class variables from hide()
+       virtual void clearStore();
+       /// Pointer to the actual instantiation of the xform's form
        virtual FL_FORM * const form() const;
+
        ///
        void updateBrowser( FL_OBJECT *, std::vector<string> const & ) const;
        ///
@@ -64,7 +66,6 @@ private:
        void setSize( int, bool ) const;
        ///
        FD_form_citation * build_citation();
-       //@}
 
        /// Real GUI implementation.
        FD_form_citation * dialog_;
index 4f30c131ef848ab63b2bc0d3ca5ea8d915db9f26..44237d86d6e1aa97e8de84a66aedb0690150d58d 100644 (file)
@@ -34,15 +34,18 @@ FormCommand::FormCommand(LyXView * lv, Dialogs * d, string const & t)
 {}
 
 
+FormCommand::~FormCommand()
+{
+       free();
+}
+
+
 void FormCommand::showInset( InsetCommand * const inset )
 {
        if( dialogIsOpen || inset == 0 ) return;
 
        inset_ = inset;
-       // companion to Lars' commenting out in insetcommand.
-       // need a better plan perhaps since there seems to be a small
-       // flaw here if we copy an inset while it's visible
-       //      ih_ = inset_->hide.connect(slot(this, &FormCommand::hide));
+       ih_ = inset_->hide.connect(slot(this, &FormCommand::hide));
 
        params = inset->params();
        show();
@@ -110,6 +113,7 @@ void FormCommand::hide()
        inset_ = 0;
        ih_.disconnect();
        dialogIsOpen = false;
+       clearStore();
 }
 
 
index 34da04483661ab47c23f9e13f80073a9d806b133..a0d89367bc524baa8be4478e0129bab6e5d2f70f 100644 (file)
@@ -31,6 +31,8 @@ class FormCommand : public DialogBase, public noncopyable {
 public:
        /// Constructor
        FormCommand(LyXView *, Dialogs *, string const & );
+       /// Destructor
+       virtual ~FormCommand();
 
        /**@name Real per-instance Callback Methods */
        //@{
@@ -44,29 +46,26 @@ public:
 protected:
        /**@name Slot Methods */
        //@{
-       /// Create the dialog if necessary, update it and display it.
+       /// Slot launching dialog to (possibly) create a new inset
        void createInset( string const & );
-       /// 
+       /// Slot launching dialog to an existing inset
        void showInset( InsetCommand * const );
-       /// 
-       void show();
-       /// Hide the dialog.
-       void hide();
-       /// Explicitly free the dialog.
-       void free();
-       ///
+       //@}
+
+       /// Build the dialog
+       virtual void build() = 0;
+       /// Filter the inputs on callback from xforms
        virtual void input( long ) = 0;
-       ///
+       /// Update dialog before showing it
        virtual void update() = 0;
-       /// Apply from dialog
+       /// Apply from dialog (modify or create inset)
        virtual void apply() = 0;
-       /// Build the dialog
-       virtual void build() = 0;
-       ///
+       /// delete derived class variables from hide()
+       virtual void clearStore() {}
+       /// Pointer to the actual instantiation of the xform's form
        virtual FL_FORM * const form() const = 0;
-       //@}
 
-       /**@name Private Data */
+       /**@name Protected Data */
        //@{
        /** Which LyXFunc do we use?
            We could modify Dialogs to have a visible LyXFunc* instead and
@@ -77,19 +76,32 @@ protected:
            Used so we can get at the signals we have to connect to.
        */
        Dialogs * d_;
+       /// pointer to the inset passed through showInset (if any)
+       InsetCommand * inset_;
+       /// the nitty-griity. What is modified and passed back
+       InsetCommandParams params;
+       //@}
+
+private:
+       /// Create the dialog if necessary, update it and display it.
+       void show();
+       /// Hide the dialog.
+       void hide();
+       /// Explicitly free the dialog.
+       void free();
+
+
+       /**@name Private Data */
+       //@{
        /// Update connection.
        Connection u_;
        /// Hide connection.
        Connection h_;
        /// inset::hide connection.
        Connection ih_;
-       ///
-       InsetCommand * inset_;
-       ///
+       /// block opening of form from more than one inset
        bool dialogIsOpen;
-       ///
-       InsetCommandParams params;
-       ///
+       /// dialog title, displayed by WM.
        string title;
        //@}
 };
diff --git a/src/frontends/xforms/FormIndex.C b/src/frontends/xforms/FormIndex.C
new file mode 100644 (file)
index 0000000..147886c
--- /dev/null
@@ -0,0 +1,108 @@
+// -*- C++ -*-
+/* This file is part of
+ * ====================================================== 
+ *
+ *           LyX, The Document Processor
+ *
+ *           Copyright 2000 The LyX Team.
+ *
+ * ======================================================
+ */
+
+#include <config.h>
+
+#include FORMS_H_LOCATION
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+
+#include "gettext.h"
+#include "Dialogs.h"
+#include "FormIndex.h"
+#include "LyXView.h"
+#include "buffer.h"
+#include "form_index.h"
+#include "lyxfunc.h"
+
+FormIndex::FormIndex(LyXView * lv, Dialogs * d)
+       : FormCommand(lv, d, _("Index")), dialog_(0)
+{
+       // let the dialog be shown
+       // These are permanent connections so we won't bother
+       // storing a copy because we won't be disconnecting.
+       d->showIndex.connect(slot(this, &FormIndex::showInset));
+       d->createIndex.connect(slot(this, &FormIndex::createInset));
+}
+
+
+FormIndex::~FormIndex()
+{
+       delete dialog_;
+}
+
+
+void FormIndex::build()
+{
+       dialog_ = build_index();
+}
+
+
+FL_FORM * const FormIndex::form() const
+{
+       if( dialog_ && dialog_->form_index )
+               return dialog_->form_index;
+       else
+               return 0;
+}
+
+
+void FormIndex::update()
+{
+       static int ow = -1, oh;
+
+       if (ow < 0) {
+               ow = dialog_->form_index->w;
+               oh = dialog_->form_index->h;
+
+               fl_set_form_minsize(dialog_->form_index, ow, oh);
+               fl_set_form_maxsize(dialog_->form_index, 2*ow, oh);
+       }
+
+       fl_freeze_form( dialog_->form_index );
+
+       fl_set_input(dialog_->key, params.getContents().c_str());
+
+       if( lv_->buffer()->isReadonly() ) {
+               fl_deactivate_object( dialog_->key );
+               fl_deactivate_object( dialog_->ok );
+               fl_set_object_lcol( dialog_->ok, FL_INACTIVE );
+       } else {
+               fl_activate_object( dialog_->key );
+               fl_activate_object( dialog_->ok );
+               fl_set_object_lcol( dialog_->ok, FL_BLACK );
+       }
+
+       fl_unfreeze_form( dialog_->form_index );
+}
+
+
+void FormIndex::apply()
+{
+       if( lv_->buffer()->isReadonly() ) return;
+
+       params.setContents( fl_get_input(dialog_->key) );
+
+       if( inset_ != 0 )
+       {
+               // Only update if contents have changed
+               if( params.getContents() != inset_->getContents() ) {
+                       inset_->setParams( params );
+                       lv_->view()->updateInset( inset_, true );
+               }
+       } else {
+               lv_->getLyXFunc()->Dispatch( LFUN_INDEX_INSERT,
+                                            params.getAsString().c_str() );
+       }
+}
diff --git a/src/frontends/xforms/FormIndex.h b/src/frontends/xforms/FormIndex.h
new file mode 100644 (file)
index 0000000..4b7fa42
--- /dev/null
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+/* This file is part of
+ * ====================================================== 
+ *
+ *           LyX, The Document Processor
+ *
+ *           Copyright 2000 The LyX Team.
+ *
+ * ======================================================
+ */
+
+#ifndef FORMINDEX_H
+#define FORMINDEX_H
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include "FormCommand.h"
+struct FD_form_index;
+
+/** This class provides an XForms implementation of the FormIndex Dialog.
+ */
+class FormIndex : public FormCommand {
+public:
+       /**@name Constructors and Destructors */
+       //@{
+       ///
+       FormIndex(LyXView *, Dialogs *);
+       ///
+       ~FormIndex();
+       //@}
+
+private:
+       /// Build the dialog
+       virtual void build();
+       /// Not used but must be instantiated
+       virtual void input( long ) {}
+       /// Update dialog before showing it
+       virtual void update();
+       /// Apply from dialog (modify or create inset)
+       virtual void apply();
+       /// Pointer to the actual instantiation of the xform's form
+       virtual FL_FORM * const form() const;
+       ///
+       FD_form_index * build_index();
+       //@}
+
+       /// Real GUI implementation.
+       FD_form_index * dialog_;
+};
+
+#endif
index 8063ec4a67226cc62734d9f4d442d9e52ab6a111..4dba7b0fb0c6cae02952c7766182ff158925c37e 100644 (file)
@@ -30,7 +30,7 @@
 static vector<Buffer::TocItem> toclist;
 
 FormToc::FormToc(LyXView * lv, Dialogs * d)
-  : FormCommand(lv, d, _("Table of Contents")), dialog_(0)
+       : FormCommand(lv, d, _("Table of Contents")), dialog_(0)
 {
        // let the dialog be shown
        // These are permanent connections so we won't bother
@@ -42,11 +42,16 @@ FormToc::FormToc(LyXView * lv, Dialogs * d)
 
 FormToc::~FormToc()
 {
-       free();
        delete dialog_;
 }
 
 
+void FormToc::clearStore()
+{
+       toclist.clear();
+}
+
+
 void FormToc::build()
 {
        dialog_ = build_toc();
index c115b9f9934da246b5674b841b1f55d260ef9fc2..6825b212c9c18880a6e04e36a0d09409ddec2c0c 100644 (file)
@@ -31,23 +31,22 @@ public:
        ~FormToc();
 
 private:
-       /**@name Slot Methods */
-       //@{
-       ///
-       virtual void update();
-       /// Apply from dialog
-       virtual void apply();
-       ///
-       virtual void input( long ) {};
        /// Build the dialog
        virtual void build();
-       ///
+       /// Not used but must be instantiated
+       virtual void input( long ) {}
+       /// Update dialog before showing it
+       virtual void update();
+       /// Apply from dialog (modify or create inset)
+       virtual void apply();
+       /// delete derived class variables from hide()
+       virtual void clearStore();
+       /// Pointer to the actual instantiation of the xform's form
        virtual FL_FORM * const form() const;
        ///
        void updateToc();
        ///
        FD_form_toc * build_toc();
-       //@}
 
        /// Real GUI implementation.
        FD_form_toc * dialog_;
index 41873282c3902179fc505b1ee6b2974969a31443..bf640fe656350093e8ebbc7a54f737b42eeeb715 100644 (file)
 
 
 #include "gettext.h"
-#include "BufferView.h"
 #include "Dialogs.h"
 #include "FormUrl.h"
 #include "LyXView.h"
 #include "buffer.h"
 #include "form_url.h"
 #include "lyxfunc.h"
-#include "xform_macros.h"
-#include "insets/insetcommand.h"
-#include "insets/inseturl.h"
-#include "support/filetools.h"
 
 FormUrl::FormUrl(LyXView * lv, Dialogs * d)
-  : FormCommand(lv, d, _("Url")), dialog_(0)
+       : FormCommand(lv, d, _("Url")), dialog_(0)
 {
        // let the dialog be shown
        // These are permanent connections so we won't bother
@@ -44,7 +39,6 @@ FormUrl::FormUrl(LyXView * lv, Dialogs * d)
 
 FormUrl::~FormUrl()
 {
-       free();
        delete dialog_;
 }
 
index 6bb5d0ea14a3c7daa3bf5f5a4ad65a81fc5d9c82..0635409c85265419a244f5f64521274172e8ada1 100644 (file)
@@ -32,17 +32,15 @@ public:
        //@}
 
 private:
-       /**@name Slot Methods */
-       //@{
-       ///
-       virtual void update();
-       /// Apply from dialog
-       void apply();
-       ///
-       virtual void input( long ) {};
        /// Build the dialog
-       void build();
-       ///
+       virtual void build();
+       /// Not used but must be instantiated
+       virtual void input( long ) {}
+       /// Update dialog before showing it
+       virtual void update();
+       /// Apply from dialog (modify or create inset)
+       virtual void apply();
+       /// Pointer to the actual instantiation of the xform's form
        virtual FL_FORM * const form() const;
        ///
        FD_form_url * build_url();
index 0cca58a829a1a792df6d7f4bfda611c352839cb6..abcfc97fdf4061f8dbd404a6a8663f8a00c6228c 100644 (file)
@@ -26,6 +26,10 @@ libxforms_la_SOURCES = \
        FormGraphics.h \
        form_graphics.C \
        form_graphics.h \
+       FormIndex.C \
+       FormIndex.h \
+       form_index.C \
+       form_index.h \
        FormPreferences.C \
        FormPreferences.h \
        form_preferences.C \
diff --git a/src/frontends/xforms/form_index.C b/src/frontends/xforms/form_index.C
new file mode 100644 (file)
index 0000000..a644864
--- /dev/null
@@ -0,0 +1,40 @@
+// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
+#include <config.h>
+#include "lyx_gui_misc.h"
+#include "gettext.h"
+
+/* Form definition file generated with fdesign. */
+
+#include FORMS_H_LOCATION
+#include <stdlib.h>
+#include "form_index.h"
+#include "FormIndex.h" 
+
+FD_form_index * FormIndex::build_index()
+{
+  FL_OBJECT *obj;
+  FD_form_index *fdui = new FD_form_index;
+
+  fdui->form_index = fl_bgn_form(FL_NO_BOX, 520, 100);
+  fdui->form_index->u_vdata = this;
+  obj = fl_add_box(FL_UP_BOX, 0, 0, 520, 100, "");
+  fdui->key = obj = fl_add_input(FL_NORMAL_INPUT, 90, 10, 420, 30, _("Keyword"));
+    fl_set_input_shortcut(obj, scex(_("Keyword|#K#k")), 1);
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_resize(obj, FL_RESIZE_X);
+  fdui->cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 410, 60, 100, 30, _("Cancel"));
+    fl_set_button_shortcut(obj, _("^["), 1);
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
+    fl_set_object_callback(obj, C_FormCommandCancelCB, 0);
+  fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON, 300, 60, 100, 30, _("OK"));
+    fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
+    fl_set_object_callback(obj, C_FormCommandOKCB, 0);
+  fl_end_form();
+
+  fdui->form_index->fdui = fdui;
+
+  return fdui;
+}
+/*---------------------------------------*/
+
diff --git a/src/frontends/xforms/form_index.h b/src/frontends/xforms/form_index.h
new file mode 100644 (file)
index 0000000..7cec02b
--- /dev/null
@@ -0,0 +1,20 @@
+/** Header file generated with fdesign on Thu Aug  3 11:33:50 2000.**/
+
+#ifndef FD_form_index_h_
+#define FD_form_index_h_
+
+/** Callbacks, globals and object handlers **/
+extern  "C" void C_FormCommandCancelCB(FL_OBJECT *, long);
+extern  "C" void C_FormCommandOKCB(FL_OBJECT *, long);
+
+
+/**** Forms and Objects ****/
+struct FD_form_index {
+
+       FL_FORM *form_index;
+       FL_OBJECT *key;
+       FL_OBJECT *cancel;
+       FL_OBJECT *ok;
+};
+
+#endif /* FD_form_index_h_ */
diff --git a/src/frontends/xforms/forms/form_index.fd b/src/frontends/xforms/forms/form_index.fd
new file mode 100644 (file)
index 0000000..996cf87
--- /dev/null
@@ -0,0 +1,88 @@
+Magic: 13000
+
+Internal Form Definition File
+    (do not change)
+
+Number of forms: 1
+Unit of measure: FL_COORD_PIXEL
+
+=============== FORM ===============
+Name: form_index
+Width: 520
+Height: 100
+Number of Objects: 4
+
+--------------------
+class: FL_BOX
+type: UP_BOX
+box: 0 0 520 100
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: 
+shortcut: 
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: 
+callback: 
+argument: 
+
+--------------------
+class: FL_INPUT
+type: NORMAL_INPUT
+box: 90 10 420 30
+boxtype: FL_DOWN_BOX
+colors: FL_COL1 FL_MCOL
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Keyword
+shortcut: Keyword|#K#k
+resize: FL_RESIZE_X
+gravity: FL_NoGravity FL_NoGravity
+name: key
+callback: 
+argument: 
+
+--------------------
+class: FL_BUTTON
+type: NORMAL_BUTTON
+box: 410 60 100 30
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Cancel
+shortcut: ^[
+resize: FL_RESIZE_NONE
+gravity: FL_SouthEast FL_SouthEast
+name: cancel
+callback: C_FormCommandCancelCB
+argument: 0
+
+--------------------
+class: FL_BUTTON
+type: RETURN_BUTTON
+box: 300 60 100 30
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: OK
+shortcut: ^M
+resize: FL_RESIZE_ALL
+gravity: FL_SouthEast FL_SouthEast
+name: ok
+callback: C_FormCommandOKCB
+argument: 0
+
+==============================
+create_the_forms
index 50b20c6a3eb5726a062da2d92c53ee415e638d8f..754e90f0caa0bf7ff8f22bc9ef9de1ca4f022e53 100644 (file)
@@ -21,6 +21,7 @@ FDESIGN = fdesign
 
 SRCS := form_citation.fd \
        form_copyright.fd \
+       form_index.fd \
        form_preferences.fd \
        form_print.fd \
        form_graphics.fd \
index 51d9658f4bbcf9cb2743a0703f6189c561737867..f0d33a8021993fc8b89d06ee59856638ee4670f6 100644 (file)
@@ -21,7 +21,7 @@
 #include "support/lstrings.h"
 
 InsetCitation::InsetCitation(InsetCommandParams const & p)
-               : InsetCommand(p)
+       : InsetCommand(p)
 {}
 
 string InsetCitation::getScreenLabel() const
index 7e7676400b216908a7584e7d81350b384ad531c1..7a766f577d4ec33b4d09fec0a15a4aac215fddee 100644 (file)
 #endif
 
 #include "insetcommand.h"
+#include "support/utility.hpp"
 
 /** Used to insert citations  
  */
-class InsetCitation : public InsetCommand {
+class InsetCitation : public InsetCommand, public noncopyable {
 public:
        ///
-       explicit
        InsetCitation(InsetCommandParams const &);
        ///
        Inset * Clone() const { return new InsetCitation(params()); }
index c009b38848e6c891fa41c3989606f3e39823f7a6..c5ebb9b92f61cb75cace221a59ce3822490a4346 100644 (file)
 #include <config.h>
 
-#include <cstdlib>
-
 #ifdef __GNUG__
 #pragma implementation
 #endif
 
-#include FORMS_H_LOCATION  
 #include "insetindex.h"
-#include "buffer.h"
-#include "debug.h"
+#include "BufferView.h"
+#include "LyXView.h"
+#include "frontends/Dialogs.h"
 #include "LaTeXFeatures.h"
-#include "gettext.h"
-#include "LString.h"
-#include "lyx_gui_misc.h" // WarnReadonly
-FD_index_form * index_form = 0;
-
-extern "C"
-void index_cb(FL_OBJECT *, long data)
-{
-       InsetIndex::Holder * holder =
-               static_cast<InsetIndex::Holder*>
-               (index_form->index_form->u_vdata);
-
-       holder->inset->callback( index_form, data );
-}
-       
-
-static
-FD_index_form * create_form_index_form()
-{
-       FL_OBJECT * obj;
-       FD_index_form *fdui = (FD_index_form *) fl_calloc(1, sizeof(FD_index_form));
-
-       fdui->index_form = fl_bgn_form(FL_NO_BOX, 258, 196);
-       obj = fl_add_box(FL_UP_BOX, 0, 0, 258, 196, "");
-       fdui->key = obj = fl_add_input(FL_NORMAL_INPUT, 93, 26, 130, 30,
-                                      idex(_("Keyword:|#K")));
-         fl_set_object_shortcut(obj, scex(_("Keyword:|#K")), 1);
-         fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-       obj = fl_add_button(FL_RETURN_BUTTON, 50, 140, 80, 30, _("OK"));
-         obj->u_vdata = index_form;
-         fl_set_object_callback(obj, index_cb, 1);
-       obj = fl_add_button(FL_NORMAL_BUTTON, 150, 140, 80, 30,
-                           idex(_("Cancel|^[")));
-         fl_set_object_shortcut(obj, scex(_("Cancel|^[")), 1);
-         obj->u_vdata = index_form;
-         fl_set_object_callback(obj, index_cb, 0);
-       fl_end_form();
-
-       return fdui;
-}
 
-
-
-/*---------------------------------------*/
-
-
-InsetIndex::InsetIndex(string const & key)
-       : InsetCommand("index", key) 
+InsetIndex::InsetIndex(InsetCommandParams const & p)
+       : InsetCommand(p)
 {}
 
 
-InsetIndex::~InsetIndex()
-{
-       if(index_form && index_form->index_form
-          && index_form->index_form->visible
-          && index_form->index_form->u_vdata == &holder)
-               fl_hide_form(index_form->index_form);
-}
-
-
-void InsetIndex::callback( FD_index_form * form, long data )
-{
-       switch (data)
-       {
-       case 1: // OK
-               if(!holder.view->buffer()->isReadonly())
-               {
-                       string tmp = fl_get_input(form->key);
-                       if(tmp != getContents())
-                       {
-                               setContents(tmp);
-                               holder.view->updateInset( this, true );
-                       }
-               } // fall through to Cancel
-       case 0:
-               fl_hide_form(form->index_form);
-               break;
-       }
-}
-
-
-void InsetIndex::Edit(BufferView * bv, int, int, unsigned int)
-{
-       if(bv->buffer()->isReadonly())
-               WarnReadonly(bv->buffer()->fileName());
-
-       if (!index_form) {
-               index_form = create_form_index_form();
-               fl_set_form_atclose(index_form->index_form,
-                                   CancelCloseBoxCB, 0);
-       }
-
-       holder.inset = this;
-       holder.view = bv;
-       
-       index_form->index_form->u_vdata =  &holder;
-       fl_set_input(index_form->key, getContents().c_str());
-       if (index_form->index_form->visible) {
-               fl_raise_form(index_form->index_form);
-       } else {
-               fl_show_form(index_form->index_form,
-                            FL_PLACE_MOUSE, FL_FULLBORDER,
-                            _("Index"));
-       }
-}
-
-
 string InsetIndex::getScreenLabel() const
 {
        return _("Idx");
 }
 
 
-//
-// InsetPrintIndex
-//
-
-#if 0
-InsetPrintIndex::InsetPrintIndex()
-       : InsetCommand("printindex")
+void InsetIndex::Edit(BufferView * bv, int, int, unsigned int)
 {
-       owner = 0;
+       bv->owner()->getDialogs()->showIndex( this );
 }
-#endif
 
 
-InsetPrintIndex::InsetPrintIndex(Buffer * o)
-       : InsetCommand("printindex"), owner(o)
+InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p)
+       : InsetCommand(p)
 {}
 
-
-#if 0
-InsetPrintIndex::~InsetPrintIndex()
-{
-}
-#endif
-
-
 string InsetPrintIndex::getScreenLabel() const
 {
-       return _("PrintIndex");
+       return _("Index");
 }
 
 
index 50a2e4cf20cd0dbf3a9f0237df64c461b83a04b7..b92853804f179ecd8d5c94b0e4dd65d2c2f406df 100644 (file)
 #endif
 
 #include "insetcommand.h"
+#include "support/utility.hpp"
 
-class Buffer;
 struct LaTeXFeatures;
-struct FD_index_form;
-
-// Created by Lgb 970227
-
 
 /** Used to insert index labels  
   */
-class InsetIndex : public InsetCommand {
+class InsetIndex : public InsetCommand, public noncopyable {
 public:
        ///
-       InsetIndex() : InsetCommand("index") {}
-       ///
-       explicit
-       InsetIndex(string const & key);
-       ///
-       ~InsetIndex();
+       InsetIndex(InsetCommandParams const &);
        ///
-       Inset * Clone() const { return new InsetIndex(getContents());}
-       ///
-       void Edit(BufferView *, int, int, unsigned int);
-       ///
-       EDITABLE Editable() const
-       {
-               return IS_EDITABLE;
-       }
+       Inset * Clone() const { return new InsetIndex(params());}
        ///
        string getScreenLabel() const;
        ///
-       void callback( FD_index_form *, long );
-       ///
-       struct Holder {
-               InsetIndex * inset;
-               BufferView * view;
-       };
- private:
+       EDITABLE Editable() const { return IS_EDITABLE; }
        ///
-       Holder holder;
+       void Edit(BufferView *, int, int, unsigned int);
 };
 
 
-class InsetPrintIndex : public InsetCommand {
+class InsetPrintIndex : public InsetCommand, public noncopyable {
 public:
-#if 0
-       ///
-       InsetPrintIndex();
-#endif
        ///
-       InsetPrintIndex(Buffer *);
-#if 0
+       InsetPrintIndex(InsetCommandParams const &);
        ///
-       ~InsetPrintIndex();
-#endif
+       Inset * Clone() const { return new InsetPrintIndex(params());}
        /// Updates needed features for this inset.
        void Validate(LaTeXFeatures & features) const;
        ///
        void Edit(BufferView *, int, int, unsigned int) {}
        ///
-       EDITABLE Editable() const{
-               return IS_EDITABLE;
-       }
-       /// WHY is clone missing? (Lgb)
+       EDITABLE Editable() const{ return NOT_EDITABLE; }
        ///
        bool display() const { return true; }
        ///
        Inset::Code LyxCode() const;
        ///
        string getScreenLabel() const;
-private:
-       ///
-       Buffer * owner;
-};
-
-// this was shifted here rather than a separate
-// file because its little and only need by
-// insetindex.C and lyx_gui_misc.C ARRae 981020
-struct FD_index_form {
-       FL_FORM * index_form;
-       FL_OBJECT * key;
 };
 
-extern FD_index_form * index_form;
 #endif
index cf0de54519bb71dc09fe13124324d3edfd981a29..4c6848c447b6fc73868851f2ca7549062db96e87 100644 (file)
 #endif
 
 #include "insetcommand.h"
+#include "support/utility.hpp"
 
 /** Used to insert table of contents
  */
-class InsetTOC : public InsetCommand {
+class InsetTOC : public InsetCommand, public noncopyable {
 public:
        ///
        InsetTOC(InsetCommandParams const & p) : InsetCommand(p) {}
index 30a7b2c49bbd5342569f9b47817fb4b0672a7aec..6170b545df86cb3ea154a205ea9b24f408713d83 100644 (file)
 #endif
 
 #include "insetcommand.h"
+#include "support/utility.hpp"
 
 struct LaTeXFeatures;
 
 /** The url inset  
  */
-class InsetUrl : public InsetCommand {
+class InsetUrl : public InsetCommand, public noncopyable {
 public:
        ///
        explicit
index fd6cfd211948cc767c6522e64482c7d43f3ecc78..7954c722214211645c20ddc97ed21df839616e4d 100644 (file)
@@ -33,7 +33,6 @@
 #include "minibuffer.h"
 #include "print_form.h"
 #include "sp_form.h"
-#include "insets/insetindex.h"
 #include "LyXView.h"
 #include "bufferview_funcs.h"
 #include "support/filetools.h"
@@ -66,7 +65,6 @@ extern FD_space  * fd_space;
 extern FD_matrix * fd_matrix;
 extern FD_bibitem_form * bibitem_form;
 extern FD_include * form;
-extern FD_index_form * index_form;
 
 extern void HideFiguresPopups();
 
@@ -178,11 +176,6 @@ void CloseAllBufferRelatedDialogs()
                        fl_hide_form(form->include);
                }
        }
-       if (index_form) {
-               if (index_form->index_form->visible) {
-                       fl_hide_form(index_form->index_form);
-               }
-       }
        HideFiguresPopups();
 }
 
@@ -321,11 +314,6 @@ void updateAllVisibleBufferRelatedDialogs()
                        fl_hide_form(form->include);
                }
        }
-       if (index_form) {
-               if (index_form->index_form->visible) {
-                       fl_hide_form(index_form->index_form);
-               }
-       }
        HideFiguresPopups();
 }
 
index 34112ce3b5b3a9d0028456faba9bf0089d9b4acf..d01236b739da9216911a1ff169d21ce891e73903 100644 (file)
@@ -2538,11 +2538,10 @@ string LyXFunc::Dispatch(int ac,
        }
        break;
        
-       case LFUN_CREATE_CITATION:
+       case LFUN_CITATION_CREATE:
        {
                // Should do this "at source"
-               InsetCommandParams p;
-               p.setCmdName( "cite" );
+               InsetCommandParams p( "cite" );
                
                if (contains(argument, "|")) {
                        p.setContents( token(argument, '|', 0) );
@@ -2555,7 +2554,7 @@ string LyXFunc::Dispatch(int ac,
        }
        break;
                    
-       case LFUN_INSERT_CITATION:
+       case LFUN_CITATION_INSERT:
        {
                InsetCommandParams p;
                p.setFromString( argument );
@@ -2621,21 +2620,18 @@ string LyXFunc::Dispatch(int ac,
        }
        break;
                
-       case LFUN_INDEX_INSERT:
-       case LFUN_INDEX_INSERT_LAST:
+       case LFUN_INDEX_CREATE:
+       case LFUN_INDEX_CREATE_LAST:
        {
                // Can't do that at the beginning of a paragraph.
                if (owner->view()->text->cursor.pos() - 1 < 0)
                        break;
 
-               InsetIndex * new_inset = new InsetIndex();
+               InsetCommandParams p( "index" );
+               
                if (!argument.empty()) {
-                       string lsarg(argument);
-                       new_inset->setContents(lsarg);
-                       if (!owner->view()->insertInset(new_inset))
-                               delete new_inset;
+                       p.setContents( argument );
                } else {
-                       //reh 98/09/21
                        //get the current word for an argument
                        LyXParagraph::size_type lastpos = 
                                owner->view()->text->cursor.pos() - 1;
@@ -2646,36 +2642,32 @@ string LyXFunc::Dispatch(int ac,
                                         ->text->cursor.par()->GetWord(lastpos));
 
                        //make the new inset and write the current word into it
-                       InsetIndex * new_inset = new InsetIndex();
-
-                       new_inset->setContents(curstring);
-
-                       //don't edit it if the call was to INSERT_LAST
-                       if(action != LFUN_INDEX_INSERT_LAST) {
-                               new_inset->Edit(owner->view(), 0, 0, 0);
-                       } else {
-                               //it looks blank on the screen unless
-                               //we do  something.  put it here.
-
-                               // move the cursor to the returned value of lastpos
-                               // but only for the auto-insert
-                               owner->view()->text->cursor.pos(lastpos);
-                       }
-
-                       //put the new inset into the buffer.
-                       // there should be some way of knowing the user
-                       //cancelled & avoiding this, but i don't know how
-                       if (!owner->view()->insertInset(new_inset))
-                               delete new_inset;
+                       p.setContents( curstring );
                }
+
+               owner->getDialogs()->createIndex( p.getAsString() );
        }
        break;
+                   
+       case LFUN_INDEX_INSERT:
+       {
+               InsetCommandParams p;
+               p.setFromString( argument );
 
+               InsetIndex * inset = new InsetIndex( p );
+               if (!owner->view()->insertInset(inset))
+                       delete inset;
+               else
+                       owner->view()->updateInset( inset, true );
+       }
+       break;
+                   
        case LFUN_INDEX_PRINT:
        {
-               Inset * new_inset = new InsetPrintIndex(owner->buffer());
-               if (!owner->view()->insertInset(new_inset, "Standard", true))
-                       delete new_inset;
+               InsetCommandParams p("printindex");
+               Inset * inset = new InsetPrintIndex(p);
+               if (!owner->view()->insertInset(inset, "Standard", true))
+                       delete inset;
        }
        break;
 
index bd5bff06595ba776eb9cb945929aaea88dbd19c0..425f01529944450a8292060bbd05c6d1910aa7ec 100644 (file)
@@ -99,6 +99,12 @@ void MathDelimInset::Write(ostream & os, bool fragile)
 void MathDecorationInset::Write(ostream & os, bool fragile)
 {
        latexkeys * l = lm_get_key_by_id(deco, LM_TK_WIDE);
+       if (fragile &&
+           (strcmp(l->name, "overbrace") == 0 ||
+            strcmp(l->name, "underbrace") == 0 ||
+            strcmp(l->name, "overleftarrow") == 0 ||
+            strcmp(l->name, "overrightarrow") == 0))
+               os << "\\protect";
        os << '\\' << l->name << '{';
        MathParInset::Write(os, fragile);  
        os << '}';
index d1b091df9324e96c2455d1103f47bb82df1b0361..aacb3f007c323cc6359a068169fca8e53c22413a 100644 (file)
@@ -1899,9 +1899,9 @@ void Menus::ShowInsertMenu(FL_OBJECT * ob, long)
                case 12: tmpfunc->Dispatch(LFUN_INSERT_NOTE); break;
                case 13: tmpfunc->Dispatch(LFUN_INSERT_LABEL); break;
                case 14: tmpfunc->Dispatch(LFUN_INSERT_REF); break;
-               case 15: tmpfunc->Dispatch(LFUN_CREATE_CITATION); break;
-               case 16: tmpfunc->Dispatch(LFUN_INDEX_INSERT); break;
-               case 17: tmpfunc->Dispatch(LFUN_INDEX_INSERT_LAST); break;
+               case 15: tmpfunc->Dispatch(LFUN_CITATION_CREATE); break;
+               case 16: tmpfunc->Dispatch(LFUN_INDEX_CREATE); break;
+               case 17: tmpfunc->Dispatch(LFUN_INDEX_CREATE_LAST); break;
                case 18: tmpfunc->Dispatch(LFUN_URL); break;
                }
        }