Recent

Author Topic: Making ATSynEdit  (Read 27261 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: Making new SynEdit
« Reply #30 on: March 21, 2015, 02:09:13 am »
@Martin F

Do u think it's ok way: build column-selection(Alt-Drag) ABOVE
existing multi-carets. All programs: column-sel is new thing ,where
editor draws column block and handles it as column. Why not: don't
make new thing but use existing multicarets for this-- just make N carets
for all lines of block and make selections for them? it will look like old approach.
Less code. No need to make new code for AltDrag and utilize old

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Making new SynEdit
« Reply #31 on: March 21, 2015, 02:31:01 am »
This is really probably a personal decisions. I dont know how different editors handle different selections.

AFAIK:
Multiple selections (such as you propose) are copied to the clipboard, by joining them with a new line (though I really do not know if that always applies).
Thus when pasted, I would expect them to insert new lines.

Column mode selection, is copied in a special mode, that, if pasted inserts into existing lines. They do not insert new lines.

But I do not know how many editors do this.

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: Making new SynEdit
« Reply #32 on: March 21, 2015, 02:44:14 am »
It seems such copy/paste breaks that idea. I dont want to paste incorrect, so i stay with usual idea.. 
I've done mul-selections: make selections with Ctrl+Drag

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: Making new SynEdit
« Reply #33 on: March 26, 2015, 07:11:01 pm »

Code: [Select]
procedure TATSynEdit.UpdateScrollbarVert;
var
  si: TScrollInfo;
begin
  FillChar(si{%H-}, SizeOf(si), 0);
  si.cbSize:= SizeOf(si);
  si.fMask:= SIF_ALL;// or SIF_DISABLENOSCROLL; //todo -- DisableNoScroll doesnt work(Win)
  si.nMin:= FScrollVert.NMin;
  si.nMax:= FScrollVert.NMax;
  si.nPage:= FScrollVert.NPage;
  si.nPos:= FScrollVert.NPos;
  SetScrollInfo(Handle, SB_VERT, si, True);
end;


problem. If i uncomment 'or SIF_DISABLENOSCROLL' then I expect that scroll won't hide but will be shown on small text. it's ok - Linux, it's broken- Win32, on Win i see scroll hidden !

What to do on Win?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Making new SynEdit
« Reply #34 on: March 26, 2015, 08:13:16 pm »
It works in SynEdit (at least win), the flag is set, and the scrollbar is shown disabled if needed. (and if SynEdit is set to do so)

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: Making new SynEdit
« Reply #35 on: March 29, 2015, 12:34:01 am »
how to group Undo items, via "Group undo" option? e.g. I type text, then Enter, then move-caret, then type again... and what are groups of undo?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Making new SynEdit
« Reply #36 on: March 29, 2015, 12:44:14 am »
In SynEdit items are grouped if:

- they have the same command: both ecChar, or both ecNewLine, or both ecDeleteWordLeft ...
- the caret start pos, of the 2nd item is the caret end pos of the 1st

But there could be different rules, for example, instead of checking the caret pos, one could check, that no other action (e.g. caret move) happened in between.

I have no idea how other editors do this.

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: Making new SynEdit
« Reply #37 on: March 29, 2015, 01:21:33 am »
Thank; it's good, group if caret not moved(key or mouse cmds), it;s ok

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: Making new SynEdit
« Reply #38 on: March 31, 2015, 12:17:21 am »
Delphi or some ide, has featire-- undo jumps to last change,only next undo undoes this change.
Synedit has it?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Making new SynEdit
« Reply #39 on: March 31, 2015, 12:36:56 am »
No.

But thanks for explaining it. I had never been able to figure out the logic, about what Delphi actually does on undo.

Now I at leas get it, thanks to your post.

Easy to implement though, but no priority.

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: Making new SynEdit
« Reply #40 on: March 31, 2015, 03:57:58 am »
@Martin
so many empty lines in your msg...  %)

Made Undo

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: Making new SynEdit
« Reply #41 on: April 03, 2015, 01:56:54 am »
I need copying/pastin of Col Blocks into clp (Alt+drag). I don't know how to copy col block/
how to get "text is col block" on paste. Help me?
« Last Edit: April 03, 2015, 01:58:45 am by Alextp »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Making new SynEdit
« Reply #42 on: April 03, 2015, 02:06:36 am »
I am not aware of any "standard" how the *extra* info is stored in the clipboard. SynEdit invents its own.

That is, 2 parts a copied.
1) the text, normal format for any text editor.
2) the extra info (i.e. a flag, that this is column mode data)

for 2 clipboard has AddFormat(). etc..

Code: [Select]
  SYNEDIT_CLIPBOARD_FORMAT_TAGGED = 'Application/X-Laz-SynEdit-Tagged';

The same is used to keep folds in copy and paste.

SO column mode works only synedit to synedit. Other editors only see the text.



AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: Making new SynEdit
« Reply #43 on: April 03, 2015, 02:13:25 am »
thank. I ll see SE code how to.
Btw, maybe interesting to u: i made ColBlock as mul-selections (as I wrote before), with flag "we have rect [x1,y1,x2,y2]" (flag is used if needed to copy)

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: Making new SynEdit
« Reply #44 on: April 04, 2015, 11:29:55 pm »
I make "Move sel up-down", "insert empty ln up-down". If Synedit has not these, pls add

 

TinyPortal © 2005-2018