void cbStyledTextCtrl::OnMouseMiddleClick(wxMouseEvent& event)
{
    event.Skip();
    // emulate middle mouse paste under all systems due to buggy wxClipboard
    const int pos = PositionFromPoint(wxPoint(event.GetX(), event.GetY()));
    if (pos == wxSCI_INVALID_POSITION || pos != m_middleClickPos)
        return;
    GotoPos(pos);
    if (GetReadOnly())
        return;
    wxTextFileType type;
    switch (GetEOLMode())
    {
        case wxSCI_EOL_CRLF:
            type = wxTextFileType_Dos;
            break;

        case wxSCI_EOL_CR:
            type = wxTextFileType_Mac;
            break;

        case wxSCI_EOL_LF:
            type = wxTextFileType_Unix;
            break;

        default:
            type = wxTextBuffer::typeDefault;
            break;
    }
    AddText(wxTextBuffer::Translate(Manager::Get()->GetEditorManager()->GetSelectionClipboard(), type));
}
void cbStyledTextCtrl::EmulateDwellStart()
{
    EditorBase *editor = static_cast<EditorBase*>(m_pParent);

    CodeBlocksEvent event(cbEVT_EDITOR_TOOLTIP);
    wxPoint pt(ScreenToClient(wxGetMousePosition()));
    event.SetX(pt.x);
    event.SetY(pt.y);
    int pos = PositionFromPoint(pt);
    int style = GetStyleAt(pos);
    event.SetInt(style);
    event.SetEditor(editor);
    event.SetExtraLong(0); // allow plugins to recommend each other not to cancel a tooltip
    Manager::Get()->GetPluginManager()->NotifyPlugins(event);
}
void SvnBlameEditor::OnContextMenu(wxContextMenuEvent& event)
{
    wxPoint pt       = event.GetPosition();
    wxPoint clientPt = ScreenToClient(pt);

    int margin = GetMarginWidth(0); // get the margin width
    if ( clientPt.x < margin ) {

        GotoPos( PositionFromPoint(clientPt) );
        // Margin context menu
        wxMenu menu;
        menu.Append( XRCID("svn_highlight_revision"), _("Highlight this revision"), _("Highlight this revision"), false);
        menu.Connect(XRCID("svn_highlight_revision"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(SvnBlameEditor::OnHighlightRevision), NULL, this);

        PopupMenu(&menu);

    } else {
        wxStyledTextCtrl::OnContextMenu(event);

    }
}
void DisassemblyTextCtrl::OnGPM(wxMouseEvent& event)
{
    if(platform::gtk == false) // only if GPM 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 of OnGPM
void cbStyledTextCtrl::OnMouseMiddleDown(wxMouseEvent& event)
{
    m_middleClickPos = PositionFromPoint(wxPoint(event.GetX(), event.GetY()));
    event.Skip();
}
Exemple #6
0
void OutputCtrl::OnDblClick( wxMouseEvent& event )
{
   int pos = PositionFromPoint( event.GetPosition() );
   int line = LineFromPosition( pos );
   ActivateLine( line, true );
}