Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

[C::B svn 11712] Problem when scrolling with the mouse wheel in the editor

<< < (3/3)

Pecan:
Pasting happens with the middle mouse click when any word is marked before the click. This happens with both the Nightly and all the way back to my oldest CB version svn10542. (Both Windows and Linux.)

This happens with no contrib plugins loaded.
It has nothing to do with BrowseTracker or DragScroll.

I quite like it.

The original poster was successful stopping the paste because DragScroll captured the middle mouse to use as the drag key.

I don't see a problem here.

oBFusCATed:

--- Quote from: Pecan on September 23, 2019, 06:22:37 pm ---I don't see a problem here.

--- End quote ---
For windows people it might seem unexpected. Do you know where in the source this pasting happens?

Pecan:

--- Quote from: oBFusCATed on September 23, 2019, 08:48:03 pm ---Do you know where in the source this pasting happens?

--- End quote ---

cbstyledtextctrl.cpp:116

I hope those of us who use this feature regularly will be able to keep it.
It's been in CB for a very long time.


--- Code: ---
void cbStyledTextCtrl::OnMouseMiddleDown(wxMouseEvent& event)
{
    if (platform::gtk == false) // only if OnMouseMiddleDown is not already implemented by the OS
    {
        int pos = PositionFromPoint(wxPoint(event.GetX(), event.GetY()));

        if (pos == wxSCI_INVALID_POSITION)
            return;

        int start = GetSelectionStart();
        int end   = GetSelectionEnd();

        const wxString s = GetSelectedText();

        if (pos < GetCurrentPos())
        {
            start += s.length();
            end += s.length();
        }

        InsertText(pos, s);
        SetSelectionVoid(start, end);
    }
}

--- End code ---

oBFusCATed:
I think it should not be on by default on platforms which don't have it natively (on linux I use this feature all the time, but there it is sort of integrated in everything). I'm fine if it is an option you could enable.

But if we have this here, what is the purpose of the mousesap plugin? Doing copy on selection change? Isn't this a duplication of features? Shouldn't this be moved to the mouse-sap plugins (which btw fails to compile with wxgtk + gtk3 :( )

Pecan:

--- Quote from: oBFusCATed on September 24, 2019, 07:45:02 pm ---I'm fine if it is an option you could enable.
...
But if we have this here, what is the purpose of the mousesap plugin?

--- End quote ---

I'll look at it.

Navigation

[0] Message Index

[*] Previous page

Go to full version