Selection Mode Rectangle

Oct 4, 2010 at 11:07 AM

Hello,

 

if you want to use, this mode of selection, you need to use more messages not implemented into Scintilla.net

in Constants.cs:

adding line 588 :

 

    public const uint SCI_GETSELECTIONS = 2570;
    public const uint SCI_CLEARSELECTIONS = 2571;
    public const uint SCI_ADDSELECTION = 2573;
    public const uint SCI_GETSELECTIONNSTART = 2585;
    public const uint SCI_GETSELECTIONNEND = 2587;

 

in INativeScintillas.cs

adding line206:

 

        int GetSelectionsCount();
        void ClearSelections();
        void AddSelection(int start, int end);
        int GetSelectionnStart(int num);
        int GetSelectionnEnd(int num);

and into Scintilla.INativeScintilla.cs

        void INativeScintilla.AddSelection(int start, int end)
        {
            _ns.SendMessageDirect(Constants.SCI_ADDSELECTION, start, end);
        }
        int INativeScintilla.GetSelectionsCount()
        {
            return _ns.SendMessageDirect(Constants.SCI_GETSELECTIONS, 0, 0);
        }

        void INativeScintilla.ClearSelections()
        {
            _ns.SendMessageDirect(Constants.SCI_CLEARSELECTIONS, 0, 0);
        }

        int INativeScintilla.GetSelectionnStart(int num)
        {
            return _ns.SendMessageDirect(Constants.SCI_GETSELECTIONNSTART, num, 0);
        }
        int INativeScintilla.GetSelectionnEnd(int num)
        {
            return _ns.SendMessageDirect(Constants.SCI_GETSELECTIONNEND, num, 0);
        }


Jul 10, 2012 at 8:16 AM

Hi Could you explain where to use these new options. When I create a regtangle selection I get a column or carets as expected but when I type the selection is cancelled and a single character is added at the last point in the selection. I guess this has something to do with the range assuming stream mode and replacing the entire selection area with a single char.