mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-02 08:10:39 +00:00
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
This commit is contained in:
parent
a1a47b2255
commit
fcee90ebd5
@ -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:
|
||||
|
@ -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"
|
||||
|
@ -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.
|
||||
|
@ -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):
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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());
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user