major GUII cleanup + Baruchs patch + Angus's patch + removed a couple of generated files

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@966 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Allan Rae 2000-08-14 05:24:35 +00:00
parent b7a16fc402
commit f4d7b803f3
86 changed files with 2162 additions and 6142 deletions

View File

@ -1,3 +1,79 @@
2000-08-14 Allan Rae <rae@lyx.org>
* lib/Makefile.am: listerrors cleaning
* lib/listerrors: removed -- generated file
* acinclude.m4: ditto
* sigc++/acinclude.m4: ditto
* src/frontends/xforms/forms/form_citation.fd:
* src/frontends/xforms/FormCitation.C (setSize): Made the form a more
manageable size.
* src/frontends/xforms/forms/makefile: I renamed the `install` target
`updatesrc` and now we have a `test` target that does what `updatesrc`
used to do. I didn't like having an install target that wasn't related
to the dist.
* src/frontends/xforms/Form*.[hC]: Removed the free() member functions
on all except FormGraphics. This may yet happen. Followed by a major
cleanup including using FL_TRANSIENT for most of the dialogs. More
changes to come when the ButtonController below is introduced.
* src/frontends/xforms/ButtonController.h: New file for managing up to
four buttons on a dialog according to an externally defined policy.
* src/frontends/xforms/Makefile.am: added above
* src/frontends/ButtonPolicies.[hC]: New files full of policies for Ok,
Apply and Cancel/Close buttons and everything in between and beyond.
* src/frontends/Makefile.am: added above.
* src/frontends/xforms/forms/form_preferences.fd:
* src/frontends/xforms/FormPreferences.[hC]: Uses the ButtonController
and removed variable 'status' as a result. Fixed the set_minsize thing.
Use the new screen-font-update after checking screen fonts were changed
Added a "Restore" button to restore the original lyxrc values while
editing. This restores everything not just the last input changed.
That's still a tricky one. As is the "LyX: this shouldn't happen..."
* src/LyXAction.C: screen-font-update added for updating buffers after
screen font settings have been changed.
* src/commandtags.h: ditto
* src/lyxfunc.C: ditto
* forms/lyx.fd: removed screen fonts dialog.
* src/lyx_gui.C: ditto
* src/menus.[Ch]: ditto
* src/lyx.[Ch]: ditto
* src/lyx_cb.C: ditto + code from here moved to make screen-font-update.
And people wonder why progress on GUII is slow. Look at how scattered
this stuff was! It takes forever just find it all.
* forms/fdfix.sh: Fixup the spacing after commas.
* forms/makefile: Remove date from generated files. Fewer clashes now.
* forms/bullet_forms.C.patch: included someones handwritten changes
* src/lyxrc.[Ch]: Added a commented out system_lyxrc. Will use it RSN
once I've discovered why LyXRC was made noncopyable.
* src/lyx_main.C: ditto
2000-08-14 Angus Leeming <a.leeming@ic.ac.uk>
* src/frontends/xforms/forms/fdfix.sh:
* src/frontends/xforms/forms/fdfixh.sed:
* src/frontends/xforms/forms/fdfixc.sed: New file from Angus
* src/frontends/xforms/Form*.[hC]:
* src/frontends/xforms/form_*.[hC]: Massive rewrite of the generation
scripts to rename all the "FL_OBJECT * form_xxxx" to "form" and to
provide a destructor for the struct FD_form_xxxx. Another version of
the set_[max|min]size workaround and a few other cleanups. Actually,
Angus' patch from 20000809.
2000-08-13 Baruch Even <baruch.even@writeme.com>
* src/insets/insetgraphics.C (Clone): Added several fields that needed
copying.
2000-08-11 Juergen Vigna <jug@sad.it> 2000-08-11 Juergen Vigna <jug@sad.it>
* src/insets/insetgraphics.C (InsetGraphics): changing init * src/insets/insetgraphics.C (InsetGraphics): changing init

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
--- bullet_forms.c.orig Fri Jun 9 17:38:18 2000 --- bullet_forms.c.orig Thu Aug 10 00:38:18 2000
+++ bullet_forms.c Fri Jun 9 17:39:31 2000 +++ bullet_forms.c Thu Aug 10 00:38:18 2000
@@ -3,6 +3,8 @@ @@ -3,6 +3,8 @@
#include "forms.h" #include "forms.h"
#include <stdlib.h> #include <stdlib.h>
@ -28,7 +28,7 @@
+ fl_set_object_boxtype(obj, FL_UP_BOX); + fl_set_object_boxtype(obj, FL_UP_BOX);
+ fl_set_bmtable_pixmap_file(obj, 6, 6, + fl_set_bmtable_pixmap_file(obj, 6, 6,
+ LibFileSearch("images", + LibFileSearch("images",
+ "standard.xpm").c_str()); + "standard", "xpm").c_str());
+ +
+ fl_set_border_width(-1); + fl_set_border_width(-1);
obj = fl_add_frame(FL_ENGRAVED_FRAME,95,20,255,70,""); obj = fl_add_frame(FL_ENGRAVED_FRAME,95,20,255,70,"");

View File

@ -74,12 +74,12 @@ echo >> $2
# reported to its authors). # reported to its authors).
# #
# -e 's/,\([^ ]\)/, \1/g' \ # -e 's/,\([^ ]\)/, \1/g' \
# -e 's/\("[^"]*,\) \("\)/\1\2/g' # -e 's/\("[^"][^"]*,\) \("\)/\1\2/g'
# #
# Someone got busy and put spaces in after commas but didn't allow for the # Someone got busy and put spaces in after commas but didn't allow for the
# autogeneration of the files so their pretty formatting got lost. Not anymore. # autogeneration of the files so their pretty formatting got lost. Not anymore.
# The second rule cleans up one special case where a comma appears at the end # The second rule cleans up one special case where a comma appears at the end
# of a string. # of a string while ensuring "...", "..." isn't affected.
# #
# -e 's/stdlib.h/cstdlib/' # -e 's/stdlib.h/cstdlib/'
# #
@ -109,7 +109,7 @@ cat $1 | sed \
-e 's/fdui->.*->fdui = fdui/\/\/&/' \ -e 's/fdui->.*->fdui = fdui/\/\/&/' \
-e 's/\(\(FD_[^ ]*\) \*fdui.*\)sizeof(\*fdui)/\1sizeof(\2)/' \ -e 's/\(\(FD_[^ ]*\) \*fdui.*\)sizeof(\*fdui)/\1sizeof(\2)/' \
-e 's/,\([^ ]\)/, \1/g' \ -e 's/,\([^ ]\)/, \1/g' \
-e 's/\("[^"]*,\) \("\)/\1\2/g' \ -e 's/\("[^"][^"]*,\) \("\)/\1\2/g' \
-e '/fl_.*"[^"]*%.*"/i\ -e '/fl_.*"[^"]*%.*"/i\
// xgettext:no-c-format' \ // xgettext:no-c-format' \
-e 's/NULL/0/' \ -e 's/NULL/0/' \

View File

@ -3,7 +3,7 @@ Magic: 13000
Internal Form Definition File Internal Form Definition File
(do not change) (do not change)
Number of forms: 4 Number of forms: 3
Unit of measure: FL_COORD_PIXEL Unit of measure: FL_COORD_PIXEL
=============== FORM =============== =============== FORM ===============
@ -93,7 +93,7 @@ argument:
-------------------- --------------------
class: FL_BEGIN_GROUP class: FL_BEGIN_GROUP
type: 0 type: 0
box: 0 10 10 0 box: 0 0 0 0
boxtype: FL_NO_BOX boxtype: FL_NO_BOX
colors: FL_COL1 FL_MCOL colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER
@ -234,174 +234,6 @@ name:
callback: callback:
argument: argument:
=============== FORM ===============
Name: form_screen
Width: 390
Height: 220
Number of Objects: 9
--------------------
class: FL_BOX
type: UP_BOX
box: 0 0 390 220
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: 140 10 240 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: Roman font|#R
shortcut:
resize: FL_RESIZE_X
gravity: FL_NorthWest FL_NoGravity
name: input_roman
callback:
argument:
--------------------
class: FL_INPUT
type: NORMAL_INPUT
box: 140 40 240 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: Sans serif font|#S
shortcut:
resize: FL_RESIZE_X
gravity: FL_NorthWest FL_NoGravity
name: input_sans
callback:
argument:
--------------------
class: FL_INPUT
type: NORMAL_INPUT
box: 140 70 240 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: Typewriter font|#T
shortcut:
resize: FL_RESIZE_X
gravity: FL_NorthWest FL_NoGravity
name: input_typewriter
callback:
argument:
--------------------
class: FL_INPUT
type: NORMAL_INPUT
box: 140 100 240 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: Font norm|#N
shortcut:
resize: FL_RESIZE_X
gravity: FL_NorthWest FL_NoGravity
name: input_font_norm
callback:
argument:
--------------------
class: FL_INPUT
type: INT_INPUT
box: 140 140 50 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: Font zoom|#Z
shortcut:
resize: FL_RESIZE_X
gravity: FL_NorthWest FL_NoGravity
name: intinput_size
callback:
argument:
--------------------
class: FL_BUTTON
type: RETURN_BUTTON
box: 60 180 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: OK
shortcut: ^M
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name:
callback: ScreenOKCB
argument: 0
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 170 180 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: Apply|#A
shortcut:
resize: FL_RESIZE_NONE
gravity: FL_SouthEast FL_SouthEast
name:
callback: ScreenApplyCB
argument: 0
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 280 180 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:
callback: ScreenCancelCB
argument: 0
=============== FORM =============== =============== FORM ===============
Name: form_external Name: form_external
Width: 560 Width: 560

View File

@ -43,6 +43,11 @@ d: c $(COBJS)
# #
# We need the callbacks to all be declared as: extern "C" void # We need the callbacks to all be declared as: extern "C" void
# #
# -e 's,\(generated with fdesign\)\(.*\)\(\*\*/\),\1 \3,';\
#
# Clean up the line with the date in it. This means we'll have fewer false
# updates (where the only thing that changed was the date).
#
e: c e: c
for hfil in *.h ; do \ for hfil in *.h ; do \
if [ -f "$$hfil.patch" ] ; then \ if [ -f "$$hfil.patch" ] ; then \
@ -50,7 +55,8 @@ e: c
patch -s $$hfil < $$hfil.patch) \ patch -s $$hfil < $$hfil.patch) \
fi; \ fi; \
sed < $$hfil > $$hfil.tmp \ sed < $$hfil > $$hfil.tmp \
-e 's/\(extern\) \(void.*FL_OBJECT\)/\1 "C" \2/' ; \ -e 's/\(extern\) \(void.*FL_OBJECT\)/\1 "C" \2/' \
-e 's,\(generated with fdesign\)\(.*\)\(\*\*/\),\1 \3,';\
mv $$hfil.tmp $$hfil; \ mv $$hfil.tmp $$hfil; \
done done

View File

@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = foreign
DISTCLEANFILES = *.orig *.rej *~ *.bak core textclass.lst packages.lst \ DISTCLEANFILES = *.orig *.rej *~ *.bak core textclass.lst packages.lst \
lyxrc.defaults doc/LyXConfig.lyx lyxrc.defaults doc/LyXConfig.lyx
pkgdata_SCRIPTS = configure configure.cmd pkgdata_SCRIPTS = configure configure.cmd
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in MAINTAINERCLEANFILES = $(srcdir)/Makefile.in listerrors
SUBDIRS = reLyX SUBDIRS = reLyX
bin_SCRIPTS = listerrors bin_SCRIPTS = listerrors

View File

@ -1,5 +0,0 @@
#!/bin/sh
echo "This is NOT the listerrors program."
echo ""
echo "Here was the problem when we tried to build listerrors:"
echo The NOWEB notangle was not found.

View File

@ -30,6 +30,8 @@ src/frontends/xforms/FormCitation.C
src/frontends/xforms/form_citation.C src/frontends/xforms/form_citation.C
src/frontends/xforms/FormCopyright.C src/frontends/xforms/FormCopyright.C
src/frontends/xforms/form_copyright.C src/frontends/xforms/form_copyright.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/form_document.C
src/frontends/xforms/FormGraphics.C src/frontends/xforms/FormGraphics.C
src/frontends/xforms/form_graphics.C src/frontends/xforms/form_graphics.C
src/frontends/xforms/FormIndex.C src/frontends/xforms/FormIndex.C
@ -40,13 +42,6 @@ src/frontends/xforms/FormPrint.C
src/frontends/xforms/form_print.C src/frontends/xforms/form_print.C
src/frontends/xforms/FormRef.C src/frontends/xforms/FormRef.C
src/frontends/xforms/form_ref.C src/frontends/xforms/form_ref.C
src/frontends/xforms/forms/form_citation.C
src/frontends/xforms/forms/form_copyright.C
src/frontends/xforms/forms/form_graphics.C
src/frontends/xforms/forms/form_preferences.C
src/frontends/xforms/forms/form_print.C
src/frontends/xforms/forms/form_tabular.C
src/frontends/xforms/forms/form_url.C
src/frontends/xforms/FormTabular.C src/frontends/xforms/FormTabular.C
src/frontends/xforms/form_tabular.C src/frontends/xforms/form_tabular.C
src/frontends/xforms/FormToc.C src/frontends/xforms/FormToc.C

View File

@ -1,430 +0,0 @@
## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
## Copyright (C) 1996-1999 Free Software Foundation, Inc.
## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##
## As a special exception to the GNU General Public License, if you
## distribute this file as part of a program that contains a
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
# serial 40 AC_PROG_LIBTOOL
AC_DEFUN(AC_PROG_LIBTOOL,
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
# Save cache, so that ltconfig can load it
AC_CACHE_SAVE
# Actually configure libtool. ac_aux_dir is where install-sh is found.
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
|| AC_MSG_ERROR([libtool configure failed])
# Reload cache, that may have been modified by ltconfig
AC_CACHE_LOAD
# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)dnl
# Redirect the config.log output again, so that the ltconfig log is not
# clobbered by the next message.
exec 5>>./config.log
])
AC_DEFUN(AC_LIBTOOL_SETUP,
[AC_PREREQ(2.13)dnl
AC_REQUIRE([AC_ENABLE_SHARED])dnl
AC_REQUIRE([AC_ENABLE_STATIC])dnl
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_LD])dnl
AC_REQUIRE([AC_PROG_NM])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
case "$target" in
NONE) lt_target="$host" ;;
*) lt_target="$target" ;;
esac
# Check for any special flags to pass to ltconfig.
libtool_flags="--cache-file=$cache_file"
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
[libtool_flags="$libtool_flags --enable-dlopen"])
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
[libtool_flags="$libtool_flags --enable-win32-dll"])
AC_ARG_ENABLE(libtool-lock,
[ --disable-libtool-lock avoid locking (might break parallel builds)])
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case "$lt_target" in
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
LD="${LD-ld} -32"
;;
*N32*)
LD="${LD-ld} -n32"
;;
*64-bit*)
LD="${LD-ld} -64"
;;
esac
fi
rm -rf conftest*
;;
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
[AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS="$SAVE_CFLAGS"
fi
;;
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
[*-*-cygwin* | *-*-mingw*)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
])
esac
])
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
# AC_ENABLE_SHARED - implement the --enable-shared flag
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_SHARED, [dnl
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(shared,
changequote(<<, >>)dnl
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
])
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_SHARED(no)])
# AC_ENABLE_STATIC - implement the --enable-static flag
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_STATIC, [dnl
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(static,
changequote(<<, >>)dnl
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
])
# AC_DISABLE_STATIC - set the default static flag to --disable-static
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_STATIC(no)])
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(fast-install,
changequote(<<, >>)dnl
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
])
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_FAST_INSTALL(no)])
# AC_PROG_LD - find the path to the GNU or non-GNU linker
AC_DEFUN(AC_PROG_LD,
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
ac_prog=`($CC -print-prog-name=ld) 2>&5`
case "$ac_prog" in
# Accept absolute paths.
changequote(,)dnl
[\\/]* | [A-Za-z]:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
changequote([,])dnl
# Canonicalize the path of ld
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL(ac_cv_path_LD,
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
ac_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
fi
fi
done
IFS="$ac_save_ifs"
else
ac_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
LD="$ac_cv_path_LD"
if test -n "$LD"; then
AC_MSG_RESULT($LD)
else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_PROG_LD_GNU
])
AC_DEFUN(AC_PROG_LD_GNU,
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
ac_cv_prog_gnu_ld=yes
else
ac_cv_prog_gnu_ld=no
fi])
])
# AC_PROG_NM - find the path to a BSD-compatible name lister
AC_DEFUN(AC_PROG_NM,
[AC_MSG_CHECKING([for BSD-compatible nm])
AC_CACHE_VAL(ac_cv_path_NM,
[if test -n "$NM"; then
# Let the user override the test.
ac_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
ac_cv_path_NM="$ac_dir/nm -B"
break
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
ac_cv_path_NM="$ac_dir/nm -p"
break
else
ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
fi])
NM="$ac_cv_path_NM"
AC_MSG_RESULT([$NM])
])
# AC_CHECK_LIBM - check for math library
AC_DEFUN(AC_CHECK_LIBM,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case "$lt_target" in
*-*-beos* | *-*-cygwin*)
# These system don't have libm
;;
*-ncr-sysv4.3*)
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
;;
*)
AC_CHECK_LIB(m, main, LIBM="-lm")
;;
esac
])
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl convenience library, adds --enable-ltdl-convenience to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
# '${top_builddir}/' (note the single quotes!) if your package is not
# flat, and, if you're not using automake, define top_builddir as
# appropriate in the Makefiles.
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
case "$enable_ltdl_convenience" in
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
"") enable_ltdl_convenience=yes
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
esac
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
])
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl installable library, and adds --enable-ltdl-install to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
# '${top_builddir}/' (note the single quotes!) if your package is not
# flat, and, if you're not using automake, define top_builddir as
# appropriate in the Makefiles.
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_CHECK_LIB(ltdl, main,
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
[if test x"$enable_ltdl_install" = xno; then
AC_MSG_WARN([libltdl not installed, but installation disabled])
else
enable_ltdl_install=yes
fi
])
if test x"$enable_ltdl_install" = x"yes"; then
ac_configure_args="$ac_configure_args --enable-ltdl-install"
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
else
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
LIBLTDL="-lltdl"
INCLTDL=
fi
])
dnl old names
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
dnl This is just to silence aclocal about the macro not being used
ifelse([AC_DISABLE_FAST_INSTALL])dnl

View File

@ -432,6 +432,7 @@ void LyXAction::init()
{ LFUN_INSET_LIST, "list-insert", "", Noop }, { LFUN_INSET_LIST, "list-insert", "", Noop },
{ LFUN_INSET_THEOREM, "theorem-insert", "", Noop }, { LFUN_INSET_THEOREM, "theorem-insert", "", Noop },
{ LFUN_INSET_CAPTION, "caption-insert", "", Noop }, { LFUN_INSET_CAPTION, "caption-insert", "", Noop },
{ LFUN_SCREEN_FONT_UPDATE, "screen-font-update", "", NoBuffer },
{ LFUN_NOACTION, "", "", Noop } { LFUN_NOACTION, "", "", Noop }
}; };

View File

@ -1,4 +1,4 @@
/** Header file generated with fdesign on Mon Jun 19 12:55:08 2000.**/ /** Header file generated with fdesign **/
#ifndef FD_form_bullet_h_ #ifndef FD_form_bullet_h_
#define FD_form_bullet_h_ #define FD_form_bullet_h_

View File

@ -275,6 +275,7 @@ enum kb_action {
LFUN_SCROLL_INSET, // Jug 20000801 LFUN_SCROLL_INSET, // Jug 20000801
LFUN_INDEX_INSERT, // Angus 20000803 LFUN_INDEX_INSERT, // Angus 20000803
LFUN_REF_CREATE, // Angus 20000807 LFUN_REF_CREATE, // Angus 20000807
LFUN_SCREEN_FONT_UPDATE, // ARRae 20000813
LFUN_LASTACTION /* this marks the end of the table */ LFUN_LASTACTION /* this marks the end of the table */
}; };

View File

@ -1,4 +1,4 @@
/** Header file generated with fdesign on Mon Jun 19 12:55:08 2000.**/ /** Header file generated with fdesign **/
#ifndef FD_form_credits_h_ #ifndef FD_form_credits_h_
#define FD_form_credits_h_ #define FD_form_credits_h_

View File

@ -165,18 +165,17 @@ _("Credits...|e");
_("Version...|V"); _("Version...|V");
_(""); _("");
_("A&A"); _("A&A");
_("ACT");
_("AT_RISE:");
_("Abstract"); _("Abstract");
_("Accepted"); _("Accepted");
_("Acknowledgement"); _("Acknowledgement");
_("Acknowledgement(s)");
_("Acknowledgement*"); _("Acknowledgement*");
_("Acknowledgement-numbered"); _("Acknowledgement-numbered");
_("Acknowledgement-unnumbered"); _("Acknowledgement(s)");
_("Acknowledgements"); _("Acknowledgements");
_("Acknowledgement-unnumbered");
_("Acknowledgments"); _("Acknowledgments");
_("Acnowledgement"); _("Acnowledgement");
_("ACT");
_("Addchap"); _("Addchap");
_("Addchap*"); _("Addchap*");
_("Addition"); _("Addition");
@ -194,15 +193,15 @@ _("Anlagen");
_("Anrede"); _("Anrede");
_("Appendices"); _("Appendices");
_("Appendix"); _("Appendix");
_("AT_RISE:");
_("Author"); _("Author");
_("AuthorRunning");
_("Author_Email"); _("Author_Email");
_("Author_Running"); _("Author_Running");
_("AuthorRunning");
_("Author_URL"); _("Author_URL");
_("Axiom"); _("Axiom");
_("Axiom-numbered"); _("Axiom-numbered");
_("Axiom-plain"); _("Axiom-plain");
_("BLZ");
_("Backaddress"); _("Backaddress");
_("Bank"); _("Bank");
_("BankAccount"); _("BankAccount");
@ -210,12 +209,13 @@ _("BankCode");
_("Betreff"); _("Betreff");
_("Bibliography"); _("Bibliography");
_("Biography"); _("Biography");
_("BLZ");
_("Brieftext"); _("Brieftext");
_("CC");
_("CURTAIN");
_("Caption"); _("Caption");
_("Case"); _("Case");
_("Case-numbered"); _("Case-numbered");
_("CC");
_("cc");
_("CenteredCaption"); _("CenteredCaption");
_("Chapter"); _("Chapter");
_("Chapter*"); _("Chapter*");
@ -255,6 +255,7 @@ _("Criterion-plain");
_("CrossList"); _("CrossList");
_("Current"); _("Current");
_("Current_Address"); _("Current_Address");
_("CURTAIN");
_("Customer"); _("Customer");
_("Data"); _("Data");
_("Date"); _("Date");
@ -269,10 +270,10 @@ _("Definition-unnumbered");
_("Description"); _("Description");
_("Dialogue"); _("Dialogue");
_("EMail"); _("EMail");
_("EXT.");
_("Email"); _("Email");
_("Encl"); _("Encl");
_("Encl."); _("Encl.");
_("encl");
_("End_All_Slides"); _("End_All_Slides");
_("Enumerate"); _("Enumerate");
_("Example"); _("Example");
@ -283,43 +284,48 @@ _("Example-unnumbered");
_("Exercise"); _("Exercise");
_("Exercise-numbered"); _("Exercise-numbered");
_("Exercise-plain"); _("Exercise-plain");
_("EXT.");
_("Extratitle"); _("Extratitle");
_("FADE_IN:");
_("FADE_OUT:");
_("Fact"); _("Fact");
_("Fact*"); _("Fact*");
_("Fact-numbered"); _("Fact-numbered");
_("Fact-plain"); _("Fact-plain");
_("Fact-unnumbered"); _("Fact-unnumbered");
_("FADE_IN:");
_("FADE_OUT:");
_("FigCaption"); _("FigCaption");
_("first");
_("FirstAuthor"); _("FirstAuthor");
_("FirstName"); _("FirstName");
_("FitBitmap"); _("FitBitmap");
_("FitFigure"); _("FitFigure");
_("Foilhead"); _("Foilhead");
_("foilhead");
_("Footernote"); _("Footernote");
_("FourAffiliations"); _("FourAffiliations");
_("FourAuthors"); _("FourAuthors");
_("Gruss"); _("Gruss");
_("HTTP");
_("Headnote"); _("Headnote");
_("INT."); _("HTTP");
_("Idea"); _("Idea");
_("IhrSchreiben"); _("IhrSchreiben");
_("IhrZeichen"); _("IhrZeichen");
_("Institute"); _("Institute");
_("Institution"); _("Institution");
_("INT.");
_("InvisibleText"); _("InvisibleText");
_("Invoice"); _("Invoice");
_("Itemize"); _("Itemize");
_("Journal"); _("Journal");
_("journal");
_("Keywords"); _("Keywords");
_("Konto"); _("Konto");
_("LaTeX");
_("LaTeX_Title");
_("Labeling"); _("Labeling");
_("Land"); _("Land");
_("landscape");
_("LandscapeSlide"); _("LandscapeSlide");
_("LaTeX");
_("LaTeX_Title");
_("Lemma"); _("Lemma");
_("Lemma*"); _("Lemma*");
_("Lemma-numbered"); _("Lemma-numbered");
@ -338,8 +344,10 @@ _("MarkBoth");
_("MathLetters"); _("MathLetters");
_("MeinZeichen"); _("MeinZeichen");
_("Minisec"); _("Minisec");
_("MyRef"); _("modying");
_("msnumber");
_("My_Address"); _("My_Address");
_("MyRef");
_("Myref"); _("Myref");
_("Name"); _("Name");
_("Narrative"); _("Narrative");
@ -349,18 +357,18 @@ _("Note");
_("Note*"); _("Note*");
_("Note-numbered"); _("Note-numbered");
_("Note-plain"); _("Note-plain");
_("Note-unnumbered");
_("NoteToEditor"); _("NoteToEditor");
_("Notetoeditor"); _("Notetoeditor");
_("Note-unnumbered");
_("Offprint"); _("Offprint");
_("Offprints"); _("Offprints");
_("Offsets"); _("Offsets");
_("offsets");
_("Oggetto"); _("Oggetto");
_("Opening"); _("Opening");
_("Ort"); _("Ort");
_("Overlay"); _("Overlay");
_("PACS"); _("PACS");
_("PS");
_("Paragraph"); _("Paragraph");
_("Paragraph*"); _("Paragraph*");
_("Paragraph-numbered"); _("Paragraph-numbered");
@ -371,8 +379,8 @@ _("Petit");
_("Phone"); _("Phone");
_("Place"); _("Place");
_("PlaceFigure"); _("PlaceFigure");
_("PlaceTable");
_("Placefigure"); _("Placefigure");
_("PlaceTable");
_("Placetable"); _("Placetable");
_("PortraitSlide"); _("PortraitSlide");
_("PostalCommend"); _("PostalCommend");
@ -389,11 +397,12 @@ _("Proposition*");
_("Proposition-numbered"); _("Proposition-numbered");
_("Proposition-plain"); _("Proposition-plain");
_("Proposition-unnumbered"); _("Proposition-unnumbered");
_("PS");
_("ps");
_("Publishers"); _("Publishers");
_("Question"); _("Question");
_("Quotation"); _("Quotation");
_("Quote"); _("Quote");
_("REVTEX_Title");
_("Received"); _("Received");
_("Recieved"); _("Recieved");
_("Recieved/Accepted"); _("Recieved/Accepted");
@ -403,17 +412,17 @@ _("Remark");
_("Remark*"); _("Remark*");
_("Remark-numbered"); _("Remark-numbered");
_("Remark-plain"); _("Remark-plain");
_("Remark-unnumbered");
_("Remarks"); _("Remarks");
_("Remark-unnumbered");
_("RetourAdresse"); _("RetourAdresse");
_("ReturnAddress"); _("ReturnAddress");
_("RightHeader"); _("REVTEX_Title");
_("Right_Address"); _("Right_Address");
_("RightHeader");
_("Rotatefoilhead"); _("Rotatefoilhead");
_("Running_LaTeX_Title"); _("Running_LaTeX_Title");
_("SCENE"); _("SCENE");
_("SCENE*"); _("SCENE*");
_("SGML");
_("Scrap"); _("Scrap");
_("Section"); _("Section");
_("Section*"); _("Section*");
@ -421,10 +430,11 @@ _("Section-numbered");
_("Send"); _("Send");
_("Send_To_Address"); _("Send_To_Address");
_("Seriate"); _("Seriate");
_("SGML");
_("ShortFoilhead"); _("ShortFoilhead");
_("Shortfoilhead");
_("ShortRotatefoilhead"); _("ShortRotatefoilhead");
_("ShortTitle"); _("ShortTitle");
_("Shortfoilhead");
_("Signature"); _("Signature");
_("Slide"); _("Slide");
_("Slide*"); _("Slide*");
@ -440,26 +450,26 @@ _("State");
_("Strasse"); _("Strasse");
_("Street"); _("Street");
_("Style"); _("Style");
_("SubSection"); _("style");
_("SubTitle");
_("Subitle"); _("Subitle");
_("Subject"); _("Subject");
_("Subjectclass"); _("Subjectclass");
_("Subparagraph"); _("Subparagraph");
_("Subparagraph*"); _("Subparagraph*");
_("SubSection");
_("Subsection"); _("Subsection");
_("Subsection*"); _("Subsection*");
_("Subsection-numbered"); _("Subsection-numbered");
_("Subsubsection"); _("Subsubsection");
_("Subsubsection*"); _("Subsubsection*");
_("Subsubsection-numbered"); _("Subsubsection-numbered");
_("SubTitle");
_("Subtitle"); _("Subtitle");
_("Suggested"); _("Suggested");
_("Summary"); _("Summary");
_("Summary-numbered"); _("Summary-numbered");
_("Surname"); _("Surname");
_("TOC_Author"); _("surname");
_("TOC_Title");
_("TableComments"); _("TableComments");
_("TableRefs"); _("TableRefs");
_("Telefax"); _("Telefax");
@ -471,8 +481,8 @@ _("Theorem");
_("Theorem*"); _("Theorem*");
_("Theorem-numbered"); _("Theorem-numbered");
_("Theorem-plain"); _("Theorem-plain");
_("Theorem-unnumbered");
_("TheoremTemplate"); _("TheoremTemplate");
_("Theorem-unnumbered");
_("Thesaurus"); _("Thesaurus");
_("ThickLine"); _("ThickLine");
_("This"); _("This");
@ -480,39 +490,29 @@ _("ThreeAffiliations");
_("ThreeAuthors"); _("ThreeAuthors");
_("TickList"); _("TickList");
_("Title"); _("Title");
_("Title_Running");
_("Titlehead"); _("Titlehead");
_("Title_Running");
_("TOC_Author");
_("TOC_Title");
_("Town"); _("Town");
_("Trans_Keywords");
_("Transition"); _("Transition");
_("Trans_Keywords");
_("Translated"); _("Translated");
_("TranslatedAbstract"); _("TranslatedAbstract");
_("Translated_Title"); _("Translated_Title");
_("Translator"); _("Translator");
_("TwoAffiliations"); _("TwoAffiliations");
_("TwoAuthors"); _("TwoAuthors");
_("URL");
_("Unterschrift"); _("Unterschrift");
_("Uppertitleback"); _("Uppertitleback");
_("URL");
_("Use"); _("Use");
_("Verbatim"); _("Verbatim");
_("Verse"); _("Verse");
_("Verteiler"); _("Verteiler");
_("VisibleText"); _("VisibleText");
_("YourMail"); _("YourMail");
_("YourRef");
_("Yourmail"); _("Yourmail");
_("YourRef");
_("Yourref"); _("Yourref");
_("Zusatz"); _("Zusatz");
_("cc");
_("encl");
_("first");
_("foilhead");
_("journal");
_("landscape");
_("modying");
_("msnumber");
_("offsets");
_("ps");
_("style");
_("surname");

View File

@ -1,4 +1,4 @@
/** Header file generated with fdesign on Mon Jun 19 12:55:08 2000.**/ /** Header file generated with fdesign **/
#ifndef FD_KeyMap_h_ #ifndef FD_KeyMap_h_
#define FD_KeyMap_h_ #define FD_KeyMap_h_

View File

@ -0,0 +1,503 @@
// -*- C++ -*-
/* ButtonPolicies.C
* Provides a state machine implementation of the various button policies
* used by the dialogs.
* Author: Allan Rae <rae@lyx.org>
* This file is part of
* ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2000 The LyX Team.
*
* This file Copyright 2000
* Allan Rae
* ======================================================
*/
#include <config.h>
#include "ButtonPolicies.h"
#include "debug.h"
// Helper function
inline void nextState(ButtonPolicy::State & state,
ButtonPolicy::SMInput in,
ButtonPolicy::StateMachine s_m,
char const * function_name = "nextState")
{
ButtonPolicy::State tmp = s_m[state][in];
if (ButtonPolicy::BOGUS != tmp) {
state = tmp;
} else {
lyxerr << function_name
<< ": No transition for input "
<< in
<< " from state "
<< state
<< std::endl;
}
}
/*-----------------------------PreferencesPolicy-----------------------------*/
PreferencesPolicy::PreferencesPolicy()
: state_(INITIAL),
outputs_(APPLIED+1, OKAY | APPLY | CANCEL | UNDO_ALL),
state_machine_(APPLIED+1, StateArray(SMI_TOTAL, BOGUS))
{
// Build the state output map
outputs_[INITIAL] = CLOSE;
outputs_[VALID] = UNDO_ALL | OKAY | APPLY | CANCEL;
outputs_[INVALID] = UNDO_ALL | CANCEL;
outputs_[APPLIED] = OKAY | CLOSE;
// Build the state machine one state at a time
// NOTE: Since CANCEL and HIDE always go to INITIAL they are
// left out of the state machine and handled explicitly
// in input(). This won't necessarily be true for all
// policies though so I'll leave those two as distinct
// inputs rather than merge them. For example, a dialog
// that doesn't update it's input fields when reshown
// after being hidden needs a policy where CANCEL and
// HIDE are treated differently.
//
// State::INITIAL
state_machine_[INITIAL][SMI_READ_ONLY] = INITIAL;
state_machine_[INITIAL][SMI_READ_WRITE] = INITIAL;
state_machine_[INITIAL][SMI_VALID] = VALID;
state_machine_[INITIAL][SMI_INVALID] = INVALID;
// State::VALID
state_machine_[VALID][SMI_VALID] = VALID;
state_machine_[VALID][SMI_READ_ONLY] = VALID;
state_machine_[VALID][SMI_READ_WRITE] = VALID;
state_machine_[VALID][SMI_INVALID] = INVALID;
state_machine_[VALID][SMI_APPLY] = APPLIED;
state_machine_[VALID][SMI_OKAY] = INITIAL;
state_machine_[VALID][SMI_UNDO_ALL] = INITIAL;
// State::INVALID
state_machine_[INVALID][SMI_VALID] = VALID;
state_machine_[INVALID][SMI_INVALID] = INVALID;
state_machine_[INVALID][SMI_READ_ONLY] = INVALID;
state_machine_[INVALID][SMI_READ_WRITE] = INVALID;
state_machine_[INVALID][SMI_UNDO_ALL] = INITIAL;
// State::APPLIED
state_machine_[APPLIED][SMI_VALID] = VALID;
state_machine_[APPLIED][SMI_INVALID] = INVALID;
state_machine_[APPLIED][SMI_OKAY] = INITIAL;
state_machine_[APPLIED][SMI_READ_ONLY] = APPLIED;
state_machine_[APPLIED][SMI_READ_WRITE] = APPLIED;
}
void PreferencesPolicy::input(SMInput input)
{
// CANCEL and HIDE always take us to INITIAL for all cases.
// Note that I didn't put that special case in the helper function
// because it doesn't belong there. Some other
// This is probably optimising for the wrong case since it occurs as the
// dialog will be hidden. It would have saved a little memory in the
// state machine if I could have gotten map working. ARRae 20000813
if (SMI_CANCEL == input
|| SMI_HIDE == input) {
state_ = INITIAL;
} else {
nextState(state_,
input,
state_machine_,
"PreferencesPolicy");
}
}
/*-------------------------------OkCancelPolicy------------------------------*/
OkCancelPolicy::OkCancelPolicy()
: state_(INITIAL),
outputs_(INVALID+1, OKAY | APPLY | CANCEL | UNDO_ALL),
state_machine_(INVALID+1, StateArray(SMI_TOTAL, BOGUS))
{
// Build the state output map
outputs_[INITIAL] = CLOSE;
outputs_[VALID] = OKAY | CANCEL;
outputs_[INVALID] = CANCEL;
// Build the state machine one state at a time
// NOTE: Since CANCEL and HIDE always go to INITIAL they are
// left out of the state machine and handled explicitly
// in input()
//
// State::INITIAL
state_machine_[INITIAL][SMI_READ_ONLY] = INITIAL;
state_machine_[INITIAL][SMI_READ_WRITE] = INITIAL;
state_machine_[INITIAL][SMI_VALID] = VALID;
state_machine_[INITIAL][SMI_INVALID] = INVALID;
// State::VALID
state_machine_[VALID][SMI_VALID] = VALID;
state_machine_[VALID][SMI_READ_ONLY] = VALID;
state_machine_[VALID][SMI_READ_WRITE] = VALID;
state_machine_[VALID][SMI_INVALID] = INVALID;
state_machine_[VALID][SMI_OKAY] = INITIAL;
// State::INVALID
state_machine_[INVALID][SMI_VALID] = VALID;
state_machine_[INVALID][SMI_INVALID] = INVALID;
state_machine_[INVALID][SMI_READ_ONLY] = INVALID;
state_machine_[INVALID][SMI_READ_WRITE] = INVALID;
}
void OkCancelPolicy::input(SMInput input)
{
// CANCEL and HIDE always take us to INITIAL for all cases
if (SMI_CANCEL == input
|| SMI_HIDE == input) {
state_ = INITIAL;
} else {
nextState(state_, input, state_machine_, "OkCancelPolicy");
}
}
/*---------------------------OkCancelReadOnlyPolicy-------------------------*/
OkCancelReadOnlyPolicy::OkCancelReadOnlyPolicy()
: state_(INITIAL),
outputs_(RO_INVALID+1, OKAY | APPLY | CANCEL | UNDO_ALL),
state_machine_(RO_INVALID+1, StateArray(SMI_TOTAL, BOGUS))
{
// Build the state output map
outputs_[INITIAL] = CLOSE;
outputs_[VALID] = OKAY | CANCEL;
outputs_[INVALID] = CANCEL;
outputs_[RO_INITIAL] = CLOSE;
outputs_[RO_VALID] = CANCEL;
outputs_[RO_INVALID] = CANCEL;
// Build the state machine one state at a time
// NOTE: Since CANCEL and HIDE always go to INITIAL they are
// left out of the state machine and handled explicitly
// in input()
//
// State::INITIAL
state_machine_[INITIAL][SMI_READ_WRITE] = INITIAL;
state_machine_[INITIAL][SMI_VALID] = VALID;
state_machine_[INITIAL][SMI_INVALID] = INVALID;
state_machine_[INITIAL][SMI_READ_ONLY] = RO_INITIAL;
// State::VALID
state_machine_[VALID][SMI_VALID] = VALID;
state_machine_[VALID][SMI_READ_WRITE] = VALID;
state_machine_[VALID][SMI_INVALID] = INVALID;
state_machine_[VALID][SMI_OKAY] = INITIAL;
state_machine_[VALID][SMI_READ_ONLY] = RO_VALID;
// State::INVALID
state_machine_[INVALID][SMI_INVALID] = INVALID;
state_machine_[INVALID][SMI_READ_WRITE] = INVALID;
state_machine_[INVALID][SMI_VALID] = VALID;
state_machine_[INVALID][SMI_READ_ONLY] = RO_INVALID;
// State::RO_INITIAL
state_machine_[RO_INITIAL][SMI_READ_ONLY] = RO_INITIAL;
state_machine_[RO_INITIAL][SMI_VALID] = RO_VALID;
state_machine_[RO_INITIAL][SMI_INVALID] = RO_INVALID;
state_machine_[RO_INITIAL][SMI_READ_WRITE] = INITIAL;
// State::RO_VALID
state_machine_[RO_VALID][SMI_VALID] = RO_VALID;
state_machine_[RO_VALID][SMI_READ_ONLY] = RO_VALID;
state_machine_[RO_VALID][SMI_INVALID] = RO_INVALID;
state_machine_[RO_VALID][SMI_READ_WRITE] = VALID;
// State::RO_INVALID
state_machine_[RO_INVALID][SMI_READ_ONLY] = RO_INVALID;
state_machine_[RO_INVALID][SMI_INVALID] = RO_INVALID;
state_machine_[RO_INVALID][SMI_VALID] = RO_VALID;
state_machine_[RO_INVALID][SMI_READ_WRITE] = INVALID;
}
void OkCancelReadOnlyPolicy::input(SMInput input)
{
// CANCEL and HIDE always take us to INITIAL for all cases
if (SMI_CANCEL == input
|| SMI_HIDE == input) {
state_ = INITIAL;
} else {
nextState(state_,
input,
state_machine_,
"OkCancelReadOnlyPolicy");
}
}
/*--------------------------NoRepeatedApplyReadOnlyPolicy----------------------*/
NoRepeatedApplyReadOnlyPolicy::NoRepeatedApplyReadOnlyPolicy()
: state_(INITIAL),
outputs_(RO_INVALID+1, OKAY | APPLY | CANCEL | UNDO_ALL),
state_machine_(RO_INVALID+1, StateArray(SMI_TOTAL, BOGUS))
{
// Build the state output map
outputs_[INITIAL] = CLOSE;
outputs_[VALID] = OKAY | APPLY | CANCEL;
outputs_[INVALID] = CANCEL;
outputs_[RO_INITIAL] = CLOSE;
outputs_[RO_VALID] = CANCEL;
outputs_[RO_INVALID] = CANCEL;
// Build the state machine one state at a time
// NOTE: Since CANCEL and HIDE always go to INITIAL they are
// left out of the state machine and handled explicitly
// in input()
//
// State::INITIAL
state_machine_[INITIAL][SMI_READ_WRITE] = INITIAL;
state_machine_[INITIAL][SMI_VALID] = VALID;
state_machine_[INITIAL][SMI_INVALID] = INVALID;
state_machine_[INITIAL][SMI_READ_ONLY] = RO_INITIAL;
// State::VALID
state_machine_[VALID][SMI_VALID] = VALID;
state_machine_[VALID][SMI_READ_WRITE] = VALID;
state_machine_[VALID][SMI_INVALID] = INVALID;
state_machine_[VALID][SMI_OKAY] = INITIAL;
state_machine_[VALID][SMI_APPLY] = INITIAL;
state_machine_[VALID][SMI_READ_ONLY] = RO_VALID;
// State::INVALID
state_machine_[INVALID][SMI_INVALID] = INVALID;
state_machine_[INVALID][SMI_READ_WRITE] = INVALID;
state_machine_[INVALID][SMI_VALID] = VALID;
state_machine_[INVALID][SMI_READ_ONLY] = RO_INVALID;
// State::RO_INITIAL
state_machine_[RO_INITIAL][SMI_READ_ONLY] = RO_INITIAL;
state_machine_[RO_INITIAL][SMI_VALID] = RO_VALID;
state_machine_[RO_INITIAL][SMI_INVALID] = RO_INVALID;
state_machine_[RO_INITIAL][SMI_READ_WRITE] = INITIAL;
// State::RO_VALID
state_machine_[RO_VALID][SMI_VALID] = RO_VALID;
state_machine_[RO_VALID][SMI_READ_ONLY] = RO_VALID;
state_machine_[RO_VALID][SMI_INVALID] = RO_INVALID;
state_machine_[RO_VALID][SMI_READ_WRITE] = VALID;
// State::RO_INVALID
state_machine_[RO_INVALID][SMI_INVALID] = RO_INVALID;
state_machine_[RO_INVALID][SMI_READ_ONLY] = RO_INVALID;
state_machine_[RO_INVALID][SMI_VALID] = RO_VALID;
state_machine_[RO_INVALID][SMI_READ_WRITE] = INVALID;
}
void NoRepeatedApplyReadOnlyPolicy::input(SMInput input)
{
// CANCEL and HIDE always take us to INITIAL for all cases
if (SMI_CANCEL == input
|| SMI_HIDE == input) {
state_ = INITIAL;
} else {
nextState(state_,
input,
state_machine_,
"NoRepeatedApplyReadOnlyPolicy");
}
}
/*--------------------------OkApplyCancelReadOnlyPolicy----------------------*/
OkApplyCancelReadOnlyPolicy::OkApplyCancelReadOnlyPolicy()
: state_(INITIAL),
outputs_(RO_APPLIED+1, OKAY | APPLY | CANCEL | UNDO_ALL),
state_machine_(RO_APPLIED+1, StateArray(SMI_TOTAL, BOGUS))
{
// Build the state output map
outputs_[INITIAL] = CLOSE;
outputs_[VALID] = OKAY | APPLY | CANCEL;
outputs_[INVALID] = CANCEL;
outputs_[APPLIED] = OKAY | APPLY | CLOSE;
outputs_[RO_INITIAL] = CLOSE;
outputs_[RO_VALID] = CANCEL;
outputs_[RO_INVALID] = CANCEL;
outputs_[RO_APPLIED] = CANCEL;
// Build the state machine one state at a time
// NOTE: Since CANCEL and HIDE always go to INITIAL they are
// left out of the state machine and handled explicitly
// in input()
//
// State::INITIAL
state_machine_[INITIAL][SMI_READ_WRITE] = INITIAL;
state_machine_[INITIAL][SMI_VALID] = VALID;
state_machine_[INITIAL][SMI_INVALID] = INVALID;
state_machine_[INITIAL][SMI_READ_ONLY] = RO_INITIAL;
// State::VALID
state_machine_[VALID][SMI_VALID] = VALID;
state_machine_[VALID][SMI_READ_WRITE] = VALID;
state_machine_[VALID][SMI_INVALID] = INVALID;
state_machine_[VALID][SMI_OKAY] = INITIAL;
state_machine_[VALID][SMI_APPLY] = APPLIED;
state_machine_[VALID][SMI_READ_ONLY] = RO_VALID;
// State::INVALID
state_machine_[INVALID][SMI_INVALID] = INVALID;
state_machine_[INVALID][SMI_READ_WRITE] = INVALID;
state_machine_[INVALID][SMI_VALID] = VALID;
state_machine_[INVALID][SMI_READ_ONLY] = RO_INVALID;
// State::APPLIED
state_machine_[APPLIED][SMI_APPLY] = APPLIED;
state_machine_[APPLIED][SMI_READ_WRITE] = APPLIED;
state_machine_[APPLIED][SMI_VALID] = VALID;
state_machine_[APPLIED][SMI_INVALID] = INVALID;
state_machine_[APPLIED][SMI_OKAY] = INITIAL;
state_machine_[APPLIED][SMI_READ_ONLY] = RO_APPLIED;
// State::RO_INITIAL
state_machine_[RO_INITIAL][SMI_READ_ONLY] = RO_INITIAL;
state_machine_[RO_INITIAL][SMI_VALID] = RO_VALID;
state_machine_[RO_INITIAL][SMI_INVALID] = RO_INVALID;
state_machine_[RO_INITIAL][SMI_READ_WRITE] = INITIAL;
// State::RO_VALID
state_machine_[RO_VALID][SMI_VALID] = RO_VALID;
state_machine_[RO_VALID][SMI_READ_ONLY] = RO_VALID;
state_machine_[RO_VALID][SMI_INVALID] = RO_INVALID;
state_machine_[RO_VALID][SMI_READ_WRITE] = VALID;
// State::RO_INVALID
state_machine_[RO_INVALID][SMI_INVALID] = RO_INVALID;
state_machine_[RO_INVALID][SMI_READ_ONLY] = RO_INVALID;
state_machine_[RO_INVALID][SMI_VALID] = RO_VALID;
state_machine_[RO_INVALID][SMI_READ_WRITE] = INVALID;
// State::RO_APPLIED
state_machine_[RO_APPLIED][SMI_READ_ONLY] = RO_APPLIED;
state_machine_[RO_APPLIED][SMI_INVALID] = RO_INVALID;
state_machine_[RO_APPLIED][SMI_VALID] = RO_VALID;
state_machine_[RO_APPLIED][SMI_READ_WRITE] = APPLIED;
}
void OkApplyCancelReadOnlyPolicy::input(SMInput input)
{
// CANCEL and HIDE always take us to INITIAL for all cases
if (SMI_CANCEL == input
|| SMI_HIDE == input) {
state_ = INITIAL;
} else {
nextState(state_,
input,
state_machine_,
"OkApplyCancelReadOnlyPolicy");
}
}
/*--------------------------OkApplyCancelPolicy----------------------*/
OkApplyCancelPolicy::OkApplyCancelPolicy()
: state_(INITIAL),
outputs_(APPLIED+1, OKAY | APPLY | CANCEL | UNDO_ALL),
state_machine_(APPLIED+1, StateArray(SMI_TOTAL, BOGUS))
{
// Build the state output map
outputs_[INITIAL] = CLOSE;
outputs_[VALID] = OKAY | APPLY | CANCEL;
outputs_[INVALID] = CANCEL;
outputs_[APPLIED] = OKAY | APPLY | CLOSE;
// Build the state machine one state at a time
// NOTE: Since CANCEL and HIDE always go to INITIAL they are
// left out of the state machine and handled explicitly
// in input()
//
// State::INITIAL
state_machine_[INITIAL][SMI_READ_ONLY] = INITIAL;
state_machine_[INITIAL][SMI_READ_WRITE] = INITIAL;
state_machine_[INITIAL][SMI_VALID] = VALID;
state_machine_[INITIAL][SMI_INVALID] = INVALID;
// State::VALID
state_machine_[VALID][SMI_VALID] = VALID;
state_machine_[VALID][SMI_READ_ONLY] = VALID;
state_machine_[VALID][SMI_READ_WRITE] = VALID;
state_machine_[VALID][SMI_INVALID] = INVALID;
state_machine_[VALID][SMI_OKAY] = INITIAL;
state_machine_[VALID][SMI_APPLY] = APPLIED;
// State::INVALID
state_machine_[INVALID][SMI_INVALID] = INVALID;
state_machine_[INVALID][SMI_READ_ONLY] = INVALID;
state_machine_[INVALID][SMI_READ_WRITE] = INVALID;
state_machine_[INVALID][SMI_VALID] = VALID;
// State::APPLIED
state_machine_[APPLIED][SMI_APPLY] = APPLIED;
state_machine_[APPLIED][SMI_READ_ONLY] = APPLIED;
state_machine_[APPLIED][SMI_READ_WRITE] = APPLIED;
state_machine_[APPLIED][SMI_VALID] = VALID;
state_machine_[APPLIED][SMI_INVALID] = INVALID;
state_machine_[APPLIED][SMI_OKAY] = INITIAL;
}
void OkApplyCancelPolicy::input(SMInput input)
{
// CANCEL and HIDE always take us to INITIAL for all cases
if (SMI_CANCEL == input
|| SMI_HIDE == input) {
state_ = INITIAL;
} else {
nextState(state_,
input,
state_machine_,
"OkApplyCancelPolicy");
}
}
/*--------------------------NoRepeatedApplyPolicy----------------------*/
NoRepeatedApplyPolicy::NoRepeatedApplyPolicy()
: state_(INITIAL),
outputs_(INVALID+1, OKAY | APPLY | CANCEL | UNDO_ALL),
state_machine_(INVALID+1, StateArray(SMI_TOTAL, BOGUS))
{
// Build the state output map
outputs_[INITIAL] = CLOSE;
outputs_[VALID] = OKAY | APPLY | CANCEL;
outputs_[INVALID] = CANCEL;
// Build the state machine one state at a time
// NOTE: Since CANCEL and HIDE always go to INITIAL they are
// left out of the state machine and handled explicitly
// in input()
//
// State::INITIAL
state_machine_[INITIAL][SMI_READ_ONLY] = INITIAL;
state_machine_[INITIAL][SMI_READ_WRITE] = INITIAL;
state_machine_[INITIAL][SMI_VALID] = VALID;
state_machine_[INITIAL][SMI_INVALID] = INVALID;
// State::VALID
state_machine_[VALID][SMI_VALID] = VALID;
state_machine_[VALID][SMI_READ_ONLY] = VALID;
state_machine_[VALID][SMI_READ_WRITE] = VALID;
state_machine_[VALID][SMI_INVALID] = INVALID;
state_machine_[VALID][SMI_OKAY] = INITIAL;
state_machine_[VALID][SMI_APPLY] = INITIAL;
// State::INVALID
state_machine_[INVALID][SMI_INVALID] = INVALID;
state_machine_[INVALID][SMI_READ_ONLY] = INVALID;
state_machine_[INVALID][SMI_READ_WRITE] = INVALID;
state_machine_[INVALID][SMI_VALID] = VALID;
}
void NoRepeatedApplyPolicy::input(SMInput input)
{
// CANCEL and HIDE always take us to INITIAL for all cases
if (SMI_CANCEL == input
|| SMI_HIDE == input) {
state_ = INITIAL;
} else {
nextState(state_,
input,
state_machine_,
"NoRepeatedApplyPolicy");
}
}

View File

@ -0,0 +1,370 @@
// -*- C++ -*-
/* ButtonPolicies.h
* Provides a state machine implementation of the various button policies
* used by the dialogs.
* Author: Allan Rae <rae@lyx.org>
* This file is part of
* ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2000 The LyX Team.
*
* This file Copyright 2000
* Allan Rae
* ======================================================
*/
#ifndef BUTTONPOLICIES_H
#define BUTTONPOLICIES_H
#include <vector>
#include "support/utility.hpp"
/** An abstract base class for button policies.
A state machine implementation of the various button policies used by the
dialogs. Only the policy is implemented here. Separate ButtonController
classes are needed for each GUI implementation.
*/
class ButtonPolicy : public noncopyable
{
public:
/**@name Constructors and Deconstructors */
//@{
///
virtual ~ButtonPolicy() {}
//@}
/**@name Enums */
//@{
/** The various possible state names.
Not all state-machines have this many states. However, we need
to define them all here so we can share the code.
*/
enum State {
INITIAL = 0,
VALID,
INVALID,
APPLIED,
RO_INITIAL,
RO_VALID,
RO_INVALID,
RO_APPLIED,
BOGUS = 55
};
/// The various button types.
enum Button {
CLOSE = 0, // Not a real button, but effectively !CANCEL
OKAY = 1,
APPLY = 2,
CANCEL = 4,
UNDO_ALL = 8
};
/** State machine inputs.
All the policies so far have both CANCEL and HIDE always going to
INITIAL. This won't necessarily be true for all [future] policies
though so I'll leave those two as distinct inputs rather than merge
them. For example, a dialog that doesn't update it's input fields
when reshown after being hidden needs a policy where CANCEL and
HIDE are treated differently.
*/
enum SMInput {
SMI_VALID = 0,
SMI_INVALID,
SMI_OKAY,
SMI_APPLY,
SMI_CANCEL,
SMI_UNDO_ALL,
SMI_HIDE,
SMI_READ_ONLY,
SMI_READ_WRITE,
SMI_TOTAL // not a real input
};
//@}
/**@name Access Functions */
//@{
/// Trigger a transition with this input.
virtual void input(SMInput) = 0;
/// Activation status of OK
virtual bool buttonStatus(Button) = 0;
//@}
/**@name Typedefs */
//@{
/// Transition map of the state machine.
typedef std::vector<State> StateArray;
typedef std::vector<StateArray> StateMachine;
/// The state outputs are the status of the buttons.
typedef std::vector<int> StateOutputs;
//@}
};
/** Defines the policy used by the Preferences dialog.
Four buttons: Ok (Save), Apply, Cancel/Close, Restore.
Note: This scheme supports the relabelling of Cancel to Close and vice versa.
This is based on the value of the bool state of the Button::CANCEL.
true == Cancel, false == Close
*/
class PreferencesPolicy : public ButtonPolicy
{
public:
///
PreferencesPolicy();
///
virtual ~PreferencesPolicy() {}
/**@name Access Functions */
//@{
/// Trigger a transition with this input.
virtual void input(SMInput);
/** Activation status of a button.
We assume that we haven't gotten into an undefined state.
This is reasonable since we can only reach states defined
in the state machine and they should all have been defined in
the outputs_ variable. Perhaps we can do something at compile
time to check that all the states have corresponding outputs.
*/
virtual bool buttonStatus(Button button)
{ return button & outputs_[state_]; }
//@}
private:
/**@name Private Data Members */
//@{
/// Current state.
State state_;
/// Which buttons are active for a given state.
StateOutputs outputs_;
///
StateMachine state_machine_;
//@}
};
/** Ok and Cancel buttons for dialogs with read-only operation.
Note: This scheme supports the relabelling of Cancel to Close and vice versa.
This is based on the value of the bool state of the Button::CANCEL.
true == Cancel, false == Close
*/
class OkCancelPolicy : public ButtonPolicy
{
public:
///
OkCancelPolicy();
///
virtual ~OkCancelPolicy() {}
/**@name Access Functions */
//@{
/// Trigger a transition with this input.
virtual void input(SMInput);
/// Activation status of a button.
virtual bool buttonStatus(Button button)
{ return button & outputs_[state_]; }
//@}
private:
/**@name Private Data Members */
//@{
/// Current state.
State state_;
/// Which buttons are active for a given state.
StateOutputs outputs_;
///
StateMachine state_machine_;
//@}
};
/** Ok and Cancel buttons for dialogs where read-only operation is blocked.
The state machine design for this policy allows changes to occur within
the dialog while a file is read-only -- the okay button is disabled until
a read-write input is given. When the file is made read-write the dialog
will then be in the correct state (as if the file had always been read-write).
Note: This scheme supports the relabelling of Cancel to Close and vice versa.
This is based on the value of the bool state of the Button::CANCEL.
true == Cancel, false == Close
*/
class OkCancelReadOnlyPolicy : public ButtonPolicy
{
public:
///
OkCancelReadOnlyPolicy();
///
virtual ~OkCancelReadOnlyPolicy() {}
/**@name Access Functions */
//@{
/// Trigger a transition with this input.
virtual void input(SMInput);
/// Activation status of a button.
virtual bool buttonStatus(Button button)
{ return button & outputs_[state_]; }
//@}
private:
/**@name Private Data Members */
//@{
/// Current state.
State state_;
/// Which buttons are active for a given state.
StateOutputs outputs_;
///
StateMachine state_machine_;
//@}
};
/** Ok, Apply and Cancel buttons for dialogs where read-only operation is blocked.
Repeated Apply are not allowed. Likewise, Ok cannot follow Apply without
some valid input. That is, the dialog contents must change between each Apply
or Apply and Ok.
The state machine design for this policy allows changes to occur within
the dialog while a file is read-only -- the Ok+Apply buttons are disabled
until a read-write input is given. When the file is made read-write the
dialog will then be in the correct state (as if the file had always been
read-write).
Note: This scheme supports the relabelling of Cancel to Close and vice versa.
This is based on the value of the bool state of the Button::CANCEL.
true == Cancel, false == Close
*/
class NoRepeatedApplyReadOnlyPolicy : public ButtonPolicy
{
public:
///
NoRepeatedApplyReadOnlyPolicy();
///
virtual ~NoRepeatedApplyReadOnlyPolicy() {}
/**@name Access Functions */
//@{
/// Trigger a transition with this input.
virtual void input(SMInput);
/// Activation status of a button.
virtual bool buttonStatus(Button button)
{ return button & outputs_[state_]; }
//@}
private:
/**@name Private Data Members */
//@{
/// Current state.
State state_;
/// Which buttons are active for a given state.
StateOutputs outputs_;
///
StateMachine state_machine_;
//@}
};
/** Ok, Apply and Cancel buttons for dialogs where read-only operation is blocked.
Repeated Apply is allowed. Likewise, Ok can follow Apply.
The state machine design for this policy allows changes to occur within
the dialog while a file is read-only -- the Ok+Apply buttons are disabled
until a read-write input is given. When the file is made read-write the
dialog will then be in the correct state (as if the file had always been
read-write).
Note: This scheme supports the relabelling of Cancel to Close and vice versa.
This is based on the value of the bool state of the Button::CANCEL.
true == Cancel, false == Close
*/
class OkApplyCancelReadOnlyPolicy : public ButtonPolicy
{
public:
///
OkApplyCancelReadOnlyPolicy();
///
virtual ~OkApplyCancelReadOnlyPolicy() {}
/**@name Access Functions */
//@{
/// Trigger a transition with this input.
virtual void input(SMInput);
/// Activation status of a button.
virtual bool buttonStatus(Button button)
{ return button & outputs_[state_]; }
//@}
private:
/**@name Private Data Members */
//@{
/// Current state.
State state_;
/// Which buttons are active for a given state.
StateOutputs outputs_;
///
StateMachine state_machine_;
//@}
};
/** Ok, Apply and Cancel buttons for dialogs where repeated Apply is allowed.
Note: This scheme supports the relabelling of Cancel to Close and vice versa.
This is based on the value of the bool state of the Button::CANCEL.
true == Cancel, false == Close
*/
class OkApplyCancelPolicy : public ButtonPolicy
{
public:
///
OkApplyCancelPolicy();
///
virtual ~OkApplyCancelPolicy() {}
/**@name Access Functions */
//@{
/// Trigger a transition with this input.
virtual void input(SMInput);
/// Activation status of a button.
virtual bool buttonStatus(Button button)
{ return button & outputs_[state_]; }
//@}
private:
/**@name Private Data Members */
//@{
/// Current state.
State state_;
/// Which buttons are active for a given state.
StateOutputs outputs_;
///
StateMachine state_machine_;
//@}
};
/** Ok, Apply and Cancel buttons for dialogs with no repeated Apply.
Note: This scheme supports the relabelling of Cancel to Close and vice versa.
This is based on the value of the bool state of the Button::CANCEL.
true == Cancel, false == Close
*/
class NoRepeatedApplyPolicy : public ButtonPolicy
{
public:
///
NoRepeatedApplyPolicy();
///
virtual ~NoRepeatedApplyPolicy() {}
/**@name Access Functions */
//@{
/// Trigger a transition with this input.
virtual void input(SMInput);
/// Activation status of a button.
virtual bool buttonStatus(Button button)
{ return button & outputs_[state_]; }
//@}
private:
/**@name Private Data Members */
//@{
/// Current state.
State state_;
/// Which buttons are active for a given state.
StateOutputs outputs_;
///
StateMachine state_machine_;
//@}
};
#endif

View File

@ -7,6 +7,8 @@ INCLUDES = ${FRONTEND_INCLUDES} -I${srcdir}/.. -I${srcdir}/@FRONTEND@ ${SIGC_CFL
LIBS = LIBS =
noinst_LTLIBRARIES = libfrontends.la noinst_LTLIBRARIES = libfrontends.la
libfrontends_la_SOURCES=\ libfrontends_la_SOURCES=\
ButtonPolicies.C \
ButtonPolicies.h \
Dialogs.h \ Dialogs.h \
DialogBase.h \ DialogBase.h \
Liason.C \ Liason.C \

View File

@ -0,0 +1,189 @@
// -*- C++ -*-
/* ButtonController.h
* Controls the activation of the OK, Apply and Cancel buttons.
* Actually supports 4 buttons in all and it's up to the user to decide on
* the activation policy and which buttons correspond to which output of the
* state machine.
* Author: Allan Rae <rae@lyx.org>
* This file is part of
* ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2000 The LyX Team.
*
* This file Copyright 2000
* Allan Rae
* ======================================================
*/
#ifndef BUTTONCONTROLLER_H
#define BUTTONCONTROLLER_H
#include "ButtonPolicies.h"
/** General purpose button controller for up to four buttons.
Controls the activation of the OK, Apply and Cancel buttons.
Actually supports 4 buttons in all and it's up to the user to decide on
the activation policy and which buttons correspond to which output of the
state machine.
*/
template <class Policy>
class ButtonController : public noncopyable
{
public:
/**@name Constructors and Deconstructors */
//@{
/** Constructor.
The cancel/close label entries are _not_ managed within the class
thereby allowing you to reassign at will and to use static labels.
It also means if you really don't want to have the Cancel button
label be different when there is nothing changed in the dialog then
you can just assign "Cancel" to both labels. Or even reuse this
class for something completely different.
*/
ButtonController(char const * cancel, char const * close)
: bp_(), okay_(0), apply_(0), cancel_(0), undo_all_(0),
cancel_label(cancel), close_label(close) {}
/// Somebody else owns the FL_OBJECTs we just manipulate them.
~ButtonController() {}
//@}
/**@name Initialise Button Functions */
//@{
/// Call refresh() when finished setting the buttons.
void setOkay(FL_OBJECT * obj)
{ okay_ = obj; }
///
void setApply(FL_OBJECT * obj)
{ apply_ = obj; }
///
void setCancel(FL_OBJECT * obj)
{ cancel_ = obj; }
///
void setUndoAll(FL_OBJECT * obj)
{ undo_all_ = obj; }
///
void setCancelTrueLabel(char const * c)
{ cancel_label = c; }
///
void setCancelFalseLabel(char const * c)
{ close_label = c; }
//@}
/**@name Action Functions */
//@{
///
void input(ButtonPolicy::SMInput in)
{
bp_.input(in);
refresh();
}
///
void okay()
{ input(ButtonPolicy::SMI_OKAY); }
///
void apply()
{ input(ButtonPolicy::SMI_APPLY); }
///
void cancel()
{ input(ButtonPolicy::SMI_CANCEL); }
///
void undoAll()
{ input(ButtonPolicy::SMI_UNDO_ALL); }
///
void hide()
{ input(ButtonPolicy::SMI_HIDE); }
/// Passthrough function -- returns its input value
bool read_only(bool ro = true)
{
if (ro) {
input(ButtonPolicy::SMI_READ_ONLY);
} else {
input(ButtonPolicy::SMI_READ_WRITE);
}
return ro;
}
///
void read_write()
{ read_only(false); }
/// Passthrough function -- returns its input value
bool valid(bool v = true)
{
if (v) {
input(ButtonPolicy::SMI_VALID);
} else {
input(ButtonPolicy::SMI_INVALID);
}
return v;
}
///
void invalid()
{ valid(false); }
/// force a refresh of the buttons
void refresh()
{
if (okay_) {
if (bp_.buttonStatus(ButtonPolicy::OKAY)) {
fl_activate_object(okay_);
fl_set_object_lcol(okay_, FL_BLACK);
} else {
fl_deactivate_object(okay_);
fl_set_object_lcol(okay_, FL_INACTIVE);
}
}
if (apply_) {
if (bp_.buttonStatus(ButtonPolicy::APPLY)) {
fl_activate_object(apply_);
fl_set_object_lcol(apply_, FL_BLACK);
} else {
fl_deactivate_object(apply_);
fl_set_object_lcol(apply_, FL_INACTIVE);
}
}
if (undo_all_) {
if (bp_.buttonStatus(ButtonPolicy::UNDO_ALL)) {
fl_activate_object(undo_all_);
fl_set_object_lcol(undo_all_, FL_BLACK);
} else {
fl_deactivate_object(undo_all_);
fl_set_object_lcol(undo_all_,
FL_INACTIVE);
}
}
if (cancel_) {
if (bp_.buttonStatus(ButtonPolicy::CANCEL)) {
fl_set_object_label(cancel_,
cancel_label);
} else {
fl_set_object_label(cancel_,
close_label);
}
}
}
//@}
private:
///
Policy bp_;
/**@name Button Widgets */
//@{
///
FL_OBJECT * okay_;
///
FL_OBJECT * apply_;
///
FL_OBJECT * cancel_;
///
FL_OBJECT * undo_all_;
//@}
/**@name Cancel/Close Button Labels */
//@{
///
char const * cancel_label;
///
char const * close_label;
//@}
};
#endif

View File

@ -49,7 +49,6 @@ FormCitation::FormCitation(LyXView * lv, Dialogs * d)
FormCitation::~FormCitation() FormCitation::~FormCitation()
{ {
free();
delete dialog_; delete dialog_;
} }
@ -70,8 +69,8 @@ void FormCitation::build()
FL_FORM * const FormCitation::form() const FL_FORM * const FormCitation::form() const
{ {
if( dialog_ ) // no need to test for dialog_->citation if( dialog_ ) // no need to test for dialog_->form
return dialog_->form_citation; return dialog_->form;
else else
return 0; return 0;
} }
@ -109,8 +108,8 @@ void FormCitation::update()
int noKeys = max( bibkeys.size(), citekeys.size() ); int noKeys = max( bibkeys.size(), citekeys.size() );
// Place bounds, so that 4 <= noKeys <= 15 // Place bounds, so that 4 <= noKeys <= 10
noKeys = max( 4, min(15, noKeys) ); noKeys = max( 4, min(10, noKeys) );
// Re-size the form to accommodate the new browser size // Re-size the form to accommodate the new browser size
int size = 20 * noKeys; int size = 20 * noKeys;
@ -200,15 +199,15 @@ void FormCitation::setSize( int hbrsr, bool bibPresent ) const
int const hinfo = dialog_->infoBrsr->h; int const hinfo = dialog_->infoBrsr->h;
int const hother = 140; int const hother = 140;
hbrsr = max( hbrsr, 175 ); hbrsr = max( hbrsr, 175 );
int wform = dialog_->form_citation->w; int wform = dialog_->form->w;
int hform = hbrsr + hother; int hform = hbrsr + hother;
if( bibPresent ) hform += hinfo + 30; if( bibPresent ) hform += hinfo + 30;
fl_set_form_size( dialog_->form_citation, wform, hform ); fl_set_form_size( dialog_->form, wform, hform );
// No resizing is alowed in the y-direction // No resizing is allowed in the y-direction
fl_set_form_minsize( dialog_->form_citation, wform, hform ); fl_set_form_minsize( dialog_->form, wform, hform );
fl_set_form_maxsize( dialog_->form_citation, 3*wform, hform ); fl_set_form_maxsize( dialog_->form, 3*wform, hform );
int y = 0; int y = 0;
fl_set_object_geometry( dialog_->box, 0, y, wform, hform ); fl_set_object_geometry( dialog_->box, 0, y, wform, hform );

View File

@ -83,18 +83,6 @@ void FormCommand::show()
} }
void FormCommand::free()
{
// we don't need to delete u and h here because
// hide() does that after disconnecting.
if( form() ) {
if( form()->visible )
hide();
fl_free_form(form());
}
}
void FormCommand::hide() void FormCommand::hide()
{ {
if (form() && form()->visible) { if (form() && form()->visible) {

View File

@ -57,8 +57,6 @@ protected:
virtual void update() = 0; virtual void update() = 0;
/// Apply from dialog (modify or create inset) /// Apply from dialog (modify or create inset)
virtual void apply() = 0; virtual void apply() = 0;
/// Explicitly free the dialog.
void free();
/// delete derived class variables from hide() /// delete derived class variables from hide()
virtual void clearStore() {} virtual void clearStore() {}
/// Pointer to the actual instantiation of the xform's form /// Pointer to the actual instantiation of the xform's form

View File

@ -33,13 +33,15 @@ FormCopyright::FormCopyright(LyXView * lv, Dialogs * d)
FormCopyright::~FormCopyright() FormCopyright::~FormCopyright()
{ {
free(); delete dialog_;
} }
void FormCopyright::build() void FormCopyright::build()
{ {
dialog_ = build_copyright(); dialog_ = build_copyright();
fl_set_form_atclose(dialog_->form,
C_FormCopyrightWMHideCB, 0);
} }
@ -47,14 +49,12 @@ void FormCopyright::show()
{ {
if (!dialog_) { if (!dialog_) {
build(); build();
fl_set_form_atclose(dialog_->form_copyright,
C_FormCopyrightWMHideCB, 0);
} }
if (dialog_->form_copyright->visible) { if (dialog_->form->visible) {
fl_raise_form(dialog_->form_copyright); fl_raise_form(dialog_->form);
} else { } else {
fl_show_form(dialog_->form_copyright, fl_show_form(dialog_->form,
FL_PLACE_MOUSE, FL_PLACE_MOUSE,
FL_FULLBORDER, FL_FULLBORDER,
_("Copyright and Warranty")); _("Copyright and Warranty"));
@ -66,28 +66,11 @@ void FormCopyright::show()
void FormCopyright::hide() void FormCopyright::hide()
{ {
if (dialog_ if (dialog_
&& dialog_->form_copyright && dialog_->form
&& dialog_->form_copyright->visible) { && dialog_->form->visible) {
fl_hide_form(dialog_->form_copyright); fl_hide_form(dialog_->form);
h_.disconnect(); h_.disconnect();
} }
free();
}
void FormCopyright::free()
{
// we don't need to delete h here because
// hide() does that after disconnecting.
if (dialog_) {
if (dialog_->form_copyright
&& dialog_->form_copyright->visible) {
hide();
}
fl_free_form(dialog_->form_copyright);
delete dialog_;
dialog_ = 0;
}
} }

View File

@ -55,8 +55,6 @@ private:
void build(); void build();
/// ///
FD_form_copyright * build_copyright(); FD_form_copyright * build_copyright();
/// Explicitly free the dialog.
void free();
/// Real GUI implementation. /// Real GUI implementation.
FD_form_copyright * dialog_; FD_form_copyright * dialog_;

View File

@ -119,7 +119,7 @@ void FormDocument::build()
// The language is a combo-box and has to be inserted manually // The language is a combo-box and has to be inserted manually
FL_OBJECT * obj = language_->choice_language; FL_OBJECT * obj = language_->choice_language;
fl_addto_form(language_->form_doc_language); fl_addto_form(language_->form);
combo_language = new Combox(FL_COMBOX_DROPLIST); combo_language = new Combox(FL_COMBOX_DROPLIST);
combo_language->add(obj->x, obj->y, obj->w, obj->h, 200); combo_language->add(obj->x, obj->y, obj->w, obj->h, 200);
combo_language->shortcut("#L",1); combo_language->shortcut("#L",1);
@ -156,18 +156,18 @@ void FormDocument::build()
fl_set_input_return(bullets_->input_bullet_latex, FL_RETURN_CHANGED); fl_set_input_return(bullets_->input_bullet_latex, FL_RETURN_CHANGED);
fl_set_input_maxchars(bullets_->input_bullet_latex, 80); fl_set_input_maxchars(bullets_->input_bullet_latex, 80);
fl_set_form_atclose(dialog_->form_tabbed_document, fl_set_form_atclose(dialog_->form,
FormDocument::WMHideCB, 0); FormDocument::WMHideCB, 0);
fl_addto_tabfolder(dialog_->tabbed_folder,_("Document"), fl_addto_tabfolder(dialog_->tabbed_folder,_("Document"),
class_->form_doc_class); class_->form);
fl_addto_tabfolder(dialog_->tabbed_folder,_("Paper"), fl_addto_tabfolder(dialog_->tabbed_folder,_("Paper"),
paper_->form_doc_paper); paper_->form);
fl_addto_tabfolder(dialog_->tabbed_folder,_("Language"), fl_addto_tabfolder(dialog_->tabbed_folder,_("Language"),
language_->form_doc_language); language_->form);
fl_addto_tabfolder(dialog_->tabbed_folder,_("Extra"), fl_addto_tabfolder(dialog_->tabbed_folder,_("Extra"),
options_->form_doc_options); options_->form);
fbullet = fl_addto_tabfolder(dialog_->tabbed_folder,_("Bullets"), fbullet = fl_addto_tabfolder(dialog_->tabbed_folder,_("Bullets"),
bullets_->form_doc_bullet); bullets_->form);
if ((XpmVersion < 4) || (XpmVersion == 4 && XpmRevision < 7)) { if ((XpmVersion < 4) || (XpmVersion == 4 && XpmRevision < 7)) {
lyxerr << _("Your version of libXpm is older than 4.7.\n" lyxerr << _("Your version of libXpm is older than 4.7.\n"
"The `bullet' tab of the document popup " "The `bullet' tab of the document popup "
@ -183,10 +183,10 @@ void FormDocument::show()
build(); build();
update(); // make sure its up-to-date update(); // make sure its up-to-date
if (dialog_->form_tabbed_document->visible) { if (dialog_->form->visible) {
fl_raise_form(dialog_->form_tabbed_document); fl_raise_form(dialog_->form);
} else { } else {
fl_show_form(dialog_->form_tabbed_document, fl_show_form(dialog_->form,
FL_PLACE_MOUSE | FL_FREE_SIZE, FL_PLACE_MOUSE | FL_FREE_SIZE,
FL_TRANSIENT, _("Document Layout")); FL_TRANSIENT, _("Document Layout"));
u_ = d_->updateBufferDependent.connect( u_ = d_->updateBufferDependent.connect(
@ -198,8 +198,8 @@ void FormDocument::show()
void FormDocument::hide() void FormDocument::hide()
{ {
if (dialog_->form_tabbed_document->visible) { if (dialog_->form->visible) {
fl_hide_form(dialog_->form_tabbed_document); fl_hide_form(dialog_->form);
u_.disconnect(); u_.disconnect();
h_.disconnect(); h_.disconnect();
} }
@ -645,7 +645,7 @@ void FormDocument::paper_update()
fl_set_input(paper_->input_head_height, params.headheight.c_str()); fl_set_input(paper_->input_head_height, params.headheight.c_str());
fl_set_input(paper_->input_head_sep, params.headsep.c_str()); fl_set_input(paper_->input_head_sep, params.headsep.c_str());
fl_set_input(paper_->input_foot_skip, params.footskip.c_str()); fl_set_input(paper_->input_foot_skip, params.footskip.c_str());
fl_set_focus_object(paper_->form_doc_paper, paper_->choice_papersize2); fl_set_focus_object(paper_->form, paper_->choice_papersize2);
} }
void FormDocument::bullets_update() void FormDocument::bullets_update()
@ -686,32 +686,32 @@ void FormDocument::free()
if (dialog_) { if (dialog_) {
hide(); hide();
if (class_) { if (class_) {
fl_free_form(class_->form_doc_class); fl_free_form(class_->form);
delete class_; delete class_;
class_ = 0; class_ = 0;
} }
if (paper_) { if (paper_) {
fl_free_form(paper_->form_doc_paper); fl_free_form(paper_->form);
delete paper_; delete paper_;
paper_ = 0; paper_ = 0;
} }
if (language_) { if (language_) {
delete combo_language; delete combo_language;
fl_free_form(language_->form_doc_language); fl_free_form(language_->form);
delete language_; delete language_;
language_ = 0; language_ = 0;
} }
if (options_) { if (options_) {
fl_free_form(options_->form_doc_options); fl_free_form(options_->form);
delete options_; delete options_;
options_ = 0; options_ = 0;
} }
if (bullets_) { if (bullets_) {
fl_free_form(bullets_->form_doc_bullet); fl_free_form(bullets_->form);
delete bullets_; delete bullets_;
bullets_ = 0; bullets_ = 0;
} }
fl_free_form(dialog_->form_tabbed_document); fl_free_form(dialog_->form);
delete dialog_; delete dialog_;
dialog_ = 0; dialog_ = 0;
} }
@ -933,7 +933,7 @@ void FormDocument::BulletPanel(FL_OBJECT * /*ob*/, long data)
/* by the user. (eg. standard.xpm, psnfss1.xpm etc...) */ /* by the user. (eg. standard.xpm, psnfss1.xpm etc...) */
if (data != current_bullet_panel) { if (data != current_bullet_panel) {
fl_freeze_form(bullets_->form_doc_bullet); fl_freeze_form(bullets_->form);
current_bullet_panel = data; current_bullet_panel = data;
/* free the current pixmap */ /* free the current pixmap */
@ -970,7 +970,7 @@ void FormDocument::BulletPanel(FL_OBJECT * /*ob*/, long data)
fl_set_bmtable_pixmap_file(bullets_->bmtable_bullet_panel, 6, 6, fl_set_bmtable_pixmap_file(bullets_->bmtable_bullet_panel, 6, 6,
LibFileSearch("images", new_panel.c_str()).c_str()); LibFileSearch("images", new_panel.c_str()).c_str());
fl_redraw_object(bullets_->bmtable_bullet_panel); fl_redraw_object(bullets_->bmtable_bullet_panel);
fl_unfreeze_form(bullets_->form_doc_bullet); fl_unfreeze_form(bullets_->form);
} }
} }

View File

@ -147,7 +147,7 @@ void FormGraphics::build()
InsetGraphicsParams::NONE); InsetGraphicsParams::NONE);
// Connect a signal to hide the window when the window manager orders it. // Connect a signal to hide the window when the window manager orders it.
fl_set_form_atclose(dialog_->form_graphics, fl_set_form_atclose(dialog_->form,
C_FormGraphicsWMHideCB, 0); C_FormGraphicsWMHideCB, 0);
} }
@ -162,12 +162,12 @@ void FormGraphics::show()
update(); update();
// If the form is visible // If the form is visible
if (dialog_->form_graphics->visible) { if (dialog_->form->visible) {
// Raise it. // Raise it.
fl_raise_form(dialog_->form_graphics); fl_raise_form(dialog_->form);
} else { } else {
// Otherwise (invisible), show it. // Otherwise (invisible), show it.
fl_show_form(dialog_->form_graphics, fl_show_form(dialog_->form,
FL_PLACE_MOUSE, FL_PLACE_MOUSE,
FL_FULLBORDER, FL_FULLBORDER,
_("Graphics")); _("Graphics"));
@ -204,10 +204,10 @@ void FormGraphics::hide()
{ {
// If the dialog exists, and the form is allocated and visible. // If the dialog exists, and the form is allocated and visible.
if (dialog_ if (dialog_
&& dialog_->form_graphics && dialog_->form
&& dialog_->form_graphics->visible) { && dialog_->form->visible) {
// Hide the form // Hide the form
fl_hide_form(dialog_->form_graphics); fl_hide_form(dialog_->form);
// And disconnect the signals. // And disconnect the signals.
u_.disconnect(); u_.disconnect();
@ -225,27 +225,15 @@ void FormGraphics::hide()
void FormGraphics::free() void FormGraphics::free()
{ {
// hide() will disconnect the signals so we need not worry about them.
if (dialog_) {
if (dialog_->form_graphics) {
// If the dialog is visible, hide it.
if (dialog_->form_graphics->visible) {
hide();
}
// Remove all associations for the radio buttons // Remove all associations for the radio buttons
widthButtons.reset(); widthButtons.reset();
heightButtons.reset(); heightButtons.reset();
displayButtons.reset(); displayButtons.reset();
// Free the form. // Free the form.
fl_free_form(dialog_->form_graphics);
}
delete dialog_; delete dialog_;
dialog_ = 0; dialog_ = 0;
} }
}
void FormGraphics::apply() void FormGraphics::apply()
{ {

View File

@ -27,7 +27,7 @@
#include "lyxfunc.h" #include "lyxfunc.h"
FormIndex::FormIndex(LyXView * lv, Dialogs * d) FormIndex::FormIndex(LyXView * lv, Dialogs * d)
: FormCommand(lv, d, _("Index")), dialog_(0), minh(0), minw(0) : FormCommand(lv, d, _("Index")), minh(0), minw(0), dialog_(0)
{ {
// let the dialog be shown // let the dialog be shown
// These are permanent connections so we won't bother // These are permanent connections so we won't bother
@ -39,7 +39,6 @@ FormIndex::FormIndex(LyXView * lv, Dialogs * d)
FormIndex::~FormIndex() FormIndex::~FormIndex()
{ {
free();
delete dialog_; delete dialog_;
} }
@ -56,8 +55,8 @@ void FormIndex::build()
FL_FORM * const FormIndex::form() const FL_FORM * const FormIndex::form() const
{ {
if( dialog_ ) // no need to test for dialog_->form_index if( dialog_ ) // no need to test for dialog_->form
return dialog_->form_index; return dialog_->form;
else else
return 0; return 0;
} }

View File

@ -23,6 +23,7 @@
#include "support/filetools.h" #include "support/filetools.h"
#include "lyx_gui_misc.h" #include "lyx_gui_misc.h"
#include "gettext.h" #include "gettext.h"
#include "ButtonController.h"
#ifdef SIGC_CXX_NAMESPACES #ifdef SIGC_CXX_NAMESPACES
using SigC::slot; using SigC::slot;
@ -33,12 +34,14 @@ C_GENERICCB(FormPreferences, OKCB)
C_GENERICCB(FormPreferences, ApplyCB) C_GENERICCB(FormPreferences, ApplyCB)
C_GENERICCB(FormPreferences, CancelCB) C_GENERICCB(FormPreferences, CancelCB)
C_GENERICCB(FormPreferences, InputCB) C_GENERICCB(FormPreferences, InputCB)
C_GENERICCB(FormPreferences, RestoreCB)
FormPreferences::FormPreferences(LyXView * lv, Dialogs * d) FormPreferences::FormPreferences(LyXView * lv, Dialogs * d)
: dialog_(0), bind_(0), misc_(0), screen_fonts_(0), : dialog_(0), bind_(0), misc_(0), screen_fonts_(0), interface_fonts_(0),
interface_fonts_(0), printer_(0), paths_(0), printer_(0), paths_(0), lv_(lv), d_(d), u_(0), h_(0),
lv_(lv), d_(d), u_(0), h_(0), status(DIALOG_UNMODIFIED) minw_(0), minh_(0),
bc_(new ButtonController<PreferencesPolicy>(_("Cancel"), _("Close")))
{ {
// let the dialog be shown // let the dialog be shown
// This is a permanent connection so we won't bother // This is a permanent connection so we won't bother
@ -49,13 +52,26 @@ FormPreferences::FormPreferences(LyXView * lv, Dialogs * d)
FormPreferences::~FormPreferences() FormPreferences::~FormPreferences()
{ {
free(); delete dialog_;
delete bc_;
} }
void FormPreferences::build() void FormPreferences::build()
{ {
dialog_ = build_preferences(); dialog_ = build_preferences();
// manage the restore, save, apply and cancel/close buttons
bc_->setOkay(dialog_->button_ok);
bc_->setApply(dialog_->button_apply);
bc_->setCancel(dialog_->button_cancel);
bc_->setUndoAll(dialog_->button_restore);
bc_->refresh();
// Workaround dumb xforms sizing bug
minw_ = dialog_->form->w;
minh_ = dialog_->form->h;
bind_ = build_bind(); bind_ = build_bind();
screen_fonts_ = build_screen_fonts(); screen_fonts_ = build_screen_fonts();
interface_fonts_ = build_interface_fonts(); interface_fonts_ = build_interface_fonts();
@ -74,7 +90,8 @@ void FormPreferences::build()
fl_set_input_return(screen_fonts_->input_sans, FL_RETURN_CHANGED); fl_set_input_return(screen_fonts_->input_sans, FL_RETURN_CHANGED);
fl_set_input_return(screen_fonts_->input_typewriter, fl_set_input_return(screen_fonts_->input_typewriter,
FL_RETURN_CHANGED); FL_RETURN_CHANGED);
fl_set_input_return(screen_fonts_->input_encoding, FL_RETURN_CHANGED); fl_set_input_return(screen_fonts_->input_screen_encoding,
FL_RETURN_CHANGED);
fl_set_counter_return(screen_fonts_->counter_zoom, FL_RETURN_CHANGED); fl_set_counter_return(screen_fonts_->counter_zoom, FL_RETURN_CHANGED);
fl_set_input_return(screen_fonts_->input_tiny, FL_RETURN_CHANGED); fl_set_input_return(screen_fonts_->input_tiny, FL_RETURN_CHANGED);
fl_set_input_return(screen_fonts_->input_script, FL_RETURN_CHANGED); fl_set_input_return(screen_fonts_->input_script, FL_RETURN_CHANGED);
@ -91,7 +108,7 @@ void FormPreferences::build()
FL_RETURN_CHANGED); FL_RETURN_CHANGED);
fl_set_input_return(interface_fonts_->input_menu_font, fl_set_input_return(interface_fonts_->input_menu_font,
FL_RETURN_CHANGED); FL_RETURN_CHANGED);
fl_set_input_return(interface_fonts_->input_encoding, fl_set_input_return(interface_fonts_->input_popup_encoding,
FL_RETURN_CHANGED); FL_RETURN_CHANGED);
// printer // printer
fl_set_input_return(printer_->input_command, FL_RETURN_CHANGED); fl_set_input_return(printer_->input_command, FL_RETURN_CHANGED);
@ -122,24 +139,24 @@ void FormPreferences::build()
// Now add them to the tabfolder // Now add them to the tabfolder
fl_addto_tabfolder(dialog_->tabfolder_prefs, fl_addto_tabfolder(dialog_->tabfolder_prefs,
_("Bindings"), _("Bindings"),
bind_->form_bind); bind_->form);
fl_addto_tabfolder(dialog_->tabfolder_prefs, fl_addto_tabfolder(dialog_->tabfolder_prefs,
_("Screen Fonts"), _("Screen Fonts"),
screen_fonts_->form_screen_fonts); screen_fonts_->form);
fl_addto_tabfolder(dialog_->tabfolder_prefs, fl_addto_tabfolder(dialog_->tabfolder_prefs,
_("Interface Fonts"), _("Interface Fonts"),
interface_fonts_->form_interface_fonts); interface_fonts_->form);
fl_addto_tabfolder(dialog_->tabfolder_prefs, fl_addto_tabfolder(dialog_->tabfolder_prefs,
_("Miscellaneous"), _("Miscellaneous"),
misc_->form_misc); misc_->form);
fl_addto_tabfolder(dialog_->tabfolder_prefs, fl_addto_tabfolder(dialog_->tabfolder_prefs,
_("Printer"), _("Printer"),
printer_->form_printer); printer_->form);
fl_addto_tabfolder(dialog_->tabfolder_prefs, fl_addto_tabfolder(dialog_->tabfolder_prefs,
_("Paths"), _("Paths"),
paths_->form_paths); paths_->form);
fl_set_form_atclose(dialog_->form_preferences, fl_set_form_atclose(dialog_->form,
C_FormPreferencesWMHideCB, 0); C_FormPreferencesWMHideCB, 0);
// deactivate the various browse buttons because they // deactivate the various browse buttons because they
@ -166,18 +183,15 @@ void FormPreferences::show()
} }
update(); // make sure its up-to-date update(); // make sure its up-to-date
if (dialog_->form_preferences->visible) { if (dialog_->form->visible) {
fl_raise_form(dialog_->form_preferences); fl_raise_form(dialog_->form);
} else { } else {
status = DIALOG_UNMODIFIED; fl_set_form_minsize(dialog_->form,
fl_deactivate_object(dialog_->button_ok); minw_,
fl_deactivate_object(dialog_->button_apply); minh_);
fl_set_object_lcol(dialog_->button_ok, FL_INACTIVE); fl_show_form(dialog_->form,
fl_set_object_lcol(dialog_->button_apply, FL_INACTIVE);
fl_show_form(dialog_->form_preferences,
FL_PLACE_MOUSE | FL_FREE_SIZE, FL_PLACE_MOUSE | FL_FREE_SIZE,
FL_FULLBORDER, FL_TRANSIENT,
_("Preferences")); _("Preferences"));
} }
} }
@ -186,9 +200,10 @@ void FormPreferences::show()
void FormPreferences::hide() void FormPreferences::hide()
{ {
if (dialog_ if (dialog_
&& dialog_->form_preferences && dialog_->form
&& dialog_->form_preferences->visible) { && dialog_->form->visible) {
fl_hide_form(dialog_->form_preferences); bc_->hide();
fl_hide_form(dialog_->form);
} }
} }
@ -200,6 +215,10 @@ void FormPreferences::apply()
// is made. For example, screen zoom and font types. These could be // is made. For example, screen zoom and font types. These could be
// handled either by signals/slots in lyxrc or just directly call the // handled either by signals/slots in lyxrc or just directly call the
// associated functions here. // associated functions here.
// There are other problems with this scheme. We really should check
// what we copy to make sure that it really is necessary to do things
// like update the screen fonts because that flushes the textcache
// and other stuff which may cost us a lot on slower/high-load machines.
// Bind tab // Bind tab
lyxrc.bind_file = fl_get_input(bind_->input_bind); lyxrc.bind_file = fl_get_input(bind_->input_bind);
@ -214,12 +233,53 @@ void FormPreferences::apply()
(fl_get_counter_value(misc_->counter_autosave)); (fl_get_counter_value(misc_->counter_autosave));
lyxrc.ascii_linelen = static_cast<unsigned int> lyxrc.ascii_linelen = static_cast<unsigned int>
(fl_get_counter_value(misc_->counter_line_len)); (fl_get_counter_value(misc_->counter_line_len));
// Interface fonts
lyxrc.popup_font_name =
fl_get_input(interface_fonts_->input_popup_font);
lyxrc.menu_font_name = fl_get_input(interface_fonts_->input_menu_font);
lyxrc.font_norm_menu =
fl_get_input(interface_fonts_->input_popup_encoding);
// Screen fonts // Screen fonts
if (lyxrc.roman_font_name !=
fl_get_input(screen_fonts_->input_roman) ||
lyxrc.sans_font_name !=
fl_get_input(screen_fonts_->input_sans) ||
lyxrc.typewriter_font_name !=
fl_get_input(screen_fonts_->input_typewriter) ||
lyxrc.font_norm !=
fl_get_input(screen_fonts_->input_screen_encoding) ||
lyxrc.use_scalable_fonts !=
fl_get_button(screen_fonts_->check_scalable) ||
lyxrc.zoom != static_cast<unsigned int>
(fl_get_counter_value(screen_fonts_->counter_zoom)) ||
lyxrc.font_sizes[LyXFont::SIZE_TINY] !=
strToDbl(fl_get_input(screen_fonts_->input_tiny)) ||
lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] !=
strToDbl(fl_get_input(screen_fonts_->input_script)) ||
lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] !=
strToDbl(fl_get_input(screen_fonts_->input_footnote)) ||
lyxrc.font_sizes[LyXFont::SIZE_SMALL] !=
strToDbl(fl_get_input(screen_fonts_->input_small)) ||
lyxrc.font_sizes[LyXFont::SIZE_NORMAL] !=
strToDbl(fl_get_input(screen_fonts_->input_normal)) ||
lyxrc.font_sizes[LyXFont::SIZE_LARGE] !=
strToDbl(fl_get_input(screen_fonts_->input_large)) ||
lyxrc.font_sizes[LyXFont::SIZE_LARGER] !=
strToDbl(fl_get_input(screen_fonts_->input_larger)) ||
lyxrc.font_sizes[LyXFont::SIZE_LARGEST] !=
strToDbl(fl_get_input(screen_fonts_->input_largest)) ||
lyxrc.font_sizes[LyXFont::SIZE_HUGE] !=
strToDbl(fl_get_input(screen_fonts_->input_huge)) ||
lyxrc.font_sizes[LyXFont::SIZE_HUGER] !=
strToDbl(fl_get_input(screen_fonts_->input_huger))) {
// Something has changed so copy all of them and then force
// an update of the screen fonts (ie. redraw every buffer)
lyxrc.roman_font_name = fl_get_input(screen_fonts_->input_roman); lyxrc.roman_font_name = fl_get_input(screen_fonts_->input_roman);
lyxrc.sans_font_name = fl_get_input(screen_fonts_->input_sans); lyxrc.sans_font_name = fl_get_input(screen_fonts_->input_sans);
lyxrc.typewriter_font_name = fl_get_input(screen_fonts_-> lyxrc.typewriter_font_name = fl_get_input(screen_fonts_->
input_typewriter); input_typewriter);
lyxrc.font_norm = fl_get_input(screen_fonts_->input_encoding); lyxrc.font_norm = fl_get_input(screen_fonts_->
input_screen_encoding);
lyxrc.use_scalable_fonts = lyxrc.use_scalable_fonts =
fl_get_button(screen_fonts_->check_scalable); fl_get_button(screen_fonts_->check_scalable);
lyxrc.zoom = static_cast<unsigned int> lyxrc.zoom = static_cast<unsigned int>
@ -244,11 +304,10 @@ void FormPreferences::apply()
strToDbl(fl_get_input(screen_fonts_->input_huge)); strToDbl(fl_get_input(screen_fonts_->input_huge));
lyxrc.font_sizes[LyXFont::SIZE_HUGER] = lyxrc.font_sizes[LyXFont::SIZE_HUGER] =
strToDbl(fl_get_input(screen_fonts_->input_huger)); strToDbl(fl_get_input(screen_fonts_->input_huger));
// interface fonts // Now update the buffers
lyxrc.popup_font_name = // Can anything below here affect the redraw process?
fl_get_input(interface_fonts_->input_popup_font); lv_->getLyXFunc()->Dispatch(LFUN_SCREEN_FONT_UPDATE);
lyxrc.menu_font_name = fl_get_input(interface_fonts_->input_menu_font); }
lyxrc.font_norm_menu = fl_get_input(interface_fonts_->input_encoding);
// printer // printer
lyxrc.print_adapt_output = fl_get_button(printer_->check_adapt_output); lyxrc.print_adapt_output = fl_get_button(printer_->check_adapt_output);
lyxrc.print_command = fl_get_input(printer_->input_command); lyxrc.print_command = fl_get_input(printer_->input_command);
@ -284,6 +343,8 @@ void FormPreferences::apply()
lyxrc.make_backup = fl_get_button(paths_->check_make_backups); lyxrc.make_backup = fl_get_button(paths_->check_make_backups);
lyxrc.num_lastfiles = static_cast<unsigned int> lyxrc.num_lastfiles = static_cast<unsigned int>
(fl_get_counter_value(paths_->counter_lastfiles)); (fl_get_counter_value(paths_->counter_lastfiles));
bc_->apply();
} }
@ -313,7 +374,7 @@ void FormPreferences::update()
lyxrc.sans_font_name.c_str()); lyxrc.sans_font_name.c_str());
fl_set_input(screen_fonts_->input_typewriter, fl_set_input(screen_fonts_->input_typewriter,
lyxrc.typewriter_font_name.c_str()); lyxrc.typewriter_font_name.c_str());
fl_set_input(screen_fonts_->input_encoding, fl_set_input(screen_fonts_->input_screen_encoding,
lyxrc.font_norm.c_str()); lyxrc.font_norm.c_str());
fl_set_button(screen_fonts_->check_scalable, fl_set_button(screen_fonts_->check_scalable,
lyxrc.use_scalable_fonts); lyxrc.use_scalable_fonts);
@ -344,7 +405,7 @@ void FormPreferences::update()
lyxrc.popup_font_name.c_str()); lyxrc.popup_font_name.c_str());
fl_set_input(interface_fonts_->input_menu_font, fl_set_input(interface_fonts_->input_menu_font,
lyxrc.menu_font_name.c_str()); lyxrc.menu_font_name.c_str());
fl_set_input(interface_fonts_->input_encoding, fl_set_input(interface_fonts_->input_popup_encoding,
lyxrc.font_norm_menu.c_str()); lyxrc.font_norm_menu.c_str());
// printer // printer
fl_set_button(printer_->check_adapt_output, fl_set_button(printer_->check_adapt_output,
@ -406,7 +467,7 @@ void FormPreferences::update()
} }
void FormPreferences::input() bool FormPreferences::input()
{ {
bool activate = true; bool activate = true;
// //
@ -440,6 +501,7 @@ void FormPreferences::input()
|| !AbsolutePath(fl_get_input(paths_-> || !AbsolutePath(fl_get_input(paths_->
input_backup_path)))))) { input_backup_path)))))) {
activate = false; activate = false;
lyxerr[Debug::GUI] << "Preferences: Path is wrong\n";
} }
// fontsizes -- tiny < script < footnote etc. // fontsizes -- tiny < script < footnote etc.
@ -456,6 +518,7 @@ void FormPreferences::input()
// make sure they all have positive entries // make sure they all have positive entries
// Also note that an empty entry is returned as 0.0 by strToDbl // Also note that an empty entry is returned as 0.0 by strToDbl
activate = false; activate = false;
lyxerr[Debug::GUI] << "Preferences: Sizes are wrong\n";
} else if (strToDbl(fl_get_input(screen_fonts_->input_tiny)) > } else if (strToDbl(fl_get_input(screen_fonts_->input_tiny)) >
strToDbl(fl_get_input(screen_fonts_->input_script)) || strToDbl(fl_get_input(screen_fonts_->input_script)) ||
strToDbl(fl_get_input(screen_fonts_->input_script)) > strToDbl(fl_get_input(screen_fonts_->input_script)) >
@ -475,40 +538,10 @@ void FormPreferences::input()
strToDbl(fl_get_input(screen_fonts_->input_huge)) > strToDbl(fl_get_input(screen_fonts_->input_huge)) >
strToDbl(fl_get_input(screen_fonts_->input_huger))) { strToDbl(fl_get_input(screen_fonts_->input_huger))) {
activate = false; activate = false;
lyxerr[Debug::GUI] << "Preferences: Sizes are wrong\n";
} }
// return activate;
// You can modify the dialog and still have the buttons disabled
status = DIALOG_MODIFIED;
if (status == DIALOG_MODIFIED
&& activate) {
fl_activate_object(dialog_->button_ok);
fl_activate_object(dialog_->button_apply);
fl_set_object_lcol(dialog_->button_ok, FL_BLACK);
fl_set_object_lcol(dialog_->button_apply, FL_BLACK);
} else {
fl_deactivate_object(dialog_->button_ok);
fl_deactivate_object(dialog_->button_apply);
fl_set_object_lcol(dialog_->button_ok, FL_INACTIVE);
fl_set_object_lcol(dialog_->button_apply, FL_INACTIVE);
}
}
void FormPreferences::free()
{
// we don't need to delete u and h here because
// hide() does that after disconnecting.
if (dialog_) {
if (dialog_->form_preferences
&& dialog_->form_preferences->visible) {
hide();
}
fl_free_form(dialog_->form_preferences);
delete dialog_;
dialog_ = 0;
}
} }
@ -549,5 +582,14 @@ void FormPreferences::CancelCB(FL_OBJECT * ob, long)
void FormPreferences::InputCB(FL_OBJECT * ob, long) void FormPreferences::InputCB(FL_OBJECT * ob, long)
{ {
FormPreferences * pre = static_cast<FormPreferences*>(ob->form->u_vdata); FormPreferences * pre = static_cast<FormPreferences*>(ob->form->u_vdata);
pre->input(); pre->bc_->valid(pre->input());
}
void FormPreferences::RestoreCB(FL_OBJECT * ob, long)
{
FormPreferences * pre = static_cast<FormPreferences*>(ob->form->u_vdata);
pre->update();
pre->input();
pre->bc_->undoAll();
} }

View File

@ -26,6 +26,9 @@
class LyXView; class LyXView;
class Dialogs; class Dialogs;
class PreferencesPolicy;
template <class x> class ButtonController;
struct FD_form_preferences; struct FD_form_preferences;
struct FD_form_bind; struct FD_form_bind;
struct FD_form_misc; struct FD_form_misc;
@ -58,6 +61,7 @@ public:
static void ApplyCB(FL_OBJECT *, long); static void ApplyCB(FL_OBJECT *, long);
static void CancelCB(FL_OBJECT *, long); static void CancelCB(FL_OBJECT *, long);
static void InputCB(FL_OBJECT *, long); static void InputCB(FL_OBJECT *, long);
static void RestoreCB(FL_OBJECT *, long);
//@} //@}
private: private:
@ -75,8 +79,8 @@ private:
//@{ //@{
/// Apply from dialog /// Apply from dialog
void apply(); void apply();
/// Filter the inputs /// Filter the inputs -- return true if entries are valid
void input(); bool input();
/// Build the dialog /// Build the dialog
void build(); void build();
/// ///
@ -93,8 +97,6 @@ private:
FD_form_printer * build_printer(); FD_form_printer * build_printer();
/// ///
FD_form_paths * build_paths(); FD_form_paths * build_paths();
/// Explicitly free the dialog.
void free();
//@} //@}
/**@name Private Data */ /**@name Private Data */
@ -115,13 +117,16 @@ private:
FD_form_paths * paths_; FD_form_paths * paths_;
/// Which LyXView do we belong to? /// Which LyXView do we belong to?
LyXView * lv_; LyXView * lv_;
///
Dialogs * d_; Dialogs * d_;
/// Update connection. /// Update connection.
Connection u_; Connection u_;
/// Hide connection. /// Hide connection.
Connection h_; Connection h_;
/// Overcome a dumb xforms sizing bug
int minw_, minh_;
/// ///
EnumDialogStatus status; ButtonController<PreferencesPolicy> * bc_;
//@} //@}
}; };

View File

@ -54,20 +54,14 @@ FormPrint::FormPrint(LyXView * lv, Dialogs * d)
FormPrint::~FormPrint() FormPrint::~FormPrint()
{ {
free(); delete dialog_;
} }
void FormPrint::build() void FormPrint::build()
{ {
dialog_ = build_print(); dialog_ = build_print();
}
void FormPrint::show()
{
if (!dialog_) {
build();
// allow controlling of input and ok/apply (de)activation // allow controlling of input and ok/apply (de)activation
fl_set_input_return(dialog_->input_printer, fl_set_input_return(dialog_->input_printer,
FL_RETURN_CHANGED); FL_RETURN_CHANGED);
@ -95,19 +89,29 @@ void FormPrint::show()
fl_set_input_maxchars(dialog_->input_to_page, 4); // 9999 fl_set_input_maxchars(dialog_->input_to_page, 4); // 9999
fl_set_input_maxchars(dialog_->input_count, 4); // 9999 fl_set_input_maxchars(dialog_->input_count, 4); // 9999
fl_set_form_atclose(dialog_->form_print, fl_set_form_atclose(dialog_->form,
C_FormPrintWMHideCB, 0); C_FormPrintWMHideCB, 0);
} }
void FormPrint::show()
{
if (!dialog_) {
build();
}
update(); // make sure its up-to-date update(); // make sure its up-to-date
if (dialog_->form_print->visible) { if (dialog_->form->visible) {
fl_raise_form(dialog_->form_print); fl_raise_form(dialog_->form);
} else { } else {
fl_show_form(dialog_->form_print, fl_show_form(dialog_->form,
FL_PLACE_MOUSE | FL_FREE_SIZE, FL_PLACE_MOUSE | FL_FREE_SIZE,
FL_FULLBORDER, FL_TRANSIENT,
_("Print")); _("Print"));
fl_set_form_minsize(dialog_->form,
dialog_->form->w,
dialog_->form->h);
u_ = d_->updateBufferDependent.connect(slot(this, u_ = d_->updateBufferDependent.connect(slot(this,
&FormPrint::update)); &FormPrint::update));
h_ = d_->hideBufferDependent.connect(slot(this, h_ = d_->hideBufferDependent.connect(slot(this,
@ -119,9 +123,9 @@ void FormPrint::show()
void FormPrint::hide() void FormPrint::hide()
{ {
if (dialog_ if (dialog_
&& dialog_->form_print && dialog_->form
&& dialog_->form_print->visible) { && dialog_->form->visible) {
fl_hide_form(dialog_->form_print); fl_hide_form(dialog_->form);
u_.disconnect(); u_.disconnect();
h_.disconnect(); h_.disconnect();
} }
@ -327,22 +331,6 @@ void FormPrint::input()
} }
void FormPrint::free()
{
// we don't need to delete u and h here because
// hide() does that after disconnecting.
if (dialog_) {
if (dialog_->form_print
&& dialog_->form_print->visible) {
hide();
}
fl_free_form(dialog_->form_print);
delete dialog_;
dialog_ = 0;
}
}
int FormPrint::WMHideCB(FL_FORM * form, void *) int FormPrint::WMHideCB(FL_FORM * form, void *)
{ {
// Ensure that the signals (u and h) are disconnected even if the // Ensure that the signals (u and h) are disconnected even if the

View File

@ -75,8 +75,6 @@ private:
void build(); void build();
/// ///
FD_form_print * build_print(); FD_form_print * build_print();
/// Explicitly free the dialog.
void free();
//@} //@}
/**@name Private Data */ /**@name Private Data */
@ -85,6 +83,7 @@ private:
FD_form_print * dialog_; FD_form_print * dialog_;
/// Which LyXView do we belong to? /// Which LyXView do we belong to?
LyXView * lv_; LyXView * lv_;
///
Dialogs * d_; Dialogs * d_;
/// Update connection. /// Update connection.
Connection u_; Connection u_;

View File

@ -35,8 +35,7 @@ static int formw;
static int formh; static int formh;
FormRef::FormRef(LyXView * lv, Dialogs * d) FormRef::FormRef(LyXView * lv, Dialogs * d)
: FormCommand(lv, d, _("Reference")), dialog_(0), : FormCommand(lv, d, _("Reference")), toggle(GOBACK), dialog_(0)
toggle(GOBACK)
{ {
// let the dialog be shown // let the dialog be shown
// These are permanent connections so we won't bother // These are permanent connections so we won't bother
@ -48,7 +47,6 @@ FormRef::FormRef(LyXView * lv, Dialogs * d)
FormRef::~FormRef() FormRef::~FormRef()
{ {
free();
delete dialog_; delete dialog_;
} }
@ -94,7 +92,7 @@ void FormRef::build()
FL_FORM * const FormRef::form() const FL_FORM * const FormRef::form() const
{ {
if ( dialog_ ) // no need to test for dialog_->form_ref if ( dialog_ ) // no need to test for dialog_->form_ref
return dialog_->form_ref; return dialog_->form;
else else
return 0; return 0;
} }

View File

@ -65,13 +65,13 @@ private:
/// ///
string getName( Type type ) const; string getName( Type type ) const;
/// Real GUI implementation.
FD_form_ref * dialog_;
/// ///
Goto toggle; Goto toggle;
/// ///
std::vector<string> refs; std::vector<string> refs;
/// Real GUI implementation.
FD_form_ref * dialog_;
}; };
#endif #endif

View File

@ -49,7 +49,14 @@ FormTabular::FormTabular(LyXView * lv, Dialogs * d)
FormTabular::~FormTabular() FormTabular::~FormTabular()
{ {
free(); // we don't need to disconnect u and h here because
// their destructors do that.
delete dialog_;
delete tabular_options_;
delete column_options_;
delete cell_options_;
delete longtable_options_;
delete create_tabular_;
} }
@ -72,15 +79,15 @@ void FormTabular::build()
FL_RETURN_CHANGED); FL_RETURN_CHANGED);
fl_addto_tabfolder(dialog_->tabFolder, _("Tabular"), fl_addto_tabfolder(dialog_->tabFolder, _("Tabular"),
tabular_options_->form_tabular_options); tabular_options_->form);
fl_addto_tabfolder(dialog_->tabFolder, _("Column/Row"), fl_addto_tabfolder(dialog_->tabFolder, _("Column/Row"),
column_options_->form_column_options); column_options_->form);
fl_addto_tabfolder(dialog_->tabFolder, _("Cell"), fl_addto_tabfolder(dialog_->tabFolder, _("Cell"),
cell_options_->form_cell_options); cell_options_->form);
fl_addto_tabfolder(dialog_->tabFolder, _("LongTable"), fl_addto_tabfolder(dialog_->tabFolder, _("LongTable"),
longtable_options_->form_longtable_options); longtable_options_->form);
fl_set_form_atclose(dialog_->form_tabular, fl_set_form_atclose(dialog_->form,
C_FormTabularWMHideCB, 0); C_FormTabularWMHideCB, 0);
fl_set_slider_bounds(create_tabular_->slider_rows, 1, 50); fl_set_slider_bounds(create_tabular_->slider_rows, 1, 50);
@ -89,7 +96,7 @@ void FormTabular::build()
fl_set_slider_value(create_tabular_->slider_columns, 5); fl_set_slider_value(create_tabular_->slider_columns, 5);
fl_set_slider_precision(create_tabular_->slider_rows, 0); fl_set_slider_precision(create_tabular_->slider_rows, 0);
fl_set_slider_precision(create_tabular_->slider_columns, 0); fl_set_slider_precision(create_tabular_->slider_columns, 0);
fl_set_form_atclose(create_tabular_->form_create_tabular, fl_set_form_atclose(create_tabular_->form,
C_FormTabularWMHideCB, 0); C_FormTabularWMHideCB, 0);
} }
@ -101,10 +108,10 @@ void FormTabular::show()
} }
update(); // make sure its up-to-date update(); // make sure its up-to-date
if (dialog_->form_tabular->visible) { if (dialog_->form->visible) {
fl_raise_form(dialog_->form_tabular); fl_raise_form(dialog_->form);
} else { } else {
fl_show_form(dialog_->form_tabular, fl_show_form(dialog_->form,
FL_PLACE_MOUSE | FL_FREE_SIZE, FL_PLACE_MOUSE | FL_FREE_SIZE,
FL_TRANSIENT, FL_TRANSIENT,
_("Tabular Layout")); _("Tabular Layout"));
@ -125,8 +132,8 @@ void FormTabular::showInset(InsetTabular * ti)
void FormTabular::hide() void FormTabular::hide()
{ {
if (dialog_ && dialog_->form_tabular && dialog_->form_tabular->visible) { if (dialog_ && dialog_->form && dialog_->form->visible) {
fl_hide_form(dialog_->form_tabular); fl_hide_form(dialog_->form);
u_.disconnect(); u_.disconnect();
h_.disconnect(); h_.disconnect();
inset_ = 0; inset_ = 0;
@ -153,49 +160,12 @@ void FormTabular::update()
void FormTabular::updateInset(InsetTabular * ti) void FormTabular::updateInset(InsetTabular * ti)
{ {
inset_ = ti; inset_ = ti;
if (ti && dialog_ && dialog_->form_tabular->visible) { if (ti && dialog_ && dialog_->form->visible) {
update(); update();
} }
} }
void FormTabular::free()
{
// we don't need to delete u and h here because
// hide() does that after disconnecting.
if (dialog_) {
if (dialog_->form_tabular
&& dialog_->form_tabular->visible) {
hide();
}
fl_free_form(dialog_->form_tabular);
delete dialog_;
dialog_ = 0;
fl_free_form(tabular_options_->form_tabular_options);
delete tabular_options_;
tabular_options_ = 0;
fl_free_form(column_options_->form_column_options);
delete column_options_;
column_options_ = 0;
fl_free_form(cell_options_->form_cell_options);
delete cell_options_;
cell_options_ = 0;
fl_free_form(longtable_options_->form_longtable_options);
delete longtable_options_;
longtable_options_ = 0;
hide_create();
fl_free_form(create_tabular_->form_create_tabular);
delete create_tabular_;
create_tabular_ = 0;
}
}
int FormTabular::WMHideCB(FL_FORM * form, void *) int FormTabular::WMHideCB(FL_FORM * form, void *)
{ {
// Ensure that the signals (u and h) are disconnected even if the // Ensure that the signals (u and h) are disconnected even if the
@ -718,24 +688,16 @@ void FormTabular::show_create()
if (!dialog_) { if (!dialog_) {
build(); build();
} }
if (create_tabular_->form_create_tabular->visible) { if (create_tabular_->form->visible) {
fl_raise_form(create_tabular_->form_create_tabular); fl_raise_form(create_tabular_->form);
} else { } else {
fl_show_form(create_tabular_->form_create_tabular, fl_show_form(create_tabular_->form,
FL_PLACE_MOUSE | FL_FREE_SIZE, FL_PLACE_MOUSE | FL_FREE_SIZE,
FL_FULLBORDER, _("Insert Tabular")); FL_FULLBORDER, _("Insert Tabular"));
} }
} }
void FormTabular::hide_create()
{
if (create_tabular_->form_create_tabular &&
create_tabular_->form_create_tabular->visible)
fl_hide_form(create_tabular_->form_create_tabular);
}
void FormTabular::apply_create() void FormTabular::apply_create()
{ {
int int
@ -752,6 +714,14 @@ void FormTabular::apply_create()
} }
void FormTabular::hide_create()
{
if (create_tabular_->form &&
create_tabular_->form->visible)
fl_hide_form(create_tabular_->form);
}
void FormTabular::OKCB(FL_OBJECT * ob, long) void FormTabular::OKCB(FL_OBJECT * ob, long)
{ {
FormTabular * pre = (FormTabular*)ob->form->u_vdata; FormTabular * pre = (FormTabular*)ob->form->u_vdata;

View File

@ -18,6 +18,8 @@
#define FORMTABULAR_H #define FORMTABULAR_H
#include "DialogBase.h" #include "DialogBase.h"
#include "support/utility.hpp"
#ifdef SIGC_CXX_NAMESPACES #ifdef SIGC_CXX_NAMESPACES
using SigC::Connection; using SigC::Connection;
#endif #endif
@ -35,7 +37,7 @@ struct FD_form_create_tabular;
/** This class provides an XForms implementation of the FormTabular Dialog. /** This class provides an XForms implementation of the FormTabular Dialog.
The tabular dialog allows users to set/save their tabular. The tabular dialog allows users to set/save their tabular.
*/ */
class FormTabular : public DialogBase { class FormTabular : public DialogBase, public noncopyable {
public: public:
/**@name Constructors and Destructors */ /**@name Constructors and Destructors */
//@{ //@{
@ -56,9 +58,6 @@ public:
//@} //@}
private: private:
FormTabular() {}
FormTabular(FormTabular &) : DialogBase() {}
/**@name Slot Methods */ /**@name Slot Methods */
//@{ //@{
/// Create the dialog if necessary, update it and display it. /// Create the dialog if necessary, update it and display it.
@ -95,9 +94,6 @@ private:
FD_form_longtable_options * build_longtable_options(); FD_form_longtable_options * build_longtable_options();
/// ///
FD_form_create_tabular * build_create_tabular(); FD_form_create_tabular * build_create_tabular();
///
/// Explicitly free the dialog.
void free();
//@} //@}
/**@name Private Data */ /**@name Private Data */
@ -114,17 +110,20 @@ private:
FD_form_longtable_options * longtable_options_; FD_form_longtable_options * longtable_options_;
/// ///
FD_form_create_tabular * create_tabular_; FD_form_create_tabular * create_tabular_;
/// //
/// Which LyXView do we belong to? /// Which LyXView do we belong to?
LyXView * lv_; LyXView * lv_;
///
Dialogs * d_; Dialogs * d_;
/// Update connection. /// Update connection.
Connection u_; Connection u_;
/// Hide connection. /// Hide connection.
Connection h_; Connection h_;
//@} ///
InsetTabular * inset_; InsetTabular * inset_;
///
int actCell_; int actCell_;
//@}
}; };
#endif #endif

View File

@ -39,7 +39,6 @@ FormToc::FormToc(LyXView * lv, Dialogs * d)
FormToc::~FormToc() FormToc::~FormToc()
{ {
free();
delete dialog_; delete dialog_;
} }
@ -62,8 +61,8 @@ void FormToc::build()
FL_FORM * const FormToc::form() const FL_FORM * const FormToc::form() const
{ {
if( dialog_ ) // no need to test for dialog_->form_toc if ( dialog_ ) // no need to test for dialog_->form
return dialog_->form_toc; return dialog_->form;
else else
return 0; return 0;
} }

View File

@ -27,9 +27,8 @@
#include "lyxfunc.h" #include "lyxfunc.h"
FormUrl::FormUrl(LyXView * lv, Dialogs * d) FormUrl::FormUrl(LyXView * lv, Dialogs * d)
: FormCommand(lv, d, _("Url")), dialog_(0), minh(0), minw(0) : FormCommand(lv, d, _("Url")), minh(0), minw(0), dialog_(0)
{ {
dialog_ = 0;
// let the dialog be shown // let the dialog be shown
// These are permanent connections so we won't bother // These are permanent connections so we won't bother
// storing a copy because we won't be disconnecting. // storing a copy because we won't be disconnecting.
@ -40,7 +39,6 @@ FormUrl::FormUrl(LyXView * lv, Dialogs * d)
FormUrl::~FormUrl() FormUrl::~FormUrl()
{ {
free();
delete dialog_; delete dialog_;
} }
@ -57,8 +55,8 @@ void FormUrl::build()
FL_FORM * const FormUrl::form() const FL_FORM * const FormUrl::form() const
{ {
if( dialog_ ) // no need to test for dialog_->form_url if( dialog_ ) // no need to test for dialog_->form
return dialog_->form_url; return dialog_->form;
else else
return 0; return 0;
} }

View File

@ -11,6 +11,7 @@ LYXDATADIRS = forms
ETAGS_ARGS = --lang=c++ ETAGS_ARGS = --lang=c++
# Alphabetical order please. It makes it easier to figure out what's missing. # Alphabetical order please. It makes it easier to figure out what's missing.
libxforms_la_SOURCES = \ libxforms_la_SOURCES = \
ButtonController.h \
Dialogs.C \ Dialogs.C \
FormCitation.C \ FormCitation.C \
FormCitation.h \ FormCitation.h \

View File

@ -10,20 +10,27 @@
#include "form_citation.h" #include "form_citation.h"
#include "FormCitation.h" #include "FormCitation.h"
FD_form_citation::~FD_form_citation()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_citation * FormCitation::build_citation() FD_form_citation * FormCitation::build_citation()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_citation *fdui = new FD_form_citation; FD_form_citation *fdui = new FD_form_citation;
fdui->form_citation = fl_bgn_form(FL_NO_BOX, 430, 770); fdui->form = fl_bgn_form(FL_NO_BOX, 435, 665);
fdui->form_citation->u_vdata = this; fdui->form->u_vdata = this;
fdui->box = obj = fl_add_box(FL_UP_BOX, 0, 0, 430, 770, ""); fdui->box = obj = fl_add_box(FL_UP_BOX, 0, 0, 435, 665, "");
fl_set_object_resize(obj, FL_RESIZE_X); fl_set_object_resize(obj, FL_RESIZE_X);
fdui->citeBrsr = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 30, 180, 370, _("Inset keys")); fdui->citeBrsr = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 30, 180, 300, _("Inset keys"));
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
fl_set_object_resize(obj, FL_RESIZE_X); fl_set_object_resize(obj, FL_RESIZE_X);
fl_set_object_callback(obj, C_FormCommandInputCB, CITEBRSR); fl_set_object_callback(obj, C_FormCommandInputCB, CITEBRSR);
fdui->bibBrsr = obj = fl_add_browser(FL_HOLD_BROWSER, 240, 30, 180, 370, _("Bibliography keys")); fdui->bibBrsr = obj = fl_add_browser(FL_HOLD_BROWSER, 240, 30, 180, 300, _("Bibliography keys"));
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
fl_set_object_resize(obj, FL_RESIZE_X); fl_set_object_resize(obj, FL_RESIZE_X);
fl_set_object_callback(obj, C_FormCommandInputCB, BIBBRSR); fl_set_object_callback(obj, C_FormCommandInputCB, BIBBRSR);
@ -39,26 +46,26 @@ FD_form_citation * FormCitation::build_citation()
fdui->downBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 135, 30, 30, _("@2->")); fdui->downBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 135, 30, 30, _("@2->"));
fl_set_object_resize(obj, FL_RESIZE_NONE); fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_set_object_callback(obj, C_FormCommandInputCB, DOWN); fl_set_object_callback(obj, C_FormCommandInputCB, DOWN);
fdui->infoBrsr = obj = fl_add_browser(FL_NORMAL_BROWSER, 10, 440, 410, 110, _("Info")); fdui->infoBrsr = obj = fl_add_browser(FL_NORMAL_BROWSER, 10, 360, 410, 80, _("Info"));
fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
fl_set_object_resize(obj, FL_RESIZE_X); fl_set_object_resize(obj, FL_RESIZE_X);
fdui->style = obj = fl_add_choice(FL_NORMAL_CHOICE, 160, 570, 130, 30, _("Citation style")); fdui->style = obj = fl_add_choice(FL_NORMAL_CHOICE, 160, 470, 130, 30, _("Citation style"));
fl_set_object_boxtype(obj, FL_DOWN_BOX); fl_set_object_boxtype(obj, FL_DOWN_BOX);
fl_set_object_resize(obj, FL_RESIZE_X); fl_set_object_resize(obj, FL_RESIZE_X);
fdui->textBefore = obj = fl_add_input(FL_NORMAL_INPUT, 100, 620, 250, 30, _("Text before")); fdui->textBefore = obj = fl_add_input(FL_NORMAL_INPUT, 100, 520, 250, 30, _("Text before"));
fl_set_object_resize(obj, FL_RESIZE_X); fl_set_object_resize(obj, FL_RESIZE_X);
fdui->textAftr = obj = fl_add_input(FL_NORMAL_INPUT, 100, 660, 250, 30, _("Text after")); fdui->textAftr = obj = fl_add_input(FL_NORMAL_INPUT, 100, 570, 250, 30, _("Text after"));
fl_set_object_resize(obj, FL_RESIZE_X); fl_set_object_resize(obj, FL_RESIZE_X);
fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON, 230, 730, 90, 30, _("OK")); fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON, 230, 630, 90, 30, _("OK"));
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, C_FormCommandOKCB, 0); fl_set_object_callback(obj, C_FormCommandOKCB, 0);
fdui->cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 330, 730, 90, 30, _("Cancel")); fdui->cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 330, 630, 90, 30, _("Cancel"));
fl_set_button_shortcut(obj, _("^["), 1); fl_set_button_shortcut(obj, _("^["), 1);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, C_FormCommandCancelCB, 0); fl_set_object_callback(obj, C_FormCommandCancelCB, 0);
fl_end_form(); fl_end_form();
fdui->form_citation->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -1,4 +1,5 @@
/** Header file generated with fdesign on Wed Aug 2 13:56:56 2000.**/ // File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
/** Header file generated with fdesign **/
#ifndef FD_form_citation_h_ #ifndef FD_form_citation_h_
#define FD_form_citation_h_ #define FD_form_citation_h_
@ -11,8 +12,9 @@ extern "C" void C_FormCommandCancelCB(FL_OBJECT *, long);
/**** Forms and Objects ****/ /**** Forms and Objects ****/
struct FD_form_citation { struct FD_form_citation {
~FD_form_citation();
FL_FORM *form_citation; FL_FORM *form;
FL_OBJECT *box; FL_OBJECT *box;
FL_OBJECT *citeBrsr; FL_OBJECT *citeBrsr;
FL_OBJECT *bibBrsr; FL_OBJECT *bibBrsr;

View File

@ -10,13 +10,20 @@
#include "form_copyright.h" #include "form_copyright.h"
#include "FormCopyright.h" #include "FormCopyright.h"
FD_form_copyright::~FD_form_copyright()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_copyright * FormCopyright::build_copyright() FD_form_copyright * FormCopyright::build_copyright()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_copyright *fdui = new FD_form_copyright; FD_form_copyright *fdui = new FD_form_copyright;
fdui->form_copyright = fl_bgn_form(FL_NO_BOX, 450, 430); fdui->form = fl_bgn_form(FL_NO_BOX, 450, 430);
fdui->form_copyright->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 450, 430, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 450, 430, "");
obj = fl_add_text(FL_NORMAL_TEXT, 10, 10, 430, 50, _("LyX is Copyright (C) 1995 by Matthias Ettrich, \n1995-2000 LyX Team")); obj = fl_add_text(FL_NORMAL_TEXT, 10, 10, 430, 50, _("LyX is Copyright (C) 1995 by Matthias Ettrich, \n1995-2000 LyX Team"));
fl_set_object_boxtype(obj, FL_FRAME_BOX); fl_set_object_boxtype(obj, FL_FRAME_BOX);
@ -38,7 +45,7 @@ FD_form_copyright * FormCopyright::build_copyright()
fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE); fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
fl_end_form(); fl_end_form();
fdui->form_copyright->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -1,4 +1,5 @@
/** Header file generated with fdesign on Wed Aug 2 13:56:56 2000.**/ // File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
/** Header file generated with fdesign **/
#ifndef FD_form_copyright_h_ #ifndef FD_form_copyright_h_
#define FD_form_copyright_h_ #define FD_form_copyright_h_
@ -9,8 +10,9 @@ extern "C" void C_FormCopyrightOKCB(FL_OBJECT *, long);
/**** Forms and Objects ****/ /**** Forms and Objects ****/
struct FD_form_copyright { struct FD_form_copyright {
~FD_form_copyright();
FL_FORM *form_copyright; FL_FORM *form;
FL_OBJECT *button_ok; FL_OBJECT *button_ok;
}; };

View File

@ -12,13 +12,20 @@
#include "bmtable.h" #include "bmtable.h"
#include "support/filetools.h" #include "support/filetools.h"
FD_form_tabbed_document::~FD_form_tabbed_document()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_tabbed_document * FormDocument::build_tabbed_document() FD_form_tabbed_document * FormDocument::build_tabbed_document()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_tabbed_document *fdui = new FD_form_tabbed_document; FD_form_tabbed_document *fdui = new FD_form_tabbed_document;
fdui->form_tabbed_document = fl_bgn_form(FL_NO_BOX, 465, 450); fdui->form = fl_bgn_form(FL_NO_BOX, 465, 450);
fdui->form_tabbed_document->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 465, 450, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 465, 450, "");
fdui->tabbed_folder = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 20, 15, 435, 365, _("Tabbed folder")); fdui->tabbed_folder = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 20, 15, 435, 365, _("Tabbed folder"));
fl_set_object_resize(obj, FL_RESIZE_ALL); fl_set_object_resize(obj, FL_RESIZE_ALL);
@ -37,19 +44,26 @@ FD_form_tabbed_document * FormDocument::build_tabbed_document()
fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE); fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_end_form(); fl_end_form();
fdui->form_tabbed_document->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_doc_paper::~FD_form_doc_paper()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_doc_paper * FormDocument::build_doc_paper() FD_form_doc_paper * FormDocument::build_doc_paper()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_doc_paper *fdui = new FD_form_doc_paper; FD_form_doc_paper *fdui = new FD_form_doc_paper;
fdui->form_doc_paper = fl_bgn_form(FL_NO_BOX, 440, 345); fdui->form = fl_bgn_form(FL_NO_BOX, 440, 345);
fdui->form_doc_paper->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, "");
obj = fl_add_frame(FL_ENGRAVED_FRAME, 230, 85, 200, 100, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 230, 85, 200, 100, "");
fl_set_object_color(obj, FL_COL1, FL_COL1); fl_set_object_color(obj, FL_COL1, FL_COL1);
@ -148,19 +162,26 @@ FD_form_doc_paper * FormDocument::build_doc_paper()
fl_set_object_lstyle(obj, FL_BOLD_STYLE); fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_end_form(); fl_end_form();
fdui->form_doc_paper->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_doc_class::~FD_form_doc_class()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_doc_class * FormDocument::build_doc_class() FD_form_doc_class * FormDocument::build_doc_class()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_doc_class *fdui = new FD_form_doc_class; FD_form_doc_class *fdui = new FD_form_doc_class;
fdui->form_doc_class = fl_bgn_form(FL_NO_BOX, 440, 345); fdui->form = fl_bgn_form(FL_NO_BOX, 440, 345);
fdui->form_doc_class->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, "");
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 300, 200, 120, 80, _("Separation")); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 300, 200, 120, 80, _("Separation"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
@ -240,19 +261,26 @@ FD_form_doc_class * FormDocument::build_doc_class()
fl_set_object_callback(obj, InputCB, 0); fl_set_object_callback(obj, InputCB, 0);
fl_end_form(); fl_end_form();
fdui->form_doc_class->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_doc_language::~FD_form_doc_language()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_doc_language * FormDocument::build_doc_language() FD_form_doc_language * FormDocument::build_doc_language()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_doc_language *fdui = new FD_form_doc_language; FD_form_doc_language *fdui = new FD_form_doc_language;
fdui->form_doc_language = fl_bgn_form(FL_NO_BOX, 440, 345); fdui->form = fl_bgn_form(FL_NO_BOX, 440, 345);
fdui->form_doc_language->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, "");
obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 40, 120, 290, 110, _("Quote Style ")); obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 40, 120, 290, 110, _("Quote Style "));
fdui->choice_inputenc = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 70, 190, 30, idex(_("Encoding:|#D"))); fdui->choice_inputenc = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 70, 190, 30, idex(_("Encoding:|#D")));
@ -278,19 +306,26 @@ FD_form_doc_language * FormDocument::build_doc_language()
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_form(); fl_end_form();
fdui->form_doc_language->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_doc_options::~FD_form_doc_options()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_doc_options * FormDocument::build_doc_options() FD_form_doc_options * FormDocument::build_doc_options()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_doc_options *fdui = new FD_form_doc_options; FD_form_doc_options *fdui = new FD_form_doc_options;
fdui->form_doc_options = fl_bgn_form(FL_NO_BOX, 440, 345); fdui->form = fl_bgn_form(FL_NO_BOX, 440, 345);
fdui->form_doc_options->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, "");
fdui->input_float_placement = obj = fl_add_input(FL_NORMAL_INPUT, 155, 60, 120, 30, idex(_("Float Placement:|#L"))); fdui->input_float_placement = obj = fl_add_input(FL_NORMAL_INPUT, 155, 60, 120, 30, idex(_("Float Placement:|#L")));
fl_set_button_shortcut(obj, scex(_("Float Placement:|#L")), 1); fl_set_button_shortcut(obj, scex(_("Float Placement:|#L")), 1);
@ -310,19 +345,26 @@ FD_form_doc_options * FormDocument::build_doc_options()
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_form(); fl_end_form();
fdui->form_doc_options->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_doc_bullet::~FD_form_doc_bullet()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_doc_bullet * FormDocument::build_doc_bullet() FD_form_doc_bullet * FormDocument::build_doc_bullet()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_doc_bullet *fdui = new FD_form_doc_bullet; FD_form_doc_bullet *fdui = new FD_form_doc_bullet;
fdui->form_doc_bullet = fl_bgn_form(FL_NO_BOX, 440, 345); fdui->form = fl_bgn_form(FL_NO_BOX, 440, 345);
fdui->form_doc_bullet->u_vdata = this; fdui->form->u_vdata = this;
fl_set_border_width(-1); fl_set_border_width(-1);
obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, "");
fl_set_border_width(-3); fl_set_border_width(-3);
@ -331,7 +373,9 @@ FD_form_doc_bullet * FormDocument::build_doc_bullet()
fl_set_object_lcol(obj, FL_BLUE); fl_set_object_lcol(obj, FL_BLUE);
fl_set_object_boxtype(obj, FL_UP_BOX); fl_set_object_boxtype(obj, FL_UP_BOX);
fl_set_bmtable_pixmap_file(obj, 6, 6, fl_set_bmtable_pixmap_file(obj, 6, 6,
LibFileSearch("images", "standard.xpm").c_str()); LibFileSearch("images",
"standard",
"xpm").c_str());
fl_set_border_width(-1); fl_set_border_width(-1);
obj = fl_add_frame(FL_ENGRAVED_FRAME, 95, 20, 255, 70, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 95, 20, 255, 70, "");
fdui->choice_bullet_size = obj = fl_add_choice(FL_NORMAL_CHOICE, 15, 45, 65, 30, idex(_("Size|#z"))); fdui->choice_bullet_size = obj = fl_add_choice(FL_NORMAL_CHOICE, 15, 45, 65, 30, idex(_("Size|#z")));
@ -344,8 +388,6 @@ FD_form_doc_bullet * FormDocument::build_doc_bullet()
fl_set_button_shortcut(obj, scex(_("LaTeX|#L")), 1); fl_set_button_shortcut(obj, scex(_("LaTeX|#L")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lstyle(obj, FL_FIXED_STYLE); fl_set_object_lstyle(obj, FL_FIXED_STYLE);
fl_set_input_return(obj, FL_RETURN_CHANGED);
fl_set_input_maxchars(obj, 80);
fl_set_object_callback(obj, InputBulletLaTeXCB, 0); fl_set_object_callback(obj, InputBulletLaTeXCB, 0);
fdui->radio_bullet_depth = fl_bgn_group(); fdui->radio_bullet_depth = fl_bgn_group();
@ -408,7 +450,7 @@ FD_form_doc_bullet * FormDocument::build_doc_bullet()
fl_end_form(); fl_end_form();
fdui->form_doc_bullet->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -1,4 +1,5 @@
/** Header file generated with fdesign on Fri Aug 11 15:45:35 2000.**/ // File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
/** Header file generated with fdesign **/
#ifndef FD_form_tabbed_document_h_ #ifndef FD_form_tabbed_document_h_
#define FD_form_tabbed_document_h_ #define FD_form_tabbed_document_h_
@ -22,16 +23,18 @@ extern "C" void BulletPanelCB(FL_OBJECT *, long);
/**** Forms and Objects ****/ /**** Forms and Objects ****/
struct FD_form_tabbed_document { struct FD_form_tabbed_document {
~FD_form_tabbed_document();
FL_FORM *form_tabbed_document; FL_FORM *form;
FL_OBJECT *tabbed_folder; FL_OBJECT *tabbed_folder;
FL_OBJECT *button_apply; FL_OBJECT *button_apply;
FL_OBJECT *button_ok; FL_OBJECT *button_ok;
FL_OBJECT *text_warning; FL_OBJECT *text_warning;
}; };
struct FD_form_doc_paper { struct FD_form_doc_paper {
~FD_form_doc_paper();
FL_FORM *form_doc_paper; FL_FORM *form;
FL_OBJECT *choice_paperpackage; FL_OBJECT *choice_paperpackage;
FL_OBJECT *greoup_radio_orientation; FL_OBJECT *greoup_radio_orientation;
FL_OBJECT *radio_portrait; FL_OBJECT *radio_portrait;
@ -50,8 +53,9 @@ struct FD_form_doc_paper {
FL_OBJECT *text_warning; FL_OBJECT *text_warning;
}; };
struct FD_form_doc_class { struct FD_form_doc_class {
~FD_form_doc_class();
FL_FORM *form_doc_class; FL_FORM *form;
FL_OBJECT *choice_doc_fonts; FL_OBJECT *choice_doc_fonts;
FL_OBJECT *choice_doc_fontsize; FL_OBJECT *choice_doc_fontsize;
FL_OBJECT *choice_doc_class; FL_OBJECT *choice_doc_class;
@ -72,8 +76,9 @@ struct FD_form_doc_class {
FL_OBJECT *input_doc_spacing; FL_OBJECT *input_doc_spacing;
}; };
struct FD_form_doc_language { struct FD_form_doc_language {
~FD_form_doc_language();
FL_FORM *form_doc_language; FL_FORM *form;
FL_OBJECT *choice_inputenc; FL_OBJECT *choice_inputenc;
FL_OBJECT *choice_quotes_language; FL_OBJECT *choice_quotes_language;
FL_OBJECT *radio_single; FL_OBJECT *radio_single;
@ -81,8 +86,9 @@ struct FD_form_doc_language {
FL_OBJECT *choice_language; FL_OBJECT *choice_language;
}; };
struct FD_form_doc_options { struct FD_form_doc_options {
~FD_form_doc_options();
FL_FORM *form_doc_options; FL_FORM *form;
FL_OBJECT *input_float_placement; FL_OBJECT *input_float_placement;
FL_OBJECT *slider_secnumdepth; FL_OBJECT *slider_secnumdepth;
FL_OBJECT *slider_tocdepth; FL_OBJECT *slider_tocdepth;
@ -90,8 +96,9 @@ struct FD_form_doc_options {
FL_OBJECT *check_use_amsmath; FL_OBJECT *check_use_amsmath;
}; };
struct FD_form_doc_bullet { struct FD_form_doc_bullet {
~FD_form_doc_bullet();
FL_FORM *form_doc_bullet; FL_FORM *form;
FL_OBJECT *bmtable_bullet_panel; FL_OBJECT *bmtable_bullet_panel;
FL_OBJECT *choice_bullet_size; FL_OBJECT *choice_bullet_size;
FL_OBJECT *input_bullet_latex; FL_OBJECT *input_bullet_latex;

View File

@ -1,6 +1,5 @@
// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext // File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
#include <config.h> #include <config.h>
#include "lyx_gui_misc.h" #include "lyx_gui_misc.h"
#include "gettext.h" #include "gettext.h"
@ -11,13 +10,20 @@
#include "form_graphics.h" #include "form_graphics.h"
#include "FormGraphics.h" #include "FormGraphics.h"
FD_form_graphics::~FD_form_graphics()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_graphics * FormGraphics::build_graphics() FD_form_graphics * FormGraphics::build_graphics()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_graphics *fdui = new FD_form_graphics; FD_form_graphics *fdui = new FD_form_graphics;
fdui->form_graphics = fl_bgn_form(FL_NO_BOX, 410, 390); fdui->form = fl_bgn_form(FL_NO_BOX, 410, 390);
fdui->form_graphics->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 410, 390, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 410, 390, "");
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_resize(obj, FL_RESIZE_NONE); fl_set_object_resize(obj, FL_RESIZE_NONE);
@ -98,8 +104,9 @@ FD_form_graphics * FormGraphics::build_graphics()
fl_set_object_callback(obj, C_FormGraphicsInputCB, 0); fl_set_object_callback(obj, C_FormGraphicsInputCB, 0);
fl_end_form(); fl_end_form();
fdui->form_graphics->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/

View File

@ -1,4 +1,5 @@
/** Header file generated with fdesign on Wed Aug 2 13:56:57 2000.**/ // File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
/** Header file generated with fdesign **/
#ifndef FD_form_graphics_h_ #ifndef FD_form_graphics_h_
#define FD_form_graphics_h_ #define FD_form_graphics_h_
@ -13,8 +14,9 @@ extern "C" void C_FormGraphicsCancelCB(FL_OBJECT *, long);
/**** Forms and Objects ****/ /**** Forms and Objects ****/
struct FD_form_graphics { struct FD_form_graphics {
~FD_form_graphics();
FL_FORM *form_graphics; FL_FORM *form;
FL_OBJECT *input_filename; FL_OBJECT *input_filename;
FL_OBJECT *button_browse; FL_OBJECT *button_browse;
FL_OBJECT *input_width; FL_OBJECT *input_width;

View File

@ -10,13 +10,20 @@
#include "form_index.h" #include "form_index.h"
#include "FormIndex.h" #include "FormIndex.h"
FD_form_index::~FD_form_index()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_index * FormIndex::build_index() FD_form_index * FormIndex::build_index()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_index *fdui = new FD_form_index; FD_form_index *fdui = new FD_form_index;
fdui->form_index = fl_bgn_form(FL_NO_BOX, 520, 100); fdui->form = fl_bgn_form(FL_NO_BOX, 520, 100);
fdui->form_index->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 520, 100, ""); 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")); 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_input_shortcut(obj, scex(_("Keyword|#K#k")), 1);
@ -32,7 +39,7 @@ FD_form_index * FormIndex::build_index()
fl_set_object_callback(obj, C_FormCommandOKCB, 0); fl_set_object_callback(obj, C_FormCommandOKCB, 0);
fl_end_form(); fl_end_form();
fdui->form_index->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -1,4 +1,5 @@
/** Header file generated with fdesign on Thu Aug 3 11:33:50 2000.**/ // File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
/** Header file generated with fdesign **/
#ifndef FD_form_index_h_ #ifndef FD_form_index_h_
#define FD_form_index_h_ #define FD_form_index_h_
@ -10,8 +11,9 @@ extern "C" void C_FormCommandOKCB(FL_OBJECT *, long);
/**** Forms and Objects ****/ /**** Forms and Objects ****/
struct FD_form_index { struct FD_form_index {
~FD_form_index();
FL_FORM *form_index; FL_FORM *form;
FL_OBJECT *key; FL_OBJECT *key;
FL_OBJECT *cancel; FL_OBJECT *cancel;
FL_OBJECT *ok; FL_OBJECT *ok;

View File

@ -10,13 +10,20 @@
#include "form_preferences.h" #include "form_preferences.h"
#include "FormPreferences.h" #include "FormPreferences.h"
FD_form_bind::~FD_form_bind()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_bind * FormPreferences::build_bind() FD_form_bind * FormPreferences::build_bind()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_bind *fdui = new FD_form_bind; FD_form_bind *fdui = new FD_form_bind;
fdui->form_bind = fl_bgn_form(FL_NO_BOX, 450, 320); fdui->form = fl_bgn_form(FL_NO_BOX, 450, 320);
fdui->form_bind->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, ""); obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, "");
fdui->input_bind = obj = fl_add_input(FL_NORMAL_INPUT, 145, 80, 190, 30, _("Bind file")); fdui->input_bind = obj = fl_add_input(FL_NORMAL_INPUT, 145, 80, 190, 30, _("Bind file"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
@ -25,19 +32,26 @@ FD_form_bind * FormPreferences::build_bind()
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_form(); fl_end_form();
fdui->form_bind->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_misc::~FD_form_misc()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_misc * FormPreferences::build_misc() FD_form_misc * FormPreferences::build_misc()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_misc *fdui = new FD_form_misc; FD_form_misc *fdui = new FD_form_misc;
fdui->form_misc = fl_bgn_form(FL_NO_BOX, 450, 320); fdui->form = fl_bgn_form(FL_NO_BOX, 450, 320);
fdui->form_misc->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, ""); obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, "");
fdui->check_banner = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 30, 240, 30, _("Show banner")); fdui->check_banner = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 30, 240, 30, _("Show banner"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
@ -73,19 +87,26 @@ FD_form_misc * FormPreferences::build_misc()
fl_set_counter_step(obj, 1, 1); fl_set_counter_step(obj, 1, 1);
fl_end_form(); fl_end_form();
fdui->form_misc->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_screen_fonts::~FD_form_screen_fonts()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_screen_fonts * FormPreferences::build_screen_fonts() FD_form_screen_fonts * FormPreferences::build_screen_fonts()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_screen_fonts *fdui = new FD_form_screen_fonts; FD_form_screen_fonts *fdui = new FD_form_screen_fonts;
fdui->form_screen_fonts = fl_bgn_form(FL_NO_BOX, 450, 320); fdui->form = fl_bgn_form(FL_NO_BOX, 450, 320);
fdui->form_screen_fonts->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, ""); obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, "");
fdui->input_roman = obj = fl_add_input(FL_NORMAL_INPUT, 210, 5, 200, 30, _("Roman")); fdui->input_roman = obj = fl_add_input(FL_NORMAL_INPUT, 210, 5, 200, 30, _("Roman"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
@ -108,7 +129,7 @@ FD_form_screen_fonts * FormPreferences::build_screen_fonts()
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormPreferencesInputCB, 0); fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
fl_set_button(obj, 1); fl_set_button(obj, 1);
fdui->input_encoding = obj = fl_add_input(FL_NORMAL_INPUT, 210, 95, 200, 30, _("Encoding")); fdui->input_screen_encoding = obj = fl_add_input(FL_NORMAL_INPUT, 210, 95, 200, 30, _("Encoding"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormPreferencesInputCB, 0); fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
fdui->input_tiny = obj = fl_add_input(FL_FLOAT_INPUT, 140, 165, 70, 30, _("tiny")); fdui->input_tiny = obj = fl_add_input(FL_FLOAT_INPUT, 140, 165, 70, 30, _("tiny"));
@ -143,19 +164,26 @@ FD_form_screen_fonts * FormPreferences::build_screen_fonts()
fl_set_object_callback(obj, C_FormPreferencesInputCB, 0); fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
fl_end_form(); fl_end_form();
fdui->form_screen_fonts->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_interface_fonts::~FD_form_interface_fonts()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_interface_fonts * FormPreferences::build_interface_fonts() FD_form_interface_fonts * FormPreferences::build_interface_fonts()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_interface_fonts *fdui = new FD_form_interface_fonts; FD_form_interface_fonts *fdui = new FD_form_interface_fonts;
fdui->form_interface_fonts = fl_bgn_form(FL_NO_BOX, 450, 320); fdui->form = fl_bgn_form(FL_NO_BOX, 450, 320);
fdui->form_interface_fonts->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, ""); obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, "");
fdui->input_popup_font = obj = fl_add_input(FL_NORMAL_INPUT, 215, 50, 200, 30, _("Popup")); fdui->input_popup_font = obj = fl_add_input(FL_NORMAL_INPUT, 215, 50, 200, 30, _("Popup"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
@ -163,24 +191,31 @@ FD_form_interface_fonts * FormPreferences::build_interface_fonts()
fdui->input_menu_font = obj = fl_add_input(FL_NORMAL_INPUT, 215, 80, 200, 30, _("Menu")); fdui->input_menu_font = obj = fl_add_input(FL_NORMAL_INPUT, 215, 80, 200, 30, _("Menu"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormPreferencesInputCB, 0); fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
fdui->input_encoding = obj = fl_add_input(FL_NORMAL_INPUT, 215, 110, 200, 30, _("Encoding")); fdui->input_popup_encoding = obj = fl_add_input(FL_NORMAL_INPUT, 215, 110, 200, 30, _("Encoding"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormPreferencesInputCB, 0); fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
fl_end_form(); fl_end_form();
fdui->form_interface_fonts->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_printer::~FD_form_printer()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_printer * FormPreferences::build_printer() FD_form_printer * FormPreferences::build_printer()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_printer *fdui = new FD_form_printer; FD_form_printer *fdui = new FD_form_printer;
fdui->form_printer = fl_bgn_form(FL_NO_BOX, 450, 320); fdui->form = fl_bgn_form(FL_NO_BOX, 450, 320);
fdui->form_printer->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, ""); obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, "");
fdui->input_command = obj = fl_add_input(FL_NORMAL_INPUT, 130, 60, 80, 30, _("command")); fdui->input_command = obj = fl_add_input(FL_NORMAL_INPUT, 130, 60, 80, 30, _("command"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
@ -238,19 +273,26 @@ FD_form_printer * FormPreferences::build_printer()
fl_set_object_callback(obj, C_FormPreferencesInputCB, 0); fl_set_object_callback(obj, C_FormPreferencesInputCB, 0);
fl_end_form(); fl_end_form();
fdui->form_printer->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_paths::~FD_form_paths()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_paths * FormPreferences::build_paths() FD_form_paths * FormPreferences::build_paths()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_paths *fdui = new FD_form_paths; FD_form_paths *fdui = new FD_form_paths;
fdui->form_paths = fl_bgn_form(FL_NO_BOX, 450, 320); fdui->form = fl_bgn_form(FL_NO_BOX, 450, 320);
fdui->form_paths->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, ""); obj = fl_add_box(FL_FLAT_BOX, 0, 0, 450, 320, "");
fdui->input_default_path = obj = fl_add_input(FL_NORMAL_INPUT, 170, 10, 170, 30, _("Default path")); fdui->input_default_path = obj = fl_add_input(FL_NORMAL_INPUT, 170, 10, 170, 30, _("Default path"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
@ -300,36 +342,47 @@ FD_form_paths * FormPreferences::build_paths()
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_form(); fl_end_form();
fdui->form_paths->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_preferences::~FD_form_preferences()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_preferences * FormPreferences::build_preferences() FD_form_preferences * FormPreferences::build_preferences()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_preferences *fdui = new FD_form_preferences; FD_form_preferences *fdui = new FD_form_preferences;
fdui->form_preferences = fl_bgn_form(FL_NO_BOX, 460, 435); fdui->form = fl_bgn_form(FL_NO_BOX, 475, 435);
fdui->form_preferences->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 460, 435, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 475, 435, "");
fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 250, 395, 90, 30, idex(_("Apply|#A"))); fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 275, 395, 90, 30, idex(_("Apply|#A")));
fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1); fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormPreferencesApplyCB, 0); fl_set_object_callback(obj, C_FormPreferencesApplyCB, 0);
fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 350, 395, 90, 30, idex(_("Cancel|^["))); fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 375, 395, 90, 30, idex(_("Cancel|^[")));
fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1); fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormPreferencesCancelCB, 0); fl_set_object_callback(obj, C_FormPreferencesCancelCB, 0);
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 150, 395, 90, 30, _("Ok")); fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 175, 395, 90, 30, _("Ok"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormPreferencesOKCB, 0); fl_set_object_callback(obj, C_FormPreferencesOKCB, 0);
fdui->tabfolder_prefs = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 5, 5, 450, 385, ""); fdui->tabfolder_prefs = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 5, 5, 450, 385, "");
fl_set_object_boxtype(obj, FL_FLAT_BOX); fl_set_object_boxtype(obj, FL_FLAT_BOX);
fdui->button_restore = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 395, 90, 30, idex(_("Restore|#R")));
fl_set_button_shortcut(obj, scex(_("Restore|#R")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_FormPreferencesRestoreCB, 0);
fl_end_form(); fl_end_form();
fdui->form_preferences->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -1,4 +1,5 @@
/** Header file generated with fdesign on Wed Aug 2 13:56:57 2000.**/ // File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
/** Header file generated with fdesign **/
#ifndef FD_form_bind_h_ #ifndef FD_form_bind_h_
#define FD_form_bind_h_ #define FD_form_bind_h_
@ -19,18 +20,21 @@ extern "C" void C_FormPreferencesInputCB(FL_OBJECT *, long);
extern "C" void C_FormPreferencesApplyCB(FL_OBJECT *, long); extern "C" void C_FormPreferencesApplyCB(FL_OBJECT *, long);
extern "C" void C_FormPreferencesCancelCB(FL_OBJECT *, long); extern "C" void C_FormPreferencesCancelCB(FL_OBJECT *, long);
extern "C" void C_FormPreferencesOKCB(FL_OBJECT *, long); extern "C" void C_FormPreferencesOKCB(FL_OBJECT *, long);
extern "C" void C_FormPreferencesRestoreCB(FL_OBJECT *, long);
/**** Forms and Objects ****/ /**** Forms and Objects ****/
struct FD_form_bind { struct FD_form_bind {
~FD_form_bind();
FL_FORM *form_bind; FL_FORM *form;
FL_OBJECT *input_bind; FL_OBJECT *input_bind;
FL_OBJECT *button_bind_file_browse; FL_OBJECT *button_bind_file_browse;
}; };
struct FD_form_misc { struct FD_form_misc {
~FD_form_misc();
FL_FORM *form_misc; FL_FORM *form;
FL_OBJECT *check_banner; FL_OBJECT *check_banner;
FL_OBJECT *check_auto_region_delete; FL_OBJECT *check_auto_region_delete;
FL_OBJECT *check_exit_confirm; FL_OBJECT *check_exit_confirm;
@ -39,14 +43,15 @@ struct FD_form_misc {
FL_OBJECT *counter_line_len; FL_OBJECT *counter_line_len;
}; };
struct FD_form_screen_fonts { struct FD_form_screen_fonts {
~FD_form_screen_fonts();
FL_FORM *form_screen_fonts; FL_FORM *form;
FL_OBJECT *input_roman; FL_OBJECT *input_roman;
FL_OBJECT *input_sans; FL_OBJECT *input_sans;
FL_OBJECT *input_typewriter; FL_OBJECT *input_typewriter;
FL_OBJECT *counter_zoom; FL_OBJECT *counter_zoom;
FL_OBJECT *check_scalable; FL_OBJECT *check_scalable;
FL_OBJECT *input_encoding; FL_OBJECT *input_screen_encoding;
FL_OBJECT *input_tiny; FL_OBJECT *input_tiny;
FL_OBJECT *input_script; FL_OBJECT *input_script;
FL_OBJECT *input_footnote; FL_OBJECT *input_footnote;
@ -59,15 +64,17 @@ struct FD_form_screen_fonts {
FL_OBJECT *input_huger; FL_OBJECT *input_huger;
}; };
struct FD_form_interface_fonts { struct FD_form_interface_fonts {
~FD_form_interface_fonts();
FL_FORM *form_interface_fonts; FL_FORM *form;
FL_OBJECT *input_popup_font; FL_OBJECT *input_popup_font;
FL_OBJECT *input_menu_font; FL_OBJECT *input_menu_font;
FL_OBJECT *input_encoding; FL_OBJECT *input_popup_encoding;
}; };
struct FD_form_printer { struct FD_form_printer {
~FD_form_printer();
FL_FORM *form_printer; FL_FORM *form;
FL_OBJECT *input_command; FL_OBJECT *input_command;
FL_OBJECT *input_page_range; FL_OBJECT *input_page_range;
FL_OBJECT *input_copies; FL_OBJECT *input_copies;
@ -88,8 +95,9 @@ struct FD_form_printer {
FL_OBJECT *check_adapt_output; FL_OBJECT *check_adapt_output;
}; };
struct FD_form_paths { struct FD_form_paths {
~FD_form_paths();
FL_FORM *form_paths; FL_FORM *form;
FL_OBJECT *input_default_path; FL_OBJECT *input_default_path;
FL_OBJECT *button_document_browse; FL_OBJECT *button_document_browse;
FL_OBJECT *counter_lastfiles; FL_OBJECT *counter_lastfiles;
@ -106,12 +114,14 @@ struct FD_form_paths {
FL_OBJECT *button_backup_path_browse; FL_OBJECT *button_backup_path_browse;
}; };
struct FD_form_preferences { struct FD_form_preferences {
~FD_form_preferences();
FL_FORM *form_preferences; FL_FORM *form;
FL_OBJECT *button_apply; FL_OBJECT *button_apply;
FL_OBJECT *button_cancel; FL_OBJECT *button_cancel;
FL_OBJECT *button_ok; FL_OBJECT *button_ok;
FL_OBJECT *tabfolder_prefs; FL_OBJECT *tabfolder_prefs;
FL_OBJECT *button_restore;
}; };
#endif /* FD_form_bind_h_ */ #endif /* FD_form_bind_h_ */

View File

@ -10,13 +10,20 @@
#include "form_print.h" #include "form_print.h"
#include "FormPrint.h" #include "FormPrint.h"
FD_form_print::~FD_form_print()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_print * FormPrint::build_print() FD_form_print * FormPrint::build_print()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_print *fdui = new FD_form_print; FD_form_print *fdui = new FD_form_print;
fdui->form_print = fl_bgn_form(FL_NO_BOX, 340, 360); fdui->form = fl_bgn_form(FL_NO_BOX, 340, 360);
fdui->form_print->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 340, 360, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 340, 360, "");
obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 215, 320, 90, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 215, 320, 90, "");
fl_set_object_color(obj, FL_COL1, FL_COL1); fl_set_object_color(obj, FL_COL1, FL_COL1);
@ -115,7 +122,7 @@ FD_form_print * FormPrint::build_print()
fl_set_object_callback(obj, C_FormPrintInputCB, 0); fl_set_object_callback(obj, C_FormPrintInputCB, 0);
fl_end_form(); fl_end_form();
fdui->form_print->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -1,4 +1,5 @@
/** Header file generated with fdesign on Wed Aug 2 13:56:57 2000.**/ // File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
/** Header file generated with fdesign **/
#ifndef FD_form_print_h_ #ifndef FD_form_print_h_
#define FD_form_print_h_ #define FD_form_print_h_
@ -12,8 +13,9 @@ extern "C" void C_FormPrintCancelCB(FL_OBJECT *, long);
/**** Forms and Objects ****/ /**** Forms and Objects ****/
struct FD_form_print { struct FD_form_print {
~FD_form_print();
FL_FORM *form_print; FL_FORM *form;
FL_OBJECT *input_printer; FL_OBJECT *input_printer;
FL_OBJECT *input_file; FL_OBJECT *input_file;
FL_OBJECT *group_radio_printto; FL_OBJECT *group_radio_printto;

View File

@ -10,13 +10,20 @@
#include "form_ref.h" #include "form_ref.h"
#include "FormRef.h" #include "FormRef.h"
FD_form_ref::~FD_form_ref()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_ref * FormRef::build_ref() FD_form_ref * FormRef::build_ref()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_ref *fdui = new FD_form_ref; FD_form_ref *fdui = new FD_form_ref;
fdui->form_ref = fl_bgn_form(FL_NO_BOX, 530, 340); fdui->form = fl_bgn_form(FL_NO_BOX, 530, 340);
fdui->form_ref->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 530, 340, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 530, 340, "");
fdui->browser = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 10, 270, 280, ""); fdui->browser = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 10, 270, 280, "");
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity); fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
@ -52,7 +59,7 @@ FD_form_ref * FormRef::build_ref()
fl_set_object_callback(obj, C_FormCommandCancelCB, 0); fl_set_object_callback(obj, C_FormCommandCancelCB, 0);
fl_end_form(); fl_end_form();
fdui->form_ref->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -1,4 +1,5 @@
/** Header file generated with fdesign on Mon Aug 7 17:11:47 2000.**/ // File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
/** Header file generated with fdesign **/
#ifndef FD_form_ref_h_ #ifndef FD_form_ref_h_
#define FD_form_ref_h_ #define FD_form_ref_h_
@ -11,8 +12,9 @@ extern "C" void C_FormCommandCancelCB(FL_OBJECT *, long);
/**** Forms and Objects ****/ /**** Forms and Objects ****/
struct FD_form_ref { struct FD_form_ref {
~FD_form_ref();
FL_FORM *form_ref; FL_FORM *form;
FL_OBJECT *browser; FL_OBJECT *browser;
FL_OBJECT *update; FL_OBJECT *update;
FL_OBJECT *sort; FL_OBJECT *sort;

View File

@ -10,13 +10,20 @@
#include "form_tabular.h" #include "form_tabular.h"
#include "FormTabular.h" #include "FormTabular.h"
FD_form_tabular::~FD_form_tabular()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_tabular * FormTabular::build_tabular() FD_form_tabular * FormTabular::build_tabular()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_tabular *fdui = new FD_form_tabular; FD_form_tabular *fdui = new FD_form_tabular;
fdui->form_tabular = fl_bgn_form(FL_NO_BOX, 510, 295); fdui->form = fl_bgn_form(FL_NO_BOX, 510, 295);
fdui->form_tabular->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_FLAT_BOX, 0, 0, 510, 295, ""); obj = fl_add_box(FL_FLAT_BOX, 0, 0, 510, 295, "");
fdui->tabFolder = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 0, 0, 505, 250, _("Tabbed folder")); fdui->tabFolder = obj = fl_add_tabfolder(FL_TOP_TABFOLDER, 0, 0, 505, 250, _("Tabbed folder"));
fl_set_object_resize(obj, FL_RESIZE_ALL); fl_set_object_resize(obj, FL_RESIZE_ALL);
@ -36,19 +43,26 @@ FD_form_tabular * FormTabular::build_tabular()
fl_set_object_lstyle(obj, FL_BOLD_STYLE); fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_end_form(); fl_end_form();
fdui->form_tabular->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_tabular_options::~FD_form_tabular_options()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_tabular_options * FormTabular::build_tabular_options() FD_form_tabular_options * FormTabular::build_tabular_options()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_tabular_options *fdui = new FD_form_tabular_options; FD_form_tabular_options *fdui = new FD_form_tabular_options;
fdui->form_tabular_options = fl_bgn_form(FL_NO_BOX, 505, 227); fdui->form = fl_bgn_form(FL_NO_BOX, 505, 227);
fdui->form_tabular_options->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 505, 227, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 505, 227, "");
obj = fl_add_frame(FL_ENGRAVED_FRAME, 280, 20, 120, 75, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 280, 20, 120, 75, "");
fl_set_object_color(obj, FL_COL1, FL_COL1); fl_set_object_color(obj, FL_COL1, FL_COL1);
@ -87,19 +101,26 @@ FD_form_tabular_options * FormTabular::build_tabular_options()
fl_set_object_lstyle(obj, FL_BOLD_STYLE); fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_end_form(); fl_end_form();
fdui->form_tabular_options->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_column_options::~FD_form_column_options()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_column_options * FormTabular::build_column_options() FD_form_column_options * FormTabular::build_column_options()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_column_options *fdui = new FD_form_column_options; FD_form_column_options *fdui = new FD_form_column_options;
fdui->form_column_options = fl_bgn_form(FL_NO_BOX, 505, 227); fdui->form = fl_bgn_form(FL_NO_BOX, 505, 227);
fdui->form_column_options->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 505, 227, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 505, 227, "");
obj = fl_add_frame(FL_ENGRAVED_FRAME, 20, 20, 170, 105, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 20, 20, 170, 105, "");
fl_set_object_color(obj, FL_COL1, FL_COL1); fl_set_object_color(obj, FL_COL1, FL_COL1);
@ -179,19 +200,26 @@ FD_form_column_options * FormTabular::build_column_options()
fl_set_object_callback(obj, C_FormTabularInputCB, 0); fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fl_end_form(); fl_end_form();
fdui->form_column_options->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_cell_options::~FD_form_cell_options()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_cell_options * FormTabular::build_cell_options() FD_form_cell_options * FormTabular::build_cell_options()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_cell_options *fdui = new FD_form_cell_options; FD_form_cell_options *fdui = new FD_form_cell_options;
fdui->form_cell_options = fl_bgn_form(FL_NO_BOX, 505, 227); fdui->form = fl_bgn_form(FL_NO_BOX, 505, 227);
fdui->form_cell_options->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 505, 227, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 505, 227, "");
obj = fl_add_frame(FL_ENGRAVED_FRAME, 335, 115, 155, 100, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 335, 115, 155, 100, "");
obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 115, 180, 100, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 115, 180, 100, "");
@ -283,19 +311,26 @@ FD_form_cell_options * FormTabular::build_cell_options()
fl_set_object_callback(obj, C_FormTabularInputCB, 0); fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fl_end_form(); fl_end_form();
fdui->form_cell_options->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_longtable_options::~FD_form_longtable_options()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_longtable_options * FormTabular::build_longtable_options() FD_form_longtable_options * FormTabular::build_longtable_options()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_longtable_options *fdui = new FD_form_longtable_options; FD_form_longtable_options *fdui = new FD_form_longtable_options;
fdui->form_longtable_options = fl_bgn_form(FL_NO_BOX, 505, 227); fdui->form = fl_bgn_form(FL_NO_BOX, 505, 227);
fdui->form_longtable_options->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 505, 227, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 505, 227, "");
obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 20, 100, 75, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 20, 100, 75, "");
obj = fl_add_text(FL_NORMAL_TEXT, 15, 10, 85, 20, _("Header")); obj = fl_add_text(FL_NORMAL_TEXT, 15, 10, 85, 20, _("Header"));
@ -324,19 +359,26 @@ FD_form_longtable_options * FormTabular::build_longtable_options()
fl_set_object_callback(obj, C_FormTabularInputCB, 0); fl_set_object_callback(obj, C_FormTabularInputCB, 0);
fl_end_form(); fl_end_form();
fdui->form_longtable_options->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_create_tabular::~FD_form_create_tabular()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_create_tabular * FormTabular::build_create_tabular() FD_form_create_tabular * FormTabular::build_create_tabular()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_create_tabular *fdui = new FD_form_create_tabular; FD_form_create_tabular *fdui = new FD_form_create_tabular;
fdui->form_create_tabular = fl_bgn_form(FL_NO_BOX, 310, 130); fdui->form = fl_bgn_form(FL_NO_BOX, 310, 130);
fdui->form_create_tabular->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 310, 130, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 310, 130, "");
fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 10, 90, 90, 30, _("OK")); fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 10, 90, 90, 30, _("OK"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_set_object_lsize(obj, FL_NORMAL_SIZE);
@ -359,7 +401,7 @@ FD_form_create_tabular * FormTabular::build_create_tabular()
fl_set_object_resize(obj, FL_RESIZE_X); fl_set_object_resize(obj, FL_RESIZE_X);
fl_end_form(); fl_end_form();
fdui->form_create_tabular->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -1,4 +1,5 @@
/** Header file generated with fdesign on Tue Aug 1 15:15:57 2000.**/ // File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
/** Header file generated with fdesign **/
#ifndef FD_form_tabular_h_ #ifndef FD_form_tabular_h_
#define FD_form_tabular_h_ #define FD_form_tabular_h_
@ -21,8 +22,9 @@ extern "C" void C_FormTabularCancelCB(FL_OBJECT *, long);
/**** Forms and Objects ****/ /**** Forms and Objects ****/
struct FD_form_tabular { struct FD_form_tabular {
~FD_form_tabular();
FL_FORM *form_tabular; FL_FORM *form;
FL_OBJECT *tabFolder; FL_OBJECT *tabFolder;
FL_OBJECT *button_close; FL_OBJECT *button_close;
FL_OBJECT *input_tabular_column; FL_OBJECT *input_tabular_column;
@ -30,8 +32,9 @@ struct FD_form_tabular {
FL_OBJECT *text_warning; FL_OBJECT *text_warning;
}; };
struct FD_form_tabular_options { struct FD_form_tabular_options {
~FD_form_tabular_options();
FL_FORM *form_tabular_options; FL_FORM *form;
FL_OBJECT *button_append_column; FL_OBJECT *button_append_column;
FL_OBJECT *button_delete_column; FL_OBJECT *button_delete_column;
FL_OBJECT *button_append_row; FL_OBJECT *button_append_row;
@ -42,8 +45,9 @@ struct FD_form_tabular_options {
FL_OBJECT *radio_rotate_tabular; FL_OBJECT *radio_rotate_tabular;
}; };
struct FD_form_column_options { struct FD_form_column_options {
~FD_form_column_options();
FL_FORM *form_column_options; FL_FORM *form;
FL_OBJECT *radio_border_top; FL_OBJECT *radio_border_top;
FL_OBJECT *radio_border_bottom; FL_OBJECT *radio_border_bottom;
FL_OBJECT *radio_border_left; FL_OBJECT *radio_border_left;
@ -58,8 +62,9 @@ struct FD_form_column_options {
FL_OBJECT *radio_valign_bottom; FL_OBJECT *radio_valign_bottom;
}; };
struct FD_form_cell_options { struct FD_form_cell_options {
~FD_form_cell_options();
FL_FORM *form_cell_options; FL_FORM *form;
FL_OBJECT *radio_multicolumn; FL_OBJECT *radio_multicolumn;
FL_OBJECT *radio_rotate_cell; FL_OBJECT *radio_rotate_cell;
FL_OBJECT *input_special_multialign; FL_OBJECT *input_special_multialign;
@ -77,8 +82,9 @@ struct FD_form_cell_options {
FL_OBJECT *radio_useminipage; FL_OBJECT *radio_useminipage;
}; };
struct FD_form_longtable_options { struct FD_form_longtable_options {
~FD_form_longtable_options();
FL_FORM *form_longtable_options; FL_FORM *form;
FL_OBJECT *radio_lt_firsthead; FL_OBJECT *radio_lt_firsthead;
FL_OBJECT *radio_lt_head; FL_OBJECT *radio_lt_head;
FL_OBJECT *radio_lt_foot; FL_OBJECT *radio_lt_foot;
@ -86,8 +92,9 @@ struct FD_form_longtable_options {
FL_OBJECT *radio_lt_newpage; FL_OBJECT *radio_lt_newpage;
}; };
struct FD_form_create_tabular { struct FD_form_create_tabular {
~FD_form_create_tabular();
FL_FORM *form_create_tabular; FL_FORM *form;
FL_OBJECT *button_ok; FL_OBJECT *button_ok;
FL_OBJECT *button_apply; FL_OBJECT *button_apply;
FL_OBJECT *button_cancel; FL_OBJECT *button_cancel;

View File

@ -10,13 +10,20 @@
#include "form_toc.h" #include "form_toc.h"
#include "FormToc.h" #include "FormToc.h"
FD_form_toc::~FD_form_toc()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_toc * FormToc::build_toc() FD_form_toc * FormToc::build_toc()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_toc *fdui = new FD_form_toc; FD_form_toc *fdui = new FD_form_toc;
fdui->form_toc = fl_bgn_form(FL_NO_BOX, 420, 340); fdui->form = fl_bgn_form(FL_NO_BOX, 420, 340);
fdui->form_toc->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 420, 340, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 420, 340, "");
fdui->browser = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 10, 400, 280, ""); fdui->browser = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 10, 400, 280, "");
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast); fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
@ -37,7 +44,7 @@ FD_form_toc * FormToc::build_toc()
fl_set_object_callback(obj, C_FormCommandApplyCB, 0); fl_set_object_callback(obj, C_FormCommandApplyCB, 0);
fl_end_form(); fl_end_form();
fdui->form_toc->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -1,4 +1,5 @@
/** Header file generated with fdesign on Wed Aug 2 13:56:57 2000.**/ // File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
/** Header file generated with fdesign **/
#ifndef FD_form_toc_h_ #ifndef FD_form_toc_h_
#define FD_form_toc_h_ #define FD_form_toc_h_
@ -10,8 +11,9 @@ extern "C" void C_FormCommandCancelCB(FL_OBJECT *, long);
/**** Forms and Objects ****/ /**** Forms and Objects ****/
struct FD_form_toc { struct FD_form_toc {
~FD_form_toc();
FL_FORM *form_toc; FL_FORM *form;
FL_OBJECT *browser; FL_OBJECT *browser;
FL_OBJECT *type; FL_OBJECT *type;
}; };

View File

@ -10,13 +10,20 @@
#include "form_url.h" #include "form_url.h"
#include "FormUrl.h" #include "FormUrl.h"
FD_form_url::~FD_form_url()
{
if( form->visible ) fl_hide_form( form );
fl_free_form( form );
}
FD_form_url * FormUrl::build_url() FD_form_url * FormUrl::build_url()
{ {
FL_OBJECT *obj; FL_OBJECT *obj;
FD_form_url *fdui = new FD_form_url; FD_form_url *fdui = new FD_form_url;
fdui->form_url = fl_bgn_form(FL_NO_BOX, 520, 140); fdui->form = fl_bgn_form(FL_NO_BOX, 520, 140);
fdui->form_url->u_vdata = this; fdui->form->u_vdata = this;
obj = fl_add_box(FL_UP_BOX, 0, 0, 520, 140, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 520, 140, "");
fdui->url = obj = fl_add_input(FL_NORMAL_INPUT, 70, 20, 440, 30, _("URL")); fdui->url = obj = fl_add_input(FL_NORMAL_INPUT, 70, 20, 440, 30, _("URL"));
fl_set_input_shortcut(obj, scex(_("Url|#U")), 1); fl_set_input_shortcut(obj, scex(_("Url|#U")), 1);
@ -43,7 +50,7 @@ FD_form_url * FormUrl::build_url()
fl_set_object_callback(obj, C_FormCommandOKCB, 0); fl_set_object_callback(obj, C_FormCommandOKCB, 0);
fl_end_form(); fl_end_form();
fdui->form_url->fdui = fdui; fdui->form->fdui = fdui;
return fdui; return fdui;
} }

View File

@ -1,4 +1,5 @@
/** Header file generated with fdesign on Wed Aug 2 13:56:57 2000.**/ // File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
/** Header file generated with fdesign **/
#ifndef FD_form_url_h_ #ifndef FD_form_url_h_
#define FD_form_url_h_ #define FD_form_url_h_
@ -10,8 +11,9 @@ extern "C" void C_FormCommandOKCB(FL_OBJECT *, long);
/**** Forms and Objects ****/ /**** Forms and Objects ****/
struct FD_form_url { struct FD_form_url {
~FD_form_url();
FL_FORM *form_url; FL_FORM *form;
FL_OBJECT *url; FL_OBJECT *url;
FL_OBJECT *name; FL_OBJECT *name;
FL_OBJECT *radio_html; FL_OBJECT *radio_html;

View File

@ -3,109 +3,58 @@
# NOTE: This is NOT the same fdfix.sh as in ${top_srcdir}/forms # NOTE: This is NOT the same fdfix.sh as in ${top_srcdir}/forms
# It is a modified version to suit use for gui-indep. # It is a modified version to suit use for gui-indep.
# #
if [ "$1" = "$2" ]; then
echo "Input and Output file can not be the same."
exit 1
fi
if [ -f $2 ]; then
echo "Output file already exists, overwrite?"
read
if [ "$REPLY" != "y" ]; then
exit 0
fi
fi
if [ ! -f $1 ]; then if [ ! -f $1 ]; then
echo "Input file does not exist, can not continue" echo "Input file does not exist. Cannot continue"
exit 1 exit 1
fi fi
# If there is a patch for the inputfile patch the input file with it. FDESIGN=fdesign
if [ -f "$1.patch" ]; then base=`basename $1 .fd`
echo "Patching $1 with $1.patch"
patch -s $1 < "$1.patch" if [ $1 = $base ]; then
echo "Input file is not a .fd file. Cannot continue"
exit 1
fi fi
echo "// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext" > $2 cin=$base.c
echo "#include <config.h>" >> $2 cout=$base.C
echo "#include \"lyx_gui_misc.h\"" >> $2 hin=$base.h
echo "#include \"gettext.h\"" >> $2 hout=$base.H
echo >> $2
# The commands to sed does this: classname=`echo $base | cut -c6-`
#
# -e 's/#include \"forms\.h\"/#include FORMS_H_LOCATION/'
#
# Replace "forms.h" by FORMS_H_LOCATION in #include directives. This
# macro is defined in config.h and is either <forms.h> or
# <X11/forms.h>.
#
# -e "/#include \"form_.*\"/a\\
# #include \"$classname.h\" "
#
# For all lines containing "#include "form_*"", append a line
# containing the header file of the parent class
#
# -e '/fl_/ s/".[^|]*"/_(&)/'
#
# For all lines containing "fl_" and a string _not_ containing |,
# replace the string with _(string)
#
# -e '/shortcut/ s/".*[|].*"/scex(_(&))/'
#
# For all lines containing "shortcut" and a string containing |, replace
# the string with scex(_(string))
#
# -e '/fl_add/ s/".*[|].*"/idex(_(&))/'
#
# For all lines containing "fl_add" and a string containing |, replace
# the string with idex(_(string))
#
# -e '/fl_add/ s/idex("\(.*\)").*$/&\
# fl_set_button_shortcut(obj,"\1",1);/'
#
# For all lines containing "fl_add" and a string containing |, add the
# shortcut command after the end of this line
#
# -e 's/\(\(FD_[^ ]*\) \*fdui =\).*sizeof(\*fdui))/\1 new \2/'
#
# We use new/delete not malloc/free so change to suit.
#
# -e "s/\(FD_f\([^ _]*\)_\([^ ]*\)\) \*create_form_form[^ ]*/\1 * $classname::build_\3()/"
#
# Fixup the name of the create_form... function to have a signature matching
# that of the method it will become.
#
# -e 's/\(fdui->form[^ ]*\)\(.*bgn_form.*\)/\1\2\
# \1->u_vdata = this;/' \
#
# We need to store a pointer to the dialog in u_vdata so that the callbacks
# will work.
#
# -e 's/,\([^ ]\)/, \1/g'
#
# Someone got busy and put spaces in after commas but didn't allow for the
# autogeneration of the files so their pretty formatting got lost. Not anymore.
#
classname=`basename $1 .c | cut -c6-`
firstchar=`echo $classname | cut -c1 | tr a-z A-Z` firstchar=`echo $classname | cut -c1 | tr a-z A-Z`
rest=`echo $classname | cut -c2-` rest=`echo $classname | cut -c2-`
classname=Form$firstchar$rest classname=Form$firstchar$rest
export classname
cat $1 | sed \ # Create .c and .h files
-e 's/#include \"forms\.h\"/#include FORMS_H_LOCATION/' \ $FDESIGN -convert $1
-e "/#include \"form_.*\"/a\\
#include \"$classname.h\" " \ # Modify .h file for use by LyX
-e '/fl_/ s/".[^|]*"/_(&)/' \ echo "// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext" > $hout
-e '/shortcut/ s/".*[|].*"/scex(_(&))/' \ sed -f fdfixh.sed < $hin >> $hout
-e '/fl_add/ s/".*[|].*"/idex(_(&))/' \
-e '/fl_add/ s/idex(\(.*\)").*$/&\ # Patch the .h file if a patch exists
fl_set_button_shortcut(obj,scex(\1")),1);/' \ if [ -f "$hout.patch" ] ; then
-e 's/\(\(FD_[^ ]*\) \*fdui =\).*sizeof(\*fdui))/\1 new \2/' \ echo "Patching $hout with $hout.patch"
-e "s/\(FD_f\([^ _]*\)_\([^ ]*\)\) \*create_form_form[^ ]*/\1 * $classname::build_\3()/" \ patch -s $hout < $hout.patch
-e 's/\(fdui->form[^ ]*\)\(.*bgn_form.*\)/\1\2\ fi
\1->u_vdata = this;/' \
-e 's/,\([^ ]\)/, \1/g' >> $2 # Modify .c file for use by LyX
echo "// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext" > $cout
echo "#include <config.h>" >> $cout
echo "#include \"lyx_gui_misc.h\"" >> $cout
echo "#include \"gettext.h\"" >> $cout
echo >> $cout
sed -f fdfixc.sed < $cin | sed -e "s/CLASSNAME/$classname/" >> $cout
# Patch the .C file if a patch exists
if [ -f "$cout.patch" ] ; then
echo "Patching $cout with $cout.patch"
patch -s $cout < $cout.patch
fi
# Clean up, to leave .C and .h files
rm -f $cin $hin
mv $hout $hin

View File

@ -0,0 +1,78 @@
# Can't seem to input $classname!
# CLASSNAME will be swapped for the true classname later
# Create the destructor.
/\(.*\) *create_form_form/{
h
s/\(.*\) \*create_form_form[^ ]*/\1::~\1()/p
/\(.*\)::~\(.*\)()/{
i\
{\
if( form->visible ) fl_hide_form( form );\
fl_free_form( form );\
}\
\
}
x
}
# Rewrite "fdui->form_xxx->fdui = ..." as "fdui->form->fdui = ..."
s/fdui->form_\([^ ]*\)->fdui =/fdui->form->fdui =/
# Rewrite "fdui->form_xxx = ..." as "fdui->form = ..."
s/fdui->form_\([^ ]*\) =/fdui->form =/
# Rewrite "fdui->form_xxx->..." as "fdui->form->..."
s/fdui->form_\([^ ]*\)->/fdui->form->/
# Replace "forms.h" by FORMS_H_LOCATION in #include directives. This
# macro is defined in config.h and is either <forms.h> or
# <X11/forms.h>.
s/#include \"forms\.h\"/#include FORMS_H_LOCATION/
# For all lines containing "#include "form_*"", append a line
# containing the header file of the parent class
/#include \"form_.*\"/a\
#include \"CLASSNAME.h\"
# For all lines containing "fl_" and a string _not_ containing |,
# replace the string with _(string)
/fl_/ s/".[^|]*"/_(&)/
# For all lines containing "shortcut" and a string containing |,
# replace the string with scex(_(string))
/shortcut/ s/".*[|].*"/scex(_(&))/
# For all lines containing "fl_add" and a string containing |, replace
# the string with idex(_(string))
/fl_add/ s/".*[|].*"/idex(_(&))/
# For all lines containing "fl_add" and a string containing |, add the
# shortcut command after the end of this line
/fl_add/ s/idex(\(.*\)").*$/&\
fl_set_button_shortcut(obj,scex(\1")),1);/
# We use new/delete not malloc/free so change to suit.
s/\(\(FD_[^ ]*\) \*fdui =\).*sizeof(\*fdui))/\1 new \2/
# Fixup the name of the create_form... function to have a signature
# matching that of the method it will become.
s/\(FD_f\([^ _]*\)_\([^ ]*\)\) \*create_form_form[^ ]*/\1 * CLASSNAME::build_\3()/
# We need to store a pointer to the dialog in u_vdata so that the
# callbacks will work.
s/\(fdui->form\)\(.*bgn_form.*\)/\1\2\
\1->u_vdata = this;/
# Someone got busy and put spaces in after commas but didn't allow for the
# autogeneration of the files so their pretty formatting got lost. Not anymore.
#
s/,\([^ ]\)/, \1/g
# Clean up one special case where a comma appears at the end of a string
# while ensuring "...", "..." isn't affected.
#
s/\("[^"]+,\) \("\)/\1\2/g

View File

@ -1,52 +1,61 @@
# cat someFile.h | sed -f fdfixh.sed # sed -f fdfixh.sed < somefile.h > fixedfile.h
#
# It contains the instructions that sed requires to manipulate # It contains the instructions that sed requires to manipulate
# the header files produced by fdesign into a form usable by LyX # the header files produced by fdesign into a form usable by LyX
# In summary it... s/\(extern \)\(.*\)/\1 "C" \2/
# s/\(extern \)\(.*\)/\1 "C" \2/
# #
# Replaces lines such as "extern void func(args);" # Replaces lines such as "extern void func(args);"
# with "extern "C" void func(args);" # with "extern "C" void func(args);"
# /create_form_/d /create_form_/d
# #
# Deletes lines containing "/create_form_/d" # Deletes lines containing "create_form_"
s,\(generated with fdesign\)\(.*\)\(\*\*/\),\1 \3,
#
# Deletes the dated signature so we can rebuild everything as often
# as we want without silly clashes due to the date.
# Rewrites as # Rewrites as
# typedef struct { struct someStruct { # typedef struct { struct FD_form_xxx {
# ... ... # FL_FORM *form_xxx; ~FD_form_xxx();
# void *vdata; ... # void *vdata;
# char *cdata; }; # char *cdata; FL_FORM *form;
# long ldata; # long ldata; ...
# ... # ... }
# } someStruct; # } FD_form_xxx;
# #
# This is detailed more closely below # This is detailed more closely below
s/\(extern \)\(.*\)/\1 "C" \2/ #Manipulate the struct
/create_form_/d #=====================
/typedef struct {/,/} .*;/{ /typedef struct {/,/} .*;/{
# delete lines containing ... # delete lines containing ...
/typedef struct {/d /typedef struct {/d
/vdata/d /vdata/d
/cdata/d /cdata/d
/ldata/d /ldata/d
# rewrite "FL_FORM *form_xxx;" as "FL_FORM *form;"
s/FL_FORM \(.*\);/FL_FORM *form;/
# copy remaining lines into the hold space # copy remaining lines into the hold space
H H
# rewrite "} someStruct;" as "struct someStruct {" and print # rewrite "} someStruct;" as "struct someStruct {" and print
# " ~someStruct();"
/} \(.*\);/{
s/} \(.*\);/struct \1 {/p s/} \(.*\);/struct \1 {/p
s/struct \(.*\) {/ ~\1();/p
}
# delete line from pattern space # delete line from pattern space
d d
} }
# swap the hold space back into the pattern space and... # swap the hold space back into the pattern space and...
/^$/x /^$/x
{
# rewrite "} someStruct;" as "};" # rewrite "} someStruct;" as "};"
s/} \(.*\);/};/ s/} \(.*\);/};/
}

View File

@ -8,14 +8,14 @@ Unit of measure: FL_COORD_PIXEL
=============== FORM =============== =============== FORM ===============
Name: form_citation Name: form_citation
Width: 430 Width: 435
Height: 770 Height: 665
Number of Objects: 13 Number of Objects: 13
-------------------- --------------------
class: FL_BOX class: FL_BOX
type: UP_BOX type: UP_BOX
box: 0 0 430 770 box: 0 0 435 665
boxtype: FL_UP_BOX boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1 colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER
@ -33,7 +33,7 @@ argument:
-------------------- --------------------
class: FL_BROWSER class: FL_BROWSER
type: HOLD_BROWSER type: HOLD_BROWSER
box: 10 30 180 370 box: 10 30 180 300
boxtype: FL_DOWN_BOX boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_YELLOW colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_TOP_LEFT alignment: FL_ALIGN_TOP_LEFT
@ -51,7 +51,7 @@ argument: CITEBRSR
-------------------- --------------------
class: FL_BROWSER class: FL_BROWSER
type: HOLD_BROWSER type: HOLD_BROWSER
box: 240 30 180 370 box: 240 30 180 300
boxtype: FL_DOWN_BOX boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_YELLOW colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_TOP_LEFT alignment: FL_ALIGN_TOP_LEFT
@ -141,7 +141,7 @@ argument: DOWN
-------------------- --------------------
class: FL_BROWSER class: FL_BROWSER
type: NORMAL_BROWSER type: NORMAL_BROWSER
box: 10 440 410 110 box: 10 360 410 80
boxtype: FL_DOWN_BOX boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_YELLOW colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_TOP_LEFT alignment: FL_ALIGN_TOP_LEFT
@ -159,7 +159,7 @@ argument:
-------------------- --------------------
class: FL_CHOICE class: FL_CHOICE
type: NORMAL_CHOICE type: NORMAL_CHOICE
box: 160 570 130 30 box: 160 470 130 30
boxtype: FL_DOWN_BOX boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_BLACK colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT alignment: FL_ALIGN_LEFT
@ -177,7 +177,7 @@ argument:
-------------------- --------------------
class: FL_INPUT class: FL_INPUT
type: NORMAL_INPUT type: NORMAL_INPUT
box: 100 620 250 30 box: 100 520 250 30
boxtype: FL_DOWN_BOX boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT alignment: FL_ALIGN_LEFT
@ -195,7 +195,7 @@ argument:
-------------------- --------------------
class: FL_INPUT class: FL_INPUT
type: NORMAL_INPUT type: NORMAL_INPUT
box: 100 660 250 30 box: 100 570 250 30
boxtype: FL_DOWN_BOX boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT alignment: FL_ALIGN_LEFT
@ -213,7 +213,7 @@ argument:
-------------------- --------------------
class: FL_BUTTON class: FL_BUTTON
type: RETURN_BUTTON type: RETURN_BUTTON
box: 230 730 90 30 box: 230 630 90 30
boxtype: FL_UP_BOX boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1 colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER
@ -231,7 +231,7 @@ argument: 0
-------------------- --------------------
class: FL_BUTTON class: FL_BUTTON
type: NORMAL_BUTTON type: NORMAL_BUTTON
box: 330 730 90 30 box: 330 630 90 30
boxtype: FL_UP_BOX boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1 colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER

View File

@ -1,5 +1,5 @@
--- form_document.C.old Fri Aug 11 15:30:33 2000 --- form_document.C.orig Mon Aug 14 13:17:32 2000
+++ form_document.C Fri Aug 11 15:32:41 2000 +++ form_document.C Mon Aug 14 13:22:59 2000
@@ -9,6 +9,8 @@ @@ -9,6 +9,8 @@
#include <stdlib.h> #include <stdlib.h>
#include "form_document.h" #include "form_document.h"
@ -7,12 +7,12 @@
+#include "bmtable.h" +#include "bmtable.h"
+#include "support/filetools.h" +#include "support/filetools.h"
FD_form_tabbed_document * FormDocument::build_tabbed_document() FD_form_tabbed_document::~FD_form_tabbed_document()
{ {
@@ -321,10 +323,16 @@ @@ -363,10 +365,18 @@
fdui->form_doc_bullet = fl_bgn_form(FL_NO_BOX, 440, 345); fdui->form = fl_bgn_form(FL_NO_BOX, 440, 345);
fdui->form_doc_bullet->u_vdata = this; fdui->form->u_vdata = this;
+ fl_set_border_width(-1); + fl_set_border_width(-1);
obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, ""); obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 345, "");
- fdui->bmtable_bullet_panel = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 90, 105, 260, 180, ""); - fdui->bmtable_bullet_panel = obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 90, 105, 260, 180, "");
@ -24,17 +24,10 @@
+ fl_set_object_lcol(obj, FL_BLUE); + fl_set_object_lcol(obj, FL_BLUE);
+ fl_set_object_boxtype(obj, FL_UP_BOX); + fl_set_object_boxtype(obj, FL_UP_BOX);
+ fl_set_bmtable_pixmap_file(obj, 6, 6, + fl_set_bmtable_pixmap_file(obj, 6, 6,
+ LibFileSearch("images", "standard.xpm").c_str()); + LibFileSearch("images",
+ "standard",
+ "xpm").c_str());
+ fl_set_border_width(-1); + fl_set_border_width(-1);
obj = fl_add_frame(FL_ENGRAVED_FRAME, 95, 20, 255, 70, ""); obj = fl_add_frame(FL_ENGRAVED_FRAME, 95, 20, 255, 70, "");
fdui->choice_bullet_size = obj = fl_add_choice(FL_NORMAL_CHOICE, 15, 45, 65, 30, idex(_("Size|#z"))); fdui->choice_bullet_size = obj = fl_add_choice(FL_NORMAL_CHOICE, 15, 45, 65, 30, idex(_("Size|#z")));
fl_set_button_shortcut(obj, scex(_("Size|#z")), 1); fl_set_button_shortcut(obj, scex(_("Size|#z")), 1);
@@ -336,6 +344,8 @@
fl_set_button_shortcut(obj, scex(_("LaTeX|#L")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_lstyle(obj, FL_FIXED_STYLE);
+ fl_set_input_return(obj, FL_RETURN_CHANGED);
+ fl_set_input_maxchars(obj, 80);
fl_set_object_callback(obj, InputBulletLaTeXCB, 0);
fdui->radio_bullet_depth = fl_bgn_group();

View File

@ -344,7 +344,7 @@ label: Encoding
shortcut: shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: input_encoding name: input_screen_encoding
callback: C_FormPreferencesInputCB callback: C_FormPreferencesInputCB
argument: 0 argument: 0
@ -602,7 +602,7 @@ label: Encoding
shortcut: shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: input_encoding name: input_popup_encoding
callback: C_FormPreferencesInputCB callback: C_FormPreferencesInputCB
argument: 0 argument: 0
@ -1239,14 +1239,14 @@ argument:
=============== FORM =============== =============== FORM ===============
Name: form_preferences Name: form_preferences
Width: 460 Width: 475
Height: 435 Height: 435
Number of Objects: 5 Number of Objects: 6
-------------------- --------------------
class: FL_BOX class: FL_BOX
type: UP_BOX type: UP_BOX
box: 0 0 460 435 box: 0 0 475 435
boxtype: FL_UP_BOX boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1 colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER
@ -1264,7 +1264,7 @@ argument:
-------------------- --------------------
class: FL_BUTTON class: FL_BUTTON
type: NORMAL_BUTTON type: NORMAL_BUTTON
box: 250 395 90 30 box: 275 395 90 30
boxtype: FL_UP_BOX boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1 colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER
@ -1282,7 +1282,7 @@ argument: 0
-------------------- --------------------
class: FL_BUTTON class: FL_BUTTON
type: NORMAL_BUTTON type: NORMAL_BUTTON
box: 350 395 90 30 box: 375 395 90 30
boxtype: FL_UP_BOX boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1 colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER
@ -1300,7 +1300,7 @@ argument: 0
-------------------- --------------------
class: FL_BUTTON class: FL_BUTTON
type: RETURN_BUTTON type: RETURN_BUTTON
box: 150 395 90 30 box: 175 395 90 30
boxtype: FL_UP_BOX boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1 colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER
@ -1333,5 +1333,23 @@ name: tabfolder_prefs
callback: callback:
argument: argument:
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
box: 10 395 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: Restore|#R
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: button_restore
callback: C_FormPreferencesRestoreCB
argument: 0
============================== ==============================
create_the_forms create_the_forms

View File

@ -11,7 +11,7 @@
### ###
### Makefile by Lars Gullik Bjønnes (larsbj@ifi.uio.no) ### Makefile by Lars Gullik Bjønnes (larsbj@ifi.uio.no)
### Modified by Allan Rae <rae@lyx.org> ### Modified by Allan Rae <rae@lyx.org>
### ### Rewritten by Angus Leeming.
SHELL = /bin/sh SHELL = /bin/sh
.SUFFIXES: .fd .c .SUFFIXES: .fd .c
@ -31,51 +31,23 @@ SRCS := form_citation.fd \
form_toc.fd \ form_toc.fd \
form_url.fd form_url.fd
OBJS := $(SRCS:.fd=.C)
OBJS := $(SRCS:.fd=.c)
COBJS := $(SRCS:.fd=.C)
all: all:
@echo "This is a makefile intended for the maintainer only." @echo "This is a makefile intended for the maintainer only."
@echo "Only run it if you are absolutely sure about what you" @echo "Only run it if you are absolutely sure about what you"
@echo "are doing." @echo "are doing."
c: $(OBJS) test: clean $(OBJS)
d: c $(COBJS) updatesrc: test
mv *.C *.h ..
.fd.C:
# Modify the header files using the instructions in fdfixh.sed ${SHELL} ./fdfix.sh $<
e: c
@echo "Modifying header files using the instructions in fdfixh.sed";\
for hfil in *.h ; do \
if [ -f "$$hfil.patch" ] ; then \
(echo "Patching $$hfil with $$hfil.patch" ; \
patch -s $$hfil < $$hfil.patch) \
fi; \
sed -f fdfixh.sed < $$hfil > $$hfil.tmp; \
mv $$hfil.tmp $$hfil; \
done
updatesrc: d e
.fd.c:
$(FDESIGN) -convert $<
.c.C:
${SHELL} ./fdfix.sh $< $@
rm $<
@if [ -f "$@.patch" ] ; then \
(echo "Patching $@ with $@.patch" ; \
patch -s $@ < $@.patch) \
fi;
clean: clean:
rm -f *.[hcC] *.bak rm -f *.[hcC] *.bak
distclean: clean distclean: clean
rm -f *.orig *.rej *~ rm -f *.orig *.rej *~
install: clean updatesrc
cp *.C *.h ..

View File

@ -671,6 +671,11 @@ InsetGraphicsParams InsetGraphics::getParams() const
Inset * InsetGraphics::Clone() const Inset * InsetGraphics::Clone() const
{ {
InsetGraphics * newInset = new InsetGraphics; InsetGraphics * newInset = new InsetGraphics;
newInset->cacheHandle = cacheHandle;
newInset->pixmap = pixmap;
newInset->pixmapInitialized = pixmapInitialized;
newInset->setParams(getParams()); newInset->setParams(getParams());
return newInset; return newInset;

View File

@ -1,4 +1,4 @@
/** Header file generated with fdesign on Mon Jun 19 12:55:08 2000.**/ /** Header file generated with fdesign **/
#ifndef FD_form_document_h_ #ifndef FD_form_document_h_
#define FD_form_document_h_ #define FD_form_document_h_

View File

@ -1,4 +1,4 @@
/** Header file generated with fdesign on Mon Jul 17 21:08:23 2000.**/ /** Header file generated with fdesign **/
#ifndef FD_LaTeXLog_h_ #ifndef FD_LaTeXLog_h_
#define FD_LaTeXLog_h_ #define FD_LaTeXLog_h_

View File

@ -65,53 +65,6 @@ FD_form_figure *create_form_form_figure(void)
} }
/*---------------------------------------*/ /*---------------------------------------*/
FD_form_screen *create_form_form_screen(void)
{
FL_OBJECT *obj;
FD_form_screen *fdui = (FD_form_screen *) fl_calloc(1, sizeof(FD_form_screen));
fdui->form_screen = fl_bgn_form(FL_NO_BOX, 390, 220);
obj = fl_add_box(FL_UP_BOX, 0, 0, 390, 220, "");
fdui->input_roman = obj = fl_add_input(FL_NORMAL_INPUT, 140, 10, 240, 30, idex(_("Roman font|#R")));fl_set_button_shortcut(obj, scex(_("Roman font|#R")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
fdui->input_sans = obj = fl_add_input(FL_NORMAL_INPUT, 140, 40, 240, 30, idex(_("Sans serif font|#S")));fl_set_button_shortcut(obj, scex(_("Sans serif font|#S")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
fdui->input_typewriter = obj = fl_add_input(FL_NORMAL_INPUT, 140, 70, 240, 30, idex(_("Typewriter font|#T")));fl_set_button_shortcut(obj, scex(_("Typewriter font|#T")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
fdui->input_font_norm = obj = fl_add_input(FL_NORMAL_INPUT, 140, 100, 240, 30, idex(_("Font norm|#N")));fl_set_button_shortcut(obj, scex(_("Font norm|#N")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
fdui->intinput_size = obj = fl_add_input(FL_INT_INPUT, 140, 140, 50, 30, idex(_("Font zoom|#Z")));fl_set_button_shortcut(obj, scex(_("Font zoom|#Z")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
obj = fl_add_button(FL_RETURN_BUTTON, 60, 180, 100, 30, _("OK"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, ScreenOKCB, 0);
obj = fl_add_button(FL_NORMAL_BUTTON, 170, 180, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, ScreenApplyCB, 0);
obj = fl_add_button(FL_NORMAL_BUTTON, 280, 180, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
fl_set_object_callback(obj, ScreenCancelCB, 0);
fl_end_form();
//fdui->form_screen->fdui = fdui;
return fdui;
}
/*---------------------------------------*/
FD_form_external *create_form_form_external(void) FD_form_external *create_form_form_external(void)
{ {
FL_OBJECT *obj; FL_OBJECT *obj;

View File

@ -1,4 +1,4 @@
/** Header file generated with fdesign on Mon Jul 31 11:17:12 2000.**/ /** Header file generated with fdesign **/
#ifndef FD_form_title_h_ #ifndef FD_form_title_h_
#define FD_form_title_h_ #define FD_form_title_h_
@ -10,10 +10,6 @@ extern "C" void FigureOKCB(FL_OBJECT *, long);
extern "C" void FigureApplyCB(FL_OBJECT *, long); extern "C" void FigureApplyCB(FL_OBJECT *, long);
extern "C" void FigureCancelCB(FL_OBJECT *, long); extern "C" void FigureCancelCB(FL_OBJECT *, long);
extern "C" void ScreenOKCB(FL_OBJECT *, long);
extern "C" void ScreenApplyCB(FL_OBJECT *, long);
extern "C" void ScreenCancelCB(FL_OBJECT *, long);
extern "C" void ExternalTemplateCB(FL_OBJECT *, long); extern "C" void ExternalTemplateCB(FL_OBJECT *, long);
extern "C" void ExternalBrowseCB(FL_OBJECT *, long); extern "C" void ExternalBrowseCB(FL_OBJECT *, long);
extern "C" void ExternalEditCB(FL_OBJECT *, long); extern "C" void ExternalEditCB(FL_OBJECT *, long);
@ -44,19 +40,6 @@ typedef struct {
} FD_form_figure; } FD_form_figure;
extern FD_form_figure * create_form_form_figure(void); extern FD_form_figure * create_form_form_figure(void);
typedef struct {
FL_FORM *form_screen;
void *vdata;
char *cdata;
long ldata;
FL_OBJECT *input_roman;
FL_OBJECT *input_sans;
FL_OBJECT *input_typewriter;
FL_OBJECT *input_font_norm;
FL_OBJECT *intinput_size;
} FD_form_screen;
extern FD_form_screen * create_form_form_screen(void);
typedef struct { typedef struct {
FL_FORM *form_external; FL_FORM *form_external;
void *vdata; void *vdata;

View File

@ -40,11 +40,9 @@
#include "support/filetools.h" #include "support/filetools.h"
#include "support/path.h" #include "support/path.h"
#include "lyxserver.h" #include "lyxserver.h"
#include "FontLoader.h"
#include "lyxrc.h" #include "lyxrc.h"
#include "lyxtext.h" #include "lyxtext.h"
#include "CutAndPaste.h" #include "CutAndPaste.h"
#include "TextCache.h"
using std::ifstream; using std::ifstream;
using std::copy; using std::copy;
@ -70,7 +68,6 @@ extern FD_form_quotes * fd_form_quotes;
extern FD_form_preamble * fd_form_preamble; extern FD_form_preamble * fd_form_preamble;
extern FD_form_table * fd_form_table; extern FD_form_table * fd_form_table;
extern FD_form_figure * fd_form_figure; extern FD_form_figure * fd_form_figure;
extern FD_form_screen * fd_form_screen;
extern FD_form_bullet * fd_form_bullet; extern FD_form_bullet * fd_form_bullet;
extern BufferView * current_view; // called too many times in this file... extern BufferView * current_view; // called too many times in this file...
@ -2832,43 +2829,6 @@ extern "C" void FigureOKCB(FL_OBJECT * ob, long data)
} }
extern "C" void ScreenApplyCB(FL_OBJECT *, long)
{
lyxrc.roman_font_name = fl_get_input(fd_form_screen->input_roman);
lyxrc.sans_font_name = fl_get_input(fd_form_screen->input_sans);
lyxrc.typewriter_font_name = fl_get_input(fd_form_screen->input_typewriter);
lyxrc.font_norm = fl_get_input(fd_form_screen->input_font_norm);
lyxrc.set_font_norm_type();
lyxrc.zoom = atoi(fl_get_input(fd_form_screen->intinput_size));
fontloader.update();
// Of course we should only to the resize and the textcahce.clear
// if values really changed...but not very important right now. (Lgb)
// All buffers will need resize
bufferlist.resize();
// We also need to empty the textcache so that
// the buffer will be formatted correctly after
// a zoom change.
textcache.clear();
current_view->owner()->getMiniBuffer()->Set(_("Screen options set"));
}
extern "C" void ScreenCancelCB(FL_OBJECT *, long)
{
fl_hide_form(fd_form_screen->form_screen);
}
extern "C" void ScreenOKCB(FL_OBJECT * ob, long data)
{
ScreenCancelCB(ob, data);
ScreenApplyCB(ob, data);
}
// This function runs "configure" and then rereads lyx.defaults to // This function runs "configure" and then rereads lyx.defaults to
// reconfigure the automatic settings. // reconfigure the automatic settings.
void Reconfigure(BufferView * bv) void Reconfigure(BufferView * bv)

View File

@ -63,7 +63,6 @@ FD_form_preamble * fd_form_preamble;
FD_form_table * fd_form_table; FD_form_table * fd_form_table;
FD_form_sendto * fd_form_sendto; FD_form_sendto * fd_form_sendto;
FD_form_figure * fd_form_figure; FD_form_figure * fd_form_figure;
FD_form_screen * fd_form_screen;
FD_LaTeXLog * fd_latex_log; // from log_form.h FD_LaTeXLog * fd_latex_log; // from log_form.h
Combox * combo_language; Combox * combo_language;
Combox * combo_language2; Combox * combo_language2;
@ -525,11 +524,6 @@ void LyXGUI::create_forms()
CancelCloseBoxCB, 0); CancelCloseBoxCB, 0);
fl_set_button(fd_form_figure->radio_postscript, 1); fl_set_button(fd_form_figure->radio_postscript, 1);
// the screen form
fd_form_screen = create_form_form_screen();
fl_set_form_atclose(fd_form_screen->form_screen,
CancelCloseBoxCB, 0);
// the latex log form // the latex log form
fd_latex_log = create_form_LaTeXLog(); fd_latex_log = create_form_LaTeXLog();
fl_set_form_atclose(fd_latex_log->LaTeXLog, fl_set_form_atclose(fd_latex_log->LaTeXLog,

View File

@ -403,6 +403,7 @@ void LyX::init(int */*argc*/, char **argv, bool gui)
// //
ReadRcFile("lyxrc.defaults"); ReadRcFile("lyxrc.defaults");
// system_lyxrc = lyxrc;
// If there is a preferences file we read that instead // If there is a preferences file we read that instead
// of the old lyxrc file. // of the old lyxrc file.
if (!ReadRcFile("preferences")) if (!ReadRcFile("preferences"))

View File

@ -1,4 +1,4 @@
/** Header file generated with fdesign on Mon Jun 19 12:55:08 2000.**/ /** Header file generated with fdesign **/
#ifndef FD_xsendfax_h_ #ifndef FD_xsendfax_h_
#define FD_xsendfax_h_ #define FD_xsendfax_h_

View File

@ -92,6 +92,8 @@ using std::istringstream;
#include "menus.h" #include "menus.h"
#endif #endif
#include "FloatList.h" #include "FloatList.h"
#include "FontLoader.h"
#include "TextCache.h"
using std::pair; using std::pair;
using std::endl; using std::endl;
@ -2844,6 +2846,22 @@ string LyXFunc::Dispatch(int ac,
} }
break; break;
case LFUN_SCREEN_FONT_UPDATE:
{
// handle the screen font changes.
//
lyxrc.set_font_norm_type();
fontloader.update();
// Of course we should only do the resize and the textcache.clear
// if values really changed...but not very important right now. (Lgb)
// All buffers will need resize
bufferlist.resize();
// We also need to empty the textcache so that
// the buffer will be formatted correctly after
// a zoom change.
textcache.clear();
}
case LFUN_SET_COLOR: case LFUN_SET_COLOR:
{ {
string lyx_name, x11_name; string lyx_name, x11_name;

View File

@ -1553,3 +1553,6 @@ void LyXRC::set_font_norm_type()
// The global instance // The global instance
LyXRC lyxrc; LyXRC lyxrc;
// The global copy of the system lyxrc entries (everything except preferences)
//LyXRC system_lyxrc;

View File

@ -265,5 +265,6 @@ public:
/// ///
extern LyXRC lyxrc; extern LyXRC lyxrc;
///
//extern LyXRC system_lyxrc;
#endif #endif

View File

@ -1,4 +1,4 @@
/** Header file generated with fdesign on Mon Jun 19 12:55:08 2000.**/ /** Header file generated with fdesign **/
#ifndef FD_panel_h_ #ifndef FD_panel_h_
#define FD_panel_h_ #define FD_panel_h_

View File

@ -60,7 +60,6 @@ using std::max;
using std::min; using std::min;
using std::sort; using std::sort;
extern FD_form_screen * fd_form_screen;
extern BufferList bufferlist; extern BufferList bufferlist;
// I would really prefere to see most or all of these 'extern's disappear. // I would really prefere to see most or all of these 'extern's disappear.
@ -455,37 +454,6 @@ void Menus::create_menus(int air)
} }
void Menus::ScreenOptions()
{
static int ow = -1, oh;
// this is not very nice....
fl_set_input(fd_form_screen->input_roman,
lyxrc.roman_font_name.c_str());
fl_set_input(fd_form_screen->input_sans,
lyxrc.sans_font_name.c_str());
fl_set_input(fd_form_screen->input_typewriter,
lyxrc.typewriter_font_name.c_str());
fl_set_input(fd_form_screen->input_font_norm,
lyxrc.font_norm.c_str());
char tmpstring[10];
sprintf(tmpstring, "%d", lyxrc.zoom);
fl_set_input(fd_form_screen->intinput_size, tmpstring);
if (fd_form_screen->form_screen->visible) {
fl_raise_form(fd_form_screen->form_screen);
} else {
fl_show_form(fd_form_screen->form_screen,
FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER,
_("Screen Options"));
if (ow < 0) {
ow = fd_form_screen->form_screen->w;
oh = fd_form_screen->form_screen->h;
}
fl_set_form_minsize(fd_form_screen->form_screen, ow, oh);
}
}
// //
// Here comes all the menu callbacks. // Here comes all the menu callbacks.
// //
@ -2012,17 +1980,15 @@ void Menus::ShowOptionsMenu(FL_OBJECT * ob, long)
LyXFunc * tmpfunc = men->_view->getLyXFunc(); LyXFunc * tmpfunc = men->_view->getLyXFunc();
int OptionsMenu = fl_defpup(FL_ObjWin(ob), int OptionsMenu = fl_defpup(FL_ObjWin(ob),
_("Screen Fonts..." _("|Spellchecker Options..."
"|Spellchecker Options..."
"|Keyboard...%l" "|Keyboard...%l"
"|Reconfigure" "|Reconfigure"
"|Preferences")); "|Preferences"));
fl_setpup_shortcut(OptionsMenu, 1, scex(_("OM|Ff#f#F"))); fl_setpup_shortcut(OptionsMenu, 1, scex(_("OM|Ss#s#S")));
fl_setpup_shortcut(OptionsMenu, 2, scex(_("OM|Ss#s#S"))); fl_setpup_shortcut(OptionsMenu, 2, scex(_("OM|Kk#k#K")));
fl_setpup_shortcut(OptionsMenu, 3, scex(_("OM|Kk#k#K"))); fl_setpup_shortcut(OptionsMenu, 3, scex(_("OM|Rr#r#R")));
fl_setpup_shortcut(OptionsMenu, 4, scex(_("OM|Rr#r#R"))); fl_setpup_shortcut(OptionsMenu, 4, scex(_("OM|Pp#p#P")));
fl_setpup_shortcut(OptionsMenu, 5, scex(_("OM|Pp#p#P")));
if(lyxrc.isp_command == "none") if(lyxrc.isp_command == "none")
fl_setpup_mode(OptionsMenu, 2, FL_PUP_GREY); fl_setpup_mode(OptionsMenu, 2, FL_PUP_GREY);
@ -2037,11 +2003,10 @@ void Menus::ShowOptionsMenu(FL_OBJECT * ob, long)
fl_set_object_boxtype(ob, FL_FLAT_BOX); fl_set_object_boxtype(ob, FL_FLAT_BOX);
fl_redraw_object(ob); fl_redraw_object(ob);
switch (choice){ switch (choice){
case 1: men->ScreenOptions(); break; case 1: SpellCheckerOptions(); break;
case 2: SpellCheckerOptions(); break; case 2: men->_view->getIntl()->MenuKeymap(); break;
case 3: men->_view->getIntl()->MenuKeymap(); break; case 3: tmpfunc->Dispatch(LFUN_RECONFIGURE); break;
case 4: tmpfunc->Dispatch(LFUN_RECONFIGURE); break; case 4: men->_view->getDialogs()->showPreferences(); break;
case 5: men->_view->getDialogs()->showPreferences(); break;
default: break; default: break;
} }
fl_freepup(OptionsMenu); fl_freepup(OptionsMenu);

View File

@ -61,8 +61,6 @@ private:
/// ///
void create_menus(int air); void create_menus(int air);
/// ///
void ScreenOptions();
///
void showCopyright(); void showCopyright();
/// ///
void showLicense(); void showLicense();

View File

@ -1,4 +1,4 @@
/** Header file generated with fdesign on Mon Jun 19 12:55:08 2000.**/ /** Header file generated with fdesign **/
#ifndef FD_form_sendto_h_ #ifndef FD_form_sendto_h_
#define FD_form_sendto_h_ #define FD_form_sendto_h_

View File

@ -1,4 +1,4 @@
/** Header file generated with fdesign on Mon Jun 19 12:55:08 2000.**/ /** Header file generated with fdesign **/
#ifndef FD_form_spell_options_h_ #ifndef FD_form_spell_options_h_
#define FD_form_spell_options_h_ #define FD_form_spell_options_h_