X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBufferView_pimpl.C;h=36dbfa07c3744369fb5bc1e43b0bedd0c5c6fcf6;hb=2b300d130c21037e9ae9cb547024be53111d2014;hp=11970de6f3f384200d09f4c6f074e2ea307e6e9e;hpb=578e4fa2137aa1cff4cea6c16c27ca5ecf22c1cd;p=lyx.git diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 11970de6f3..36dbfa07c3 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -26,9 +26,6 @@ #include "intl.h" #include "support/LAssert.h" #include "frontends/Dialogs.h" -#ifndef NEW_MENUBAR -# include "menus.h" -#endif #ifdef SIGC_CXX_NAMESPACES using SigC::slot; @@ -162,22 +159,14 @@ void BufferView::Pimpl::buffer(Buffer * b) updateScrollbar(); } bv_->text->first = screen_->TopCursorVisible(bv_->text); -#ifdef NEW_MENUBAR owner_->updateMenubar(); -#else - owner_->getMenus()->showMenus(); -#endif owner_->updateToolbar(); redraw(); owner_->getDialogs()->updateBufferDependent(); bv_->insetWakeup(); } else { lyxerr[Debug::INFO] << " No Buffer!" << endl; -#ifdef NEW_MENUBAR owner_->updateMenubar(); -#else - owner_->getMenus()->hideMenus(); -#endif owner_->updateToolbar(); updateScrollbar(); workarea_->redraw(); @@ -219,12 +208,13 @@ void BufferView::Pimpl::redraw() } -bool BufferView::Pimpl::fitCursor() +bool BufferView::Pimpl::fitCursor(LyXText * text) { Assert(screen_); // it is a programming error to call fitCursor // without a valid screen. - bool ret = screen_->FitCursor(bv_->text); - if (ret) updateScrollbar(); + bool ret = screen_->FitCursor(text); + if (ret) + updateScrollbar(); return ret; } @@ -552,7 +542,7 @@ void BufferView::Pimpl::workAreaMotionNotify(int x, int y, unsigned int state) bv_->text->SetSelection(); screen_->ToggleToggle(bv_->text); - fitCursor(); + fitCursor(bv_->text); screen_->ShowCursor(bv_->text); } return; @@ -602,46 +592,7 @@ void BufferView::Pimpl::workAreaButtonPress(int xpos, int ypos, selection_possible = true; screen_->HideCursor(); -#ifndef NEW_TABULAR - // Right button mouse click on a table - if (button == 3 && - (bv_->text->cursor.par()->table || - bv_->text->MouseHitInTable(bv_, xpos, ypos + bv_->text->first))) { - // Set the cursor to the press-position - bv_->text->SetCursorFromCoordinates(bv_, xpos, ypos + bv_->text->first); - bool doit = true; - - // Only show the table popup if the hit is in - // the table, too - if (!bv_->text->HitInTable(bv_, - bv_->text->cursor.row(), xpos)) - doit = false; - - // Hit above or below the table? - if (doit) { - if (!bv_->text->selection) { - screen_->ToggleSelection(bv_->text); - bv_->text->ClearSelection(); - bv_->text->FullRebreak(bv_); - screen_->Update(bv_->text); - updateScrollbar(); - } - // Popup table popup when on a table. - // This is obviously temporary, since we - // should be able to popup various - // context-sensitive-menus with the - // the right mouse. So this should be done more - // general in the future. Matthias. - selection_possible = false; - owner_->getLyXFunc() - ->Dispatch(LFUN_LAYOUT_TABLE, - "true"); - return; - } - } -#endif - - int screen_first = bv_->text->first; + int const screen_first = bv_->text->first; // Middle button press pastes if we have a selection bool paste_internally = false; @@ -684,7 +635,7 @@ void BufferView::Pimpl::workAreaButtonPress(int xpos, int ypos, bv_->text->cursor.x_fix(bv_->text->cursor.x()); owner_->updateLayoutChoice(); - if (fitCursor()) { + if (fitCursor(bv_->text)) { selection_possible = false; } @@ -716,14 +667,14 @@ void BufferView::Pimpl::doubleClick(int /*x*/, int /*y*/, unsigned int button) * if necessary */ update(BufferView::SELECT|BufferView::FITCUR); } - } + } } void BufferView::Pimpl::tripleClick(int /*x*/, int /*y*/, unsigned int button) { // select a line - if (buffer_ && screen_ && button == 1) { + if (buffer_ && screen_ && !bv_->the_locking_inset && (button == 1)) { screen_->HideCursor(); screen_->ToggleSelection(bv_->text); bv_->text->CursorHome(bv_); @@ -778,19 +729,6 @@ void BufferView::Pimpl::workAreaButtonRelease(int x, int y, } selection_possible = false; -#ifndef NEW_TABULAR - if (bv_->text->cursor.par()->table) { - int cell = bv_->text-> - NumberOfCell(bv_->text->cursor.par(), - bv_->text->cursor.pos()); - if (bv_->text->cursor.par()->table->IsContRow(cell) && - bv_->text->cursor.par()->table-> - CellHasContRow(bv_->text->cursor.par()->table-> - GetCellAbove(cell))<0) { - bv_->text->CursorUp(bv_); - } - } -#endif if (button >= 2) return; @@ -1039,7 +977,7 @@ void BufferView::Pimpl::workAreaExpose() // fitCursor() ensures we don't jump back // to the start of the document on vertical // resize - fitCursor(); + fitCursor(bv_->text); // The main window size has changed, repaint most stuff redraw(); @@ -1115,7 +1053,7 @@ void BufferView::Pimpl::update(BufferView::UpdateCodes f) update(); if ((f & FITCUR)) { - fitCursor(); + fitCursor(bv_->text); } if ((f & CHANGE)) { @@ -1198,7 +1136,7 @@ void BufferView::Pimpl::cursorPrevious() { if (!bv_->text->cursor.row()->previous()) return; - long y = bv_->text->first; + int y = bv_->text->first; Row * cursorrow = bv_->text->cursor.row(); bv_->text->SetCursorFromCoordinates(bv_, bv_->text->cursor.x_fix(), y); bv_->text->FinishUndo(); @@ -1220,7 +1158,7 @@ void BufferView::Pimpl::cursorNext() { if (!bv_->text->cursor.row()->next()) return; - long y = bv_->text->first; + int y = bv_->text->first; bv_->text->GetRowNearY(y); Row * cursorrow = bv_->text->cursor.row(); bv_->text->SetCursorFromCoordinates(bv_, bv_->text->cursor.x_fix(), y