Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-12

pointers in writing extension for Lazarus

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ik

Hello,

For a very long time now (7-8 years), that I wish to add Lazarus possibility to split edit of my current edit (and other open files) vertically and horizontally.
I understand that many people here don't like the idea, so I wish to write an extension for, rather then adding it to the UI itself.

Can you please give me some pointers in the matter on how to start writing it, what should I be looking for etc... ?

Thanks,
Ido

Reply by email

William Oliveira Ferreira
to ik

Good idea! notepad++ does it with sync scroll too :)

2012/12/5 ik

Show quoted text 20 lines
Hello, For a very long time now (7-8 years), that I wish to add Lazarus possibility to split edit of my current edit (and other open files) vertically and horizontally. I understand that many people here don't like the idea, so I wish to write an extension for, rather then adding it to the UI itself. Can you please give me some pointers in the matter on how to start writing it, what should I be looking for etc... ? Thanks, Ido -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
________________________________ William de Oliveira Ferreira -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20121205/c1cfb06a/attachment-0001.html>

Reply by email

Martin
to ik: For a very long time now (7-8 years), that I wish to add Lazarus possibility to split…
ik wrote 7 lines
Hello, For a very long time now (7-8 years), that I wish to add Lazarus possibility to split edit of my current edit (and other open files) vertically and horizontally. I understand that many people here don't like the idea, so I wish to write an extension for, rather then adding it to the UI itself.

Actually, it is on my list too. But hasn't made priority yet.

Can you please give me some pointers in the matter on how to start writing it, what should I be looking for etc... ?

Actually, you are looking at 2 things that you will need.

The first is in SynEdit. Though that depends, I will get to that in a moment.

The 2nd, is in the IDE (SourceEditor, project, ...). That is
- Adding a splitter (or rather, if the view is not yet splitted, it will just be a tiny bit on the right gutter/scrollbar)
- Adding the ability to save and restore the layout, with the project session (this is not the window manager, as it is still seen as one editor, in one tab)

Back to SynEdit. There is a decision on functional issues. Currently if you have 2 Editors in 2 windows, editing one file, then they are truly 2 editors. 2
- 2 carets (if the OS supports (GTK), and the option "Persistent caret" is set. Each has it's location, and each shows that location in the statusbar.
- 2 selections, and tey can be in different places
- 2 syncro edits
...

IMHO that is not what one expects from a split view. It should be one of each (one editor).
- Except for each split it will remember (but not show, unless active) the caret pos.
- But for example it is one selection. Changing the selection affects all splits (as they are views on the same editor).

***** SynEdit

*** "2 Edit approach"
Yet the first (2 edit) is already implemented. The 2nd still needs doing. If chosen, it should be done in a way, that it can later be replaced.

*** "1 Edit approach"
If the 2nd is done, it raises the question, if each split should have a wincontrol (with a handle). The difference is, if you edit something in the upper split, that is also seen in the lomer split, the with ore wincontrol (on most OS) the invalidate is the minimum rectangle covering both lines.
This repaints a lot of text that has not changed (battery life on laptopts)

With the recent introduction of "TLazSynTextArea = class(TLazSynSurface)" the 2nd solution became a lot easier. (See ide/SourceSynEditor TopInfoHint). Looking at TopInfoHint would be the starting point for this. (And then to check for details with me)

***** Project
You need to discover that on your self. Its a while ago, and I can only give you bits and pieces.

Files, SourceEditor (do not add dopendencies in uses, add events), main.pp, project.pp (I think someone recently factored some code into a 4th file...)

procedure TSourceEditor.UpdateProjectFile;
begin
   if Assigned(Manager) and Assigned(Manager.OnEditorMoved)
     then Manager.OnEditorMoved(self);
end;
leads you to main.pp, line 2031
   SourceEditorManager.OnEditorMoved := @OnSrcNotebookEditorMoved;
procedure TMainIDE.OnSrcNotebookEditorMoved(Sender: TObject);
var
   p: TUnitEditorInfo;
   i: Integer;
   SrcEdit: TSourceEditor;
begin
   SrcEdit := TSourceEditor(Sender);
   p :=Project1.EditorInfoWithEditorComponent(SrcEdit);
   if p  nil then begin
     p.PageIndex := SrcEdit.PageIndex;
     p.WindowIndex :=
SourceEditorManager.IndexOfSourceWindow(SrcEdit.SourceNotebook);
     p.IsLocked := SrcEdit.IsLocked;
   end
   else if SrcEdit.IsNewSharedEditor then begin
     // attach to UnitInfo
     SrcEdit.IsNewSharedEditor := False;
     i := 0;
     while (i < SrcEdit.SharedEditorCount) and (SrcEdit.SharedEditors[i]
= SrcEdit) do
       inc(i);
     p := Project1.EditorInfoWithEditorComponent(SrcEdit.SharedEditors[i]);
     p := p.UnitInfo.GetClosedOrNewEditorInfo;
     p.EditorComponent := SrcEdit;
     p.SyntaxHighlighter := SrcEdit.SyntaxHighlighterType;
     p.CustomHighlighter := p.SyntaxHighlighter
p.UnitInfo.DefaultSyntaxHighlighter;
   end;
end;

Look at the UnitInfo stuff...

Reply by email

Martin
to Martin
Martin wrote 17 lines
Back to SynEdit. There is a decision on functional issues. Currently if you have 2 Editors in 2 windows, editing one file, then they are truly 2 editors. 2 - 2 carets (if the OS supports (GTK), and the option "Persistent caret" is set. Each has it's location, and each shows that location in the statusbar. - 2 selections, and tey can be in different places - 2 syncro edits ... IMHO that is not what one expects from a split view. It should be one of each (one editor). - Except for each split it will remember (but not show, unless active) the caret pos. - But for example it is one selection. Changing the selection affects all splits (as they are views on the same editor).

Also 2 editors, means 2 overview gutters

Reply by email

leledumbo
to ik: For a very long time now (7-8 years), that I wish to add Lazarus possibility to split…
Can you please give me some pointers in the matter on how to start

writing it, what should I be looking for etc... ?

Maybe you can find something here:
http://wiki.lazarus.freepascal.org/Extending_the_IDE

View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-pointers-in-writing-extension-for-Lazarus-tp4027965p4027983.html Sent from the Free Pascal - Lazarus mailing list .

Reply by email

ik
to leledumbo
leledumbo wrote 6 lines
> Can you please give me some pointers in the matter on how to start writing it, what should I be looking for etc... ? Maybe you can find something here: http://wiki.lazarus.freepascal.org/Extending_the_IDE

Sorry for the long time to replay, thank you. I'll take a look at both this link and of Martin's replay.

Show quoted text 11 lines
-- View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-pointers-in-writing-extension-for-Lazarus-tp4027965p4027983.html Sent from the Free Pascal - Lazarus mailing list -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email