]> git.lyx.org Git - features.git/commitdiff
character2.diff.gz
authorLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 26 Feb 2001 15:17:19 +0000 (15:17 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 26 Feb 2001 15:17:19 +0000 (15:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1625 a592a061-630c-0410-9148-cb99ea01b6c8

30 files changed:
forms/ChangeLog
forms/layout_forms.fd [deleted file]
forms/layout_forms.h.patch [deleted file]
forms/makefile
po/POTFILES.in
src/BufferView_pimpl.C
src/ChangeLog
src/LyXView.C
src/Makefile.am
src/bufferview_funcs.C
src/bufferview_funcs.h
src/combox.C
src/frontends/ChangeLog
src/frontends/Dialogs.h
src/frontends/xforms/ChangeLog
src/frontends/xforms/Dialogs.C
src/frontends/xforms/FormCharacter.C [new file with mode: 0644]
src/frontends/xforms/FormCharacter.h [new file with mode: 0644]
src/frontends/xforms/Makefile.am
src/frontends/xforms/form_character.C [new file with mode: 0644]
src/frontends/xforms/form_character.h [new file with mode: 0644]
src/frontends/xforms/forms/form_character.fd [new file with mode: 0644]
src/layout_forms.C [deleted file]
src/layout_forms.h [deleted file]
src/lyx_cb.C
src/lyx_cb.h
src/lyx_gui.C
src/lyx_gui_misc.C
src/lyxfunc.C
src/mathed/math_macro.C

index 16c9531b67be18227e39541b55751dea072a6c40..43b57703fbd5a1fd006bf1089231ee68739fb5f8 100644 (file)
@@ -1,3 +1,9 @@
+2001-02-26  Lars Gullik Bjønnes  <larsbj@trylle.birdstep.com>
+
+       * layout_forms.fd: delete
+       * layout_forms.h.patch: delete
+       * makefile: remove layout_forms.fd and layout_forms.h.patch
+
 2001-02-20  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * layout_forms.[fd,h.patch]: strip out preamble form.
diff --git a/forms/layout_forms.fd b/forms/layout_forms.fd
deleted file mode 100644 (file)
index 04e40f4..0000000
+++ /dev/null
@@ -1,268 +0,0 @@
-Magic: 13000
-
-Internal Form Definition File
-    (do not change)
-
-Number of forms: 1
-Unit of measure: FL_COORD_PIXEL
-SnapGrid: 5
-
-=============== FORM ===============
-Name: form_character
-Width: 300
-Height: 415
-Number of Objects: 14
-
---------------------
-class: FL_BOX
-type: UP_BOX
-box: 0 0 300 415
-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_NorthWest FL_SouthEast
-name: 
-callback: 
-argument: 
-
---------------------
-class: FL_FRAME
-type: ENGRAVED_FRAME
-box: 10 10 280 240
-boxtype: FL_NO_BOX
-colors: FL_BLACK FL_COL1
-alignment: FL_ALIGN_CENTER
-style: FL_NORMAL_STYLE
-size: FL_DEFAULT_SIZE
-lcol: FL_BLACK
-label: 
-shortcut: 
-resize: FL_RESIZE_X
-gravity: FL_NorthWest FL_NorthEast
-name: 
-callback: 
-argument: 
-
---------------------
-class: FL_CHOICE
-type: NORMAL_CHOICE
-box: 94 15 191 30
-boxtype: FL_FRAME_BOX
-colors: FL_COL1 FL_BLACK
-alignment: FL_ALIGN_LEFT
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Family:|#F
-shortcut: 
-resize: FL_RESIZE_X
-gravity: FL_NorthWest FL_NorthEast
-name: choice_family
-callback: 
-argument: 
-
---------------------
-class: FL_CHOICE
-type: NORMAL_CHOICE
-box: 94 55 191 30
-boxtype: FL_FRAME_BOX
-colors: FL_COL1 FL_BLACK
-alignment: FL_ALIGN_LEFT
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Series:|#S
-shortcut: 
-resize: FL_RESIZE_X
-gravity: FL_NorthWest FL_NorthEast
-name: choice_series
-callback: 
-argument: 
-
---------------------
-class: FL_CHOICE
-type: NORMAL_CHOICE
-box: 94 95 191 30
-boxtype: FL_FRAME_BOX
-colors: FL_COL1 FL_BLACK
-alignment: FL_ALIGN_LEFT
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Shape:|#H
-shortcut: 
-resize: FL_RESIZE_X
-gravity: FL_NorthWest FL_NorthEast
-name: choice_shape
-callback: 
-argument: 
-
---------------------
-class: FL_CHOICE
-type: NORMAL_CHOICE
-box: 95 275 191 30
-boxtype: FL_FRAME_BOX
-colors: FL_COL1 FL_BLACK
-alignment: FL_ALIGN_LEFT
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Size:|#Z
-shortcut: 
-resize: FL_RESIZE_X
-gravity: FL_NorthWest FL_NorthEast
-name: choice_size
-callback: 
-argument: 
-
---------------------
-class: FL_CHOICE
-type: NORMAL_CHOICE
-box: 95 335 190 30
-boxtype: FL_FRAME_BOX
-colors: FL_COL1 FL_BLACK
-alignment: FL_ALIGN_LEFT
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Misc:|#M
-shortcut: 
-resize: FL_RESIZE_X
-gravity: FL_NorthWest FL_NorthEast
-name: choice_bar
-callback: 
-argument: 
-
---------------------
-class: FL_BUTTON
-type: NORMAL_BUTTON
-box: 60 375 80 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: button_apply
-callback: CharacterApplyCB
-argument: 0
-
---------------------
-class: FL_BUTTON
-type: RETURN_BUTTON
-box: 175 375 80 30
-boxtype: FL_UP_BOX
-colors: FL_COL1 FL_COL1
-alignment: FL_ALIGN_CENTER
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Close
-shortcut: ^M
-resize: FL_RESIZE_NONE
-gravity: FL_SouthEast FL_SouthEast
-name: button_close
-callback: CharacterCloseCB
-argument: 0
-
---------------------
-class: FL_CHOICE
-type: NORMAL_CHOICE
-box: 95 135 191 30
-boxtype: FL_FRAME_BOX
-colors: FL_COL1 FL_BLACK
-alignment: FL_ALIGN_LEFT
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Color:|#C
-shortcut: 
-resize: FL_RESIZE_X
-gravity: FL_NorthWest FL_NorthEast
-name: choice_color
-callback: 
-argument: 
-
---------------------
-class: FL_CHECKBUTTON
-type: PUSH_BUTTON
-box: 30 215 255 25
-boxtype: FL_NO_BOX
-colors: FL_COL1 FL_YELLOW
-alignment: FL_ALIGN_CENTER
-style: FL_NORMAL_STYLE
-size: FL_DEFAULT_SIZE
-lcol: FL_BLACK
-label: Toggle on all these|#T
-shortcut: 
-resize: FL_RESIZE_X
-gravity: FL_NorthWest FL_NorthEast
-name: check_toggle_all
-callback: 
-argument: 
-
---------------------
-class: FL_CHOICE
-type: DROPLIST_CHOICE
-box: 95 175 190 30
-boxtype: FL_FRAME_BOX
-colors: FL_COL1 FL_BLACK
-alignment: FL_ALIGN_LEFT
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Language:
-shortcut: 
-resize: FL_RESIZE_X
-gravity: FL_NorthWest FL_NorthEast
-name: choice_language
-callback: 
-argument: 
-
---------------------
-class: FL_LABELFRAME
-type: ENGRAVED_FRAME
-box: 10 265 280 45
-boxtype: FL_NO_BOX
-colors: FL_BLACK FL_COL1
-alignment: FL_ALIGN_TOP_LEFT
-style: FL_BOLD_STYLE
-size: FL_DEFAULT_SIZE
-lcol: FL_BLACK
-label: These are never toggled
-shortcut: 
-resize: FL_RESIZE_ALL
-gravity: FL_NorthWest FL_NorthEast
-name: 
-callback: 
-argument: 
-
---------------------
-class: FL_LABELFRAME
-type: ENGRAVED_FRAME
-box: 10 325 280 45
-boxtype: FL_NO_BOX
-colors: FL_BLACK FL_COL1
-alignment: FL_ALIGN_TOP_LEFT
-style: FL_BOLD_STYLE
-size: FL_DEFAULT_SIZE
-lcol: FL_BLACK
-label: These are always toggled
-shortcut: 
-resize: FL_RESIZE_ALL
-gravity: FL_NorthWest FL_NorthEast
-name: 
-callback: 
-argument: 
-
-create_the_forms
diff --git a/forms/layout_forms.h.patch b/forms/layout_forms.h.patch
deleted file mode 100644 (file)
index 58607ea..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-7,8c7,8
-< extern void CharacterApplyCB(FL_OBJECT *, long);
-< extern void CharacterCloseCB(FL_OBJECT *, long);
----
-> extern "C" void CharacterApplyCB(FL_OBJECT *, long);
-> extern "C" void CharacterCloseCB(FL_OBJECT *, long);
index bd183cc5e34871995d4a3921aea396451fc3ae46..79bb9e99263f19738743ebf09b079903dce21131 100644 (file)
@@ -18,15 +18,15 @@ SHELL = /bin/sh
 FDESIGN = fdesign
 
 SRCS = bibforms.fd credits_form.fd form1.fd include_form.fd \
-       log_form.fd layout_forms.fd lyx.fd math_forms.fd \
+       log_form.fd lyx.fd math_forms.fd \
        print_form.fd sp_form.fd
 
 OBJS = bibforms.c credits_form.c form1.c include_form.c \
-       log_form.c layout_forms.c lyx.c math_forms.c \
+       log_form.c lyx.c math_forms.c \
        print_form.c sp_form.c
 
 COBJS = bibforms.C credits_form.C form1.C include_form.C \
-       log_form.C layout_forms.C lyx.C math_forms.C \
+       log_form.C lyx.C math_forms.C \
        print_form.C sp_form.C
 
 all:
index ead986dd4ad547fef64fd7db20871f1494018a25..504d48e310a440e2d2822e77e01eb9fb4617e50b 100644 (file)
@@ -76,6 +76,8 @@ src/frontends/xforms/FormBibitem.C
 src/frontends/xforms/form_bibtex.C
 src/frontends/xforms/FormBibtex.C
 src/frontends/xforms/form_browser.C
+src/frontends/xforms/form_character.C
+src/frontends/xforms/FormCharacter.C
 src/frontends/xforms/form_citation.C
 src/frontends/xforms/FormCitation.C
 src/frontends/xforms/form_copyright.C
@@ -145,7 +147,6 @@ src/kbsequence.C
 src/language.C
 src/LaTeX.C
 src/layout.C
-src/layout_forms.C
 src/LColor.C
 src/LyXAction.C
 src/lyx.C
@@ -154,7 +155,6 @@ src/lyxfont.C
 src/lyxfr0.C
 src/lyxfr1.C
 src/lyxfunc.C
-src/lyx_gui.C
 src/lyx_gui_misc.C
 src/lyx_main.C
 src/lyxrc.C
index 9ee0f3a88ae7a146163ec44b2a6721f1e761e601..a0865b74a33abc9aac9029247c02f1533d07fd09 100644 (file)
@@ -1596,9 +1596,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
                break;
                
        case LFUN_FREE:
-               Free(bv_);
-               setState();
-               owner_->showState();
+               owner_->getDialogs()->setUserFreeFont();
                break;
                
        case LFUN_TEX:
index ce7b402d98519ca43b07972a53ad2ec47d297f33..a67ea301bb7248ce268e5e117d81adc7513e0bfe 100644 (file)
@@ -1,3 +1,12 @@
+2001-02-23  Edwin Leuven <leuven@fee.uva.nl>
+
+       * layout_forms.[Ch]: removed
+       * lyx_cb.[Ch]: out character
+       * lyx_gui.C: out character
+       * lyx_gui_misc.C: out character
+       * bufferview_funcs.C: : out character,
+       added toggleall as parameter in ToggleAndShow
+                   
 2001-02-26  Dekel Tsur  <dekelts@tau.ac.il>
 
        * lyxfunc.C (getStatus): Fix the LFUN_EXPORT case.
index c4fdd8c98929dae302c1640774ef300e6b614549..8a43792b13401682c12dfc1cb5230deb2de856db 100644 (file)
@@ -25,7 +25,6 @@
 #include "minibuffer.h"
 #include "lyxfunc.h"
 #include "debug.h"
-#include "layout_forms.h"
 #include "intl.h"
 #include "lyxrc.h"
 #include "support/filetools.h"        // OnlyFilename()
index 1a3929676e6f0d72ccd63ee6deb2c45373168754..89bfd7189cc0a9489332926681065189afba2d65 100644 (file)
@@ -136,8 +136,6 @@ lyx_SOURCES = \
        lastfiles.h \
        layout.C \
        layout.h \
-       layout_forms.C \
-       layout_forms.h \
        lyx.C \
        lyx.h \
        lyx_cb.C \
index e3da5b4f02cabf4468cab998272800f4c4c218a9..2f3fbd0cd7069bd2d9e7c680c1c436c6a6c05602 100644 (file)
@@ -25,9 +25,7 @@
 #include "buffer.h"
 #include "support/lstrings.h"
 #include "lyx_cb.h"
-#include "layout_forms.h"
 
-extern FD_form_character * fd_form_character;
 
 #ifndef NEW_INSETS
 void Foot(BufferView * bv)
@@ -147,12 +145,6 @@ void changeDepth(BufferView * bv, LyXText * text, int decInc)
 }
 
 
-void Free(BufferView * bv)
-{
-       ToggleAndShow(bv, UserFreeFont(bv->buffer()->params));
-}
-
-
 // How should this actually work? Should it prohibit input in all BufferViews,
 // or just in the current one? If "just the current one", then it should be
 // placed in BufferView. If "all BufferViews" then LyXGUI (I think) should
@@ -177,11 +169,6 @@ void ProhibitInput(BufferView * bv)
        XDefineCursor(fl_get_display(), bv->owner()->getForm()->window, 
                      cursor);
 
-       if (fd_form_character->form_character->visible)
-               XDefineCursor(fl_get_display(),
-                             fd_form_character->form_character->window,
-                             cursor);
-
        XFlush(fl_get_display());
        fl_deactivate_all_forms();
 }
@@ -193,10 +180,6 @@ void AllowInput(BufferView * bv)
    
        XUndefineCursor(fl_get_display(), bv->owner()->getForm()->window);
 
-       if (fd_form_character->form_character->visible)
-               XUndefineCursor(fl_get_display(),
-                               fd_form_character->form_character->window);
-
        XFlush(fl_get_display());
        fl_activate_all_forms();
 }
@@ -303,7 +286,7 @@ string const CurrentState(BufferView * bv)
 /* -------> Does the actual toggle job of the XxxCB() calls above.
  * Also shows the current font state.
  */
-void ToggleAndShow(BufferView * bv, LyXFont const & font)
+void ToggleAndShow(BufferView * bv, LyXFont const & font, bool toggleall=true)
 {
        if (bv->available()) { 
                LyXText * text = bv->getLyXText();
index 2a062c9eee3b60ceec50128a87ec1da15e066216..ad1b174c5d5931deaf9115e3366794f1a301af56 100644 (file)
@@ -53,8 +53,6 @@ extern void Tex(BufferView *);
 ///
 extern void changeDepth(BufferView *, LyXText *, int);
 ///
-extern void Free(BufferView *);
-///
 extern void ProhibitInput(BufferView *);
 ///
 extern void AllowInput(BufferView *);
@@ -73,5 +71,5 @@ extern void FontSize(BufferView *, string const &);
 /// Returns the current font and depth as a message. 
 extern string const CurrentState(BufferView *);
 ///
-extern void ToggleAndShow(BufferView *, LyXFont const &);
+extern void ToggleAndShow(BufferView *, LyXFont const &, bool toggleall=true);
 #endif
index 9fad5bcb35e32b4d909062454d42efe7ccbc80d7..2ed33651d3d693be98546e4858e9d2e8bf207598 100644 (file)
@@ -89,7 +89,7 @@ void Combox::remove()
        }
        
        lyxerr.debug() << "Label: " << label << endl;
-       if (label && label!= button) {
+       if (label && label != button) {
                fl_delete_object(label);
                fl_free_object(label); 
        }
index 020d70153eea9db645c03346c89db04acb07a147..910130f8c7773ce5a0d6d3f1235e422450a0beb1 100644 (file)
@@ -1,3 +1,7 @@
+2001-02-23  Edwin Leuven <leuven@fee.uva.nl)
+
+       * Dialogs.h: setUserFreeFont, showLayoutCharacter
+
 2001-02-19  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * DialogBase.h: derived from noncopyable, rather than deriving
index 94fc47990484b6e287502e271e8fef1a85f432b8..a8cd0320367ab6b37256e991adf538b6e7007fb1 100644 (file)
@@ -116,6 +116,10 @@ public:
        Signal0<void> showLayoutDocument;
        ///
        Signal0<void> showLayoutParagraph;
+       ///
+       Signal0<void> showLayoutCharacter;
+       ///
+       Signal0<void> setUserFreeFont;
        /// show the version control log
        Signal0<void> showVCLogFile;
        /// show the LaTeX log or build file
index bf2e92448900a5a06736bb31bca8e53909419af5..5965faf15c39be69099d9e1d340e04a172b3fc5c 100644 (file)
@@ -1,3 +1,12 @@
+2001-02-23  Edwin Leuven <leuven@fee.uva.nl>
+
+       * Dialogs.C: added layoutcharacter
+       * FormCharacter.C: added
+       * FormCharacter.h: added
+       * form_character.C: added
+       * form_character.h: added
+       * forms/form_character.fd: added
+               
 2001-02-23  Dekel Tsur  <dekelts@tau.ac.il>
  
        * FormPreferences.C: Handle lyxrc.language_use_babel and
index 6bbabbe2e76ed0539c85edc188e2320c99e7d3d9..e078af96a9e9378dadc025c0346c3a8b98e5655e 100644 (file)
@@ -15,6 +15,7 @@
 #include "FormBibitem.h"
 #include "FormBibtex.h"
 #include "FormCitation.h"
+#include "FormCharacter.h"
 #include "FormCopyright.h"
 #include "FormDocument.h"
 #include "FormError.h"
@@ -53,6 +54,7 @@ Dialogs::Dialogs(LyXView * lv)
 {
        dialogs_.push_back(new FormBibitem(lv, this));
        dialogs_.push_back(new FormBibtex(lv, this));
+       dialogs_.push_back(new FormCharacter(lv, this));
        dialogs_.push_back(new FormCitation(lv, this));
        dialogs_.push_back(new FormCopyright(lv, this));
        dialogs_.push_back(new FormDocument(lv, this));
diff --git a/src/frontends/xforms/FormCharacter.C b/src/frontends/xforms/FormCharacter.C
new file mode 100644 (file)
index 0000000..be81b82
--- /dev/null
@@ -0,0 +1,223 @@
+/**
+ * \file FormCharacter.C
+ * Copyright 2001 The LyX Team.
+ * See the file COPYING.
+ *
+ * \author Edwin Leuven, leuven@fee.uva.nl
+ */
+
+#include <config.h>
+
+#ifdef __GNUG_
+#pragma implementation
+#endif
+
+#include FORMS_H_LOCATION
+
+#include "FormCharacter.h"
+#include "form_character.h"
+#include "bufferview_funcs.h"
+#include "Dialogs.h"
+#include "Liason.h"
+#include "LyXView.h"
+#include "buffer.h"
+#include "lyxtext.h"
+#include "language.h"
+#include "combox.h"
+
+#ifdef CXX_WORKING_NAMESPACES
+using Liason::setMinibuffer;
+#endif
+
+
+FormCharacter::FormCharacter(LyXView * lv, Dialogs * d)
+       : FormBaseBD(lv, d, _("Character Layout"),
+                    new NoRepeatedApplyReadOnlyPolicy),
+       dialog_(0), combo_language2(0)
+{
+   // let the popup be shown
+   // This is a permanent connection so we won't bother
+   // storing a copy because we won't be disconnecting.
+   d->showLayoutCharacter.connect(slot(this, &FormCharacter::show));
+   // for LFUN_FREE
+   d->setUserFreeFont.connect(slot(this, &FormCharacter::apply));
+}
+
+
+FormCharacter::~FormCharacter()
+{
+   delete dialog_;
+   delete combo_language2;
+   
+}
+
+
+FL_FORM * FormCharacter::form() const
+{
+   if (dialog_) 
+     return dialog_->form;
+   return 0;
+}
+
+void FormCharacter::build()
+{
+   dialog_ = build_character();
+   // Workaround dumb xforms sizing bug
+   minw_ = form()->w;
+   minh_ = form()->h;
+   // Manage the ok, apply and cancel/close buttons
+   bc_.setApply(dialog_->button_apply);
+   bc_.setCancel(dialog_->button_close);
+   bc_.refresh();
+   bc_.addReadOnly (dialog_->check_toggle_all);
+   
+   fl_addto_choice(dialog_->choice_family,
+                  _(" No change %l| Roman | Sans Serif | Typewriter %l| Reset "));
+   fl_addto_choice(dialog_->choice_series,
+                  _(" No change %l| Medium | Bold %l| Reset "));
+   fl_addto_choice(dialog_->choice_shape,
+                  _(" No change %l| Upright | Italic | Slanted | Small Caps "
+                    "%l| Reset "));
+   fl_addto_choice(dialog_->choice_size,
+                  _(" No change %l| Tiny | Smallest | Smaller | Small "
+                    "| Normal | Large | Larger | Largest | Huge | Huger "
+                    "%l| Increase | Decrease | Reset "));
+   fl_addto_choice(dialog_->choice_bar,
+                  _(" No change %l| Emph | Underbar | Noun | LaTeX mode %l| Reset "));
+   fl_addto_choice(dialog_->choice_color,
+                  _(" No change %l| No color | Black | White | Red | Green "
+                    "| Blue | Cyan | Magenta | Yellow %l| Reset "));
+   fl_addto_choice(dialog_->choice_language,
+                  _(" English %l| German | French "));
+
+   // insert default language box manually
+   fl_addto_form(dialog_->form);
+   FL_OBJECT * ob = dialog_->choice_language;
+   combo_language2 = new Combox(FL_COMBOX_DROPLIST);
+   combo_language2->add(ob->x, ob->y, ob->w, ob->h, 250);
+   combo_language2->shortcut("#L", 1);
+   fl_end_form();
+
+   // build up the combox entries
+   combo_language2->addline(_("No change"));
+   combo_language2->addline(_("Reset"));
+   for (Languages::const_iterator cit = languages.begin(); 
+       cit != languages.end(); ++cit) {
+       combo_language2->addto((*cit).second.lang());
+   }
+
+   
+}
+
+
+void FormCharacter::apply()
+{
+   if (!lv_->view()->available() || !dialog_)
+     return;
+   
+   LyXFont font(LyXFont::ALL_IGNORE);
+   
+   int pos = fl_get_choice(dialog_->choice_family);
+   switch (pos) {
+      case 1: font.setFamily(LyXFont::IGNORE_FAMILY); break;
+      case 2: font.setFamily(LyXFont::ROMAN_FAMILY); break;
+      case 3: font.setFamily(LyXFont::SANS_FAMILY); break;
+      case 4: font.setFamily(LyXFont::TYPEWRITER_FAMILY); break;
+      case 5: font.setFamily(LyXFont::INHERIT_FAMILY); break;
+   }
+   
+   pos = fl_get_choice(dialog_->choice_series);
+   switch (pos) {
+      case 1: font.setSeries(LyXFont::IGNORE_SERIES); break;
+      case 2: font.setSeries(LyXFont::MEDIUM_SERIES); break;
+      case 3: font.setSeries(LyXFont::BOLD_SERIES); break;
+      case 4: font.setSeries(LyXFont::INHERIT_SERIES); break;
+   }
+   
+   pos = fl_get_choice(dialog_->choice_shape);
+   switch (pos) {
+      case 1: font.setShape(LyXFont::IGNORE_SHAPE); break;
+      case 2: font.setShape(LyXFont::UP_SHAPE); break;
+      case 3: font.setShape(LyXFont::ITALIC_SHAPE); break;
+      case 4: font.setShape(LyXFont::SLANTED_SHAPE); break;
+      case 5: font.setShape(LyXFont::SMALLCAPS_SHAPE); break;
+      case 6: font.setShape(LyXFont::INHERIT_SHAPE); break;
+   }
+   
+   pos = fl_get_choice(dialog_->choice_size);
+   switch (pos) {
+      case 1: font.setSize(LyXFont::IGNORE_SIZE); break;
+      case 2: font.setSize(LyXFont::SIZE_TINY); break;
+      case 3: font.setSize(LyXFont::SIZE_SCRIPT); break;
+      case 4: font.setSize(LyXFont::SIZE_FOOTNOTE); break;
+      case 5: font.setSize(LyXFont::SIZE_SMALL); break;
+      case 6: font.setSize(LyXFont::SIZE_NORMAL); break;
+      case 7: font.setSize(LyXFont::SIZE_LARGE); break;
+      case 8: font.setSize(LyXFont::SIZE_LARGER); break;
+      case 9: font.setSize(LyXFont::SIZE_LARGEST); break;
+      case 10: font.setSize(LyXFont::SIZE_HUGE); break;
+      case 11: font.setSize(LyXFont::SIZE_HUGER); break;
+      case 12: font.setSize(LyXFont::INCREASE_SIZE); break;
+      case 13: font.setSize(LyXFont::DECREASE_SIZE); break;
+      case 14: font.setSize(LyXFont::INHERIT_SIZE); break;
+   }
+   
+   pos = fl_get_choice(dialog_->choice_bar);
+   switch (pos) {
+      case 1: font.setEmph(LyXFont::IGNORE);
+      font.setUnderbar(LyXFont::IGNORE);
+      font.setNoun(LyXFont::IGNORE);
+      font.setLatex(LyXFont::IGNORE);
+      break;
+      case 2: font.setEmph(LyXFont::TOGGLE); break;
+      case 3: font.setUnderbar(LyXFont::TOGGLE); break;
+      case 4: font.setNoun(LyXFont::TOGGLE); break;
+      case 5: font.setLatex(LyXFont::TOGGLE); break;
+      case 6: font.setEmph(LyXFont::INHERIT);
+      font.setUnderbar(LyXFont::INHERIT);
+      font.setNoun(LyXFont::INHERIT);
+      font.setLatex(LyXFont::INHERIT);
+      break;
+   }
+   
+   pos = fl_get_choice(dialog_->choice_color);
+   switch (pos) {
+      case 1: font.setColor(LColor::ignore); break;
+      case 2: font.setColor(LColor::none); break;
+      case 3: font.setColor(LColor::black); break;
+      case 4: font.setColor(LColor::white); break;
+      case 5: font.setColor(LColor::red); break;
+      case 6: font.setColor(LColor::green); break;
+      case 7: font.setColor(LColor::blue); break;
+      case 8: font.setColor(LColor::cyan); break;
+      case 9: font.setColor(LColor::magenta); break;
+      case 10: font.setColor(LColor::yellow); break;
+      case 11: font.setColor(LColor::inherit); break;
+   }
+   
+   int const choice = combo_language2->get();
+   if (choice == 1)
+     font.setLanguage(ignore_language);
+   else if (choice == 2)
+     font.setLanguage(lv_->buffer()->params.language);
+   else
+     font.setLanguage(languages.getLanguage(combo_language2->getline()));
+
+   
+   bool toggleall = fl_get_button(dialog_->check_toggle_all);
+   ToggleAndShow(lv_->view(), font, toggleall);
+   lv_->view()->setState();
+   lv_->buffer()->markDirty();
+   setMinibuffer(lv_, _("Character set"));
+}
+
+
+void FormCharacter::update()
+{
+    if (!dialog_)
+        return;
+   
+    bc_.readOnly(lv_->buffer()->isReadonly());
+}
+
+
diff --git a/src/frontends/xforms/FormCharacter.h b/src/frontends/xforms/FormCharacter.h
new file mode 100644 (file)
index 0000000..5fc5377
--- /dev/null
@@ -0,0 +1,58 @@
+/** 
+ * \file FormCharacter.h
+ * Copyright 2001 The LyX Team.
+ * See the file COPYING.
+ * 
+ * \author Edwin Leuven, leuven@fee.uva.nl
+ */
+
+#ifndef FORM_CHARACTER_H
+#define FORM_CHARACTER_H
+
+#include "FormBase.h"
+
+#ifdef __GNUG_
+#pragma interface
+#endif
+
+
+class LyXView;
+class Dialogs;
+class Combox;
+struct FD_form_character;
+
+/** 
+ * This class provides an XForms implementation of the FormCharacter Dialog.
+ * The character dialog allows users to change the character settings
+ * in their documents.
+ */
+class FormCharacter : public FormBaseBD {
+public:
+   ///
+   FormCharacter(LyXView *, Dialogs *);
+   ///
+   ~FormCharacter();
+
+private:
+       
+   /// Build the popup
+   virtual void build();
+   
+   /// Apply from popup
+   virtual void apply();
+   
+   /// Update the popup.
+   virtual void update();
+   
+   /// Pointer to the actual instantiation of the xform's form
+   virtual FL_FORM * form() const;
+
+   FD_form_character * build_character();
+       
+   /// Real GUI implementation.
+   FD_form_character  * dialog_;
+   
+   Combox * combo_language2;
+};
+
+#endif
index 1ed52add36c694bfa64a1572b963bb6a2a70e2ea..3d1b40dc7c57a08d2c0eca1dfaa296c9ed5d8761 100644 (file)
@@ -32,6 +32,10 @@ libxforms_la_SOURCES = \
        FormBrowser.h \
        form_browser.C \
        form_browser.h \
+       FormCharacter.C \
+       FormCharacter.h \
+       form_character.C \
+       form_character.h \
        FormCitation.C \
        FormCitation.h \
        form_citation.C \
diff --git a/src/frontends/xforms/form_character.C b/src/frontends/xforms/form_character.C
new file mode 100644 (file)
index 0000000..079f35e
--- /dev/null
@@ -0,0 +1,135 @@
+// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
+#include <config.h>
+#include "lyx_gui_misc.h"
+#include "gettext.h"
+
+/* Form definition file generated with fdesign. */
+
+#include FORMS_H_LOCATION
+#include <stdlib.h>
+#include "form_character.h"
+#include "FormCharacter.h"
+
+FD_form_character::~FD_form_character()
+{
+  if ( form->visible ) fl_hide_form( form );
+  fl_free_form( form );
+}
+
+
+FD_form_character * FormCharacter::build_character()
+{
+  FL_OBJECT *obj;
+  FD_form_character *fdui = new FD_form_character;
+
+  fdui->form = fl_bgn_form(FL_NO_BOX, 300, 415);
+  fdui->form->u_vdata = this;
+  obj = fl_add_box(FL_UP_BOX, 0, 0, 300, 415, "");
+    fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
+  obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 10, 280, 240, "");
+    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
+    fl_set_object_resize(obj, FL_RESIZE_X);
+  {
+    char const * const dummy = N_("Family:|#F");
+    fdui->choice_family = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 15, 191, 30, idex(_(dummy)));
+    fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+  }
+    fl_set_object_boxtype(obj, FL_FRAME_BOX);
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
+    fl_set_object_resize(obj, FL_RESIZE_X);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+  {
+    char const * const dummy = N_("Series:|#S");
+    fdui->choice_series = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 55, 191, 30, idex(_(dummy)));
+    fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+  }
+    fl_set_object_boxtype(obj, FL_FRAME_BOX);
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
+    fl_set_object_resize(obj, FL_RESIZE_X);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+  {
+    char const * const dummy = N_("Shape:|#H");
+    fdui->choice_shape = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 95, 191, 30, idex(_(dummy)));
+    fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+  }
+    fl_set_object_boxtype(obj, FL_FRAME_BOX);
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
+    fl_set_object_resize(obj, FL_RESIZE_X);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+  {
+    char const * const dummy = N_("Size:|#Z");
+    fdui->choice_size = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 275, 191, 30, idex(_(dummy)));
+    fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+  }
+    fl_set_object_boxtype(obj, FL_FRAME_BOX);
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
+    fl_set_object_resize(obj, FL_RESIZE_X);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+  {
+    char const * const dummy = N_("Misc:|#M");
+    fdui->choice_bar = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 335, 190, 30, idex(_(dummy)));
+    fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+  }
+    fl_set_object_boxtype(obj, FL_FRAME_BOX);
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
+    fl_set_object_resize(obj, FL_RESIZE_X);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+  {
+    char const * const dummy = N_("Apply|#A");
+    fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 60, 375, 80, 30, idex(_(dummy)));
+    fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+  }
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
+    fl_set_object_callback(obj, C_FormBaseApplyCB, 0);
+  {
+    char const * const dummy = N_("Cancel|#N");
+    fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON, 175, 375, 80, 30, idex(_(dummy)));
+    fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+  }
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
+    fl_set_object_callback(obj, C_FormBaseCancelCB, 0);
+  {
+    char const * const dummy = N_("Color:|#C");
+    fdui->choice_color = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 135, 191, 30, idex(_(dummy)));
+    fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+  }
+    fl_set_object_boxtype(obj, FL_FRAME_BOX);
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
+    fl_set_object_resize(obj, FL_RESIZE_X);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+  {
+    char const * const dummy = N_("Toggle on all these|#T");
+    fdui->check_toggle_all = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 30, 215, 255, 25, idex(_(dummy)));
+    fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+  }
+    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
+    fl_set_object_resize(obj, FL_RESIZE_X);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+  fdui->choice_language = obj = fl_add_choice(FL_DROPLIST_CHOICE, 95, 175, 190, 30, _("Language:"));
+    fl_set_object_boxtype(obj, FL_FRAME_BOX);
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
+    fl_set_object_resize(obj, FL_RESIZE_X);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
+  obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 265, 280, 45, _("These are never toggled"));
+    fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
+  obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 325, 280, 45, _("These are always toggled"));
+    fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
+  fl_end_form();
+
+  fdui->form->fdui = fdui;
+
+  return fdui;
+}
+/*---------------------------------------*/
+
diff --git a/src/frontends/xforms/form_character.h b/src/frontends/xforms/form_character.h
new file mode 100644 (file)
index 0000000..6b51444
--- /dev/null
@@ -0,0 +1,30 @@
+// File modified by fdfix.sh for use by lyx (with xforms >= 0.88) and gettext
+/** Header file generated with fdesign **/
+
+#ifndef FD_form_character_h_
+#define FD_form_character_h_
+
+/** Callbacks, globals and object handlers **/
+extern  "C" void C_FormBaseInputCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseApplyCB(FL_OBJECT *, long);
+extern  "C" void C_FormBaseCancelCB(FL_OBJECT *, long);
+
+
+/**** Forms and Objects ****/
+struct FD_form_character {
+       ~FD_form_character();
+
+       FL_FORM *form;
+       FL_OBJECT *choice_family;
+       FL_OBJECT *choice_series;
+       FL_OBJECT *choice_shape;
+       FL_OBJECT *choice_size;
+       FL_OBJECT *choice_bar;
+       FL_OBJECT *button_apply;
+       FL_OBJECT *button_close;
+       FL_OBJECT *choice_color;
+       FL_OBJECT *check_toggle_all;
+       FL_OBJECT *choice_language;
+};
+
+#endif /* FD_form_character_h_ */
diff --git a/src/frontends/xforms/forms/form_character.fd b/src/frontends/xforms/forms/form_character.fd
new file mode 100644 (file)
index 0000000..fbc4bc3
--- /dev/null
@@ -0,0 +1,269 @@
+Magic: 13000
+
+Internal Form Definition File
+    (do not change)
+
+Number of forms: 1
+Unit of measure: FL_COORD_PIXEL
+SnapGrid: 5
+
+=============== FORM ===============
+Name: form_character
+Width: 300
+Height: 415
+Number of Objects: 14
+
+--------------------
+class: FL_BOX
+type: UP_BOX
+box: 0 0 300 415
+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_NorthWest FL_SouthEast
+name: 
+callback: 
+argument: 
+
+--------------------
+class: FL_FRAME
+type: ENGRAVED_FRAME
+box: 10 10 280 240
+boxtype: FL_NO_BOX
+colors: FL_BLACK FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: 
+shortcut: 
+resize: FL_RESIZE_X
+gravity: FL_NorthWest FL_NorthEast
+name: 
+callback: 
+argument: 
+
+--------------------
+class: FL_CHOICE
+type: NORMAL_CHOICE
+box: 94 15 191 30
+boxtype: FL_FRAME_BOX
+colors: FL_COL1 FL_BLACK
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Family:|#F
+shortcut: 
+resize: FL_RESIZE_X
+gravity: FL_NorthWest FL_NorthEast
+name: choice_family
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_CHOICE
+type: NORMAL_CHOICE
+box: 94 55 191 30
+boxtype: FL_FRAME_BOX
+colors: FL_COL1 FL_BLACK
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Series:|#S
+shortcut: 
+resize: FL_RESIZE_X
+gravity: FL_NorthWest FL_NorthEast
+name: choice_series
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_CHOICE
+type: NORMAL_CHOICE
+box: 94 95 191 30
+boxtype: FL_FRAME_BOX
+colors: FL_COL1 FL_BLACK
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Shape:|#H
+shortcut: 
+resize: FL_RESIZE_X
+gravity: FL_NorthWest FL_NorthEast
+name: choice_shape
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_CHOICE
+type: NORMAL_CHOICE
+box: 95 275 191 30
+boxtype: FL_FRAME_BOX
+colors: FL_COL1 FL_BLACK
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Size:|#Z
+shortcut: 
+resize: FL_RESIZE_X
+gravity: FL_NorthWest FL_NorthEast
+name: choice_size
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_CHOICE
+type: NORMAL_CHOICE
+box: 95 335 190 30
+boxtype: FL_FRAME_BOX
+colors: FL_COL1 FL_BLACK
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Misc:|#M
+shortcut: 
+resize: FL_RESIZE_X
+gravity: FL_NorthWest FL_NorthEast
+name: choice_bar
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_BUTTON
+type: NORMAL_BUTTON
+box: 60 375 80 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: button_apply
+callback: C_FormBaseApplyCB
+argument: 0
+
+--------------------
+class: FL_BUTTON
+type: RETURN_BUTTON
+box: 175 375 80 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|#N
+shortcut: ^M
+resize: FL_RESIZE_NONE
+gravity: FL_SouthEast FL_SouthEast
+name: button_close
+callback: C_FormBaseCancelCB
+argument: 0
+
+--------------------
+class: FL_CHOICE
+type: NORMAL_CHOICE
+box: 95 135 191 30
+boxtype: FL_FRAME_BOX
+colors: FL_COL1 FL_BLACK
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Color:|#C
+shortcut: 
+resize: FL_RESIZE_X
+gravity: FL_NorthWest FL_NorthEast
+name: choice_color
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_CHECKBUTTON
+type: PUSH_BUTTON
+box: 30 215 255 25
+boxtype: FL_NO_BOX
+colors: FL_COL1 FL_YELLOW
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: Toggle on all these|#T
+shortcut: 
+resize: FL_RESIZE_X
+gravity: FL_NorthWest FL_NorthEast
+name: check_toggle_all
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_CHOICE
+type: DROPLIST_CHOICE
+box: 95 175 190 30
+boxtype: FL_FRAME_BOX
+colors: FL_COL1 FL_BLACK
+alignment: FL_ALIGN_LEFT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Language:
+shortcut: 
+resize: FL_RESIZE_X
+gravity: FL_NorthWest FL_NorthEast
+name: choice_language
+callback: C_FormBaseInputCB
+argument: 0
+
+--------------------
+class: FL_LABELFRAME
+type: ENGRAVED_FRAME
+box: 10 265 280 45
+boxtype: FL_NO_BOX
+colors: FL_BLACK FL_COL1
+alignment: FL_ALIGN_TOP_LEFT
+style: FL_BOLD_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: These are never toggled
+shortcut: 
+resize: FL_RESIZE_ALL
+gravity: FL_NorthWest FL_NorthEast
+name: 
+callback: 
+argument: 
+
+--------------------
+class: FL_LABELFRAME
+type: ENGRAVED_FRAME
+box: 10 325 280 45
+boxtype: FL_NO_BOX
+colors: FL_BLACK FL_COL1
+alignment: FL_ALIGN_TOP_LEFT
+style: FL_BOLD_STYLE
+size: FL_DEFAULT_SIZE
+lcol: FL_BLACK
+label: These are always toggled
+shortcut: 
+resize: FL_RESIZE_ALL
+gravity: FL_NorthWest FL_NorthEast
+name: 
+callback: 
+argument: 
+
+==============================
+create_the_forms
diff --git a/src/layout_forms.C b/src/layout_forms.C
deleted file mode 100644 (file)
index d74289c..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-// File modified by fdfix.sh for use by lyx (with xforms > 0.88) and gettext
-#include <config.h>
-#include "lyx_gui_misc.h"
-#include "gettext.h"
-
-/* Form definition file generated with fdesign. */
-
-#include FORMS_H_LOCATION
-#include <cstdlib>
-#include "layout_forms.h"
-
-FD_form_character *create_form_form_character(void)
-{
-  FL_OBJECT *obj;
-  FD_form_character *fdui = (FD_form_character *) fl_calloc(1, sizeof(FD_form_character));
-
-  fdui->form_character = fl_bgn_form(FL_NO_BOX, 300, 415);
-  obj = fl_add_box(FL_UP_BOX, 0, 0, 300, 415, "");
-    fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
-  obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 10, 280, 240, "");
-    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
-    fl_set_object_resize(obj, FL_RESIZE_X);
-  fdui->choice_family = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 15, 191, 30, idex(_("Family:|#F")));fl_set_button_shortcut(obj, scex(_("Family:|#F")), 1);
-    fl_set_object_boxtype(obj, FL_FRAME_BOX);
-    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
-    fl_set_object_resize(obj, FL_RESIZE_X);
-  fdui->choice_series = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 55, 191, 30, idex(_("Series:|#S")));fl_set_button_shortcut(obj, scex(_("Series:|#S")), 1);
-    fl_set_object_boxtype(obj, FL_FRAME_BOX);
-    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
-    fl_set_object_resize(obj, FL_RESIZE_X);
-  fdui->choice_shape = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 95, 191, 30, idex(_("Shape:|#H")));fl_set_button_shortcut(obj, scex(_("Shape:|#H")), 1);
-    fl_set_object_boxtype(obj, FL_FRAME_BOX);
-    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
-    fl_set_object_resize(obj, FL_RESIZE_X);
-  fdui->choice_size = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 275, 191, 30, idex(_("Size:|#Z")));fl_set_button_shortcut(obj, scex(_("Size:|#Z")), 1);
-    fl_set_object_boxtype(obj, FL_FRAME_BOX);
-    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
-    fl_set_object_resize(obj, FL_RESIZE_X);
-  fdui->choice_bar = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 335, 190, 30, idex(_("Misc:|#M")));fl_set_button_shortcut(obj, scex(_("Misc:|#M")), 1);
-    fl_set_object_boxtype(obj, FL_FRAME_BOX);
-    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
-    fl_set_object_resize(obj, FL_RESIZE_X);
-  fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 60, 375, 80, 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, CharacterApplyCB, 0);
-  fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON, 175, 375, 80, 30, _("Close"));
-    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
-    fl_set_object_callback(obj, CharacterCloseCB, 0);
-  fdui->choice_color = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 135, 191, 30, idex(_("Color:|#C")));fl_set_button_shortcut(obj, scex(_("Color:|#C")), 1);
-    fl_set_object_boxtype(obj, FL_FRAME_BOX);
-    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
-    fl_set_object_resize(obj, FL_RESIZE_X);
-  fdui->check_toggle_all = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 30, 215, 255, 25, idex(_("Toggle on all these|#T")));fl_set_button_shortcut(obj, scex(_("Toggle on all these|#T")), 1);
-    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
-    fl_set_object_resize(obj, FL_RESIZE_X);
-  fdui->choice_language = obj = fl_add_choice(FL_DROPLIST_CHOICE, 95, 175, 190, 30, _("Language:"));
-    fl_set_object_boxtype(obj, FL_FRAME_BOX);
-    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
-    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
-    fl_set_object_resize(obj, FL_RESIZE_X);
-  obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 265, 280, 45, _("These are never toggled"));
-    fl_set_object_lstyle(obj, FL_BOLD_STYLE);
-    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
-  obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 325, 280, 45, _("These are always toggled"));
-    fl_set_object_lstyle(obj, FL_BOLD_STYLE);
-    fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
-  fl_end_form();
-
-  fdui->form_character->fdui = fdui;
-
-  return fdui;
-}
-/*---------------------------------------*/
-
diff --git a/src/layout_forms.h b/src/layout_forms.h
deleted file mode 100644 (file)
index 268d415..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/** Header file generated with fdesign **/
-
-#ifndef FD_form_character_h_
-#define FD_form_character_h_
-
-/** Callbacks, globals and object handlers **/
-extern "C" void CharacterApplyCB(FL_OBJECT *, long);
-extern "C" void CharacterCloseCB(FL_OBJECT *, long);
-
-
-/**** Forms and Objects ****/
-typedef struct {
-       FL_FORM *form_character;
-       void *vdata;
-       char *cdata;
-       long  ldata;
-       FL_OBJECT *choice_family;
-       FL_OBJECT *choice_series;
-       FL_OBJECT *choice_shape;
-       FL_OBJECT *choice_size;
-       FL_OBJECT *choice_bar;
-       FL_OBJECT *button_apply;
-       FL_OBJECT *button_close;
-       FL_OBJECT *choice_color;
-       FL_OBJECT *check_toggle_all;
-       FL_OBJECT *choice_language;
-} FD_form_character;
-
-extern FD_form_character * create_form_form_character(void);
-
-#endif /* FD_form_character_h_ */
index 22d31e4fbc617e5a43e3859a5ac36cd0cad2699c..601f6a6f2a3ab141afa9ece03010fb41af11a03a 100644 (file)
@@ -16,7 +16,6 @@
 
 #include FORMS_H_LOCATION
 #include "lyx.h"
-#include "layout_forms.h"
 #include "lyx_main.h"
 #include "lyx_cb.h"
 #include "insets/insetlabel.h"
@@ -49,11 +48,8 @@ using std::vector;
 using std::sort;
 using std::equal;
 
-extern Combox * combo_language;
-extern Combox * combo_language2;
 extern BufferList bufferlist;
 extern void show_symbols_form();
-extern FD_form_character * fd_form_character;
 extern FD_form_figure * fd_form_figure;
 
 extern BufferView * current_view; // called too many times in this file...
@@ -70,10 +66,6 @@ char ascii_type; /* for selection notify callbacks */
 
 bool scrolling = false;
 
-// This is used to make the dreaded font toggle problem hopefully go
-// away. Definitely not the best solution, but I think it sorta works.
-bool toggleall = true;
-
 /* 
    This is the inset locking stuff needed for mathed --------------------
 
@@ -575,26 +567,6 @@ void LayoutsCB(int sel, void *, Combox *)
 }
 
 
-void MenuLayoutCharacter()
-{
-       static int ow = -1, oh;
-
-       if (fd_form_character->form_character->visible) {
-               fl_raise_form(fd_form_character->form_character);
-       } else {
-               fl_show_form(fd_form_character->form_character,
-                            FL_PLACE_MOUSE | FL_FREE_SIZE, FL_TRANSIENT,
-                            _("Character Style"));
-               if (ow < 0) {
-                       ow = fd_form_character->form_character->w;
-                       oh = fd_form_character->form_character->h;
-               }
-               fl_set_form_minsize(fd_form_character->form_character, ow, oh);
-       }
-}
-
-
-
 void MenuLayoutSave(BufferView * bv)
 {
        if (!bv->available())
@@ -607,132 +579,6 @@ void MenuLayoutSave(BufferView * bv)
 }
 
 
-// This is both GUI and LyXFont dependent. Don't know where to put it. (Asger)
-// Well, it's mostly GUI dependent, so I guess it will stay here. (Asger)
-LyXFont const UserFreeFont(BufferParams const & params)
-{
-       LyXFont font(LyXFont::ALL_IGNORE);
-
-       int pos = fl_get_choice(fd_form_character->choice_family);
-       switch (pos) {
-       case 1: font.setFamily(LyXFont::IGNORE_FAMILY); break;
-       case 2: font.setFamily(LyXFont::ROMAN_FAMILY); break;
-       case 3: font.setFamily(LyXFont::SANS_FAMILY); break;
-       case 4: font.setFamily(LyXFont::TYPEWRITER_FAMILY); break;
-       case 5: font.setFamily(LyXFont::INHERIT_FAMILY); break;
-       }
-
-       pos = fl_get_choice(fd_form_character->choice_series);
-       switch (pos) {
-       case 1: font.setSeries(LyXFont::IGNORE_SERIES); break;
-       case 2: font.setSeries(LyXFont::MEDIUM_SERIES); break;
-       case 3: font.setSeries(LyXFont::BOLD_SERIES); break;
-       case 4: font.setSeries(LyXFont::INHERIT_SERIES); break;
-       }
-
-       pos = fl_get_choice(fd_form_character->choice_shape);
-       switch (pos) {
-       case 1: font.setShape(LyXFont::IGNORE_SHAPE); break;
-       case 2: font.setShape(LyXFont::UP_SHAPE); break;
-       case 3: font.setShape(LyXFont::ITALIC_SHAPE); break;
-       case 4: font.setShape(LyXFont::SLANTED_SHAPE); break;
-       case 5: font.setShape(LyXFont::SMALLCAPS_SHAPE); break;
-       case 6: font.setShape(LyXFont::INHERIT_SHAPE); break;
-       }
-
-       pos = fl_get_choice(fd_form_character->choice_size);
-       switch (pos) {
-       case 1: font.setSize(LyXFont::IGNORE_SIZE); break;
-       case 2: font.setSize(LyXFont::SIZE_TINY); break;
-       case 3: font.setSize(LyXFont::SIZE_SCRIPT); break;
-       case 4: font.setSize(LyXFont::SIZE_FOOTNOTE); break;
-       case 5: font.setSize(LyXFont::SIZE_SMALL); break;
-       case 6: font.setSize(LyXFont::SIZE_NORMAL); break;
-       case 7: font.setSize(LyXFont::SIZE_LARGE); break;
-       case 8: font.setSize(LyXFont::SIZE_LARGER); break;
-       case 9: font.setSize(LyXFont::SIZE_LARGEST); break;
-       case 10: font.setSize(LyXFont::SIZE_HUGE); break;
-       case 11: font.setSize(LyXFont::SIZE_HUGER); break;
-       case 12: font.setSize(LyXFont::INCREASE_SIZE); break;
-       case 13: font.setSize(LyXFont::DECREASE_SIZE); break;
-       case 14: font.setSize(LyXFont::INHERIT_SIZE); break;
-       }
-
-       pos = fl_get_choice(fd_form_character->choice_bar);
-       switch (pos) {
-       case 1: font.setEmph(LyXFont::IGNORE);
-               font.setUnderbar(LyXFont::IGNORE);
-               font.setNoun(LyXFont::IGNORE);
-               font.setLatex(LyXFont::IGNORE);
-               break;
-       case 2: font.setEmph(LyXFont::TOGGLE); break;
-       case 3: font.setUnderbar(LyXFont::TOGGLE); break;
-       case 4: font.setNoun(LyXFont::TOGGLE); break;
-       case 5: font.setLatex(LyXFont::TOGGLE); break;
-       case 6: font.setEmph(LyXFont::INHERIT);
-               font.setUnderbar(LyXFont::INHERIT);
-               font.setNoun(LyXFont::INHERIT);
-               font.setLatex(LyXFont::INHERIT);
-               break;
-       }
-
-       pos = fl_get_choice(fd_form_character->choice_color);
-       switch (pos) {
-       case 1: font.setColor(LColor::ignore); break;
-       case 2: font.setColor(LColor::none); break;
-       case 3: font.setColor(LColor::black); break;
-       case 4: font.setColor(LColor::white); break;
-       case 5: font.setColor(LColor::red); break;
-       case 6: font.setColor(LColor::green); break;
-       case 7: font.setColor(LColor::blue); break;
-       case 8: font.setColor(LColor::cyan); break;
-       case 9: font.setColor(LColor::magenta); break;
-       case 10: font.setColor(LColor::yellow); break;
-       case 11: font.setColor(LColor::inherit); break;
-       }
-
-       int const choice = combo_language2->get();
-       if (choice == 1)
-               font.setLanguage(ignore_language);
-       else if (choice == 2)
-               font.setLanguage(params.language);
-       else
-               font.setLanguage(languages.getLanguage(combo_language2->getline()));
-
-       return font; 
-}
-
-
-/* callbacks for form form_character */
-
-extern "C"
-void CharacterApplyCB(FL_OBJECT *, long)
-{
-       // we set toggleall locally here, since it should be true for
-       // all other uses of ToggleAndShow() (JMarc)
-       toggleall = fl_get_button(fd_form_character->check_toggle_all);
-       ToggleAndShow(current_view, UserFreeFont(current_view->buffer()->params));
-       current_view->setState();
-       toggleall = true;
-}
-
-
-extern "C"
-void CharacterCloseCB(FL_OBJECT *, long)
-{
-       fl_hide_form(fd_form_character->form_character);
-}
-
-
-extern "C"
-void CharacterOKCB(FL_OBJECT * ob, long data)
-{
-       CharacterApplyCB(ob, data);
-       CharacterCloseCB(ob, data);
-}
-
-
-
 void Figure()
 {
        if (fd_form_figure->form_figure->visible) {
index 4ece4bdfc389eb306092f7eece7185671963c50c..362f9b0d1873c297772e639f34e7c3886231e539 100644 (file)
@@ -19,8 +19,6 @@ extern bool toggleall;
 ///
 extern bool BindFileSet;
 ///
-extern LyXFont const UserFreeFont(BufferParams const & params);
-///
 void ShowMessage(Buffer const * buf,
                 string const & msg1,
                 string const & msg2 = string(),
@@ -48,8 +46,6 @@ void MenuLayoutCharacter();
 ///
 void MenuLayoutSave(BufferView * bv);
 ///
-LyXFont const UserFreeFont(BufferParams const & params);
-///
 void Figure();
 ///
 void Reconfigure(BufferView * bv);
index 3ea7067556bd5bfb16588436998408e32cb01c99..806372c37fe18f6389a4e1472f090c4d31c85a2f 100644 (file)
 #pragma implementation
 #endif
 
-#include <fcntl.h>
+//#include <fcntl.h>
 #include "lyx_gui.h"
 #include FORMS_H_LOCATION
 #include "support/filetools.h"
 #include "combox.h"
 #include "lyx.h"
 #include "form1.h"
-#include "layout_forms.h"
 #include "print_form.h"
 #include "tex-strings.h"
 #include "lyx_main.h"
 
 using std::endl;
 
-FD_form_character * fd_form_character;
 FD_form_sendto * fd_form_sendto;
 FD_form_figure * fd_form_figure;
-Combox * combo_language;
-Combox * combo_language2;
 
 extern LyXServer * lyxserver;
 extern bool finished;  // flag, that we are quitting the program
@@ -278,53 +274,6 @@ void LyXGUI::create_forms()
        // Create forms
        //
 
-       // the character form
-       fd_form_character = create_form_form_character();
-       fl_set_form_atclose(fd_form_character->form_character,
-                           CancelCloseBoxCB, 0);
-       fl_addto_choice(fd_form_character->choice_family, 
-                       _(" No change %l| Roman | Sans Serif | Typewriter %l| Reset "));
-       fl_addto_choice(fd_form_character->choice_series, 
-                       _(" No change %l| Medium | Bold %l| Reset "));
-       fl_addto_choice(fd_form_character->choice_shape,
-                       _(" No change %l| Upright | Italic | Slanted | Small Caps "
-                       "%l| Reset "));
-       fl_addto_choice(fd_form_character->choice_size, 
-                       _(" No change %l| Tiny | Smallest | Smaller | Small "
-                       "| Normal | Large | Larger | Largest | Huge | Huger "
-                       "%l| Increase | Decrease | Reset "));
-       fl_addto_choice(fd_form_character->choice_bar, 
-                       _(" No change %l| Emph | Underbar | Noun | LaTeX mode %l| Reset "));
-       fl_addto_choice(fd_form_character->choice_color, 
-                       _(" No change %l| No color | Black | White | Red | Green "
-                       "| Blue | Cyan | Magenta | Yellow %l| Reset "));
-       // Appears to need initialising to avoid seg fault when dialog is
-       // launched. Over-written by combo_language2, below
-       fl_addto_choice(fd_form_character->choice_language,
-                       _(" English %l| German | French "));
-       fl_set_form_minsize(fd_form_character->form_character,
-                           fd_form_character->form_character->w,
-                           fd_form_character->form_character->h);
-       lyxerr[Debug::INIT] << "Initializing form_character::combox..." << endl;
-       fl_addto_form(fd_form_character->form_character);
-       combo_language2 = new Combox(FL_COMBOX_DROPLIST);
-       FL_OBJECT * ob = fd_form_character->choice_language;
-       combo_language2->add(ob->x, ob->y, ob->w, ob->h, 250);
-       combo_language2->shortcut("#L", 1);
-       fl_end_form();
-       lyxerr[Debug::INIT] << "Initializing form_character...done" << endl;
-
-       // build up the combox entries
-       combo_language2->addline(_("No change"));
-       combo_language2->addline(_("Reset"));
-       for (Languages::const_iterator cit = languages.begin();
-           cit != languages.end(); ++cit) {
-#ifdef DO_USE_DEFAULT_LANGUAGE
-           if ((*cit).second.lang() != "default")
-#endif
-               combo_language2->addto((*cit).second.lang());
-       }
-
        // the sendto form
        fd_form_sendto = create_form_form_sendto();
        fl_set_form_atclose(fd_form_sendto->form_sendto, CancelCloseBoxCB, 0);
index 56325a561384b12ba41bd911aaad5ebb93913a69..539a3b1d56bd21765942d7331777ba4bbfc43fae 100644 (file)
@@ -22,7 +22,6 @@
 #include "credits_form.h"
 #include "form1.h"
 #include "gettext.h"
-#include "layout_forms.h"
 #include "lyx.h"
 #include "lyx_cb.h"
 #include "lyx_main.h"
@@ -41,7 +40,6 @@ using std::endl;
 
 extern BufferView * current_view;
 
-extern FD_form_character * fd_form_character;
 extern FD_form_credits * fd_form_credits;
 extern FD_form_figure * fd_form_figure;
 extern FD_form_sendto * fd_form_sendto;
@@ -70,9 +68,6 @@ void RedrawAllBufferRelatedDialogs()
        if (fd_delim && fd_delim->delim->visible) {
                fl_redraw_form(fd_delim->delim);
        }
-       if (fd_form_character->form_character->visible) {
-               fl_redraw_form(fd_form_character->form_character);
-       }
        if (fd_form_credits && fd_form_credits->form_credits->visible) {
                fl_redraw_form(fd_form_credits->form_credits);
        }
@@ -111,9 +106,6 @@ void CloseAllBufferRelatedDialogs()
        // have been created otherwise hiding one could cause a crash
        // need the visible check otherwise XForms prints a warning
        // if hiding an invisible form
-       if (fd_form_character->form_character->visible) {
-               fl_hide_form(fd_form_character->form_character);
-       }
        if (fd_form_figure->form_figure->visible) {
                fl_hide_form(fd_form_figure->form_figure);
        }
@@ -159,9 +151,6 @@ void updateAllVisibleBufferRelatedDialogs(bool)
 {
        if (current_view->buffer() &&  current_view->buffer()->isReadonly()) {
                // a little crude perhaps but it works. ARRae
-               if (fd_form_character->form_character->visible) {
-                       fl_hide_form(fd_form_character->form_character);
-               }
 #ifndef ALWAYS_CLOSE_MATH_PANELS
                // The math popups should be closed only if we switch
                // to a readonly buffer
index 14f7197207e512df945f07cd6117e023ed057cb1..b44f6c808c7018ab3ab15d9956222d65959bfbca 100644 (file)
@@ -957,9 +957,7 @@ string const LyXFunc::Dispatch(int ac,
                break;
                
        case LFUN_FREE:
-               Free(owner->view());
-               owner->view()->setState();
-               owner->showState();
+               owner->getDialogs()->setUserFreeFont();
                break;
                
        case LFUN_TEX:
@@ -1159,7 +1157,7 @@ string const LyXFunc::Dispatch(int ac,
                break;
                
        case LFUN_LAYOUT_CHARACTER:
-               MenuLayoutCharacter();
+               owner->getDialogs()->showLayoutCharacter();
                break;
 
        case LFUN_LAYOUT_TABULAR:
index 1f292a88f7449dab98ffdf24eae7a8c1cfa6bb10..13ac9b5531d280a7815eb189d33038255a9d8619 100644 (file)
@@ -151,7 +151,8 @@ void MathMacro::GetXY(int & x, int & y) const
 bool MathMacro::Permit(short f) const
 {
        return (nargs_ > 0) ?
-               tmplate_->getMacroPar(idx_)->Permit(f) : MathParInset::Permit(f);
+               tmplate_->getMacroPar(idx_)->Permit(f) :
+               MathParInset::Permit(f);
 }