From b31ab56c837915bcf95603d5f3ab49e5607bf6c0 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Tue, 9 Oct 2001 15:20:10 +0000 Subject: [PATCH] Herbert's TeX Info extravaganza. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2850 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 5 + lib/TeXFiles.sh | 118 ++++++++ lib/help/Bibtex.hlp | 32 +++ lib/help/Texinfo.hlp | 35 +++ lib/ui/default.ui | 2 + po/POTFILES.in | 3 + src/ChangeLog | 10 + src/LyXAction.C | 2 + src/commandtags.h | 1 + src/frontends/ChangeLog | 4 + src/frontends/Dialogs.h | 4 + src/frontends/controllers/ChangeLog | 15 + src/frontends/controllers/ControlDialogs.h | 2 +- src/frontends/controllers/ControlShowFile.C | 45 +++ src/frontends/controllers/ControlShowFile.h | 38 +++ .../controllers/ControlSpellchecker.C | 23 +- src/frontends/controllers/ControlTexinfo.C | 79 +++++ src/frontends/controllers/ControlTexinfo.h | 44 +++ src/frontends/controllers/GUI.h | 26 ++ src/frontends/controllers/Makefile.am | 4 + src/frontends/xforms/ChangeLog | 11 + src/frontends/xforms/Dialogs.C | 7 + src/frontends/xforms/FormShowFile.C | 36 +++ src/frontends/xforms/FormShowFile.h | 38 +++ src/frontends/xforms/FormTexinfo.C | 250 ++++++++++++++++ src/frontends/xforms/FormTexinfo.h | 53 ++++ src/frontends/xforms/Makefile.am | 6 + src/frontends/xforms/form_texinfo.C | 124 ++++++++ src/frontends/xforms/form_texinfo.h | 30 ++ src/frontends/xforms/forms/form_texinfo.fd | 270 ++++++++++++++++++ src/frontends/xforms/forms/makefile | 1 + src/frontends/xforms/xforms_helpers.C | 10 +- src/lyx_main.C | 3 +- src/lyxfunc.C | 4 + 34 files changed, 1315 insertions(+), 20 deletions(-) create mode 100755 lib/TeXFiles.sh create mode 100644 lib/help/Bibtex.hlp create mode 100644 lib/help/Texinfo.hlp create mode 100644 src/frontends/controllers/ControlShowFile.C create mode 100644 src/frontends/controllers/ControlShowFile.h create mode 100644 src/frontends/controllers/ControlTexinfo.C create mode 100644 src/frontends/controllers/ControlTexinfo.h create mode 100644 src/frontends/xforms/FormShowFile.C create mode 100644 src/frontends/xforms/FormShowFile.h create mode 100644 src/frontends/xforms/FormTexinfo.C create mode 100644 src/frontends/xforms/FormTexinfo.h create mode 100644 src/frontends/xforms/form_texinfo.C create mode 100644 src/frontends/xforms/form_texinfo.h create mode 100644 src/frontends/xforms/forms/form_texinfo.fd diff --git a/lib/ChangeLog b/lib/ChangeLog index bd7f258df7..4f30cdabc9 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2001-10-09 Herbert Voss + + * default.ui: help-Texinfo + gives an info about the installed texfiles (cls,sty,bst) + 2001-10-07 Adrien Rebollo * kbd/iso8859-4.cdef: diff --git a/lib/TeXFiles.sh b/lib/TeXFiles.sh new file mode 100755 index 0000000000..75ec6c1755 --- /dev/null +++ b/lib/TeXFiles.sh @@ -0,0 +1,118 @@ +#!/bin/sh +# file: ~/bin/TeXFiles.sh +# all files -> without option +# TeX class files -> option cls +# TeX style files -> option sty +# bibtex style files -> option bst +# +# with the help +# of kpsewhich and creates a +# bstFiles.lst, clsFiles.lst, styFiles.lst +# without any parameter all files are created. +# +# Herbert Voss +# +CLS_STYLEFILE=clsFiles.lst +STY_STYLEFILE=styFiles.lst +BST_STYLEFILE=bstFiles.lst +version='$Id: TeXFiles.sh,v 0.1 2001-10-01' +progname=`echo $0 | sed 's%.*/%%'` +echo "$version" +usage="Usage: TeXFiles.sh [-version | cls | sty | bst] + Default is without any Parameters, + so that all files will be created" + +# +# MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use ';' to separate +# directories in path lists whereas Unixes uses ':'. +# $SEP holds the right character to be used by the scripts. +# +#??????????????? +# never used this one with windows and what happens with mac?? +#??????????????? +# +if test -z "$COMSPEC" && test -z "$ComSpec"; then SEP=':'; else SEP=';'; fi +# +# Add the location of the script to the PATH if necessary. This must +# be done before kpsewhich can be called, and thus cannot be put into +# mktex.opt +# +dirname=`echo $0 | sed 's%/*[^/][^/]*$%%'` +echo "Actual Dir: $dirname" +case $dirname in # $dirname correct? + "") # Do nothing + ;; + /* | [A-z]:/*) # / -> Absolute name + PATH="$dirname$SEP$PATH" ;; + *) # other -> Relative name + PATH="`pwd`/$dirname$SEP$PATH" ;; +esac # end of case +# +# A copy of some stuff from mktex.opt, so we can run in the presence of +# terminally damaged ls-R files. +# +if test "x$1" = x--help || test "x$1" = x-help; then + echo "$usage" + exit 0 +elif test "x$1" = x--version || test "x$1" = x-version; then + echo "`basename $0` $version" + kpsewhich --version + exit 0 +fi +# +# find the directories with kpsewhich. TeX has files ls-R to hold +# the tex-tree +# +test $# = 0 && { + OIFS=$IFS; IFS=$SEP; set x `kpsewhich --show-path=ls-R 2>/dev/null`; shift; IFS=$OIFS +} +echo 'Delete old *files.lst, if present' +case "$1" in + "cls") + rm -f $CLS_STYLEFILE + touch $CLS_STYLEFILE # create new file + ;; + "sty") + rm -f $STY_STYLEFILE + touch $STY_STYLEFILE # create new file + ;; + "bst") + rm -f $BST_STYLEFILE + touch $BST_STYLEFILE # create new file + ;; + *) # all other + rm -f $CLS_STYLEFILE $STY_STYLEFILE $BST_STYLEFILE + touch $CLS_STYLEFILE $STY_STYLEFILE $BST_STYLEFILE + ;; +esac +echo "looking for all bst-style files in the latex tree"; +for TEXMFLSR in "$@"; do # go through the dirs + case "$TEXMFLSR" in # Prepend cwd if the directory was relative. + "") continue ;; # it is an error if this case is taken. + /* | [A-z]:/*) ;; # leading / + *) TEXMFLSR="`pwd`/$TEXMFLS_R" # all other + esac + echo "Dir: <$TEXMFLSR>" +case "$1" in # list all files with suffix bst + "cls") + find $TEXMFLSR -name *.cls >> $CLS_STYLEFILE + ;; + "sty") + find $TEXMFLSR -name *.sty >> $STY_STYLEFILE + ;; + "bst") + find $TEXMFLSR -name *.bst >> $BST_STYLEFILE + ;; + *) + find $TEXMFLSR -name *.cls >> $CLS_STYLEFILE + find $TEXMFLSR -name *.sty >> $STY_STYLEFILE + find $TEXMFLSR -name *.bst >> $BST_STYLEFILE + ;; +esac + + echo "done!" +done +#echo "list saved in $STYLEFILE" +#echo `wc -l $CLS_STYLEFILE` # only for information +# +# this is the end my friends ... Jim Morrison and the Doors in "The End" diff --git a/lib/help/Bibtex.hlp b/lib/help/Bibtex.hlp new file mode 100644 index 0000000000..c15278eb60 --- /dev/null +++ b/lib/help/Bibtex.hlp @@ -0,0 +1,32 @@ +** This file is part of LyX, The Document Processor +** Copyright 2001 The LyX Team. Bibtex.hlp +--------------------------------------------------- + +Database: + Insert the Bibtex-database without the default extension + ".bib". If you insert it with the browser, LyX strips + the extension. More than one databases must be separated + by a comma: natbib, books + +Bibstyle: + Insert the Bibstyle without the default extension ".bst". + Most of the bibstyles are stored in $TEXMF/bibtex/bst. + $TEXMF is the root dir of the local TeX-tree. + In difference to the Databases there is only one + Bibstyle possible, for example "plainnat". Insert all + styles without any path! + With the Shell-Script bstFiles.sh you'll get a list of all + available styles on your local TeX-System. It's available + at http://www.perce.de/lyx/bstFiles.sh + +Option bibtotoc: + By default the Bibliography doesn't appears in the table + of contents. Activate this option if you want an entry + like + Bibliography ........................17 + + LyX inserts for the name \refname, so that you get the + right name Bibliography/References, which depends to your + chosen document-class. + +2001-08-27 / Herbert Voss \ No newline at end of file diff --git a/lib/help/Texinfo.hlp b/lib/help/Texinfo.hlp new file mode 100644 index 0000000000..82049e6c32 --- /dev/null +++ b/lib/help/Texinfo.hlp @@ -0,0 +1,35 @@ +** This file is part of LyX, The Document Processor +** Copyright 2001 The LyX Team. Texinfo.hlp +--------------------------------------------------- + +Class Files: shows the installed TeX Document classes. + Remember, that these classes are only available + in LyX if a corresponding LyX-Layout file exists! + +Style Files: shows the installed TeX Style files, which are + available in LyX by default, like "babel" or through + + "\usepackage{} + + in LaTeX-preamble (Layout->preamble) + +BibTeX Stylefiles: shows the installed stylefiles for BibTeX. + They can be load through + insert->Lists&Toc->BibTeX Reference->Style + +Rescan: Runs the script TexFiles.sh to build new file lists. + +Path yes/no: toggles view of the file lists + +View: shows the contents of the marked file. Only + possible when the files are shown with path. + +Run TeXhash: runs the script texhash which builds the a new LaTeX tree. + Needed if you install a new TeX class or style! It runs only + with user-rights! Therefore you need the right-permissions + for the tex-dirs, often /var/lib/texmf and other. + +Help: shows this file + + +2001-10-01 / Herbert Voss \ No newline at end of file diff --git a/lib/ui/default.ui b/lib/ui/default.ui index b6e3697021..1cebe21759 100644 --- a/lib/ui/default.ui +++ b/lib/ui/default.ui @@ -328,6 +328,8 @@ Menuset Item "LaTeX Configuration|L" "help-open LaTeXConfig" Separator Item "About LyX|X" "help-aboutlyx" + Separator + Item "TeX Infos" "help-Texinfo" End End diff --git a/po/POTFILES.in b/po/POTFILES.in index 776a8a91ed..57027f7668 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -29,6 +29,7 @@ src/frontends/controllers/ControlPreamble.C src/frontends/controllers/ControlPrint.C src/frontends/controllers/ControlSearch.C src/frontends/controllers/ControlSpellchecker.C +src/frontends/controllers/ControlTexinfo.C src/frontends/controllers/ControlThesaurus.C src/frontends/controllers/biblio.C src/frontends/controllers/character.C @@ -104,6 +105,7 @@ src/frontends/xforms/FormSearch.C src/frontends/xforms/FormSpellchecker.C src/frontends/xforms/FormTabular.C src/frontends/xforms/FormTabularCreate.C +src/frontends/xforms/FormTexinfo.C src/frontends/xforms/FormThesaurus.C src/frontends/xforms/FormToc.C src/frontends/xforms/FormUrl.C @@ -140,6 +142,7 @@ src/frontends/xforms/form_search.C src/frontends/xforms/form_spellchecker.C src/frontends/xforms/form_tabular.C src/frontends/xforms/form_tabular_create.C +src/frontends/xforms/form_texinfo.C src/frontends/xforms/form_thesaurus.C src/frontends/xforms/form_toc.C src/frontends/xforms/form_url.C diff --git a/src/ChangeLog b/src/ChangeLog index 903d6308de..9c5b844f2e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2001-10-09 Herbert Voss + + * commandtags.h (kb_action): added LFUN_HELP_TEXINFO. + + * LyXAction.C (init): added LFUN_HELP_TEXINFO to items array. + + * lyx_main.C: added global string help_lyxdir. + + * lyxfunc.C (dispatch): added LFUN_HELP_TEXINFO to switch. + 2001-10-07 Adrien Rebollo * lyxrc.C (set_font_norm_type): support iso8859-4 diff --git a/src/LyXAction.C b/src/LyXAction.C index b0c3e705bb..58095e2e60 100644 --- a/src/LyXAction.C +++ b/src/LyXAction.C @@ -421,6 +421,8 @@ void LyXAction::init() { LFUN_ESCAPE, "escape", "", Noop }, { LFUN_HELP_ABOUTLYX, "help-aboutlyx", N_("Display information about LyX"), NoBuffer }, + { LFUN_HELP_TEXINFO, "help-Texinfo", + N_("Display information about the TeX installation"), NoBuffer }, { LFUN_NOACTION, "", "", Noop } }; diff --git a/src/commandtags.h b/src/commandtags.h index 4a55c2fd87..6fc1a29757 100644 --- a/src/commandtags.h +++ b/src/commandtags.h @@ -294,6 +294,7 @@ enum kb_action { LFUN_ESCAPE, // 260 // Lgb 20010517 LFUN_HELP_ABOUTLYX, // Edwin 20010712 LFUN_THESAURUS_ENTRY, // Levon 20010720 + LFUN_HELP_TEXINFO, // Herbert 20011001 LFUN_LASTACTION /* this marks the end of the table */ }; diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index 9b516d3832..a6543aa6cd 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,7 @@ +2001-10-09 Herbert Voss + + * Dialogs.h: added showFile and showTexinfo signals. + 2001-09-27 Angus Leeming * Dialogs.h (showSplash, destroySplash, splash_): removed. diff --git a/src/frontends/Dialogs.h b/src/frontends/Dialogs.h index 631cd9dde3..514aa69145 100644 --- a/src/frontends/Dialogs.h +++ b/src/frontends/Dialogs.h @@ -107,6 +107,8 @@ public: SigC::Signal1 showError; /// show the external inset dialog SigC::Signal1 showExternal; + /// show the contents of a file. + SigC::Signal1 showFile; /// SigC::Signal1 showGraphics; /// show the details of a LyX file include inset @@ -157,6 +159,8 @@ public: SigC::Signal1 updateTabular; /// SigC::Signal0 showTabularCreate; + /// show the TexInfo + SigC::Signal0 showTexinfo; /// show the thesaurus dialog SigC::Signal1 showThesaurus; /// diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 64d938fc9e..5abf97c5af 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,18 @@ +2001-10-09 Angus Leeming + + * ControlSpellchecker.C: commented out redundant includes. + +2001-10-09 Herbert Voss + + * ControlTexinfo.[Ch]: new files. Display information about the + installed texfiles (cls,sty,bst). + + * ControlShowFile.[Ch]: new files. Display the contents of a file. + + * GUI.h: added classes GUIShowFile and GUITexinfo. + + * Makefile.am: modified appropriately. + 2001-10-03 Jean-Marc Lasgouttes * ControlAboutlyx.C (getVersion): use lyx_version and diff --git a/src/frontends/controllers/ControlDialogs.h b/src/frontends/controllers/ControlDialogs.h index 7b4abb917d..a452d87d74 100644 --- a/src/frontends/controllers/ControlDialogs.h +++ b/src/frontends/controllers/ControlDialogs.h @@ -13,7 +13,7 @@ * * 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 + * the meaning is clear! Can anyone do any better?) Examples would be the * Document and Paragraph dialogs. */ diff --git a/src/frontends/controllers/ControlShowFile.C b/src/frontends/controllers/ControlShowFile.C new file mode 100644 index 0000000000..2bae899415 --- /dev/null +++ b/src/frontends/controllers/ControlShowFile.C @@ -0,0 +1,45 @@ +/** + * \file ControlShowFile.C + * Copyright 2001 The LyX Team. + * See the file COPYING. + * + * \author Herbert Voss + */ + +#include +#include + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include "ViewBase.h" +#include "ButtonControllerBase.h" +#include "ControlShowFile.h" +#include "Dialogs.h" +#include "LyXView.h" +#include "BufferView.h" +#include "gettext.h" +#include "support/filetools.h" // FileSearch + +ControlShowFile::ControlShowFile(LyXView & lv, Dialogs & d) + : ControlDialog(lv, d) +{ + d_.showFile.connect(SigC::slot(this, &ControlShowFile::showFile)); +} + +void ControlShowFile::showFile(string const & file) +{ + filename_ = file; + show(); +} + +string ControlShowFile::getFileContents() +{ + return GetFileContents(filename_); +} + +string ControlShowFile::getFileName() +{ + return OnlyFilename(filename_); +} diff --git a/src/frontends/controllers/ControlShowFile.h b/src/frontends/controllers/ControlShowFile.h new file mode 100644 index 0000000000..e9265fdf86 --- /dev/null +++ b/src/frontends/controllers/ControlShowFile.h @@ -0,0 +1,38 @@ +// -*- C++ -*- +/** + * Copyright 2001 The LyX Team. + * See the file COPYING. + * + * \file ControlShowFile.h + * \author Herbert Voss + */ +#ifndef CONTROLSHOWFILE_H +#define CONTROLSHOWFILE_H + +#ifdef __GNUG__ +#pragma interface +#endif + +#include "ControlDialogs.h" + +/** A controller for the ShowFile dialog. */ + +class ControlShowFile : public ControlDialog { +public: + /// + ControlShowFile(LyXView &, Dialogs &); + /// + virtual void showFile(string const &); + /// + string getFileContents(); + /// + string getFileName(); + +private: + /// not needed. + virtual void apply() {} + /// + string filename_; +}; + +#endif // CONTROLSHOWFILE_H diff --git a/src/frontends/controllers/ControlSpellchecker.C b/src/frontends/controllers/ControlSpellchecker.C index a7d6cad6c7..0ea68ebc95 100644 --- a/src/frontends/controllers/ControlSpellchecker.C +++ b/src/frontends/controllers/ControlSpellchecker.C @@ -17,18 +17,17 @@ #pragma implementation #endif -#include FORMS_H_LOCATION - -#ifdef HAVE_SYS_SELECT_H -# ifdef HAVE_STRINGS_H - // is needed at least on AIX because FD_ZERO uses bzero(). - // BUT we cannot include both string.h and strings.h on Irix 6.5 :( -# ifdef _AIX -# include -# endif -# endif -#include -#endif +// I think that this is no longer needed (Angus 9 October, 2001). +//#ifdef HAVE_SYS_SELECT_H +//# ifdef HAVE_STRINGS_H +// // is needed at least on AIX because FD_ZERO uses bzero(). +// // BUT we cannot include both string.h and strings.h on Irix 6.5 :( +//# ifdef _AIX +//# include +//# endif +//# endif +//#include +//#endif #include "buffer.h" #include "lyxrc.h" diff --git a/src/frontends/controllers/ControlTexinfo.C b/src/frontends/controllers/ControlTexinfo.C new file mode 100644 index 0000000000..959b874c36 --- /dev/null +++ b/src/frontends/controllers/ControlTexinfo.C @@ -0,0 +1,79 @@ +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2001 The LyX Team. + * + * ====================================================== + * + * \file ControlTexinfo.C + * \author Herbert Voss + */ + +#include + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include "ViewBase.h" +#include "ButtonControllerBase.h" +#include "ControlTexinfo.h" +#include "Dialogs.h" +#include "LyXView.h" +#include "Lsstream.h" +#include "BufferView.h" +#include "gettext.h" +#include "support/filetools.h" // FileSearch +#include "version.h" +#include "support/syscall.h" +#include "support/path.h" +#include "lyx_gui_misc.h" + +extern string system_lyxdir; +extern string user_lyxdir; +extern string help_lyxdir; + +using SigC::slot; + +ControlTexinfo::ControlTexinfo(LyXView & lv, Dialogs & d) + : ControlDialog(lv, d) +{ + d_.showTexinfo.connect(SigC::slot(this, &ControlTexinfo::show)); +} + +// build filelists of all availabe bst/cls/sty-files. done through +// kpsewhich and an external script, saved in *Files.lst +void ControlTexinfo::rescanStyles() +{ + // Run rescan in user lyx directory + Path p(user_lyxdir); + Systemcalls one(Systemcalls::System, + AddName(system_lyxdir,"TeXFiles.sh")); + p.pop(); +} + +void ControlTexinfo::runTexhash() +{ + // Run texhash in user lyx directory + Path p(user_lyxdir); + + //path to texhash through system + Systemcalls one(Systemcalls::System,"texhash"); + p.pop(); +// WriteAlert(_("texhash run!"), +// _("rebuilding of the TeX-tree could only be successfull"), +// _("if you have had user-write-permissions to the tex-dir.")); +} + + +void ControlTexinfo::viewFile(string const filename) +{ + lv_.getDialogs()->showFile(filename); +} + +void ControlTexinfo::help() +{ + lv_.getDialogs()->showFile(help_lyxdir+"Texinfo.hlp"); +} diff --git a/src/frontends/controllers/ControlTexinfo.h b/src/frontends/controllers/ControlTexinfo.h new file mode 100644 index 0000000000..ef2cf90336 --- /dev/null +++ b/src/frontends/controllers/ControlTexinfo.h @@ -0,0 +1,44 @@ +// -*- C++ -*- +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2001 The LyX Team. + * + * ====================================================== + * + * \file ControlTexinfo.h + * \author Herbert Voss + */ + +#ifndef CONTROLTEXINFO_H +#define CONTROLTEXINFO_H + +#ifdef __GNUG__ +#pragma interface +#endif + +#include "ControlDialogs.h" + +/** A controller for Texinfo dialogs. */ + +class ControlTexinfo : public ControlDialog { +public: + /// + ControlTexinfo(LyXView &, Dialogs &); + /// + void viewFile(string const filename); + /// + void help(); + /// + void rescanStyles(); + /// + void runTexhash(); + +private: + /// + virtual void apply() {} +}; + +#endif // CONTROLTEXINFO_H diff --git a/src/frontends/controllers/GUI.h b/src/frontends/controllers/GUI.h index 663b075eef..075d2d1051 100644 --- a/src/frontends/controllers/GUI.h +++ b/src/frontends/controllers/GUI.h @@ -289,6 +289,19 @@ public: : GUI(lv, d) {} }; +/** Specialization for ShowFile dialog + */ +class ControlShowFile; + +template +class GUIShowFile : + public GUI { +public: + /// + GUIShowFile(LyXView & lv, Dialogs & d) + : GUI(lv, d) {} +}; + /** Specialization for Spellchecker dialog */ class ControlSpellchecker; @@ -332,6 +345,19 @@ public: }; +/** Specialization for Texinfo dialog + */ +class ControlTexinfo; + +template +class GUITexinfo : + public GUI { +public: + /// + GUITexinfo(LyXView & lv, Dialogs & d) + : GUI(lv, d) {} +}; + /** Specialization for Thesaurus dialog */ class ControlThesaurus; diff --git a/src/frontends/controllers/Makefile.am b/src/frontends/controllers/Makefile.am index ee819b9f1a..9cdac6228d 100644 --- a/src/frontends/controllers/Makefile.am +++ b/src/frontends/controllers/Makefile.am @@ -62,10 +62,14 @@ libcontrollers_la_SOURCES=\ ControlRef.h \ ControlSearch.C \ ControlSearch.h \ + ControlShowFile.C \ + ControlShowFile.h \ ControlSpellchecker.C \ ControlSpellchecker.h \ ControlTabularCreate.C \ ControlTabularCreate.h \ + ControlTexinfo.C \ + ControlTexinfo.h \ ControlThesaurus.C \ ControlThesaurus.h \ ControlToc.C \ diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index ffa4a9e572..2df2d21a74 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,14 @@ +2001-10-09 Herbert Voss + + * FormTexinfo.[Ch]: + * forms/form_texinfo.fd: new files. Display information about the + installed texfiles (cls,sty,bst). + + * FormShowFile.[Ch]: new files. Display the contents of a file. + + * Dialog.C: + * Makefile.am: modified appropriately. + 2001-10-09 Angus Leeming * xforms_helpers.[Ch] (getLengthFromWidgets): new function. diff --git a/src/frontends/xforms/Dialogs.C b/src/frontends/xforms/Dialogs.C index 38cb4a15d3..6af0e19788 100644 --- a/src/frontends/xforms/Dialogs.C +++ b/src/frontends/xforms/Dialogs.C @@ -39,8 +39,10 @@ #include "ControlPrint.h" #include "ControlRef.h" #include "ControlSearch.h" +#include "ControlShowFile.h" #include "ControlSpellchecker.h" #include "ControlTabularCreate.h" +#include "ControlTexinfo.h" #include "ControlThesaurus.h" #include "ControlToc.h" #include "ControlUrl.h" @@ -69,6 +71,7 @@ #include "form_search.h" #include "form_spellchecker.h" #include "form_tabular_create.h" +#include "form_texinfo.h" #include "form_thesaurus.h" #include "form_toc.h" #include "form_url.h" @@ -91,8 +94,10 @@ #include "FormPrint.h" #include "FormRef.h" #include "FormSearch.h" +#include "FormShowFile.h" #include "FormSpellchecker.h" #include "FormTabularCreate.h" +#include "FormTexinfo.h" #include "FormThesaurus.h" #include "FormToc.h" #include "FormUrl.h" @@ -128,11 +133,13 @@ Dialogs::Dialogs(LyXView * lv) add(new GUIPrint(*lv, *this)); add(new GUIRef(*lv, *this)); add(new GUISearch(*lv, *this)); + add(new GUIShowFile(*lv, *this)); add(new GUISpellchecker(*lv, *this)); add(new GUITabularCreate(*lv, *this)); #ifdef HAVE_LIBAIKSAURUS add(new GUIThesaurus(*lv, *this)); #endif + add(new GUITexinfo(*lv, *this)); add(new GUIToc(*lv, *this)); add(new GUIUrl(*lv, *this)); add(new GUIVCLog(*lv, *this)); diff --git a/src/frontends/xforms/FormShowFile.C b/src/frontends/xforms/FormShowFile.C new file mode 100644 index 0000000000..c45f263e4b --- /dev/null +++ b/src/frontends/xforms/FormShowFile.C @@ -0,0 +1,36 @@ +/* FormHelp.C + * (C) 2001 LyX Team + * \author Herbert Voss + */ + +#include + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include "xformsBC.h" +#include "ControlShowFile.h" +#include "FormShowFile.h" +#include "form_browser.h" +#include "gettext.h" + +FormShowFile::FormShowFile(ControlShowFile & c) + : FormCB(c, string()) +{} + + +void FormShowFile::update() +{ + fl_clear_browser(dialog_->browser); + // courier medium + fl_set_browser_fontstyle(dialog_->browser,FL_FIXED_STYLE); + fl_set_form_title(dialog_->form, controller().getFileName().c_str()); + + string const contents = controller().getFileContents(); + if (contents.empty()) + fl_add_browser_line(dialog_->browser, + "Error -> Cannot load file!"); + else + fl_add_browser_line(dialog_->browser, contents.c_str()); +} diff --git a/src/frontends/xforms/FormShowFile.h b/src/frontends/xforms/FormShowFile.h new file mode 100644 index 0000000000..58ce7950ea --- /dev/null +++ b/src/frontends/xforms/FormShowFile.h @@ -0,0 +1,38 @@ +// -*- C++ -*- + +/* + * FormShowFile.h + * + * (C) 2001 LyX Team + * \author Herbert Voss + */ + +#ifndef FORMSHOWFILE_H +#define FORMSHOWFILE_H + +#ifdef __GNUG__ +#pragma interface +#endif + +#include "FormBrowser.h" + +class ControlShowFile; + +/** + * This class provides an XForms implementation of a dialog to browse through a + * Help file. + */ +class FormShowFile : public FormCB { +public: + /// + FormShowFile(ControlShowFile &); + + // Functions accessible to the Controller. + + /// Set the Params variable for the Controller. + virtual void apply() {} + /// Update dialog before/whilst showing it. + virtual void update(); +}; + +#endif // FORMSHOWFILE_H diff --git a/src/frontends/xforms/FormTexinfo.C b/src/frontends/xforms/FormTexinfo.C new file mode 100644 index 0000000000..a8357cd64d --- /dev/null +++ b/src/frontends/xforms/FormTexinfo.C @@ -0,0 +1,250 @@ +/** + * \file FormTexinfo.C + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author Herbert Voss + * \date 2001-10-01 + */ + +#include +#include + +#ifdef __GNUG__ +#pragma implementation +#endif + +#include "xformsBC.h" +#include "ControlTexinfo.h" +#include "FormTexinfo.h" +#include "form_texinfo.h" +#include "gettext.h" +#include "debug.h" +#include "helper_funcs.h" +#include "xforms_helpers.h" +#include "support/lstrings.h" +#include "support/filetools.h" +#include "support/LAssert.h" + +extern string user_lyxdir; // home of *Files.lst + +namespace { + +string const bstFilename("bstFiles.lst"); +string const clsFilename("clsFiles.lst"); +string const styFilename("styFiles.lst"); +string const errorMessage =_("Missing filelist. try Rescan"); + +// C function wrapper, required by xforms. +extern "C" +int C_FormTexinfoFeedbackCB(FL_OBJECT * ob, int event, + FL_Coord, FL_Coord, int, void *) +{ + // Note that the return value is important in the pre-emptive handler. + // Don't return anything other than 0. + + lyx::Assert(ob); + // Don't Assert this one, as it can happen quite reasonably when things + // are being deleted in the d-tor. + //Assert(ob->form); + if (!ob->form) return 0; + + FormTexinfo * pre = + static_cast(ob->form->u_vdata); + pre->feedbackCB(ob, event); + return 0; +} + +void setPreHandler(FL_OBJECT * ob) +{ + lyx::Assert(ob); + fl_set_object_prehandler(ob, C_FormTexinfoFeedbackCB); +} + +} // namespace anon + + +typedef FormCB > base_class; +FormTexinfo::FormTexinfo(ControlTexinfo & c) + : base_class(c, _("TeX Infos")), + warningPosted(false), activeStyle(FormTexinfo::cls) +{} + + +void FormTexinfo::build() { + dialog_.reset(build_texinfo()); + // courier medium + fl_set_browser_fontstyle(dialog_->browser,FL_FIXED_STYLE); + // with Path is default + fl_set_button(dialog_->button_fullPath, 1); + updateStyles(FormTexinfo::cls); + + setPreHandler(dialog_->button_rescan); + setPreHandler(dialog_->button_view); + setPreHandler(dialog_->button_texhash); + setPreHandler(dialog_->button_fullPath); + setPreHandler(dialog_->browser); + setPreHandler(dialog_->radio_cls); + setPreHandler(dialog_->radio_sty); + setPreHandler(dialog_->radio_bst); + setPreHandler(dialog_->message); + setPreHandler(dialog_->help); +} + + +ButtonPolicy::SMInput FormTexinfo::input(FL_OBJECT * ob, long) { + if (ob == dialog_->help) { + controller().help(); + + } else if (ob == dialog_->radio_cls) { + updateStyles(FormTexinfo::cls); + + } else if (ob == dialog_->radio_sty) { + updateStyles(FormTexinfo::sty); + + } else if (ob == dialog_->radio_bst) { + updateStyles(FormTexinfo::bst); + + } else if (ob == dialog_->button_rescan) { + // build new *Files.lst + controller().rescanStyles(); + updateStyles(activeStyle); + + } else if (ob == dialog_->button_fullPath) { + setEnabled(dialog_->button_view, + fl_get_button(dialog_->button_fullPath)); + updateStyles(activeStyle); + + } else if (ob == dialog_->button_texhash) { + // makes only sense if the rights are set well for + // users (/var/lib/texmf/ls-R) + controller().runTexhash(); + // update files in fact of texhash + controller().rescanStyles(); + + } else if (ob == dialog_->button_view) { + unsigned int selection = fl_get_browser(dialog_->browser); + // a valid entry? + if (selection > 0) { + controller().viewFile( + fl_get_browser_line(dialog_->browser, + selection)); + } + } + + return ButtonPolicy::SMI_VALID; +} + + +namespace { + +string const sortEntries(string & str_in) +{ + std::vector dbase = getVectorFromString(str_in,"\n"); + std::sort(dbase.begin(), dbase.end()); // sort entries + return getStringFromVector(dbase,"\n"); +} + +string const getContents(string const filename, bool withFullPath) +{ + string fileContents = GetFileContents(AddName(user_lyxdir,filename)); + // everything ok? + if (!fileContents.empty()) { + if (withFullPath) + return(sortEntries(fileContents)); + else { + int Entries = 1; + string dummy = OnlyFilename(token(fileContents,'\n',1)); + string contents = dummy; + do { + dummy = OnlyFilename(token(fileContents,'\n',++Entries)); + contents += ("\n"+dummy); + } while (!dummy.empty()); + return(sortEntries(contents)); + } + } else + return errorMessage; +} + +} // namespace anon + + +void FormTexinfo::updateStyles(FormTexinfo::texFileSuffix whichStyle) +{ + fl_clear_browser(dialog_->browser); + + bool const withFullPath = fl_get_button(dialog_->button_fullPath); + + switch (whichStyle) { + case FormTexinfo::bst: + { + string const str = getContents(bstFilename, withFullPath); + fl_add_browser_line(dialog_->browser, str.c_str()); + break; + + } + case FormTexinfo::cls: + { + string const str = getContents(clsFilename, withFullPath); + fl_add_browser_line(dialog_->browser, str.c_str()); + break; + } + case FormTexinfo::sty: + { + string const str = getContents(styFilename, withFullPath); + fl_add_browser_line(dialog_->browser, str.c_str()); + break; + } + } + + activeStyle = whichStyle; +} + + +// preemptive handler for feedback messages +void FormTexinfo::feedbackCB(FL_OBJECT * ob, int event) +{ + lyx::Assert(ob); + + switch (event) { + case FL_ENTER: + warningPosted = false; + feedback(ob); + break; + + case FL_LEAVE: + if (!warningPosted) { + fl_set_object_label(dialog_->message, ""); + fl_redraw_object(dialog_->message); + } + break; + + default: + break; + } +} + + +void FormTexinfo::feedback(FL_OBJECT * ob) +{ + lyx::Assert(ob); + + string str; + + if (ob == dialog_->button_rescan) { + str = _("run rescan ..."); + + } else if (ob == dialog_->button_fullPath) { + str = _("View full path or only file name"); + + } else if (ob == dialog_->button_texhash) { + str = _("run texhash and rescan..."); + + } else if (ob == dialog_->button_view) { + str = _("select a file to view"); + + } + + fl_set_object_label(dialog_->message, str.c_str()); + fl_redraw_object(dialog_->message); +} diff --git a/src/frontends/xforms/FormTexinfo.h b/src/frontends/xforms/FormTexinfo.h new file mode 100644 index 0000000000..e956b9a964 --- /dev/null +++ b/src/frontends/xforms/FormTexinfo.h @@ -0,0 +1,53 @@ +// -*- C++ -*- +/** + * \file FormTexinfo.h + * Copyright 2001 the LyX Team + * Read the file COPYING + * + * \author Herbert Voss + */ + +#ifndef FORMTEXINFO_H +#define FORMTEXINFO_H + +#ifdef __GNUG__ +#pragma interface +#endif + +#include "FormBase.h" + +class ControlTexinfo; +struct FD_form_texinfo; + +class FormTexinfo : public FormCB > { +public: + /// + FormTexinfo(ControlTexinfo &); + /// the file extensions + enum texFileSuffix {cls, sty, bst}; + + /// preemptive handler for feedback messages + void feedbackCB(FL_OBJECT *, int); + +private: + /// not needed + virtual void apply() {} + /// Build the dialog. + virtual void build(); + /// not needed + virtual void update() {} + /// Filter the inputs on callback from xforms + virtual ButtonPolicy::SMInput input(FL_OBJECT *, long); + /// + void feedback(FL_OBJECT *); + /// + void updateStyles(texFileSuffix); + /// Fdesign generated method + FD_form_texinfo * build_texinfo(); + /// + bool warningPosted; + /// + texFileSuffix activeStyle; +}; + +#endif // FORMTEXINFO_H diff --git a/src/frontends/xforms/Makefile.am b/src/frontends/xforms/Makefile.am index a682f07ab8..3adc7fe295 100644 --- a/src/frontends/xforms/Makefile.am +++ b/src/frontends/xforms/Makefile.am @@ -140,6 +140,8 @@ libxforms_la_SOURCES = \ FormSearch.h \ form_search.C \ form_search.h \ + FormShowFile.C \ + FormShowFile.h \ FormSpellchecker.C \ FormSpellchecker.h \ form_spellchecker.C \ @@ -152,6 +154,10 @@ libxforms_la_SOURCES = \ FormTabularCreate.h \ form_tabular_create.C \ form_tabular_create.h \ + FormTexinfo.C \ + FormTexinfo.h \ + form_texinfo.C \ + form_texinfo.h \ FormThesaurus.C \ FormThesaurus.h \ form_thesaurus.C \ diff --git a/src/frontends/xforms/form_texinfo.C b/src/frontends/xforms/form_texinfo.C new file mode 100644 index 0000000000..4b94255af5 --- /dev/null +++ b/src/frontends/xforms/form_texinfo.C @@ -0,0 +1,124 @@ +// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext +#include +#include "lyx_gui_misc.h" +#include "gettext.h" + +/* Form definition file generated with fdesign. */ + +#include FORMS_H_LOCATION +#include +#include "form_texinfo.h" +#include "FormTexinfo.h" + +FD_form_texinfo::~FD_form_texinfo() +{ + if ( form->visible ) fl_hide_form( form ); + fl_free_form( form ); +} + + +FD_form_texinfo * FormTexinfo::build_texinfo() +{ + FL_OBJECT *obj; + FD_form_texinfo *fdui = new FD_form_texinfo; + + fdui->form = fl_bgn_form(FL_NO_BOX, 513, 394); + fdui->form->u_vdata = this; + obj = fl_add_box(FL_UP_BOX, 0, 0, 513, 394, ""); + fl_set_object_lstyle(obj, FL_FIXED_STYLE); + fdui->browser = obj = fl_add_browser(FL_HOLD_BROWSER, 15, 12, 324, 290, ""); + fl_set_object_lalign(obj, FL_ALIGN_TOP); + fl_set_object_lstyle(obj, FL_FIXED_STYLE); + fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast); + fl_set_object_resize(obj, FL_RESIZE_NONE); + fl_set_object_callback(obj, C_FormBaseInputCB, 0); + obj = fl_add_frame(FL_ENGRAVED_FRAME, 345, 15, 155, 100, ""); + fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast); + { + char const * const dummy = N_("LaTeX Classes|#C"); + fdui->radio_cls = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 350, 20, 30, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_lalign(obj, FL_ALIGN_RIGHT); + fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast); + fl_set_object_callback(obj, C_FormBaseInputCB, 0); + fl_set_button(obj, 1); + { + char const * const dummy = N_("LaTeX Styles|#S"); + fdui->radio_sty = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 350, 50, 30, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_lalign(obj, FL_ALIGN_RIGHT); + fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast); + fl_set_object_callback(obj, C_FormBaseInputCB, 0); + { + char const * const dummy = N_("BibTeX Styles|#B"); + fdui->radio_bst = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 350, 80, 30, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_lalign(obj, FL_ALIGN_RIGHT); + fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast); + fl_set_object_callback(obj, C_FormBaseInputCB, 0); + obj = fl_add_frame(FL_ENGRAVED_FRAME, 345, 122, 155, 128, ""); + fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast); + { + char const * const dummy = N_("Rescan|#R"); + fdui->button_rescan = obj = fl_add_button(FL_NORMAL_BUTTON, 355, 138, 135, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast); + fl_set_object_callback(obj, C_FormBaseInputCB, 2); + { + char const * const dummy = N_("View|#V"); + fdui->button_view = obj = fl_add_button(FL_NORMAL_BUTTON, 355, 173, 135, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast); + fl_set_object_callback(obj, C_FormBaseInputCB, 2); + { + char const * const dummy = N_("Show Path|#P"); + fdui->button_fullPath = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 350, 209, 30, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_lalign(obj, FL_ALIGN_RIGHT); + fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast); + fl_set_object_callback(obj, C_FormBaseInputCB, 2); + fdui->message = obj = fl_add_text(FL_NORMAL_TEXT, 15, 313, 481, 31, ""); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); + fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast); + fdui->help = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 353, 90, 30, _("Help")); + fl_set_button_shortcut(obj, _("H"), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest); + fl_set_object_callback(obj, C_FormBaseInputCB, 0); + { + char const * const dummy = N_("Run Texhash|#T"); + fdui->button_texhash = obj = fl_add_button(FL_NORMAL_BUTTON, 188, 353, 135, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast); + fl_set_object_callback(obj, C_FormBaseInputCB, 0); + { + char const * const dummy = N_("Close|^[^M"); + fdui->button_close = obj = fl_add_button(FL_NORMAL_BUTTON, 410, 353, 90, 30, idex(_(dummy))); + fl_set_button_shortcut(obj, scex(_(dummy)), 1); + } + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); + fl_set_object_callback(obj, C_FormBaseCancelCB, 0); + fl_end_form(); + + fdui->form->fdui = fdui; + + return fdui; +} +/*---------------------------------------*/ + diff --git a/src/frontends/xforms/form_texinfo.h b/src/frontends/xforms/form_texinfo.h new file mode 100644 index 0000000000..4ac6b99e55 --- /dev/null +++ b/src/frontends/xforms/form_texinfo.h @@ -0,0 +1,30 @@ +// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext +/** Header file generated with fdesign **/ + +#ifndef FD_form_texinfo_h_ +#define FD_form_texinfo_h_ + +/** Callbacks, globals and object handlers **/ +extern "C" void C_FormBaseInputCB(FL_OBJECT *, long); +extern "C" void C_FormBaseCancelCB(FL_OBJECT *, long); + + +/**** Forms and Objects ****/ +struct FD_form_texinfo { + ~FD_form_texinfo(); + + FL_FORM *form; + FL_OBJECT *browser; + FL_OBJECT *radio_cls; + FL_OBJECT *radio_sty; + FL_OBJECT *radio_bst; + FL_OBJECT *button_rescan; + FL_OBJECT *button_view; + FL_OBJECT *button_fullPath; + FL_OBJECT *message; + FL_OBJECT *help; + FL_OBJECT *button_texhash; + FL_OBJECT *button_close; +}; + +#endif /* FD_form_texinfo_h_ */ diff --git a/src/frontends/xforms/forms/form_texinfo.fd b/src/frontends/xforms/forms/form_texinfo.fd new file mode 100644 index 0000000000..229b372583 --- /dev/null +++ b/src/frontends/xforms/forms/form_texinfo.fd @@ -0,0 +1,270 @@ +Magic: 13000 + +Internal Form Definition File + (do not change) + +Number of forms: 1 +Unit of measure: FL_COORD_PIXEL +SnapGrid: 1 + +=============== FORM =============== +Name: form_texinfo +Width: 513 +Height: 394 +Number of Objects: 14 + +-------------------- +class: FL_BOX +type: UP_BOX +box: 0 0 513 394 +boxtype: FL_UP_BOX +colors: FL_COL1 FL_COL1 +alignment: FL_ALIGN_CENTER +style: FL_FIXED_STYLE +size: FL_DEFAULT_SIZE +lcol: FL_BLACK +label: +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NoGravity FL_NoGravity +name: +callback: +argument: + +-------------------- +class: FL_BROWSER +type: HOLD_BROWSER +box: 15 12 324 290 +boxtype: FL_DOWN_BOX +colors: FL_COL1 FL_YELLOW +alignment: FL_ALIGN_TOP +style: FL_FIXED_STYLE +size: FL_DEFAULT_SIZE +lcol: FL_BLACK +label: +shortcut: +resize: FL_RESIZE_NONE +gravity: FL_NorthWest FL_SouthEast +name: browser +callback: C_FormBaseInputCB +argument: 0 + +-------------------- +class: FL_FRAME +type: ENGRAVED_FRAME +box: 345 15 155 100 +boxtype: FL_NO_BOX +colors: FL_BLACK FL_COL1 +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_DEFAULT_SIZE +lcol: FL_BLACK +label: +shortcut: +resize: FL_RESIZE_NONE +gravity: FL_NorthEast FL_NorthEast +name: +callback: +argument: + +-------------------- +class: FL_CHECKBUTTON +type: RADIO_BUTTON +box: 350 20 30 30 +boxtype: FL_NO_BOX +colors: FL_COL1 FL_YELLOW +alignment: FL_ALIGN_RIGHT +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: LaTeX Classes|#C +shortcut: +resize: FL_RESIZE_NONE +gravity: FL_NorthEast FL_NorthEast +name: radio_cls +callback: C_FormBaseInputCB +argument: 0 + value: 1 + +-------------------- +class: FL_CHECKBUTTON +type: RADIO_BUTTON +box: 350 50 30 30 +boxtype: FL_NO_BOX +colors: FL_COL1 FL_YELLOW +alignment: FL_ALIGN_RIGHT +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: LaTeX Styles|#S +shortcut: +resize: FL_RESIZE_NONE +gravity: FL_NorthEast FL_NorthEast +name: radio_sty +callback: C_FormBaseInputCB +argument: 0 + +-------------------- +class: FL_CHECKBUTTON +type: RADIO_BUTTON +box: 350 80 30 30 +boxtype: FL_NO_BOX +colors: FL_COL1 FL_YELLOW +alignment: FL_ALIGN_RIGHT +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: BibTeX Styles|#B +shortcut: +resize: FL_RESIZE_NONE +gravity: FL_NorthEast FL_NorthEast +name: radio_bst +callback: C_FormBaseInputCB +argument: 0 + +-------------------- +class: FL_FRAME +type: ENGRAVED_FRAME +box: 345 122 155 128 +boxtype: FL_NO_BOX +colors: FL_BLACK FL_COL1 +alignment: FL_ALIGN_CENTER +style: FL_NORMAL_STYLE +size: FL_DEFAULT_SIZE +lcol: FL_BLACK +label: +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_NorthEast FL_NorthEast +name: +callback: +argument: + +-------------------- +class: FL_BUTTON +type: NORMAL_BUTTON +box: 355 138 135 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: Rescan|#R +shortcut: +resize: FL_RESIZE_NONE +gravity: FL_NorthEast FL_NorthEast +name: button_rescan +callback: C_FormBaseInputCB +argument: 2 + +-------------------- +class: FL_BUTTON +type: NORMAL_BUTTON +box: 355 173 135 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: View|#V +shortcut: +resize: FL_RESIZE_NONE +gravity: FL_NorthEast FL_NorthEast +name: button_view +callback: C_FormBaseInputCB +argument: 2 + +-------------------- +class: FL_CHECKBUTTON +type: PUSH_BUTTON +box: 350 209 30 30 +boxtype: FL_NO_BOX +colors: FL_COL1 FL_YELLOW +alignment: FL_ALIGN_RIGHT +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: Show Path|#P +shortcut: +resize: FL_RESIZE_NONE +gravity: FL_NorthEast FL_NorthEast +name: button_fullPath +callback: C_FormBaseInputCB +argument: 2 + +-------------------- +class: FL_TEXT +type: NORMAL_TEXT +box: 15 313 481 31 +boxtype: FL_FLAT_BOX +colors: FL_COL1 FL_MCOL +alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE +style: FL_NORMAL_STYLE +size: FL_NORMAL_SIZE +lcol: FL_BLACK +label: +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_SouthWest FL_SouthEast +name: message +callback: +argument: + +-------------------- +class: FL_BUTTON +type: NORMAL_BUTTON +box: 10 353 90 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: Help +shortcut: H +resize: FL_RESIZE_ALL +gravity: FL_SouthWest FL_SouthWest +name: help +callback: C_FormBaseInputCB +argument: 0 + +-------------------- +class: FL_BUTTON +type: NORMAL_BUTTON +box: 188 353 135 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: Run Texhash|#T +shortcut: +resize: FL_RESIZE_ALL +gravity: FL_SouthWest FL_SouthEast +name: button_texhash +callback: C_FormBaseInputCB +argument: 0 + +-------------------- +class: FL_BUTTON +type: NORMAL_BUTTON +box: 410 353 90 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: Close|^[^M +shortcut: +resize: FL_RESIZE_NONE +gravity: FL_SouthEast FL_SouthEast +name: button_close +callback: C_FormBaseCancelCB +argument: 0 + +============================== +create_the_form diff --git a/src/frontends/xforms/forms/makefile b/src/frontends/xforms/forms/makefile index 62ad9ba5a1..240b646b18 100644 --- a/src/frontends/xforms/forms/makefile +++ b/src/frontends/xforms/forms/makefile @@ -48,6 +48,7 @@ SRCS = form_aboutlyx.fd \ form_spellchecker.fd \ form_tabular.fd \ form_tabular_create.fd \ + form_texinfo.fd \ form_thesaurus.fd \ form_toc.fd \ form_url.fd diff --git a/src/frontends/xforms/xforms_helpers.C b/src/frontends/xforms/xforms_helpers.C index dcf721ddc0..274874989b 100644 --- a/src/frontends/xforms/xforms_helpers.C +++ b/src/frontends/xforms/xforms_helpers.C @@ -75,15 +75,13 @@ string getLengthFromWidgets(FL_OBJECT * input, FL_OBJECT * choice) lyx::Assert(input && input->objclass == FL_INPUT && choice && choice->objclass == FL_CHOICE); - string length; - - string len = strip(frontStrip(fl_get_input(input))); - if (len.empty()) - len = "0"; + string length = strip(frontStrip(fl_get_input(input))); + if (length.empty()) + length = "0"; string const units = strip(frontStrip(fl_get_choice_text(choice))); - return len + units; + return length + units; } diff --git a/src/lyx_main.C b/src/lyx_main.C index 4e08e372c0..a4bbe16e6b 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -57,6 +57,7 @@ string system_lyxdir; string build_lyxdir; string system_tempdir; string user_lyxdir; // Default $HOME/.lyx +string help_lyxdir; // Default system_lyxdir/help // Should this be kept global? Asger says Yes. DebugStream lyxerr; @@ -374,7 +375,7 @@ void LyX::init(bool gui) system_lyxdir = LYX_DIR; path_shown = true; } - + help_lyxdir = system_lyxdir+"help/"; // Report the system directory if debugging is on if (!path_shown) lyxerr[Debug::INIT] << "System directory: '" diff --git a/src/lyxfunc.C b/src/lyxfunc.C index d1df3e1b24..6f0436d5a6 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -1202,6 +1202,10 @@ string const LyXFunc::dispatch(int ac, owner->getDialogs()->showAboutlyx(); break; + case LFUN_HELP_TEXINFO: + owner->getDialogs()->showTexinfo(); + break; + case LFUN_HELP_OPEN: { string const arg = argument; -- 2.39.2