]> git.lyx.org Git - lyx.git/commitdiff
Small fixes from Lior and Angus
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 19 Jan 2001 15:31:40 +0000 (15:31 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 19 Jan 2001 15:31:40 +0000 (15:31 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1349 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormPrint.C
src/frontends/xforms/FormPrint.h
src/frontends/xforms/form_print.C
src/frontends/xforms/form_print.h
src/frontends/xforms/forms/form_print.fd
src/insets/ChangeLog
src/insets/lyxinset.h
src/lyxfunc.C
src/text2.C

index c6b8506ac2603238497d8e907c0dad4de2d97e17..5c7472d5ed39962f1018a0930ba4b1cd54fe3166 100644 (file)
@@ -1,3 +1,9 @@
+2001-01-19  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * lyxfunc.C: fix the name of the inset for LFUN_CHILDINSERT
+
+       * text2.C: add a using directive.
+
 2000-01-17  John Levon  <moz@compsoc.man.ac.uk>
 
        * BufferView2.C:
index fe1d09707a63587defa0589190f21679f9d99690..40b170b9884019f849cbe425f59c8329549b0f0e 100644 (file)
@@ -1,3 +1,9 @@
+2001-01-18  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * FormPrint.[Ch] (browse): new method to browse for file to print to.
+
+       * forms/form_print.fd: give the form a Browse button.
+
 2001-01-17  Dekel Tsur  <dekelts@tau.ac.il>
 
        * FormRef.C (input): Fix the behavior of goto reference button.
index 29f5126949444b9f429e09079be3a23149f47757..969804a670109e7c2f61902761fd60c9eb2411cd 100644 (file)
@@ -21,7 +21,8 @@
 #include "Liason.h"
 #include "debug.h"
 #include "BufferView.h"
-#include "lyx_gui_misc.h"      // WriteAlert
+#include "lyx_gui_misc.h"      // WriteAlert
+#include "xform_helpers.h"     // for browseFile
 
 #ifdef SIGC_CXX_NAMESPACES
 using SigC::slot;
@@ -32,6 +33,7 @@ using Liason::printBuffer;
 using Liason::getPrinterParams;
 #endif
 
+using std::make_pair;
 
 FormPrint::FormPrint(LyXView * lv, Dialogs * d)
        : FormBaseBD(lv, d, _("Print"), new OkApplyCancelPolicy),
@@ -202,7 +204,7 @@ void FormPrint::update()
 // It would be nice if we checked for cases like:
 // Print only-odd-pages and from_page == an even number
 //
-bool FormPrint::input(FL_OBJECT *, long)
+bool FormPrint::input(FL_OBJECT * ob, long)
 {
        bool activate = true;
 
@@ -237,6 +239,10 @@ bool FormPrint::input(FL_OBJECT *, long)
                activate = false;
        }
 
+       if (ob == dialog_->button_browse) {
+               browse();
+       }
+               
        // it is probably legal to have no printer name since the system will
        // have a default printer set.  Or should have.
 //     if (fl_get_button(dialog_->radio_printer)
@@ -245,3 +251,25 @@ bool FormPrint::input(FL_OBJECT *, long)
 //     }
        return activate;
 }
+
+
+void FormPrint::browse()
+{
+       // Get the filename from the dialog
+       string const filename = fl_get_input(dialog_->input_file);
+
+       string const title = N_("Print to file");
+       string const pattern = "*.ps";
+
+       // Show the file browser dialog
+       string const new_filename =
+               browseFile(filename, title, pattern,
+                          make_pair(string(), string()),
+                          make_pair(string(), string()));
+
+       // Save the filename to the dialog
+       if (new_filename != filename && !new_filename.empty()) {
+               fl_set_input(dialog_->input_file, new_filename.c_str());
+               input(0, 0);
+       }
+}
index 0f9f69dda1bdcec3c1bfd4928fbf79bb894aa739..5357913feb6f3b0f51f3bc16b32c195f30bbe2bc 100644 (file)
@@ -49,6 +49,8 @@ private:
        virtual FL_FORM * form() const;
        /// Build the dialog
        virtual void build();
+       /// Open the file browse dialog.
+       void browse();
 
        ///
        FD_form_print * build_print();
index 7f5060f41198cc4f85cbf615b83c96f6e6c00419..1ae592570ea24f28bb0e5e0f2fad28d4a69e82fa 100644 (file)
@@ -22,9 +22,9 @@ FD_form_print * FormPrint::build_print()
   FL_OBJECT *obj;
   FD_form_print *fdui = new FD_form_print;
 
-  fdui->form = fl_bgn_form(FL_NO_BOX, 340, 360);
+  fdui->form = fl_bgn_form(FL_NO_BOX, 340, 390);
   fdui->form->u_vdata = this;
-  obj = fl_add_box(FL_UP_BOX, 0, 0, 340, 360, "");
+  obj = fl_add_box(FL_UP_BOX, 0, 0, 340, 390, "");
   fdui->input_printer = obj = fl_add_input(FL_NORMAL_INPUT, 90, 225, 230, 30, "");
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_callback(obj, C_FormBaseInputCB, 0);
@@ -49,19 +49,19 @@ FD_form_print * FormPrint::build_print()
     fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fl_end_group();
 
-  fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 10, 315, 100, 30, _("OK"));
+  fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 10, 350, 100, 30, _("OK"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_callback(obj, C_FormBaseOKCB, 0);
   {
     char const * const dummy = N_("Apply|#A");
-    fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 120, 315, 100, 30, idex(_(dummy)));
+    fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 120, 350, 100, 30, idex(_(dummy)));
     fl_set_button_shortcut(obj, scex(_(dummy)), 1);
   }
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_callback(obj, C_FormBaseApplyCB, 0);
   {
     char const * const dummy = N_("Cancel|C#C^[");
-    fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 230, 315, 100, 30, idex(_(dummy)));
+    fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 230, 350, 100, 30, idex(_(dummy)));
     fl_set_button_shortcut(obj, scex(_(dummy)), 1);
   }
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
@@ -135,9 +135,16 @@ FD_form_print * FormPrint::build_print()
   obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 180, 110, 150, 90, _("Copies"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lstyle(obj, FL_BOLD_STYLE);
-  obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 210, 320, 100, _("Print to"));
+  obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 10, 210, 320, 130, _("Print to"));
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+  {
+    char const * const dummy = N_("Browse|#B");
+    fdui->button_browse = obj = fl_add_button(FL_NORMAL_BUTTON, 220, 300, 100, 30, idex(_(dummy)));
+    fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+  }
+    fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+    fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   fl_end_form();
 
   fdui->form->fdui = fdui;
index 5c369d0a1a194528d4d90dd56fb7688a3187211d..eda70ba0d4aecb5c2e3234c10e8414827d53a6d7 100644 (file)
@@ -35,6 +35,7 @@ struct FD_form_print {
        FL_OBJECT *input_count;
        FL_OBJECT *radio_collated;
        FL_OBJECT *input_to_page;
+       FL_OBJECT *button_browse;
 };
 
 #endif /* FD_form_print_h_ */
index dc9169031fa65f2ab9295f14b8c632c58b83d79f..8ad25dc30865ab861cdd2a34924c01caefe0ac0d 100644 (file)
@@ -9,13 +9,13 @@ Unit of measure: FL_COORD_PIXEL
 =============== FORM ===============
 Name: form_print
 Width: 340
-Height: 360
-Number of Objects: 27
+Height: 390
+Number of Objects: 28
 
 --------------------
 class: FL_BOX
 type: UP_BOX
-box: 0 0 340 360
+box: 0 0 340 390
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -141,7 +141,7 @@ argument:
 --------------------
 class: FL_BUTTON
 type: RETURN_BUTTON
-box: 10 315 100 30
+box: 10 350 100 30
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -159,7 +159,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 120 315 100 30
+box: 120 350 100 30
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -177,7 +177,7 @@ argument: 0
 --------------------
 class: FL_BUTTON
 type: NORMAL_BUTTON
-box: 230 315 100 30
+box: 230 350 100 30
 boxtype: FL_UP_BOX
 colors: FL_COL1 FL_COL1
 alignment: FL_ALIGN_CENTER
@@ -483,7 +483,7 @@ argument:
 --------------------
 class: FL_LABELFRAME
 type: ENGRAVED_FRAME
-box: 10 210 320 100
+box: 10 210 320 130
 boxtype: FL_NO_BOX
 colors: FL_BLACK FL_COL1
 alignment: FL_ALIGN_TOP_LEFT
@@ -498,5 +498,23 @@ name:
 callback: 
 argument: 
 
+--------------------
+class: FL_BUTTON
+type: NORMAL_BUTTON
+box: 220 300 100 30
+boxtype: FL_UP_BOX
+colors: FL_COL1 FL_COL1
+alignment: FL_ALIGN_CENTER
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: Browse|#B
+shortcut: 
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: button_browse
+callback: C_FormBaseInputCB
+argument: 0
+
 ==============================
 create_the_forms
index 0506c89cebf889acba20a85d9b7149bd2bcaad35..d2610ba92902fe533412128173a55f6bd5277cd5 100644 (file)
@@ -1,3 +1,7 @@
+2001-01-19  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * lyxinset.h: remove trailing comma in enum.
+
 2001-01-17  John Levon  <moz@compsoc.man.ac.uk>
 
        * insettext.C: kill LyXBell.
index bbe02c7e494a7014b44dfea14cd97f2965c717ee..a8b2d2cc73a36fd7b08ddbb9b5bbb0122d31bdd9 100644 (file)
@@ -107,7 +107,7 @@ public:
                ///
                MATHMACRO_CODE,
                ///
-               ERROR_CODE,
+               ERROR_CODE
        };
 
        ///
index 3f9461e6ecb7c8fbee0296e17924983abd35311c..d9f7e28269bffacf920d40246472989ef8cfa34f 100644 (file)
@@ -2749,7 +2749,7 @@ string const LyXFunc::Dispatch(int ac,
 
        case LFUN_CHILDINSERT:
        {
-               InsetCommandParams p( "Include", argument );
+               InsetCommandParams p( "include", argument );
                Inset * inset = new InsetInclude(p, *owner->buffer());
                if (owner->view()->insertInset(inset, "Standard", true))
                        inset->Edit(owner->view(), 0, 0, 0);
index a52ac6678dccb765336c9c6419d82577aae714cc..726c4e0c305138ac10fefdc8b6476a86bf513248 100644 (file)
@@ -45,7 +45,9 @@
 #include "FloatList.h"
 
 using std::copy;
+using std::find;
 using std::endl;
+using std::find;
 using std::pair;