]> git.lyx.org Git - features.git/commitdiff
fix loss of selection from John; some small things
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 7 Feb 2002 16:43:54 +0000 (16:43 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 7 Feb 2002 16:43:54 +0000 (16:43 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3500 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ChangeLog
lib/ui/default.ui
po/POTFILES.in
src/BufferView_pimpl.C
src/BufferView_pimpl.h
src/ChangeLog
src/WorkArea.C
src/WorkArea.h
src/lyxfunc.C
src/vspace.C

index ff13f0d6c9a426e1cc86fea58af1e4b36f4b3ed1..28f36ad0a4bd13d18c576ec2eac205d9b98124b2 100644 (file)
@@ -1,3 +1,7 @@
+2002-02-07  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * ui/default.ui: add ... to math panel
+
 2002-02-04  Martin Vermeer <martin.vermeer@hut.fi>
 
        * bind/math-bind: keybindings for umlauts and other special chars
index 44a91258c50c0dafb3d28ad33830266b065bd4b7..b1a3fd3dfca2695691395c18842f4c5743515050 100644 (file)
@@ -235,7 +235,7 @@ Menuset
        Separator
        Submenu "Symbols|S" "insert_math_symbol"
   Separator
-       Item "Math Panel|l" "math-panel"
+       Item "Math Panel...|l" "math-panel"
     End
 
     Menu "insert_math_symbol"
index f4c6ecd96fe209629cf6803eab2b4bec6e2e5882..35706095476e93fda12b88574623f68891dde2c1 100644 (file)
@@ -75,6 +75,7 @@ src/frontends/xforms/combox.C
 src/frontends/xforms/FileDialog.C
 src/frontends/xforms/form_aboutlyx.C
 src/frontends/xforms/FormAboutlyx.C
+src/frontends/xforms/FormBase.C
 src/frontends/xforms/form_bibitem.C
 src/frontends/xforms/FormBibitem.C
 src/frontends/xforms/form_bibtex.C
index b8cc2a399602e9d9110ff57171ba20df22682d84..7b0b902e541f683675f1c9420a19691e07616dc8 100644 (file)
@@ -157,6 +157,8 @@ BufferView::Pimpl::Pimpl(BufferView * b, LyXView * o,
                .connect(slot(this, &BufferView::Pimpl::workAreaKeyPress));
        workarea_.selectionRequested
                .connect(slot(this, &BufferView::Pimpl::selectionRequested)); 
+       workarea_.selectionLost
+               .connect(slot(this, &BufferView::Pimpl::selectionLost));
        
        cursor_timeout.timeout.connect(slot(this,
                                            &BufferView::Pimpl::cursorToggle));
@@ -753,6 +755,15 @@ void BufferView::Pimpl::selectionRequested()
 }
 
  
+void BufferView::Pimpl::selectionLost()
+{
+       hideCursor();
+       toggleSelection();
+       bv_->getLyXText()->clearSelection();
+       showCursor(); 
+}
+
 void BufferView::Pimpl::enterView()
 {
        if (active() && available()) {
index 652b6c7be4c2aa0fa863f5f2d7944b189a7b2674..09fb00d93551073932d23ef8514d1c452bcd43e3 100644 (file)
@@ -80,6 +80,8 @@ struct BufferView::Pimpl : public SigC::Object {
        ///
        void selectionRequested();
        ///
+       void selectionLost();
+       ///
        void enterView();
        ///
        void leaveView();
index acaf6f920cc0b3d50c5cbe600520a2e1137dca38..dc4e855e1ca178bbac21a81d7af7ad3e28425287 100644 (file)
@@ -1,3 +1,19 @@
+2002-02-07  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * lyxfunc.C (dispatch): a few comments from Martin
+
+2002-02-06  John Levon  <moz@compsoc.man.ac.uk>
+
+       * WorkArea.h:
+       * WorkArea.C:
+       * BufferView_pimpl.h:
+       * BufferView_pimpl.C: clear our selection when X tells us we've lost
+         the X selection.
+
+2002-02-07  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
+
+       * vspace.C (inPixels): fix compiler warning
+
 2002-02-06  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * lyxfunc.C (getStatus): fix status message for disabled commands. 
index 7dd3b8e3f7d1ff6a6e2dc44ac3b9b7dfa195600f..ad4751de09e88104465aac971c3e679018c0cf66 100644 (file)
@@ -577,11 +577,16 @@ extern "C" {
 
 void WorkArea::event_cb(XEvent * xev)
 {
-       if (xev->type != SelectionRequest)
-               return;
-       selectionRequested.emit();
-       return;
+       switch (xev->type) {
+               case SelectionRequest:
+                       lyxerr[Debug::GUI] << "X requested selection." << endl;
+                       selectionRequested.emit();
+                       break;
+               case SelectionClear:
+                       lyxerr[Debug::GUI] << "Lost selection." << endl;
+                       selectionLost.emit();
+                       break; 
+       }
 }
 
 
index 6a1dde6b5f412bdc5136bb3a2319939f7300deaa..eb1bf551ff0a1855a6d8ef1124381d81ece880ac 100644 (file)
@@ -128,6 +128,8 @@ public:
        SigC::Signal3<void, int, int, unsigned int> workAreaTripleClick;
        /// emitted when an X client has requested our selection
        SigC::Signal0<void> selectionRequested;
+       /// emitted when another X client has stolen our selection
+       SigC::Signal0<void> selectionLost;
  
        /// handles SelectionRequest X Event, to fill the clipboard
        void event_cb(XEvent * xev);
index ebdb24c6eb3c4857f37c58b7a5d505265ca69594..a8f210868d72fb1919aac860d1281036dfdf1738 100644 (file)
@@ -881,10 +881,12 @@ string const LyXFunc::dispatch(kb_action action, string argument)
                                owner->view()->menuRedo();
                                goto exit_with_message;
                        } else if (((result=owner->view()->theLockingInset()->
+                                    // Hand-over to inset's own dispatch:
                                     localDispatch(owner->view(), action, argument)) ==
                                    UpdatableInset::DISPATCHED) ||
                                   (result == UpdatableInset::DISPATCHED_NOUPDATE))
                                goto exit_with_message;
+                                       // If UNDISPATCHED, just soldier on
                        else if (result == UpdatableInset::FINISHED) {
                                        if (TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) {
                                                TEXT()->cursorRight(owner->view());
@@ -1616,6 +1618,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
 
        default:
                // Then if it was none of the above
+               // Trying the BufferView::pimpl dispatch:
                if (!owner->view()->Dispatch(action, argument))
                        lyxerr << "A truly unknown func ["
                               << lyxaction.getActionName(action) << "]!"
index 6c1e46f34a6731f3971e0d2e7b91fb3fd50d416b..103d3e9a404ac843f5dec0c571c4a99448476d60 100644 (file)
@@ -457,4 +457,6 @@ int VSpace::inPixels(BufferView * bv) const
        case LENGTH:
                return len_.len().inPixels(default_width, default_height);
        }
+       // we cannot go there, but there is a compiler warning...
+       return 0;
 }