]> git.lyx.org Git - features.git/commitdiff
two patches from John, and a moving math panel
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 8 Nov 2001 11:46:06 +0000 (11:46 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 8 Nov 2001 11:46:06 +0000 (11:46 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2983 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ChangeLog
lib/ui/default.ui
src/ChangeLog
src/frontends/xforms/ChangeLog
src/frontends/xforms/DropDown.C
src/lyxserver.C
src/lyxserver.h
src/minibuffer.C
src/minibuffer.h

index 2b4f2b4295b50491bc5ca97d77b2e3c1b360ea06..ad5c0fd27733bd6f3ba53e2d169b945baf09b96b 100644 (file)
@@ -1,3 +1,7 @@
+2001-11-08  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * ui/default.ui: move math panel from Edit to Insert.
+
 2001-11-05  Kayvan A. Sylvan  <kayvan@sylvan.com>
 
        * layouts/chess.layout: 
index 25e69d5caedf47c0fc4690e057d55512c76b3187..6af054208cdc202365b9d975db22b9848a869e33 100644 (file)
@@ -96,7 +96,6 @@ Menuset
        Item "Find & Replace...|F" "find-replace"
        Submenu "Tabular|T" "edit_tabular"
        Submenu "Floats & Insets|I" "edit_floats"
-       Item "Math Panel|l" "math-panel"
        Submenu "Math|M" "edit_math"
        Separator
        #Item "Read Only" "buffer-toggle-read-only"
@@ -185,6 +184,7 @@ Menuset
     Menu "insert"
        Item "Math Formula|h" "math-mode"
        Item "Display Formula|D" "math-display"
+       Item "Math Panel|l" "math-panel"
        #Item "Display Formula|D" "math-mode display"
        #Item "Change to Inline Math Formula|q" "math-mutate simple"
        #Item "Change to Displayed Math Formula|q" "math-mutate equation"
index c24cb41301ed796be653b8e26c9c4b27e2fc5f7f..d1986ce746514f7ca8b3427d975dbb517595c432 100644 (file)
@@ -1,3 +1,13 @@
+2001-11-07  John Levon  <moz@compsoc.man.ac.uk>
+
+       * minibuffer.h:
+       * minibuffer.C: fix crash, improve drop-down completion 
+2001-11-06  John Levon  <moz@compsoc.man.ac.uk>
+
+       * lyxserver.h:
+       * lyxserver.C: invalidate fd's when doing endPipe()
 2001-11-08  José Matos  <jamatos@fep.up.pt>
 
        * buffer.C (sgmlLineBreak): renamed from linux_doc_line_break.
index 5cba603be8546ba03b0239105e8b8f1e3f7d249f..010e3a6f3d8686310c372bdfb11bd887562bef75 100644 (file)
@@ -1,3 +1,7 @@
+2001-11-07  John Levon  <moz@compsoc.man.ac.uk>
+
+       * DropDown.C: fix crash, improve behaviour a bit
 2001-11-07  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * FormDocument.C (class_apply): 
index ebd3cac6fa0f78ebf6582f821208009336ed64d1..455b20e22023efd97ee089d596654e9275f0fa87 100644 (file)
@@ -100,6 +100,7 @@ int DropDown::peek(XEvent * xev)
                        fl_hide_form(form_);
                        return 1;
                }
+               XUngrabPointer(fl_get_display(), CurrentTime);
        } else if (xev->type == KeyPress) {
                char s_r[10]; s_r[9] = '\0';
                KeySym keysym_return;
@@ -114,6 +115,18 @@ int DropDown::peek(XEvent * xev)
                        case XK_Return:
                                completed(); 
                                return 1;
+                       case XK_Escape:
+                               fl_select_browser_line(browser_, 0);
+                               completed();
+                               return 1;
+                       default:
+                               // FIXME: if someone has a got a way to
+                               // convince the event to fall back to the
+                               // minibuffer, I'm glad to hear it.
+                               // fl_XPutBackEvent() doesn't work. 
+                               fl_select_browser_line(browser_, 0);
+                               completed();
+                               return 1;
                }
        }
        return 0; 
@@ -122,9 +135,10 @@ int DropDown::peek(XEvent * xev)
  
 void DropDown::completed()
 {
+       XUngrabPointer(fl_get_display(), CurrentTime);
        string selection;
        int i = fl_get_browser(browser_);
-       if (i == -1)
+       if (i 1)
                selection = "";
        else
                selection = fl_get_browser_line(browser_, i); 
index fa0294c5dd921099b1b309161eead5611a935095..ab129d57553ecc781dcbd86d6c4af6cd3ba7e5ae 100644 (file)
@@ -215,7 +215,7 @@ int LyXComm::startPipe(string const & filename)
 }
 
 
-void LyXComm::endPipe(int fd, string const & filename)
+void LyXComm::endPipe(int fd, string const & filename)
 {
        if (fd < 0)
                return;
@@ -245,6 +245,8 @@ void LyXComm::endPipe(int fd, string const & filename)
                       << '\n' << strerror(errno) << endl;
        };
 #endif
+
+       fd = -1;
 }
 
 
index 4311aba232cb846cbf062c46b2adfe6e7d02ff0e..866cda07e44f86aef9aa78e93c59c7b3970bfc6d 100644 (file)
@@ -69,7 +69,7 @@ private:
        int startPipe(string const &);
  
        /// finish a pipe
-       void endPipe(int, string const &);
+       void endPipe(int &, string const &);
  
        /// This is -1 if not open
        int infd;
index eb0849850f2f5c064c677fd758bb01a9e6a1a322..7583a803eb74f571964c36ff84fab08e1208e82b 100644 (file)
@@ -70,7 +70,7 @@ MiniBuffer::MiniBuffer(LyXView * o, FL_Coord x, FL_Coord y,
 void MiniBuffer::dd_init()
 {
        dropdown_ = new DropDown(owner_, the_buffer);
-       dropdown_->result.connect(slot(this, &MiniBuffer::set_input));
+       dropdown_->result.connect(slot(this, &MiniBuffer::set_complete_input));
 }
 
 
@@ -153,14 +153,15 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key)
                                // Perfect match
                                string const tmp =
                                        comp[0] + _(" [sole completion]");
-                               stored_set(comp[0]);
+                               stored_set(comp[0] + " ");
                                set_input(tmp);
                        } else {
                                // More that one match
                                // Find maximal avaliable prefix
                                string const tmp = comp[0];
                                string test(input);
-                               test += tmp[test.length()];
+                               if (tmp.length() > test.length())
+                                       test += tmp[test.length()];
                                while (test.length() < tmp.length()) {
                                        vector<string> vtmp;
                                        lyx::copy_if(comp.begin(),
@@ -378,6 +379,13 @@ void MiniBuffer::redraw()
 }
 
 
+void MiniBuffer::set_complete_input(string const & str)
+{
+       if (!str.empty())
+               set_input(str);
+}
+
 void MiniBuffer::set_input(string const & str)
 {
        fl_set_input(the_buffer, str.c_str());
index 3a389620ec01e085d8f1a4e28e131c92567d7d3c..464b05690a9c957627d1b84e045c65553591f919 100644 (file)
@@ -74,7 +74,9 @@ private:
        void stored_slot();
        ///
        void stored_set(string const &);
-       ///
+       /// set the minibuffer content if str non-empty 
+       void set_complete_input(string const &);
+       /// set the minibuffer content
        void set_input(string const &);
        ///
        void init();