Re: [Lazarus] LHelp and LazMouseAndKeyInput package

2021-02-21 Thread Andrey Sobol via lazarus

On 22.02.2021 1:45, Juha Manninen via lazarus wrote:

Now I studied how LazMouseAndKeyInput is used in LHelp.


Juha,

read this 
https://www.codeproject.com/Tips/76427/How-to-bring-window-to-top-with-SetForegroundWindo


That problem was before, but now I don`t see it.

--
Andrey Sobol.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] LHelp and LazMouseAndKeyInput package

2021-02-21 Thread Andrey Sobol via lazarus

On 22.02.2021 1:45, Juha Manninen via lazarus wrote:

Help has improved lately thanks to Andrey Sobol's patches mostly.
However a new dependency was added: LazMouseAndKeyInput.
On Linux and UNIX systems it pulls in libXtst dependency.
LHelp is part of Lazarus BigIde target which is used for releases.
Extra dependencies for BigIde should be avoided if possible.

Now I studied how LazMouseAndKeyInput is used in LHelp.
Well, it is not used!
LHelpCore has MouseAndkeyInput in its uses section but removing it and 
the whole package dependency makes no difference.

My analysis: LazMouseAndKeyInput dependency can be removed from LHelp.
Am I right?

Regards,
Juha




Helo Juha,

You excluded this code from lcore.pas

procedure THelpForm.ShowApp();
..
{$IFDEF WINDOWS}
// Go to TOC TreeView and to get focus on foreground window
KeyInput.Apply([ssCtrl]);
KeyInput.Press(VK_T);
KeyInput.UnApply([ssCtrl]);
{$ENDIF}

Without the code on windows system we can`t get rightly a focus  lHelp 
by an event of restore the window after hide (the window is blinking on 
an aplication panel sometimes). We should send an user input sentence to 
the foregroud window from a mouse or from keyboard to get focus (that is 
windows specific problem).


I see some solutions of that:
1. To rewrite that code by WinApi (that is simple).
2. To exclude the package dependency on Mac system, but I don`t know how?
3. To fix the Application.BringToFront() function at windows to rightly 
bring a foreground window to a front of a display.



But I don`t see that problem now :). May be the blinkg was also a part 
of that issue https://bugs.freepascal.org/view.php?id=38276


I redone many pieces after that, that a second round :)

--
Andrey Sobol
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] LHelp and LazMouseAndKeyInput package

2021-02-21 Thread Juha Manninen via lazarus
Help has improved lately thanks to Andrey Sobol's patches mostly.
However a new dependency was added: LazMouseAndKeyInput.
On Linux and UNIX systems it pulls in libXtst dependency.
LHelp is part of Lazarus BigIde target which is used for releases.
Extra dependencies for BigIde should be avoided if possible.

Now I studied how LazMouseAndKeyInput is used in LHelp.
Well, it is not used!
LHelpCore has MouseAndkeyInput in its uses section but removing it and the
whole package dependency makes no difference.
My analysis: LazMouseAndKeyInput dependency can be removed from LHelp.
Am I right?

Regards,
Juha
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] I say a little prayer (for the Lazarus editor)

2021-02-21 Thread Martin Frb via lazarus

On 21/02/2021 16:53, Juha Manninen via lazarus wrote:
On Sun, Feb 21, 2021 at 1:30 PM Martin Frb via lazarus 
mailto:lazarus@lists.lazarus-ide.org>> 
wrote:


And one more thing, if you plan to submit a patch, please add an
option
to SynEdit.Options2
Many people are used to the current behaviour, I do not plan to
upset them.


This particular feature should not have an option IMO.
Now it can be considered a missing feature or even a bug.
When a user presses Alt-key when selecting, he clearly wants something 
special to happen with Ctrl-C.


Well, if the user selects a column selection of a single line, then yes 
(probably).


But if the user selects column over several lines, then pasting already 
acts different than it would for a normal selection.
(Select 3 full lines (start to end) using column selection => paste will 
be different than the same 3 lines in normal selection)


And users who grew up without the feature may not like it.


Now nothing special happens which is a semi-bug.
I am sure everybody will be happy when this feature gets 
implemented. I can remember many situations where it would have been 
useful.
I don't have an example at hand, but I am sure I have more than a few 
times made the experience that small, seemingly really useful changes 
got someone coming up wanting the old behaviour back.




IMO there are too many options already.
That is true, or rather they are badly organized. They need break down 
into basic, and expert (like the mouse options have)


If I accidentally change something during my tests, it takes a long 
time to figure out what changed and how to revert it.

Take a copy of your ___Options.xml files.
You can restore or diff them.


Please add more options only when really needed.


What I really would want to do, is include config in the keymap.
You could add new commands to the keymap.

So you would assign ctrl-v to
    paste(true)
or
   paste(ColumnAdvanceLine)
   ecPaste(ColumnAdvanceLine, IndentToContext, TabsToSpaces)

They look like pascal script, but they would not require pascalscript. 
(PascalScript does not work on all platforms, so it can not be used here)

They would always be a single command, with hardcoded options.

This is like in some browser, you can do config in css, JavaScript or 
similar.


But that is a topic on its own.


-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] I say a little prayer (for the Lazarus editor)

2021-02-21 Thread Juha Manninen via lazarus
On Sun, Feb 21, 2021 at 1:30 PM Martin Frb via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> And one more thing, if you plan to submit a patch, please add an option
> to SynEdit.Options2
> Many people are used to the current behaviour, I do not plan to upset them.
>

This particular feature should not have an option IMO.
Now it can be considered a missing feature or even a bug.
When a user presses Alt-key when selecting, he clearly wants something
special to happen with Ctrl-C.
Now nothing special happens which is a semi-bug.
I am sure everybody will be happy when this feature gets implemented. I can
remember many situations where it would have been useful.

IMO there are too many options already.
If I accidentally change something during my tests, it takes a long time to
figure out what changed and how to revert it.
Please add more options only when really needed.

Juha
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Introducing new dependencies between components - how to update make files?

2021-02-21 Thread Christo Crause via lazarus
On Sun, Feb 21, 2021 at 12:08 PM Mattias Gaertner via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> On Sun, 21 Feb 2021 11:50:49 +0200
> Christo Crause via lazarus  wrote:
>
> > I'm busy working on expanding AVR support in fpdebug/fpdebugdebugger.
> >  Some of the property classes overlap with classes already defined in
> > gdbmidebugger and I want to move these classes up the hierarchy to
> > avoid duplication.  This introduces extra dependencies and I need to
> > update the affected component make files. I started doing this using
> > the "Create Makefile" option in the Lazarus package tool with FPC 3.2
> > and noticed large changes in the resulting make file, mostly related
> > to deleted targets such as xtensa-freertos.  Should I use FPC trunk
> > (and more specifically fpcmake from trunk) for  development of
> > Lazarus, or is this just required when regenerating make files?
> >
> > Also the build order of some of the targets needs to be reordered in
> > the root make file to satisfy the dependency chain,  can I update the
> > Makefile.fpc and MakeFile by hand, or is there a tool/option to also
> > update these make files which are not part of a package?
>
> The Lazarus Makefiles are created from the corresponding Makefile.fpc.
> In order to support fpc trunk, you need fpc trunk sources.
>
> You can update one Makefile by calling the one liner (e.g linux 64bit):
>
> FPCDIR=/path/to/fpc_sources/trunk/fpc/
> /path/to/fpc_sources/trunk/fpc/utils/fpcm/bin/x86_64-linux/fpcmake
> -TAll -v
>

Thank you Mattias, that does the trick.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] I say a little prayer (for the Lazarus editor)

2021-02-21 Thread duilio foschi via lazarus
Hi Martin,

thank you for the detailled instructions.

Re your question

>does the Caret go to the start of the insert, or does it
automatically move one line down too?

in Delphi/column mode, the caret moves one line down at each insert.

1. starting from this status

https://i.ibb.co/jL30yFx/1.jpg

I click ctrl+O+C for column mode

2. I select the text 'peppe'+blank then ctrl-c to save the text into memory

https://i.ibb.co/99DH4gc/2.jpg

3. using the arrow keys, I move the caret 2 lines down...

https://i.ibb.co/ZHGqZx3/3.jpg

4. after I press ctrl-v, the caret moves 1 line down. This is exactly what
I miss in Lazarus :)

https://i.ibb.co/ZT6LJdD/4.jpg

I will try to fix the point.

Thank you

Duilio


On Sun, Feb 21, 2021 at 12:30 PM Martin Frb  wrote:

> On 21/02/2021 10:02, duilio foschi wrote:
> > Hi Martin,
> >
> > I am too lazy to learn how to use editor scripts.
> >
> > Probably it will be more productive to spend some time to correct the
> > editor code.
> >
> > After all, the Jedi editor - written in Delphi and available in source
> > code - behaves like old Delphi editor in column mode.
> >
> > How can I try to fix the problem?
> >
> > Where is the Lazarus repository with the original code of the Lazarus
> > editor?
> >
>
> Official: https://svn.freepascal.org/svn/lazarus/
> For bugs and patches:
> https://bugs.freepascal.org/set_project.php?project_id=1
>
> I am running a mirror at https://github.com/User4martin/lazarus/
> For most SynEdit and Debugger issues, I can accept pull requests (those
> go to me only, no one else in the team, therefore limited to work I will
> deal with)
>
> SynEdit is in Components/SynEdit
>
> If you are looking for the Search/Replace dialog, afaik its in the
> folder ide/ . Best to start looking from the file ide/SourceEditor.pp .
> But probably you want SynEdit.
>
> SynEdit.pp
> You probably want to look at function TCustomSynEdit.PasteFromClipboardEx
>
> You should know about the caret pos
>
> https://wiki.lazarus.freepascal.org/SynEdit#Logical.2FPhysical_caret_position
>
> You can get/set the caret pas on FCaret.
> Also you will look for   PMode: TSynSelectionMode;
>
> This actually sets the text: FInternalBlockSelection.SetSelTextPrimitive
>
> So then you only need restore the CaretX
>
> 
> Now this is important, you will see it works on CaretBytePos (logical)
> But you will need CharPos.
>
> Imagine you copy columns from 2 or more lines.
> Then (I guess) you want to set the caret to the start of the column in
> the *last* line to which was inserted..
>
> If there is a tab at the first line you insert, then you may be at
> PhysX=4 and LogX=2 (behind the tab)
> If there is no tab in the last line, and you set LogX =2 , well that is
> not what you want.
>
>
> -
>
> Remind me, does the Caret go to the start of the insert, or does it
> automatically move one line down too?
>
> And one more thing, if you plan to submit a patch, please add an option
> to SynEdit.Options2
> Many people are used to the current behaviour, I do not plan to upset them.
>
> The option will then be controlled from the IDE. So the patch will
> either wait till I get to do that.
> Or if you volunteer ide/EditorOptions.pas  (search Options2 or )
> ide/frames/editor_misc_options
>
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] I say a little prayer (for the Lazarus editor)

2021-02-21 Thread Martin Frb via lazarus

On 21/02/2021 10:02, duilio foschi wrote:

Hi Martin,

I am too lazy to learn how to use editor scripts.

Probably it will be more productive to spend some time to correct the 
editor code.


After all, the Jedi editor - written in Delphi and available in source 
code - behaves like old Delphi editor in column mode.


How can I try to fix the problem?

Where is the Lazarus repository with the original code of the Lazarus 
editor?




Official: https://svn.freepascal.org/svn/lazarus/
For bugs and patches: 
https://bugs.freepascal.org/set_project.php?project_id=1


I am running a mirror at https://github.com/User4martin/lazarus/
For most SynEdit and Debugger issues, I can accept pull requests (those 
go to me only, no one else in the team, therefore limited to work I will 
deal with)


SynEdit is in Components/SynEdit

If you are looking for the Search/Replace dialog, afaik its in the 
folder ide/ . Best to start looking from the file ide/SourceEditor.pp . 
But probably you want SynEdit.


SynEdit.pp
You probably want to look at function TCustomSynEdit.PasteFromClipboardEx

You should know about the caret pos 
https://wiki.lazarus.freepascal.org/SynEdit#Logical.2FPhysical_caret_position


You can get/set the caret pas on FCaret.
Also you will look for   PMode: TSynSelectionMode;

This actually sets the text: FInternalBlockSelection.SetSelTextPrimitive

So then you only need restore the CaretX


Now this is important, you will see it works on CaretBytePos (logical)
But you will need CharPos.

Imagine you copy columns from 2 or more lines.
Then (I guess) you want to set the caret to the start of the column in 
the *last* line to which was inserted..


If there is a tab at the first line you insert, then you may be at 
PhysX=4 and LogX=2 (behind the tab)
If there is no tab in the last line, and you set LogX =2 , well that is 
not what you want.



-

Remind me, does the Caret go to the start of the insert, or does it 
automatically move one line down too?


And one more thing, if you plan to submit a patch, please add an option 
to SynEdit.Options2

Many people are used to the current behaviour, I do not plan to upset them.

The option will then be controlled from the IDE. So the patch will 
either wait till I get to do that.
Or if you volunteer ide/EditorOptions.pas  (search Options2 or ) 
ide/frames/editor_misc_options

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Introducing new dependencies between components - how to update make files?

2021-02-21 Thread Mattias Gaertner via lazarus
On Sun, 21 Feb 2021 11:50:49 +0200
Christo Crause via lazarus  wrote:

> I'm busy working on expanding AVR support in fpdebug/fpdebugdebugger.
>  Some of the property classes overlap with classes already defined in
> gdbmidebugger and I want to move these classes up the hierarchy to
> avoid duplication.  This introduces extra dependencies and I need to
> update the affected component make files. I started doing this using
> the "Create Makefile" option in the Lazarus package tool with FPC 3.2
> and noticed large changes in the resulting make file, mostly related
> to deleted targets such as xtensa-freertos.  Should I use FPC trunk
> (and more specifically fpcmake from trunk) for  development of
> Lazarus, or is this just required when regenerating make files?
> 
> Also the build order of some of the targets needs to be reordered in
> the root make file to satisfy the dependency chain,  can I update the
> Makefile.fpc and MakeFile by hand, or is there a tool/option to also
> update these make files which are not part of a package?

The Lazarus Makefiles are created from the corresponding Makefile.fpc.
In order to support fpc trunk, you need fpc trunk sources.

You can update one Makefile by calling the one liner (e.g linux 64bit):

FPCDIR=/path/to/fpc_sources/trunk/fpc/
/path/to/fpc_sources/trunk/fpc/utils/fpcm/bin/x86_64-linux/fpcmake
-TAll -v


Mattias
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Introducing new dependencies between components - how to update make files?

2021-02-21 Thread Christo Crause via lazarus
I'm busy working on expanding AVR support in fpdebug/fpdebugdebugger.  Some
of the property classes overlap with classes already defined in
gdbmidebugger and I want to move these classes up the hierarchy to avoid
duplication.  This introduces extra dependencies and I need to update the
affected component make files. I started doing this using the "Create
Makefile" option in the Lazarus package tool with FPC 3.2 and noticed large
changes in the resulting make file, mostly related to deleted targets such
as xtensa-freertos.  Should I use FPC trunk (and more specifically fpcmake
from trunk) for  development of Lazarus, or is this just required when
regenerating make files?

Also the build order of some of the targets needs to be reordered in the
root make file to satisfy the dependency chain,  can I update the
Makefile.fpc and MakeFile by hand, or is there a tool/option to also update
these make files which are not part of a package?

Best regards,
Christo
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] I say a little prayer (for the Lazarus editor)

2021-02-21 Thread duilio foschi via lazarus
Hi Martin,

I am too lazy to learn how to use editor scripts.

Probably it will be more productive to spend some time to correct the
editor code.

After all, the Jedi editor - written in Delphi and available in source code
- behaves like old Delphi editor in column mode.

How can I try to fix the problem?

Where is the Lazarus repository with the original code of the Lazarus
editor?

Thank you

Duilio

On Sat, Feb 20, 2021 at 5:31 PM Martin Frb  wrote:

> On 20/02/2021 13:11, duilio foschi via lazarus wrote:
> >
> > pic
> >
> > https://i.ibb.co/jDBfSpZ/4.jpg 
> >
> > shows the result I wanted from the start. I can get it only by several
> > uneeded clicks on the arrows keys...
> >
> https://imgur.com/a/w5uzUhh
>
> copy
>
> Then instead of pasting once for each line, press Shift Alt down to set
> cursors on each line
> Do one single paste.
>
> If I count correctly, one keystroke more (assuming that Delphi includes
> cursor down, in the paste).
> If in Delphi you do paste,down,paste,down,...  Then in Lazarus its less
> keystrokes
>
> However, multi caret works only when there are no lines to skip (well
> you can set carets individually, but thats more work)
>
>
> > 5.
> >
> > my point is: in Lazarus edit the act of inserting a text which is
> > column-selected has the same
> > result that the act of inserting a text which is row-selected. It
> > would be nice to
> > differentiate the results (as it was in Delhi editor) so to satisfy
> > different
> > needs of the coder.
> >
> See my other reply:
> - Yes it should be added. (as build in)
> - You can (in 2.0.10) add a macro that does it
>
>
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus