]> git.lyx.org Git - features.git/commitdiff
(Rob Lahaye): updates to the xforms print, spellchecker, texinfo and wrap
authorAngus Leeming <leeming@lyx.org>
Fri, 25 Oct 2002 09:16:22 +0000 (09:16 +0000)
committerAngus Leeming <leeming@lyx.org>
Fri, 25 Oct 2002 09:16:22 +0000 (09:16 +0000)
dialogs.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5511 a592a061-630c-0410-9148-cb99ea01b6c8

21 files changed:
src/PrinterParams.h
src/frontends/ChangeLog
src/frontends/Liason.C [deleted file]
src/frontends/Liason.h [deleted file]
src/frontends/Makefile.am
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlPrint.C
src/frontends/controllers/ControlSpellchecker.C
src/frontends/controllers/ControlSpellchecker.h
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormPrint.C
src/frontends/xforms/FormPrint.h
src/frontends/xforms/FormSpellchecker.C
src/frontends/xforms/FormSpellchecker.h
src/frontends/xforms/FormTexinfo.C
src/frontends/xforms/FormWrap.C
src/frontends/xforms/FormWrap.h
src/frontends/xforms/forms/form_print.fd
src/frontends/xforms/forms/form_spellchecker.fd
src/frontends/xforms/forms/form_texinfo.fd
src/frontends/xforms/forms/form_wrap.fd

index ff4c9dfc793364c1158e0c702a036a3c2bed0f2b..06dd555d15db2d4c9f808b7711414b60e90a89ab 100644 (file)
@@ -105,7 +105,7 @@ struct PrinterParams {
                      string const & fname = string(),
                      bool const all = true,
                      unsigned int const & from = 1,
-                     unsigned int const & to = 1,
+                     unsigned int const & to = 0,
                      bool const odd = true,
                      bool const even = true,
                      unsigned int const & copies = 1,
index 3e2cad4bc4c49e5b816b0408aed5bf638f37ee49..bb6a66177d97c886931781fe3d76ce55b22f21ae 100644 (file)
@@ -1,3 +1,11 @@
+2002-10-24  Rob Lahaye  <lahaye@snu.ac.kr>
+
+       * PrinterParams.h (to): default value changed to 0 (from 1).
+
+       * Liason.[Ch]: removed. Code moved into ControlPrint.[Ch].
+
+       * makefile.am: remove Liason.[Ch].
+
 2002-10-21  Angus Leeming  <aleem@pneumon.bg.ic.ac.uk>
 
        * LyXKeySym.h (operator==): compilation fix. The two args should have
diff --git a/src/frontends/Liason.C b/src/frontends/Liason.C
deleted file mode 100644 (file)
index eeddaba..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/**
- * \file Liason.C
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Allan Rae
- *
- * Full author contact details are available in file CREDITS
- */
-
-#include <config.h>
-
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
-#include "Liason.h"
-#include "lyxrc.h"
-#include "PrinterParams.h"
-
-#include "frontends/LyXView.h"
-#include "BufferView.h"
-#include "buffer.h"
-#include "exporter.h"
-#include "converter.h"
-
-#include "support/LAssert.h"
-#include "support/lstrings.h"
-#include "support/filetools.h"
-#include "support/path.h"
-#include "support/systemcall.h"
-
-#include "debug.h" // for lyxerr
-
-using std::endl;
-
-namespace Liason {
-
-PrinterParams getPrinterParams(Buffer * buffer)
-{
-       return PrinterParams(PrinterParams::PRINTER,
-                            lyxrc.printer,
-                            ChangeExtension(buffer->fileName(),
-                                            lyxrc.print_file_extension));
-}
-
-
-bool printBuffer(Buffer * buffer, PrinterParams const & pp)
-{
-       string command(lyxrc.print_command + ' ');
-
-       if (pp.target == PrinterParams::PRINTER
-           && lyxrc.print_adapt_output  // dvips wants a printer name
-           && !pp.printer_name.empty()) {// printer name given
-               command += lyxrc.print_to_printer
-                       + pp.printer_name
-                       + ' ';
-       }
-
-       if (!pp.all_pages && pp.from_page) {
-               command += lyxrc.print_pagerange_flag + ' ';
-               command += tostr(pp.from_page);
-               if (pp.to_page) {
-                       // we have a range "from-to"
-                       command += '-';
-                       command += tostr(pp.to_page);
-               }
-               command += ' ';
-       }
-
-       // If both are, or both are not selected, then skip the odd/even printing
-       if (pp.odd_pages != pp.even_pages) {
-               if (pp.odd_pages) {
-                       command += lyxrc.print_oddpage_flag + ' ';
-               } else if (pp.even_pages) {
-                       command += lyxrc.print_evenpage_flag + ' ';
-               }
-       }
-
-       if (pp.count_copies > 1) {
-               if (pp.sorted_copies) {
-                       command += lyxrc.print_collcopies_flag;
-               } else {
-                       command += lyxrc.print_copies_flag;
-               }
-               command += ' ';
-               command += tostr(pp.count_copies);
-               command += ' ';
-       }
-
-       if (pp.reverse_order) {
-               command += lyxrc.print_reverse_flag + ' ';
-       }
-
-       if (!lyxrc.print_extra_options.empty()) {
-               command += lyxrc.print_extra_options + ' ';
-       }
-
-       command += converters.dvips_options(buffer) + ' ';
-
-       if (!Exporter::Export(buffer, "dvi", true))
-               return false;
-
-       // Push directory path.
-       string path = buffer->filePath();
-       if (lyxrc.use_tempdir || !IsDirWriteable(path)) {
-               path = buffer->tmppath;
-       }
-       Path p(path);
-
-       // there are three cases here:
-       // 1. we print to a file
-       // 2. we print direct to a printer
-       // 3. we print using a spool command (print to file first)
-       Systemcall one;
-       int res = 0;
-       string dviname = ChangeExtension(buffer->getLatexName(true), "dvi");
-       switch (pp.target) {
-       case PrinterParams::PRINTER:
-               if (!lyxrc.print_spool_command.empty()) {
-                       // case 3
-                       string psname = ChangeExtension(dviname, ".ps");
-                       command += lyxrc.print_to_file
-                               + QuoteName(psname) + ' ';
-                       command += QuoteName(dviname);
-                       string command2 = lyxrc.print_spool_command + ' ';
-                       if (!pp.printer_name.empty())
-                               command2 += lyxrc.print_spool_printerprefix
-                                       + pp.printer_name + ' ';
-                       command2 += QuoteName(psname);
-                       // First run dvips.
-                       // If successful, then spool command
-                       res = one.startscript(Systemcall::Wait, command);
-                       if (res == 0)
-                               res = one.startscript(Systemcall::DontWait,
-                                                     command2);
-               } else
-                       // case 2
-                       res = one.startscript(Systemcall::DontWait,
-                                             command + QuoteName(dviname));
-               break;
-
-       case PrinterParams::FILE:
-               // case 1
-               command += lyxrc.print_to_file
-                       + QuoteName(MakeAbsPath(pp.file_name, path));
-               command += ' ' + QuoteName(dviname);
-               res = one.startscript(Systemcall::DontWait, command);
-               break;
-       }
-
-       lyxerr[Debug::LATEX] << "printBuffer: \"" << command << "\"\n";
-
-       return res == 0;
-}
-
-} // namespace Liason
diff --git a/src/frontends/Liason.h b/src/frontends/Liason.h
deleted file mode 100644 (file)
index bfab7fc..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-// -*- C++ -*-
-/** Liason.h
- * Temporary namespace to hold the various frontend functions until XTL and
- * the compilers of the world are ready for something more elaborate.
- * This is basically the Communicator class from the lyx cvs module all
- * over again.
- *
- * FuncRequestually, we will switch back to the XTL+LyXFunc combination that
- * worked so nicely on a very small number of compilers and systems (when
- * most systems can support those required features).
- *
- * Author: Allan Rae <rae@lyx.org>
- * This file is part of
- * ======================================================
- *
- *           LyX, The Document Processor
- *
- *           Copyright 1995 Matthias Ettrich
- *
- *           This file Copyright 2000
- *           Allan Rae
- * ======================================================
- */
-
-#ifndef LIASON_H
-#define LIASON_H
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include "LString.h"
-
-class PrinterParams;
-class Buffer;
-class LyXView;
-class BufferParams;
-
-/** Temporary namespace to hold the various frontend functions
-    until XTL and the compilers of the world are ready for something more
-    elaborate. This is basically the Communicator class from the lyx cvs module
-    all over again.
-
-    FuncRequestually, we will switch back to the XTL+LyXFunc combination that
-    worked so nicely on a very small number of compilers and systems.
-    See the "dialogbase" branch of lyx-devel cvs module for xtl implementation.
-*/
-namespace Liason {
-       /**@name Global support functions */
-       //@{
-       /// get global printer parameters
-       PrinterParams getPrinterParams(Buffer *);
-       /// print the current buffer
-       bool printBuffer(Buffer *, PrinterParams const &);
-       //@}
-
-} // namespace Liason
-#endif
index fd2b7f932a4ef275a727c40520bf14f201da989f..1bf400490f20bc383aec9ffad9723e43a608a54a 100644 (file)
@@ -21,8 +21,6 @@ libfrontends_la_SOURCES = \
        Dialogs.C \
        Dialogs.h \
        FileDialog.h \
-       Liason.C \
-       Liason.h \
        LyXKeySym.h \
        LyXKeySymFactory.h \
        LyXScreenFactory.h \
index 0c75999144f957f6b6a8b847f1e59ce5a50b508d..490bde08af1773c0e51af3cbcbc3b2c25f91dc73 100644 (file)
@@ -1,3 +1,10 @@
+2002-10-24  Rob Lahaye  <lahaye@snu.ac.kr>
+
+       * ControlPrint.[Ch]: move code here from Liason.[Ch].
+
+       * ControlSpellchecker.h (getCount): new method.
+       * ControlSpellchecker.[Ch]: constify some accessor methods.
+
 2002-10-22  Angus Leeming  <leeming@lyx.org>
 
        * Makefile.am (libcontrollers_la_SOURCES): arrange list into
index cd4339cb988ca8610b2709ea6e46e69b2fb4ea24..6d40b454d36d83bea52329b3f331bc4f3710b130 100644 (file)
 #include "gettext.h"
 #include "helper_funcs.h"
 #include "PrinterParams.h"
+#include "exporter.h"
+#include "converter.h"
 
 #include "frontends/Alert.h"
-#include "frontends/Liason.h"
 
 #include "support/LAssert.h"
+#include "support/filetools.h"
+#include "support/path.h"
+#include "support/systemcall.h"
 
-using Liason::printBuffer;
-using Liason::getPrinterParams;
+#include "debug.h" // for lyxerr
 
 
 ControlPrint::ControlPrint(LyXView & lv, Dialogs & d)
@@ -39,21 +42,6 @@ ControlPrint::ControlPrint(LyXView & lv, Dialogs & d)
 {}
 
 
-void ControlPrint::apply()
-{
-       if (!bufferIsAvailable())
-               return;
-
-       view().apply();
-
-       if (!printBuffer(buffer(), params())) {
-               Alert::alert(_("Error:"),
-                          _("Unable to print"),
-                          _("Check that your parameters are correct"));
-       }
-}
-
-
 PrinterParams & ControlPrint::params() const
 {
        lyx::Assert(params_);
@@ -64,7 +52,12 @@ PrinterParams & ControlPrint::params() const
 void ControlPrint::setParams()
 {
        if (params_) delete params_;
-       params_ = new PrinterParams(getPrinterParams(buffer()));
+
+       /// get global printer parameters
+       string const name =  ChangeExtension(buffer()->fileName(),
+                                       lyxrc.print_file_extension);
+       params_ = new PrinterParams (PrinterParams::PRINTER,
+                                       lyxrc.printer, name);
 
        bc().valid(); // so that the user can press Ok
 }
@@ -88,3 +81,134 @@ string const ControlPrint::Browse(string const & in_name)
        return browseRelFile(&lv_, in_name, buffer()->filePath(),
                             title, pattern);
 }
+
+
+/// print the current buffer
+void ControlPrint::apply()
+{
+       if (!bufferIsAvailable())
+               return;
+
+       view().apply();
+
+       PrinterParams const pp = params();
+       string command(lyxrc.print_command + ' ');
+
+       if (pp.target == PrinterParams::PRINTER
+           && lyxrc.print_adapt_output  // dvips wants a printer name
+           && !pp.printer_name.empty()) {// printer name given
+               command += lyxrc.print_to_printer
+                       + pp.printer_name
+                       + ' ';
+       }
+
+       if (!pp.all_pages && pp.from_page) {
+               command += lyxrc.print_pagerange_flag + ' ';
+               command += tostr(pp.from_page);
+               if (pp.to_page) {
+                       // we have a range "from-to"
+                       command += '-'
+                               + tostr(pp.to_page);
+               }
+               command += ' ';
+       }
+
+       // If both are, or both are not selected, then skip the odd/even printing
+       if (pp.odd_pages != pp.even_pages) {
+               if (pp.odd_pages) {
+                       command += lyxrc.print_oddpage_flag + ' ';
+               } else if (pp.even_pages) {
+                       command += lyxrc.print_evenpage_flag + ' ';
+               }
+       }
+
+       if (pp.count_copies > 1) {
+               if (pp.sorted_copies) {
+                       command += lyxrc.print_collcopies_flag;
+               } else {
+                       command += lyxrc.print_copies_flag;
+               }
+               command += ' '
+                       + tostr(pp.count_copies)
+                       + ' ';
+       }
+       
+       if (pp.reverse_order) {
+               command += lyxrc.print_reverse_flag + ' ';
+       }
+
+       if (!lyxrc.print_extra_options.empty()) {
+               command += lyxrc.print_extra_options + ' ';
+       }
+
+       command += converters.dvips_options(buffer()) + ' ';
+
+       if (!Exporter::Export(buffer(), "dvi", true)) {
+               Alert::alert(_("Error:"),
+                          _("Unable to print"),
+                          _("Check that your parameters are correct"));
+               return;
+       }
+
+       // Push directory path.
+       string path = buffer()->filePath();
+       if (lyxrc.use_tempdir || !IsDirWriteable(path)) {
+               path = buffer()->tmppath;
+       }
+       Path p(path);
+
+       // there are three cases here:
+       // 1. we print to a file
+       // 2. we print directly to a printer
+       // 3. we print using a spool command (print to file first)
+       Systemcall one;
+       int res = 0;
+       string const dviname = ChangeExtension(buffer()->getLatexName(true), "dvi");
+       switch (pp.target) {
+       case PrinterParams::PRINTER:
+               if (!lyxrc.print_spool_command.empty()) {
+                       // case 3: print using a spool
+                       string const psname = ChangeExtension(dviname, ".ps");
+                       command += lyxrc.print_to_file
+                               + QuoteName(psname)
+                               + ' '
+                               + QuoteName(dviname);
+
+                       string command2 = lyxrc.print_spool_command + ' ';
+                       if (!pp.printer_name.empty()) {
+                               command2 += lyxrc.print_spool_printerprefix
+                                       + pp.printer_name
+                                       + ' ';
+                       }
+                       command2 += QuoteName(psname);
+                       // First run dvips.
+                       // If successful, then spool command
+                       res = one.startscript(Systemcall::Wait, command);
+                       if (res == 0)
+                               res = one.startscript(Systemcall::DontWait,
+                                                     command2);
+               } else {
+                       // case 2: print directly to a printer
+                       res = one.startscript(Systemcall::DontWait,
+                                             command + QuoteName(dviname));
+               }
+               break;
+
+       case PrinterParams::FILE:
+               // case 1: print to a file
+               command += lyxrc.print_to_file
+                       + QuoteName(MakeAbsPath(pp.file_name, path))
+                       + ' ' 
+                       + QuoteName(dviname);
+               res = one.startscript(Systemcall::DontWait, command);
+               break;
+       }
+
+       lyxerr[Debug::LATEX] << "ControlPrint::apply(): print command = \"" << command << "\"" << endl;
+
+       if (res != 0) {
+               Alert::alert(_("Error:"),
+                          _("Unable to print"),
+                          _("Check that your parameters are correct"));
+       }               
+}
index 49f8c6b877898ec49ceee75950d766401d552f43..a0e9e62aeec24f8ad179b4e030a33f5092764888 100644 (file)
@@ -148,7 +148,7 @@ void ControlSpellchecker::insert()
 }
 
 
-string ControlSpellchecker::getSuggestion()
+string const ControlSpellchecker::getSuggestion() const
 {
        string miss(speller_->nextMiss());
 
@@ -159,7 +159,7 @@ string ControlSpellchecker::getSuggestion()
 }
 
 
-string ControlSpellchecker::getWord()
+string const ControlSpellchecker::getWord() const
 {
        string tmp = word_.word();
        if (rtl_)
index c1444e14f9f0ecfe6fd68861af3b51391a6476a9..aa359865cda33bb97fe953c898115967f9c2706e 100644 (file)
@@ -48,20 +48,20 @@ public:
        void check();
 
        /// get suggestion
-       string getSuggestion();
+       string const getSuggestion() const;
 
        /// get word
-       string getWord();
+       string const getWord() const;
 
        /// returns progress value
-       int getProgress() {
-               return oldval_;
-       }
+       int getProgress() const { return oldval_; }
 
        /// returns exit message
-       string getMessage() {
-               return message_;
-       }
+       string const getMessage()  const { return message_; }
+
+       /// returns word count
+       int getCount()  const { return count_; }
+
 private:
        /// set the params before show or update
        void setParams();
index 637f38575bd6034c4b17df4534de3d49c1f84262..31867bb9f76bb69faf31ae1ca7814e6db5d72ce7 100644 (file)
@@ -1,8 +1,23 @@
 2002-10-24  Rob Lahaye  <lahaye@snu.ac.kr>
 
+       * forms/form_print.fd:
+       * FormPrint.[Ch]: clean-up, reflecting discussion on the list.
+
+       * forms/form_spellchecker.fd:
+       * FormSpellchecker.[Ch]: add tooltips; general clean-up.
+        add word count to dialog and improve progress status;
+         implement single Start/Stop button;
+
        * FormTabular.C (build): rearrange lines tab by tab.
        Use getString not fl_get_inout.
 
+       * FormTexinfo.C: replace View-button by catching double click in
+       browser; allow viewing of files, irrespective of full path.
+
+       * forms/form_wrap.fd: resized. Remove text_warning widget. Fix gravity.
+       * FormWrap.[Ch]: simplification through the use of RadioButtonGroup
+       and CheckedGlueLength. Add tooltips.
+
 2002-10-24  Angus Leeming  <leeming@lyx.org>
 
        * FormRef.C (updateBrowser): invoke updateHighlight
index 05422954b6b13d2d01052df51b6d284897ea9b22..ec0bb3744008e0a980cbb788d4f812527d079cf6 100644 (file)
@@ -29,7 +29,6 @@
 #include "support/lstrings.h"
 #include FORMS_H_LOCATION
 
-using std::make_pair;
 
 typedef FormCB<ControlPrint, FormDB<FD_print> > base_class;
 
@@ -47,7 +46,12 @@ void FormPrint::build()
        bc().setApply(dialog_->button_apply);
        bc().setCancel(dialog_->button_close);
 
-       // allow controlling of input and ok/apply (de)activation
+       // trigger an input event for cut&paste with middle mouse button.
+       setPrehandler(dialog_->input_printer);
+       setPrehandler(dialog_->input_file);
+       setPrehandler(dialog_->input_from_page);
+       setPrehandler(dialog_->input_to_page);
+
        fl_set_input_return(dialog_->input_printer, FL_RETURN_CHANGED);
        fl_set_input_return(dialog_->input_file, FL_RETURN_CHANGED);
        fl_set_input_return(dialog_->input_from_page, FL_RETURN_CHANGED);
@@ -63,17 +67,12 @@ void FormPrint::build()
        fl_set_input_maxchars(dialog_->input_from_page, 4); // 9999
        fl_set_input_maxchars(dialog_->input_to_page, 4);   // 9999
 
-       bc().addReadOnly(dialog_->button_browse);   
-       bc().addReadOnly(dialog_->check_odd_pages);   
-       bc().addReadOnly(dialog_->check_even_pages);   
-       bc().addReadOnly(dialog_->check_sorted_copies);
-       bc().addReadOnly(dialog_->check_reverse_order);
-
        target_.init(dialog_->radio_printer, PrinterParams::PRINTER);
        target_.init(dialog_->radio_file,    PrinterParams::FILE);
-       which_pages_.init(dialog_->radio_all_pages, true);
-       which_pages_.init(dialog_->radio_from_to,   false);
-       
+
+       all_pages_.init(dialog_->radio_all_pages, true);
+       all_pages_.init(dialog_->radio_from_to, false);
+
        // set up the tooltips for Destination
        string str = _("Select for printer output.");
        tooltips().init(dialog_->radio_printer, str);
@@ -116,16 +115,16 @@ void FormPrint::apply()
        PrinterParams pp;
 
        pp.target = static_cast<PrinterParams::Target>(target_.get());
-       pp.printer_name = fl_get_input(dialog_->input_printer);
-       pp.file_name = fl_get_input(dialog_->input_file);
+       pp.printer_name = getString(dialog_->input_printer);
+       pp.file_name = getString(dialog_->input_file);
+
+       pp.all_pages = static_cast<bool>(all_pages_.get());
 
-       pp.all_pages = which_pages_.get();
-       pp.from_page = 0;
-       pp.to_page = 0;
-       if (strlen(fl_get_input(dialog_->input_from_page)) > 0) {
+       pp.from_page = pp.to_page = 0;
+       if (!getString(dialog_->input_from_page).empty()) {
                // we have at least one page requested
                pp.from_page = strToInt(fl_get_input(dialog_->input_from_page));
-               if (strlen(fl_get_input(dialog_->input_to_page)) > 0) {
+               if (!getString(dialog_->input_to_page).empty()) {
                        // okay we have a range
                        pp.to_page = strToInt(fl_get_input(dialog_->input_to_page));
                } // else we only print one page.
@@ -153,10 +152,10 @@ void FormPrint::update()
 
        // hmmm... maybe a bit weird but maybe not
        // we might just be remembering the last time this was printed.
-       which_pages_.set(pp.all_pages);
+       all_pages_.set(pp.all_pages);
        
-       string const from = ( pp.from_page ? tostr(pp.from_page) : "");
-       string const to   = ( pp.to_page   ? tostr(pp.to_page)   : "");
+       string const from = ( pp.from_page ? tostr(pp.from_page) : string() );
+       string const to   = ( pp.to_page   ? tostr(pp.to_page)   : string() );
        fl_set_input(dialog_->input_from_page, from.c_str());
        fl_set_input(dialog_->input_to_page, to.c_str());
 
@@ -173,87 +172,82 @@ void FormPrint::update()
 
        // sorting only used when printing more than one copy
        setEnabled(dialog_->check_sorted_copies, enable_counter && pp.count_copies > 1);
+
+       // reset input fields to valid input
+       input(0, 0);
 }
 
 
-// It would be nice if we checked for cases like:
-// Print only-odd-pages and from_page == an even number
-//
 ButtonPolicy::SMInput FormPrint::input(FL_OBJECT * ob, long)
 {
-       ButtonPolicy::SMInput activate = ButtonPolicy::SMI_VALID;
-
-       // using a fl_input_filter that only permits numbers no '-' or '+'
-       // and the user cannot enter a negative number even if they try.
-       if (strlen(fl_get_input(dialog_->input_from_page))) {
-               // using a page range so activate the "to" field
-               fl_activate_object(dialog_->input_to_page);
-               if (strlen(fl_get_input(dialog_->input_to_page))
-                   && (strToInt(fl_get_input(dialog_->input_from_page))
-                       > strToInt(fl_get_input(dialog_->input_to_page)))) {
-                       // both from and to have values but from > to
-                       // We could have code to silently swap these
-                       // values but I'll disable the ok/apply until
-                       // the user fixes it since they may be editting
-                       // one of the fields.
-                       activate = ButtonPolicy::SMI_INVALID;
-                       // set both backgrounds to red?
-               }
-       } else if (strlen(fl_get_input(dialog_->input_to_page))) {
-               // from is empty but to exists, so probably editting from
-               // therefore deactivate ok and apply until form is valid again
-               activate = ButtonPolicy::SMI_INVALID;
-       } else {
-               // both from and to are empty.  This is valid so activate
-               // ok and apply but deactivate to
-               fl_deactivate_object(dialog_->input_to_page);
-       }
-
-       // number of copies only used when output goes to printer
-       bool const enable_counter = static_cast<bool>(fl_get_button(dialog_->radio_printer));
-       setEnabled(dialog_->counter_copies, enable_counter);
-
-       // sorting only used when printing more than one copy
-       bool const enable_sorted = enable_counter
-                       && static_cast<unsigned int>(fl_get_counter_value(dialog_->counter_copies)) > 1;
-       setEnabled(dialog_->check_sorted_copies, enable_sorted);
-
-       // disable OK/Apply buttons when file output is selected, but no file name entered.
-       if (fl_get_button(dialog_->radio_file) && !strlen(fl_get_input(dialog_->input_file))) {
-                       activate = ButtonPolicy::SMI_INVALID;
-       }
-
        if (ob == dialog_->button_browse) {
                // Get the filename from the dialog
-               string const in_name = fl_get_input(dialog_->input_file);
+               string const in_name = getString(dialog_->input_file);
                string const out_name = controller().Browse(in_name);
 
                // Save the filename to the dialog
                if (out_name != in_name && !out_name.empty()) {
                        fl_set_input(dialog_->input_file, out_name.c_str());
-                       input(0, 0);
                }
 
                // select the file radio
                if (!out_name.empty()) {
-                       fl_set_button(dialog_->radio_file, 1);
-                       fl_set_button(dialog_->radio_printer, 0);
+                       target_.set(dialog_->radio_file);
                }
-       }
 
        // if we type input string for file or printer, select that as a target
-       if (ob == dialog_->input_file && !fl_get_button(dialog_->radio_file)) {
-               fl_set_button(dialog_->radio_printer, 0);
-               fl_set_button(dialog_->radio_file, 1);
+       } else if (ob == dialog_->input_file && !fl_get_button(dialog_->radio_file)) {
+               target_.set(dialog_->radio_file);
+
        } else if (ob == dialog_->input_printer && !fl_get_button(dialog_->radio_printer)) {
-               fl_set_button(dialog_->radio_printer, 1);
-               fl_set_button(dialog_->radio_file, 0);
-       // if we type intput string for from/to, select from/to radio button
-       } else if ( (ob == dialog_->input_from_page || ob == dialog_->input_to_page) &&
+               target_.set(dialog_->radio_printer);
+
+       // if we type into 'from/to' fields, then select 'from/to' radio button
+       } else if ((ob == dialog_->input_from_page || ob == dialog_->input_to_page) &&
                        !fl_get_button(dialog_->radio_from_to)) {
-               fl_set_button(dialog_->radio_from_to, 1);
-               fl_set_button(dialog_->radio_all_pages, 0);
+               all_pages_.set(dialog_->radio_from_to);
        }
 
+       ButtonPolicy::SMInput activate = ButtonPolicy::SMI_VALID;
+
+       // disable OK/Apply buttons when file output is selected, but no file name entered
+       if (fl_get_button(dialog_->radio_file) && getString(dialog_->input_file).empty()) {
+                       activate = ButtonPolicy::SMI_INVALID;
+       }
+
+       // check 'from' and 'to' fields only when 'from/to' radio button is selected
+       if (fl_get_button(dialog_->radio_from_to)) {
+               char const * from = fl_get_input(dialog_->input_from_page);
+               char const * to = fl_get_input(dialog_->input_to_page);
+               bool const from_input = static_cast<bool>(*from);
+               bool const to_input = static_cast<bool>(*to);
+
+               setEnabled(dialog_->input_to_page, from_input);
+               if (!from_input || (to_input && strToInt(from) > strToInt(to))) {
+                       // Invalid input. Either 'from' is empty, or 'from' > 'to'.
+                       // Probably editting these fields, so deactivate OK/Apply until input is valid again.
+                       activate = ButtonPolicy::SMI_INVALID;
+               } else if (!to_input || strToInt(from) == strToInt(to)) {
+                       // Valid input. Either there's only 'from' input, or 'from' == 'to'.
+                       // Deactivate OK/Apply if odd/even selection implies no pages.
+                       bool const odd_pages = static_cast<bool>(fl_get_button(dialog_->check_odd_pages));
+                       bool const even_pages = static_cast<bool>(fl_get_button(dialog_->check_even_pages));
+                       bool const odd_only = odd_pages && !even_pages;
+                       bool const even_only = even_pages && !odd_pages;
+                       bool const from_is_odd = static_cast<bool>(strToInt(from) % 2);
+                       if ( (from_is_odd && even_only) || (!from_is_odd && odd_only) ) {
+                               activate = ButtonPolicy::SMI_INVALID;
+                       }
+               }
+       }
+
+       // number of copies only used when output goes to printer
+       bool const enable_counter = static_cast<bool>(fl_get_button(dialog_->radio_printer));
+       setEnabled(dialog_->counter_copies, enable_counter);
+
+       // sorting only used when printing more than one copy
+       bool const enable_sorted = enable_counter && fl_get_counter_value(dialog_->counter_copies) > 1;
+       setEnabled(dialog_->check_sorted_copies, enable_sorted);
+
        return activate;
 }
index 9016a91f472e44e366ac4af662c8701e7bf18d12..2bc487ab674bf75157ed17e7c11b6710377ee24d 100644 (file)
@@ -39,13 +39,14 @@ private:
        virtual void build();
        /// Update the dialog.
        virtual void update();
+
        /// Filter the inputs on callback from xforms
        virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
 
        /// print target
        RadioButtonGroup target_;
-       /// which pages
-       RadioButtonGroup which_pages_;
+       /// all pages or from/to
+       RadioButtonGroup all_pages_;
 };
 
 #endif // FORMPRINT_H
index ff70ad6bccecc5f293bb287ce31a988185745403..48464e88b541bccd840f62a38b0169965a53785c 100644 (file)
 #include "ControlSpellchecker.h"
 #include "FormSpellchecker.h"
 #include "forms/form_spellchecker.h"
+#include "support/lstrings.h"
+
 #include FORMS_H_LOCATION
 
 typedef FormCB<ControlSpellchecker, FormDB<FD_spellchecker> > base_class;
 
+
 FormSpellchecker::FormSpellchecker()
        : base_class(_("Spellchecker"))
 {}
@@ -33,27 +36,30 @@ void FormSpellchecker::build()
 {
        dialog_.reset(build_spellchecker(this));
 
-       fl_set_browser_dblclick_callback(dialog_->browser,
-                                        C_FormBaseInputCB, 2);
-
-       fl_set_input_return(dialog_->input, FL_RETURN_CHANGED);
-       setPrehandler(dialog_->input);
-
        // Manage the buttons
        bc().setCancel(dialog_->button_close);
+
+       // disable for read-only documents
        bc().addReadOnly(dialog_->button_replace);
-       bc().addReadOnly(dialog_->button_accept);
-       bc().addReadOnly(dialog_->button_add);
-       bc().addReadOnly(dialog_->button_ignore);
-       bc().addReadOnly(dialog_->button_start);
-       bc().addReadOnly(dialog_->browser);
+
+       // trigger an input event for cut&paste with middle mouse button.
+       setPrehandler(dialog_->input_replacement);
+
+       fl_set_input_return(dialog_->input_replacement, FL_RETURN_CHANGED);
+
+       // callback for double click in browser
+       fl_set_browser_dblclick_callback(dialog_->browser_suggestions,
+                                        C_FormBaseInputCB, 2);
+
+       // do not allow setting of slider by the mouse
+       fl_deactivate_object(dialog_->slider_progress);
 
        // set up the tooltips
        string str = _("Type replacement for unknown word "
                        " or select from suggestions.");
-       tooltips().init(dialog_->input, str);
+       tooltips().init(dialog_->input_replacement, str);
        str = _("List of replacement suggestions from dictionary.");
-       tooltips().init(dialog_->browser, str);
+       tooltips().init(dialog_->browser_suggestions, str);
        str = _("Start the spellingchecker.");
        tooltips().init(dialog_->button_start, str);
        str = _("Replace unknown word.");
@@ -64,120 +70,134 @@ void FormSpellchecker::build()
        tooltips().init(dialog_->button_accept, str);
        str = _("Add unknown word to personal dictionary.");
        tooltips().init(dialog_->button_add, str);
+       str = _("Shows word count and progress on spell check.");
+       tooltips().init(dialog_->slider_progress, str);
 }
 
+
 void FormSpellchecker::update()
 {
-       fl_set_input(dialog_->input, "");
-       fl_set_object_label(dialog_->text, "");
-       fl_clear_browser(dialog_->browser);
-       fl_set_slider_value(dialog_->slider, 0);
-       start(true);
+       // clear input fields
+       fl_set_input(dialog_->input_replacement, "");
+       fl_set_object_label(dialog_->text_unknown, "");
+       fl_clear_browser(dialog_->browser_suggestions);
+
+       // reset dialog and buttons into start condition
+       input(0, 0);
+
+       // reset slider to zero count
+       fl_set_slider_value(dialog_->slider_progress, 0.0);
+       fl_set_object_label(dialog_->slider_progress, "0 %");
 }
 
-ButtonPolicy::SMInput FormSpellchecker::input(FL_OBJECT * obj, long val)
+
+ButtonPolicy::SMInput FormSpellchecker::input(FL_OBJECT * ob, long ob_value)
 {
-       if (obj == dialog_->button_replace) {
-               string const tmp = getString(dialog_->input);
-               controller().replace(tmp);
+       if (!ob || ob == dialog_->button_start) {
+               static bool running = false;
+
+               // update running status of spellingchecker
+               running = !running && ob == dialog_->button_start;
+
+               // modify text of Start/Stop button according to running status
+               string const labeltext = running ? _("Stop") : _("Start");
+               fl_set_object_label(dialog_->button_start, labeltext.c_str());  
+               fl_set_button_shortcut(dialog_->button_start, "#S", 1);
+               fl_show_object(dialog_->button_start);
+
+               // adjust tooltips to modified Start/Stop button
+               string const str = (running ? _("Stop the spellingchecker.") :
+                                       _("Start the spellingchecker."));
+               tooltips().init(dialog_->button_start, str);
+
+               // enable buttons according to running status
+               setEnabled(dialog_->button_replace, running);
+               setEnabled(dialog_->button_ignore, running);
+               setEnabled(dialog_->button_accept, running);
+               setEnabled(dialog_->button_add, running);
+               setEnabled(dialog_->browser_suggestions, running);
+               setEnabled(dialog_->input_replacement, running);
+
+               // call controller if Start/Stop button is pressed
+               if (ob) {
+                       if (running)
+                               controller().check();
+                       else
+                               controller().stop();
+               }
 
-       } else if (obj == dialog_->button_start) {
-               if (start())
-                       controller().check();
-               else
-                       controller().stop();
+       } else if (ob == dialog_->button_replace) {
+               string const tmp = getString(dialog_->input_replacement);
+               controller().replace(tmp);
 
-       } else if (obj == dialog_->button_ignore) {
+       } else if (ob == dialog_->button_ignore) {
                controller().check();
 
-       } else if (obj == dialog_->button_accept) {
+       } else if (ob == dialog_->button_accept) {
                controller().ignoreAll();
 
-       } else if (obj == dialog_->button_add) {
+       } else if (ob == dialog_->button_add) {
                controller().insert();
 
-       } else if (obj == dialog_->browser) {
-               int const line = fl_get_browser(dialog_->browser);
-               string const tmp =
-                       getString(dialog_->browser, line);
+       } else if (ob == dialog_->browser_suggestions) {
+               string const tmp = getString(dialog_->browser_suggestions);
                if (tmp.empty())
                        return ButtonPolicy::SMI_NOOP;
 
-               if (val != 2) {
+               if (ob_value != 2) {
                        // single-click
                        // place the chosen string in the input as feedback
-                       fl_set_input(dialog_->input, tmp.c_str());
+                       fl_set_input(dialog_->input_replacement, tmp.c_str());
 
                } else {
                        // double-click
                        controller().replace(tmp);
                        // reset the browser so that the following
                        // single-click callback doesn't do anything
-                       fl_deselect_browser_line(dialog_->browser, line);
+                       fl_deselect_browser(dialog_->browser_suggestions);
                }
        }
 
+       // update slider with word count and progress
+       double const wordcount = controller().getCount();
+       if (wordcount > 0.0) {
+               int const progress = controller().getProgress();
+               double const total = 100.0 * wordcount / progress;
+
+               fl_set_slider_bounds(dialog_->slider_progress, 0.0, total);
+               fl_set_slider_value(dialog_->slider_progress, wordcount);
+               fl_set_object_label(dialog_->slider_progress,
+                                       (tostr(progress) + " %").c_str());
+       }
+
        return ButtonPolicy::SMI_VALID;
 }
 
+
 void FormSpellchecker::partialUpdate(int id)
 {
        switch (id) {
-       case 0:
-               // set progress bar
-               fl_set_slider_value(dialog_->slider,
-                                   controller().getProgress());
-               break;
-       case 1:
-       {
-               // set suggestions
+       case 1: // set suggestions
+               {
                string w = controller().getWord();
-               fl_set_input(dialog_->input, w.c_str());
-               fl_set_object_label(dialog_->text, w.c_str());
-               fl_clear_browser(dialog_->browser);
+               fl_set_input(dialog_->input_replacement, w.c_str());
+               fl_set_object_label(dialog_->text_unknown, w.c_str());
+               fl_clear_browser(dialog_->browser_suggestions);
                while (!(w = controller().getSuggestion()).empty()) {
-                       fl_add_browser_line(dialog_->browser, w.c_str());
+                       fl_add_browser_line(dialog_->browser_suggestions, w.c_str());
                }
-       }
-       break;
-       case 2:
-               // show exit message
-               fl_show_messages(controller().getMessage().c_str());
-               hide();
-       }
-}
-
+               }
+               break;
+       case 2: // end of spell checking
 
-void FormSpellchecker::showMessage(const char * msg)
-{
-       fl_show_message(msg, "", "");
-}
+               // reset dialog and buttons into start condition
+               input(0, 0);
 
-bool FormSpellchecker::start(bool init)
-{
-       static bool running = false;
+               // set slider 'finished' status
+               fl_set_slider_bounds(dialog_->slider_progress, 0.0, controller().getCount());
+               fl_set_slider_value(dialog_->slider_progress, controller().getCount());
+               fl_set_object_label(dialog_->slider_progress, "100 %");
 
-       if (init) {
-               running = false;
-       } else {
-               running = !running;
+               break;
        }
-
-       fl_set_object_label(dialog_->button_start,
-                       (running ? _("Stop") : _("Start")));    
-       fl_set_button_shortcut(dialog_->button_start, "#S", 1);
-       fl_show_object(dialog_->button_start);
-
-       string const str = (running ? _("Stop the spellingchecker.") :
-                                       _("Start the spellingchecker."));
-       tooltips().init(dialog_->button_start, str);
-
-       setEnabled(dialog_->button_replace, running);
-       setEnabled(dialog_->button_ignore, running);
-       setEnabled(dialog_->button_accept, running);
-       setEnabled(dialog_->button_add, running);
-       setEnabled(dialog_->browser, running);
-       setEnabled(dialog_->input, running);
-       
-       return running;
 }
index a05e27a676ec59945e4ef2cf219890ed764300c6..476cfa00f4d909b702ac8b4ce7a932ef75166c96 100644 (file)
@@ -35,15 +35,9 @@ private:
        ///
        void update();
 
-       /// enable/disable widgets when start/stop; return running status
-       bool start(bool init = false);
-
-       /// update progress bar, set suggestions, exit message
+       /// set suggestions and exit message
        void partialUpdate(int);
 
-       /// show an error message
-       void showMessage(const char * msg);
-
        /// Filter the inputs
        virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
 };
index 6c01058afb7e7263d3cf195993f39b5f5c524826..22938fd65f09a382a4cfe9ffadbe38a7f633bb8f 100644 (file)
 #include "forms/form_texinfo.h"
 #include "Tooltips.h"
 #include "gettext.h"
-#include "debug.h"
 #include "xforms_helpers.h"
 #include "support/LAssert.h"
+#include "support/lstrings.h"
+
 #include FORMS_H_LOCATION
 
 
@@ -37,74 +38,99 @@ FormTexinfo::FormTexinfo()
 void FormTexinfo::build() {
        dialog_.reset(build_texinfo(this));
 
-       updateStyles(ControlTexinfo::cls);
+       // callback for double click in browser to view the selected file
+       fl_set_browser_dblclick_callback(dialog_->browser, C_FormBaseInputCB, 2);
 
        string const classes_List = _("LaTeX classes|LaTeX styles|BibTeX styles");
        fl_addto_choice(dialog_->choice_classes, classes_List.c_str());
 
+       updateStyles(activeStyle);
+
        // set up the tooltips
-       string str = _("Shows the installed classses and styles for LaTeX/BibTeX. These classes are only available in LyX if a corresponding LyX layout file exists.");
+       string str = _("Shows the installed classses and styles for LaTeX/BibTeX; "
+                       "available only if the corresponding LyX layout file exists.");
        tooltips().init(dialog_->choice_classes, str);
 
-       str = _("View full path or only file name.");
+       str = _("Show full path or only file name.");
        tooltips().init(dialog_->check_fullpath, str);
 
        str = _("Runs the script \"TexFiles.sh\" to build new file lists.");
        tooltips().init(dialog_->button_rescan, str);
 
-       str = _("Shows the contents of the marked file. Only possible in full path mode.");
-       tooltips().init(dialog_->button_view, str);
+       str = _("Double click to view contents of file.");
+       tooltips().init(dialog_->browser, str);
 
-       str = _("Runs the script \"texhash\" which builds a new LaTeX tree. Needed if you install a new TeX class or style. You need write permissions for the TeX-dirs, often /var/lib/texmf and others.");
+       str = _("Runs the script \"texhash\" which builds a new LaTeX tree. "
+               "Needed if you install a new TeX class or style. You need write "
+               "permissions for the TeX-dirs, often /var/lib/texmf and others.");
        tooltips().init(dialog_->button_texhash, str);
 }
 
 
-ButtonPolicy::SMInput FormTexinfo::input(FL_OBJECT * ob, long) {
+ButtonPolicy::SMInput FormTexinfo::input(FL_OBJECT * ob, long ob_value) {
 
-       if (ob == dialog_->choice_classes) {
-               switch (fl_get_choice(dialog_->choice_classes)) {
-               case 1:
-                       updateStyles(ControlTexinfo::cls);
-                       break;
-               case 2:
-                       updateStyles(ControlTexinfo::sty);
-                       break;
-               case 3:
-               default:
-                       updateStyles(ControlTexinfo::bst);
+       if (ob == dialog_->button_texhash) {
+               // makes only sense if the rights are set well for
+               // users (/var/lib/texmf/ls-R)
+               controller().runTexhash();
+               // texhash requires a rescan and an update of the styles
+               controller().rescanStyles();
+               updateStyles(activeStyle);
+
+
+       } else if (ob == dialog_->browser && ob_value == 2) {
+               // double click in browser: view selected file
+               string selection = string();
+               if (fl_get_button(dialog_->check_fullpath)) {
+                       // contents in browser has full path
+                       selection = getString(dialog_->browser);
+               } else {
+                       // contents in browser has filenames without path
+                       // reconstruct path from controller getContents
+                       string const files = controller().getContents(activeStyle, true);
+                       vector<string> const vec = getVectorFromString(files, "\n");
+
+                       // find line in files vector
+                       vector<string>::const_iterator it = vec.begin();
+                       int const line = fl_get_browser(dialog_->browser);
+                       for (int i = line; it != vec.end() && i > 0; ++it, --i) {
+                               if (i == 1) selection = *it;
+                       }
                }
 
+               if (!selection.empty()) {
+                       controller().viewFile(selection);
+               }
+
+               // reset the browser so that the following single-click callback doesn't do anything
+               fl_deselect_browser(dialog_->browser);
+               
        } else if (ob == dialog_->button_rescan) {
                // build new *Files.lst
                controller().rescanStyles();
                updateStyles(activeStyle);
 
        } else if (ob == dialog_->check_fullpath) {
-               setEnabled(dialog_->button_view,
-                          fl_get_button(dialog_->check_fullpath));
                updateStyles(activeStyle);
 
-       } else if (ob == dialog_->button_texhash) {
-               // makes only sense if the rights are set well for
-               // users (/var/lib/texmf/ls-R)
-               controller().runTexhash();
-               // update files in fact of texhash
-               controller().rescanStyles();
-
-       } else if (ob == dialog_->button_view) {
-               unsigned int selection = fl_get_browser(dialog_->browser);
-               // a valid entry?
-               if (selection > 0) {
-                       controller().viewFile(
-                               fl_get_browser_line(dialog_->browser,
-                                                   selection));
+       } else if (ob == dialog_->choice_classes) {
+               switch (fl_get_choice(dialog_->choice_classes)) {
+               case 3:
+                       updateStyles(ControlTexinfo::bst);
+                       break;
+               case 2:
+                       updateStyles(ControlTexinfo::sty);
+                       break;
+               case 1:
+               default:
+                       updateStyles(ControlTexinfo::cls);
                }
        }
 
        return ButtonPolicy::SMI_VALID;
 }
 
+
 void FormTexinfo::updateStyles(ControlTexinfo::texFileSuffix whichStyle)
 {
        fl_clear_browser(dialog_->browser);
index 2612f3bd424153302c9854cc2a0a010be351a774..7374014c751fa724ea20b9ebc7a806334b39926c 100644 (file)
 #include "ControlWrap.h"
 #include "FormWrap.h"
 #include "forms/form_wrap.h"
+#include "Tooltips.h"
+
 #include "support/lstrings.h"
 #include "helper_funcs.h"
-#include "debug.h"
 #include "xforms_helpers.h"
+#include "checkedwidgets.h"
+
 #include FORMS_H_LOCATION
 
 typedef FormCB<ControlWrap, FormDB<FD_wrap> > base_class;
@@ -35,27 +38,46 @@ void FormWrap::build()
 {
        dialog_.reset(build_wrap(this));
 
-       // Allow the base class to control messages
-       setMessageWidget(dialog_->text_warning);
-
-       fl_set_input_return(dialog_->input_width, FL_RETURN_CHANGED);
-       setPrehandler(dialog_->input_width);
-
-       string const choice = getStringFromVector(getLatexUnits(), "|");
-       fl_addto_choice(dialog_->choice_width_units, subst(choice, "%", "%%").c_str());
-
        // Manage the ok, apply and cancel/close buttons
        bc().setOK(dialog_->button_ok);
        bc().setApply(dialog_->button_apply);
        bc().setCancel(dialog_->button_close);
        bc().setRestore(dialog_->button_restore);
 
+       // disable for read-only documents
        bc().addReadOnly(dialog_->input_width);
        bc().addReadOnly(dialog_->choice_width_units);
-       bc().addReadOnly(dialog_->radio_left);
-       bc().addReadOnly(dialog_->radio_right);
-       bc().addReadOnly(dialog_->radio_outer);
-       bc().addReadOnly(dialog_->radio_default);
+
+       // check validity of "length + unit" input
+       addCheckedGlueLength(bc(), dialog_->input_width);
+
+       // trigger an input event for cut&paste with middle mouse button.
+       setPrehandler(dialog_->input_width);
+
+       fl_set_input_return(dialog_->input_width, FL_RETURN_CHANGED);
+
+       string const choice = getStringFromVector(getLatexUnits(), "|");
+       fl_addto_choice(dialog_->choice_width_units,
+                       subst(choice, "%", "%%").c_str());
+
+       placement_.init(dialog_->radio_default, 0); // default
+       placement_.init(dialog_->radio_outer, 'p');
+       placement_.init(dialog_->radio_left,  'l');
+       placement_.init(dialog_->radio_right, 'r');
+
+       // set up the tooltips
+       string str = _("Enter width for the float.");
+       tooltips().init(dialog_->input_width, str);
+       str = _("Forces float to the right in a paragraph if the page number "
+               "is odd, and to the left if page number is even.");
+       tooltips().init(dialog_->radio_default, str);
+       str = _("Forces float to the left in a paragraph if the pagenumber "
+               "is odd, and to the right if page number is even.");
+       tooltips().init(dialog_->radio_outer, str);
+       str = _("Forces float to the left in the paragraph.");
+       tooltips().init(dialog_->radio_left, str);
+       str = _("Forces float to the right in the paragraph.");
+       tooltips().init(dialog_->radio_right, str);
 }
 
 
@@ -65,14 +87,11 @@ void FormWrap::apply()
                LyXLength(getLengthFromWidgets(dialog_->input_width,
                                               dialog_->choice_width_units));
 
-       if (fl_get_button(dialog_->radio_left))
-               controller().params().placement = "l";
-       else if (fl_get_button(dialog_->radio_right))
-               controller().params().placement = "r";
-       else if (fl_get_button(dialog_->radio_outer))
-               controller().params().placement = "p";
+       char const c = static_cast<char>(placement_.get());
+       if (c)
+               controller().params().placement = c;
        else
-               controller().params().placement.erase();
+               controller().params().placement.erase(); // default
 }
 
 
@@ -82,42 +101,8 @@ void FormWrap::update()
        fl_set_input(dialog_->input_width, tostr(len.value()).c_str());
        fl_set_choice(dialog_->choice_width_units, len.unit() + 1);
 
-       if (controller().params().placement == "l")
-               fl_set_button(dialog_->radio_left, 1);
-       else if (controller().params().placement == "r")
-               fl_set_button(dialog_->radio_right, 1);
-       else if (controller().params().placement == "p")
-               fl_set_button(dialog_->radio_outer, 1);
+       if (controller().params().placement.empty())
+               placement_.set(dialog_->radio_default); // default
        else
-               fl_set_button(dialog_->radio_default, 1);
-}
-
-
-ButtonPolicy::SMInput FormWrap::input(FL_OBJECT * ob, long)
-{
-       clearMessage();
-
-       ButtonPolicy::SMInput action = ButtonPolicy::SMI_NOOP;
-
-       if (ob == dialog_->radio_left ||
-           ob == dialog_->radio_right ||
-           ob == dialog_->radio_outer ||
-           ob == dialog_->radio_default ||
-           ob == dialog_->choice_width_units)
-               return ButtonPolicy::SMI_VALID;
-
-       // disallow senseless data
-       // warnings if input is senseless
-       if (ob == dialog_->input_width) {
-               string const input = getString(dialog_->input_width);
-               bool const invalid = !isValidLength(input) && !isStrDbl(input);
-               if (invalid) {
-                       postWarning(_("Invalid Length!"));
-                       action = ButtonPolicy::SMI_INVALID;
-               } else {
-                       action = ButtonPolicy::SMI_VALID;
-               }
-       }
-
-       return action;
+               placement_.set(controller().params().placement.c_str()[0]);
 }
index 14fb960c339ce840e01bd2e96c2cf3edda499768..97467ab36600d4d3638a7d39bda2417eb86db601 100644 (file)
@@ -17,6 +17,7 @@
 #endif
 
 #include "FormBase.h"
+#include "RadioButtonGroup.h"
 
 class ControlWrap;
 struct FD_wrap;
@@ -36,8 +37,9 @@ private:
        virtual void build();
        /// Update dialog before/whilst showing it.
        virtual void update();
-       /// Filter the inputs on callback from xforms
-       virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
+
+       /// placement
+       RadioButtonGroup placement_;
 };
 
 #endif // FORMWRAP_H
index 1430e90b41d8e2d1f88db6e7247f5098751bad6e..7886431d2ba4411c057c542171e20dbf62fe5aa3 100644 (file)
@@ -160,7 +160,7 @@ argument: 0
 --------------------
 class: FL_CHECKBUTTON
 type: PUSH_BUTTON
-box: 175 315 100 25
+box: 170 315 100 25
 boxtype: FL_NO_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_CENTER
@@ -214,7 +214,7 @@ argument: 0
 --------------------
 class: FL_CHECKBUTTON
 type: PUSH_BUTTON
-box: 10 260 270 25
+box: 10 260 200 25
 boxtype: FL_NO_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_CENTER
@@ -231,8 +231,8 @@ argument: 0
 
 --------------------
 class: FL_COUNTER
-type: NORMAL_COUNTER
-box: 80 315 90 25
+type: SIMPLE_COUNTER
+box: 90 315 70 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_BLUE
 alignment: FL_ALIGN_LEFT
@@ -291,7 +291,7 @@ argument: 0
 --------------------
 class: FL_CHECKBUTTON
 type: PUSH_BUTTON
-box: 10 210 270 25
+box: 10 210 200 25
 boxtype: FL_NO_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_CENTER
@@ -309,7 +309,7 @@ argument: 0
 --------------------
 class: FL_CHECKBUTTON
 type: PUSH_BUTTON
-box: 10 235 270 25
+box: 10 235 200 25
 boxtype: FL_NO_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_CENTER
@@ -417,7 +417,7 @@ argument:
 --------------------
 class: FL_ROUND3DBUTTON
 type: RADIO_BUTTON
-box: 10 140 270 25
+box: 10 140 85 25
 boxtype: FL_NO_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_CENTER
@@ -435,7 +435,7 @@ argument: 0
 --------------------
 class: FL_ROUND3DBUTTON
 type: RADIO_BUTTON
-box: 10 170 100 25
+box: 10 170 85 25
 boxtype: FL_NO_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_CENTER
index 5c9deaf092c7e187efa88fa4a76e0d895966fe3a..7493211482125d9494b477438f760e8827ec9efd 100644 (file)
@@ -9,14 +9,14 @@ SnapGrid: 5
 
 =============== FORM ===============
 Name: form_spellchecker
-Width: 215
-Height: 310
-Number of Objects: 12
+Width: 320
+Height: 245
+Number of Objects: 13
 
 --------------------
 class: FL_BOX
 type: FLAT_BOX
-box: 0 0 215 310
+box: 0 0 320 245
 boxtype: FL_FLAT_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -31,6 +31,24 @@ name:
 callback: 
 argument: 
 
+--------------------
+class: FL_TEXT
+type: NORMAL_TEXT
+box: 5 198 205 25
+boxtype: FL_FLAT_BOX
+colors: FL_COL1 FL_MCOL
+alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Word count
+shortcut: 
+resize: FL_RESIZE_NONE
+gravity: FL_SouthWest FL_SouthWest
+name: 
+callback: 
+argument: 
+
 --------------------
 class: FL_TEXT
 type: NORMAL_TEXT
@@ -63,7 +81,7 @@ label:
 shortcut: 
 resize: FL_RESIZE_X
 gravity: FL_NorthWest FL_NorthEast
-name: text
+name: text_unknown
 callback: C_FormBaseInputCB
 argument: 0
 
@@ -81,14 +99,14 @@ label: Replacement:|#R
 shortcut: 
 resize: FL_RESIZE_X
 gravity: FL_NorthWest FL_NorthEast
-name: input
+name: input_replacement
 callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
 class: FL_BROWSER
 type: SELECT_BROWSER
-box: 5 185 205 75
+box: 5 125 205 70
 boxtype: FL_DOWN_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_TOP_LEFT
@@ -99,14 +117,14 @@ label: Suggestions:|#g
 shortcut: 
 resize: FL_RESIZE_ALL
 gravity: FL_NorthWest FL_SouthEast
-name: browser
+name: browser_suggestions
 callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 5 280 90 25
+box: 215 10 100 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -116,7 +134,7 @@ lcol: FL_BLACK
 label: Start|#S
 shortcut: 
 resize: FL_RESIZE_NONE
-gravity: FL_SouthWest FL_SouthWest
+gravity: FL_NorthEast FL_NorthEast
 name: button_start
 callback: C_FormBaseInputCB
 argument: 0
@@ -124,7 +142,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 110 135 100 25
+box: 215 130 100 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -133,8 +151,8 @@ size: FL_NORMAL_SIZE
 lcol: FL_BLACK
 label: Add|#d
 shortcut: 
-resize: FL_RESIZE_X
-gravity: FL_North FL_NorthEast
+resize: FL_RESIZE_NONE
+gravity: FL_NorthEast FL_NorthEast
 name: button_add
 callback: C_FormBaseInputCB
 argument: 0
@@ -142,7 +160,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 110 105 100 25
+box: 215 40 100 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -152,7 +170,7 @@ lcol: FL_BLACK
 label: Ignore|#I
 shortcut: 
 resize: FL_RESIZE_X
-gravity: FL_North FL_NorthEast
+gravity: FL_NorthEast FL_NorthEast
 name: button_ignore
 callback: C_FormBaseInputCB
 argument: 0
@@ -160,7 +178,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 5 135 100 25
+box: 215 100 100 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -170,7 +188,7 @@ lcol: FL_BLACK
 label: Accept|#A
 shortcut: 
 resize: FL_RESIZE_X
-gravity: FL_NorthWest FL_North
+gravity: FL_NorthEast FL_NorthEast
 name: button_accept
 callback: C_FormBaseInputCB
 argument: 0
@@ -178,7 +196,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 120 280 90 25
+box: 225 215 90 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -196,7 +214,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 5 105 100 25
+box: 215 70 100 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -205,32 +223,33 @@ size: FL_NORMAL_SIZE
 lcol: FL_BLACK
 label: Replace|#R
 shortcut: 
-resize: FL_RESIZE_X
-gravity: FL_NorthWest FL_North
+resize: FL_RESIZE_NONE
+gravity: FL_NorthEast FL_NorthEast
 name: button_replace
 callback: C_FormBaseInputCB
 argument: 0
 
 --------------------
-class: FL_SLIDER
+class: FL_VALSLIDER
 type: HOR_FILL_SLIDER
-box: 5 265 205 10
-boxtype: FL_DOWN_BOX
-colors: FL_BLUE FL_COL1
-alignment: FL_ALIGN_LEFT
+box: 5 220 205 20
+boxtype: FL_FRAME_BOX
+colors: FL_COL1 FL_YELLOW
+alignment: FL_ALIGN_CENTER
 style: FL_NORMAL_STYLE
-size: 0
+size: FL_NORMAL_SIZE
 lcol: FL_BLACK
-label: 
+label: 0 %
 shortcut: 
 resize: FL_RESIZE_X
 gravity: FL_SouthWest FL_SouthEast
-name: slider
+name: slider_progress
 callback: 
 argument: 
        bounds: 0 100
+       precision: 0
        value: 0
-       step: 1
+       slsize: 0.00
 
 ==============================
 create_the_forms
index 5bf1e9489c7dac7f8e7f774ee08f3fbc3a9e2bf5..d682d83dee3f18780c5cfcec6b9e1399012ec954 100644 (file)
@@ -9,14 +9,14 @@ SnapGrid: 5
 
 =============== FORM ===============
 Name: form_texinfo
-Width: 250
+Width: 245
 Height: 215
-Number of Objects: 8
+Number of Objects: 7
 
 --------------------
 class: FL_BOX
 type: FLAT_BOX
-box: 0 0 250 215
+box: 0 0 245 215
 boxtype: FL_FLAT_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -34,7 +34,7 @@ argument:
 --------------------
 class: FL_BROWSER
 type: HOLD_BROWSER
-box: 5 35 240 110
+box: 5 35 235 110
 boxtype: FL_DOWN_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_TOP
@@ -52,7 +52,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 5 150 110 25
+box: 5 150 115 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -67,28 +67,10 @@ name: button_rescan
 callback: C_FormBaseInputCB
 argument: 2
 
---------------------
-class: FL_BUTTON
-type: NORMAL_BUTTON
-box: 135 150 110 25
-boxtype: FL_UP_BOX
-colors: FL_COL1 FL_COL1
-alignment: FL_ALIGN_CENTER
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: View|#V
-shortcut: 
-resize: FL_RESIZE_NONE
-gravity: FL_SouthEast FL_SouthEast
-name: button_view
-callback: C_FormBaseInputCB
-argument: 2
-
 --------------------
 class: FL_CHECKBUTTON
 type: PUSH_BUTTON
-box: 140 5 105 25
+box: 135 5 105 25
 boxtype: FL_NO_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_CENTER
@@ -106,7 +88,7 @@ argument: 2
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 160 185 85 25
+box: 150 185 90 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -124,7 +106,7 @@ argument: 0
 --------------------
 class: FL_CHOICE
 type: NORMAL_CHOICE
-box: 5 5 130 25
+box: 5 5 125 25
 boxtype: FL_FRAME_BOX
 colors: FL_COL1 FL_BLACK
 alignment: FL_ALIGN_LEFT
@@ -142,7 +124,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 5 185 110 25
+box: 125 150 115 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
index b6c353cdef5106085cf0619bceb64c100253eab0..689be37f78cc5d7ac2f2a22023c2fa8fc610d504 100644 (file)
@@ -5,17 +5,18 @@ Internal Form Definition File
 
 Number of forms: 1
 Unit of measure: FL_COORD_PIXEL
+SnapGrid: 5
 
 =============== FORM ===============
 Name: form_wrap
-Width: 430
-Height: 200
-Number of Objects: 16
+Width: 395
+Height: 115
+Number of Objects: 14
 
 --------------------
 class: FL_BOX
 type: FLAT_BOX
-box: 0 0 430 200
+box: 0 0 395 115
 boxtype: FL_FLAT_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -33,35 +34,17 @@ argument:
 --------------------
 class: FL_LABELFRAME
 type: ENGRAVED_FRAME
-box: 20 20 200 60
+box: 175 10 215 65
 boxtype: FL_NO_BOX
 colors: FL_BLACK FL_COL1
 alignment: FL_ALIGN_TOP_LEFT
-style: FL_BOLD_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Width
-shortcut: 
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
-name: 
-callback: 
-argument: 
-
---------------------
-class: FL_LABELFRAME
-type: ENGRAVED_FRAME
-box: 240 20 180 130
-boxtype: FL_NO_BOX
-colors: FL_BLACK FL_COL1
-alignment: FL_ALIGN_TOP_LEFT
-style: FL_BOLD_STYLE
+style: FL_NORMAL_STYLE
 size: FL_NORMAL_SIZE
 lcol: FL_BLACK
 label: Placement
 shortcut: 
 resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
+gravity: FL_NoGravity FL_SouthEast
 name: 
 callback: 
 argument: 
@@ -69,17 +52,17 @@ argument:
 --------------------
 class: FL_INPUT
 type: NORMAL_INPUT
-box: 30 30 110 30
+box: 5 30 85 25
 boxtype: FL_DOWN_BOX
 colors: FL_COL1 FL_MCOL
-alignment: FL_ALIGN_LEFT
+alignment: FL_ALIGN_TOP_LEFT
 style: FL_NORMAL_STYLE
 size: FL_NORMAL_SIZE
 lcol: FL_BLACK
-label: 
+label: Width:|#W
 shortcut: 
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
+resize: FL_RESIZE_X
+gravity: FL_West FL_NoGravity
 name: input_width
 callback: C_FormBaseInputCB
 argument: 0
@@ -87,7 +70,7 @@ argument: 0
 --------------------
 class: FL_CHOICE
 type: NORMAL_CHOICE
-box: 150 30 60 30
+box: 90 30 75 25
 boxtype: FL_FRAME_BOX
 colors: FL_COL1 FL_BLACK
 alignment: FL_ALIGN_LEFT
@@ -96,7 +79,7 @@ size: FL_DEFAULT_SIZE
 lcol: FL_BLACK
 label: 
 shortcut: 
-resize: FL_RESIZE_ALL
+resize: FL_RESIZE_X
 gravity: FL_NoGravity FL_NoGravity
 name: choice_width_units
 callback: C_FormBaseInputCB
@@ -105,7 +88,7 @@ argument: 0
 --------------------
 class: FL_BEGIN_GROUP
 type: 0
-box: 0 0 0
+box: 0 10 10 0
 boxtype: FL_NO_BOX
 colors: FL_COL1 FL_MCOL
 alignment: FL_ALIGN_CENTER
@@ -123,16 +106,16 @@ argument:
 --------------------
 class: FL_ROUND3DBUTTON
 type: RADIO_BUTTON
-box: 249 30 152 30
+box: 260 45 25 25
 boxtype: FL_NO_BOX
 colors: FL_COL1 FL_YELLOW
-alignment: FL_ALIGN_CENTER
+alignment: FL_ALIGN_LEFT
 style: FL_NORMAL_STYLE
 size: FL_NORMAL_SIZE
 lcol: FL_BLACK
 label: Left|#L
 shortcut: 
-resize: FL_RESIZE_ALL
+resize: FL_RESIZE_NONE
 gravity: FL_NoGravity FL_NoGravity
 name: radio_left
 callback: C_FormBaseInputCB
@@ -141,16 +124,16 @@ argument: 0
 --------------------
 class: FL_ROUND3DBUTTON
 type: RADIO_BUTTON
-box: 249 60 152 30
+box: 285 45 95 25
 boxtype: FL_NO_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_CENTER
 style: FL_NORMAL_STYLE
 size: FL_NORMAL_SIZE
 lcol: FL_BLACK
-label: Right|#R
+label: Right|#i
 shortcut: 
-resize: FL_RESIZE_ALL
+resize: FL_RESIZE_NONE
 gravity: FL_NoGravity FL_NoGravity
 name: radio_right
 callback: C_FormBaseInputCB
@@ -159,7 +142,7 @@ argument: 0
 --------------------
 class: FL_ROUND3DBUTTON
 type: RADIO_BUTTON
-box: 249 90 152 30
+box: 285 20 95 25
 boxtype: FL_NO_BOX
 colors: FL_COL1 FL_YELLOW
 alignment: FL_ALIGN_CENTER
@@ -168,7 +151,7 @@ size: FL_NORMAL_SIZE
 lcol: FL_BLACK
 label: Outer|#O
 shortcut: 
-resize: FL_RESIZE_ALL
+resize: FL_RESIZE_NONE
 gravity: FL_NoGravity FL_NoGravity
 name: radio_outer
 callback: C_FormBaseInputCB
@@ -177,16 +160,16 @@ argument: 0
 --------------------
 class: FL_ROUND3DBUTTON
 type: RADIO_BUTTON
-box: 250 120 152 30
+box: 260 20 25 25
 boxtype: FL_NO_BOX
 colors: FL_COL1 FL_YELLOW
-alignment: FL_ALIGN_CENTER
+alignment: FL_ALIGN_LEFT
 style: FL_NORMAL_STYLE
 size: FL_NORMAL_SIZE
 lcol: FL_BLACK
-label: Default (outer)|#D
+label: Default|#D
 shortcut: 
-resize: FL_RESIZE_ALL
+resize: FL_RESIZE_NONE
 gravity: FL_NoGravity FL_NoGravity
 name: radio_default
 callback: C_FormBaseInputCB
@@ -213,7 +196,7 @@ argument:
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 330 160 90 30
+box: 300 85 90 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -222,8 +205,8 @@ size: FL_NORMAL_SIZE
 lcol: FL_BLACK
 label: Cancel|^[
 shortcut: 
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
+resize: FL_RESIZE_NONE
+gravity: FL_SouthEast FL_SouthEast
 name: button_close
 callback: C_FormBaseCancelCB
 argument: 0
@@ -231,7 +214,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 230 160 90 30
+box: 205 85 90 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -240,8 +223,8 @@ size: FL_NORMAL_SIZE
 lcol: FL_BLACK
 label: Apply|#A
 shortcut: 
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
+resize: FL_RESIZE_NONE
+gravity: FL_SouthEast FL_SouthEast
 name: button_apply
 callback: C_FormBaseApplyCB
 argument: 0
@@ -249,7 +232,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: RETURN_BUTTON
-box: 130 160 90 30
+box: 110 85 90 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -258,8 +241,8 @@ size: FL_NORMAL_SIZE
 lcol: FL_BLACK
 label: OK
 shortcut: ^M
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
+resize: FL_RESIZE_NONE
+gravity: FL_SouthEast FL_SouthEast
 name: button_ok
 callback: C_FormBaseOKCB
 argument: 0
@@ -267,7 +250,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 10 160 90 30
+box: 5 85 90 25
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -276,29 +259,11 @@ size: FL_NORMAL_SIZE
 lcol: FL_BLACK
 label: Restore|#R
 shortcut: 
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
+resize: FL_RESIZE_NONE
+gravity: FL_SouthWest FL_SouthWest
 name: button_restore
 callback: C_FormBaseRestoreCB
 argument: 0
 
---------------------
-class: FL_TEXT
-type: NORMAL_TEXT
-box: 20 90 210 30
-boxtype: FL_FLAT_BOX
-colors: FL_COL1 FL_MCOL
-alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
-style: FL_NORMAL_STYLE
-size: FL_DEFAULT_SIZE
-lcol: FL_BLACK
-label: 
-shortcut: 
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
-name: text_warning
-callback: 
-argument: 
-
 ==============================
 create_the_forms