]> git.lyx.org Git - features.git/commitdiff
preamble editing in GTK document dialog
authorJohn Spray <spray@lyx.org>
Sat, 28 Jan 2006 18:32:38 +0000 (18:32 +0000)
committerJohn Spray <spray@lyx.org>
Sat, 28 Jan 2006 18:32:38 +0000 (18:32 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10789 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/gtk/ChangeLog
src/frontends/gtk/Dialogs.C
src/frontends/gtk/GDocument.C
src/frontends/gtk/GDocument.h
src/frontends/gtk/glade/document.glade

index 87c01e8bb9d3b1696b5f59ceb15010682768f402..265ebeda61254c105e0468b5b1bf6895f57e67c2 100644 (file)
@@ -2,6 +2,9 @@
 
        * GtkLengthEntry.[Ch]: implement signal_changed, setup spin limits
        * GWrap.[Ch], glade/wrap.glade: Add Wrap dialog
+       * GDocument.[Ch], Dialogs.C: Implemented preamble editing in 
+               document dialog.  "dialog-show preamble" will now violate
+               an assertion in Dialogs.C.
 
 2006-01-27  Bernhard Reiter  <ockham@gmx.net>
 
index 27da3849ee6fb623e3ba3e6479b3b30acae3d8a8..25d3f3ae4f7935a961ba3640844e195a1830367d 100644 (file)
@@ -40,7 +40,6 @@
 #include "ControlMath.h"
 #include "ControlNote.h"
 #include "ControlParagraph.h"
-#include "ControlPreamble.h"
 #include "ControlPrefs.h"
 #include "ControlPrint.h"
 #include "ControlRef.h"
@@ -80,7 +79,6 @@
 //#include "FormMathsStyle.h"
 #include "GNote.h"
 #include "GParagraph.h"
-//#include "FormPreamble.h"
 //#include "FormPreferences.h"
 #include "GPrint.h"
 #include "GRef.h"
@@ -143,7 +141,7 @@ char const * const dialognames[] = {
 "mathgreek", "mathmisc", "mathdots", "mathbigoperators", "mathamsmisc",
 "mathamsarrows", "mathamsrelations", "mathamsnegatedrelations",
 "mathamsoperators", "mathdelimiter", "mathmatrix", "mathspace", "mathstyle",
-"note", "paragraph", "preamble", "prefs", "print", "ref", "sendto",
+"note", "paragraph", "prefs", "print", "ref", "sendto",
 "spellchecker", "tabular", "tabularcreate", "texinfo",
 
 #ifdef HAVE_LIBAIKSAURUS
@@ -492,11 +490,6 @@ Dialogs::DialogPtr Dialogs::build(string const & name)
                dialog->setController(new ControlParagraph(*dialog));
                dialog->setView(new GParagraph(*dialog));
                dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
-       } else if (name == "preamble") {
-//             dialog->bc().view(new xformsBC(dialog->bc()));
-               dialog->setController(new ControlPreamble(*dialog));
-//             dialog->setView(new FormPreamble(*dialog));
-               dialog->bc().bp(new OkApplyCancelPolicy);
        } else if (name == "prefs") {
 //             dialog->bc().view(new xformsBC(dialog->bc()));
                dialog->setController(new ControlPrefs(*dialog));
index 8b090a276d47eb7266c9cdf47c5fee7358dab096..b5cce5ff76e0f0742f1e9a3f17dc8dc178be5324 100644 (file)
@@ -362,6 +362,12 @@ void GDocument::doBuild()
        (*row)[branchColName_] = "Hunch";
        (*row)[branchColActivated_] = true;
        // *** End "Branches" Page ***
+
+       // *** Begin "Preamble" Page ***
+       Gtk::TextView *view;
+       xml_->get_widget ("Preamble", view);
+       preamblebuffer_ = view->get_buffer();
+       // *** End "Preamble" Page ***
 }
 
 
@@ -587,6 +593,10 @@ void GDocument::update()
        }
        // *** End "Branches" Page ***
 
+       // *** Begin "Preamble" Page ***
+       preamblebuffer_->set_text(params.preamble);
+       // *** End "Preamble" Page ***
+
        // Be a cheesy bastard, for the moment
        bc().valid();
 }
@@ -797,6 +807,10 @@ void GDocument::apply()
        params.branchlist() = branchlist;
        
        // *** End "Branches" Page ***
+
+       // *** Begin "Preamble" Page ***
+       params.preamble = preamblebuffer_->get_text();
+       // *** End "Preamble" Page ***
 }
 
 
index ad53c424a294fe563b3935166fa3f02071d37443..1039245b485a0c3cad6f0389d249645c21edf1f4 100644 (file)
@@ -159,6 +159,10 @@ private:
        void addBranch();
        void branchSelChanged();
        // *** End "Branches" Page ***
+
+       // *** Begin "Preamble" Page ***
+       Glib::RefPtr<Gtk::TextBuffer> preamblebuffer_;
+       // *** End "Preamble" Page ***
 };
 
 } // namespace frontend
index fc151be3fc1665848d76a384493a5c557f07e168..c504c68d03e888b40748e5e5b28abf9f69ed417d 100644 (file)
              <property name="type">tab</property>
            </packing>
          </child>
+
+         <child>
+           <widget class="GtkScrolledWindow" id="scrolledwindow2">
+             <property name="border_width">12</property>
+             <property name="visible">True</property>
+             <property name="can_focus">True</property>
+             <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+             <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+             <property name="shadow_type">GTK_SHADOW_IN</property>
+             <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+             <child>
+               <widget class="GtkTextView" id="Preamble">
+                 <property name="visible">True</property>
+                 <property name="can_focus">True</property>
+                 <property name="editable">True</property>
+                 <property name="overwrite">False</property>
+                 <property name="accepts_tab">True</property>
+                 <property name="justification">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap_mode">GTK_WRAP_NONE</property>
+                 <property name="cursor_visible">True</property>
+                 <property name="pixels_above_lines">3</property>
+                 <property name="pixels_below_lines">0</property>
+                 <property name="pixels_inside_wrap">0</property>
+                 <property name="left_margin">6</property>
+                 <property name="right_margin">0</property>
+                 <property name="indent">0</property>
+                 <property name="text" translatable="yes">You should not see this.</property>
+               </widget>
+             </child>
+           </widget>
+           <packing>
+             <property name="tab_expand">False</property>
+             <property name="tab_fill">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkLabel" id="label74">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">P_reamble</property>
+             <property name="use_underline">True</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_LEFT</property>
+             <property name="wrap">False</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0.5</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
+             <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+             <property name="width_chars">-1</property>
+             <property name="single_line_mode">False</property>
+             <property name="angle">0</property>
+           </widget>
+           <packing>
+             <property name="type">tab</property>
+           </packing>
+         </child>
        </widget>
        <packing>
          <property name="padding">0</property>