On Mon, 18 Oct 2004, Jean-Marc Lasgouttes wrote:
> I chose C-Next and C-Prior for cua.bind because this is what mozilla
> uses for tabs, but we can use something else (C-tab?) if there is some
> existing standard.
The CUA standard is to use C-F6 and C-S-F6 for this, so you might want to
add those.
Regards,
Asger
Index: lib/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/ChangeLog,v
retrieving revision 1.633
diff -u -p -r1.633 ChangeLog
--- lib/ChangeLog 15 Oct 2004 16:22:43 -0000 1.633
+++ lib/ChangeLog 18 Oct 2004 09:50:47 -0000
@@ -1,3 +1,7 @@
+2004-10-18 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
+
+ * bind/cua.bind: add bindings for buffer-previous/next
+
2004-10-15 Andreas Vox <[EMAIL PROTECTED]>
* layouts/db_stdstarsections.inc: fill definitions for star sections.
Index: lib/bind/cua.bind
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/bind/cua.bind,v
retrieving revision 1.30
diff -u -p -r1.30 cua.bind
--- lib/bind/cua.bind 30 Mar 2004 12:36:29 -0000 1.30
+++ lib/bind/cua.bind 18 Oct 2004 09:50:47 -0000
@@ -49,6 +49,9 @@
\bind "C-S-D" "buffer-update dvi" # 'd' for dvi
\bind "C-S-T" "buffer-update ps"
\bind "C-q" "lyx-quit"
+\bind "C-Next" "buffer-next"
+\bind "C-Prior" "buffer-previous"
+
\bind "C-b" "font-bold"
\bind "C-e" "font-emph"
Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.1992
diff -u -p -r1.1992 ChangeLog
--- src/ChangeLog 15 Oct 2004 08:27:59 -0000 1.1992
+++ src/ChangeLog 18 Oct 2004 09:50:47 -0000
@@ -1,3 +1,12 @@
+2004-10-18 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
+
+ * lyxfunc.C (getStatus,dispatch): handle LFUN_(PREVIOUS|NEXT)BUFFER
+
+ * bufferlist.C (previous, next): new methods
+
+ * lfuns.h:
+ * LyXAction.C (init): add LFUN_NEXTBUFFER and LFUN_PREVIOUSBUFFER
+
2004-10-14 Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
* BufferView_pimpl.C (setBuffer): when closing a buffer, make sure
Index: src/LyXAction.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LyXAction.C,v
retrieving revision 1.201
diff -u -p -r1.201 LyXAction.C
--- src/LyXAction.C 13 Aug 2004 15:11:15 -0000 1.201
+++ src/LyXAction.C 18 Oct 2004 09:50:47 -0000
@@ -337,6 +337,8 @@ void LyXAction::init()
{ LFUN_BUFFERPARAMS_APPLY, "buffer-params-apply", Noop },
{ LFUN_LYXRC_APPLY, "lyxrc-apply", NoBuffer },
{ LFUN_INSET_REFRESH, "", Noop },
+ { LFUN_NEXTBUFFER, "buffer-next", ReadOnly },
+ { LFUN_PREVIOUSBUFFER, "buffer-previous", ReadOnly },
{ LFUN_NOACTION, "", Noop }
};
Index: src/bufferlist.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/bufferlist.C,v
retrieving revision 1.141
diff -u -p -r1.141 bufferlist.C
--- src/bufferlist.C 25 Mar 2004 09:16:15 -0000 1.141
+++ src/bufferlist.C 18 Oct 2004 09:50:47 -0000
@@ -217,6 +217,35 @@ Buffer * BufferList::getBuffer(unsigned
}
+Buffer * BufferList::next(Buffer const * buf) const
+{
+ if (bstore.empty())
+ return 0;
+ BufferStorage::const_iterator it = find(bstore.begin(),
+ bstore.end(), buf);
+ BOOST_ASSERT(it != bstore.end());
+ ++it;
+ if (it == bstore.end())
+ return bstore.front();
+ else
+ return *it;
+}
+
+
+Buffer * BufferList::previous(Buffer const * buf) const
+{
+ if (bstore.empty())
+ return 0;
+ BufferStorage::const_iterator it = find(bstore.begin(),
+ bstore.end(), buf);
+ BOOST_ASSERT(it != bstore.end());
+ if (it == bstore.begin())
+ return bstore.back();
+ else
+ return *(it - 1);
+}
+
+
void BufferList::updateIncludedTeXfiles(string const & mastertmpdir,
OutputParams const & runparams)
{
Index: src/bufferlist.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/bufferlist.h,v
retrieving revision 1.47
diff -u -p -r1.47 bufferlist.h
--- src/bufferlist.h 5 Nov 2003 12:06:03 -0000 1.47
+++ src/bufferlist.h 18 Oct 2004 09:50:47 -0000
@@ -71,6 +71,18 @@ public:
/// returns a pointer to the buffer whose temppath matches the string
Buffer * BufferList::getBufferFromTmp(std::string const &);
+ /** returns a pointer to the buffer that follows argument in
+ * buffer list. The buffer following the last in list is the
+ * first one.
+ */
+ Buffer * next(Buffer const *) const;
+
+ /** returns a pointer to the buffer that precedes argument in
+ * buffer list. The buffer preceding the first in list is the
+ * last one.
+ */
+ Buffer * previous(Buffer const *) const;
+
/// reset current author for all buffers
void setCurrentAuthor(std::string const & name, std::string const & email);
Index: src/lfuns.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lfuns.h,v
retrieving revision 1.36
diff -u -p -r1.36 lfuns.h
--- src/lfuns.h 17 May 2004 08:52:19 -0000 1.36
+++ src/lfuns.h 18 Oct 2004 09:50:47 -0000
@@ -350,6 +350,8 @@ enum kb_action {
LFUN_LYXRC_APPLY,
LFUN_GRAPHICS_EDIT,
LFUN_INSET_REFRESH,
+ LFUN_NEXTBUFFER,
+ LFUN_PREVIOUSBUFFER,
LFUN_LASTACTION // end of the table
};
Index: src/lyxfunc.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.626
diff -u -p -r1.626 lyxfunc.C
--- src/lyxfunc.C 5 Oct 2004 10:11:27 -0000 1.626
+++ src/lyxfunc.C 18 Oct 2004 09:50:48 -0000
@@ -503,6 +503,8 @@ FuncStatus LyXFunc::getStatus(FuncReques
case LFUN_SAVE_AS_DEFAULT:
case LFUN_BUFFERPARAMS_APPLY:
case LFUN_LYXRC_APPLY:
+ case LFUN_NEXTBUFFER:
+ case LFUN_PREVIOUSBUFFER:
// these are handled in our dispatch()
break;
@@ -956,6 +958,14 @@ void LyXFunc::dispatch(FuncRequest const
// --- buffers ----------------------------------------
case LFUN_SWITCHBUFFER:
view()->setBuffer(bufferlist.getBuffer(argument));
+ break;
+
+ case LFUN_NEXTBUFFER:
+ view()->setBuffer(bufferlist.next(view()->buffer()));
+ break;
+
+ case LFUN_PREVIOUSBUFFER:
+ view()->setBuffer(bufferlist.previous(view()->buffer()));
break;
case LFUN_FILE_NEW: