From: Jean-Marc Lasgouttes Date: Thu, 8 Nov 2001 11:46:06 +0000 (+0000) Subject: two patches from John, and a moving math panel X-Git-Tag: 1.6.10~20382 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=fcee90ebd5070ca5fbc21ec3eb28d741ebacdbf9;p=features.git two patches from John, and a moving math panel git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2983 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/ChangeLog b/lib/ChangeLog index 2b4f2b4295..ad5c0fd277 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2001-11-08 Jean-Marc Lasgouttes + + * ui/default.ui: move math panel from Edit to Insert. + 2001-11-05 Kayvan A. Sylvan * layouts/chess.layout: diff --git a/lib/ui/default.ui b/lib/ui/default.ui index 25e69d5cae..6af054208c 100644 --- a/lib/ui/default.ui +++ b/lib/ui/default.ui @@ -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" diff --git a/src/ChangeLog b/src/ChangeLog index c24cb41301..d1986ce746 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2001-11-07 John Levon + + * minibuffer.h: + * minibuffer.C: fix crash, improve drop-down completion + +2001-11-06 John Levon + + * lyxserver.h: + * lyxserver.C: invalidate fd's when doing endPipe() + 2001-11-08 José Matos * buffer.C (sgmlLineBreak): renamed from linux_doc_line_break. diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 5cba603be8..010e3a6f3d 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2001-11-07 John Levon + + * DropDown.C: fix crash, improve behaviour a bit + 2001-11-07 Jean-Marc Lasgouttes * FormDocument.C (class_apply): diff --git a/src/frontends/xforms/DropDown.C b/src/frontends/xforms/DropDown.C index ebd3cac6fa..455b20e220 100644 --- a/src/frontends/xforms/DropDown.C +++ b/src/frontends/xforms/DropDown.C @@ -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); diff --git a/src/lyxserver.C b/src/lyxserver.C index fa0294c5dd..ab129d5755 100644 --- a/src/lyxserver.C +++ b/src/lyxserver.C @@ -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; } diff --git a/src/lyxserver.h b/src/lyxserver.h index 4311aba232..866cda07e4 100644 --- a/src/lyxserver.h +++ b/src/lyxserver.h @@ -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; diff --git a/src/minibuffer.C b/src/minibuffer.C index eb0849850f..7583a803eb 100644 --- a/src/minibuffer.C +++ b/src/minibuffer.C @@ -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 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()); diff --git a/src/minibuffer.h b/src/minibuffer.h index 3a389620ec..464b05690a 100644 --- a/src/minibuffer.h +++ b/src/minibuffer.h @@ -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();