Re: [Lazarus] LazGitGui a git tool.

2023-07-29 Thread Jesus Reyes A. via lazarus


On 29-jul-23 8:42 a. m., Martin Frb via lazarus wrote:


On 29/07/2023 12:55, Juha Manninen via lazarus wrote:

An IDE plugin that runs "git blame" for an active editor source file
and shows a HashID for each line. The associated commit is shown in
another window when the HashID is clicked. All that using a local Git
repo history, no network access is needed.
That kind of IDE integration would make sense. I never understood the
traditional revision control plugins that allow commits from the IDE.
What is the benefit? I have anyways saved and tested all my changes
when I want to commit. I can as well start a proper commit tool from
outside the IDE. There is no true integration, the IDE plugin is only
started from a different place.

Well, log for the current file would be useful too, and easier.


yeah, file history is currently available in LazGitGit


But what I really fancy is an integrated "git diff" => where the
SourceEditor/SynEdit shows chages inline.
Could be different detail levels
- just line markers /like the current changed/save marker (yellow/green)
- diff show at bottom (like winmerge)
- maybe side by side split editor (though external tools to that well)
- inline markup, like MS-word capturing changes: red/strikethrough for
stuff deleted by current diff, green for stuff added.
This could work, as you type.
It would work without gif, against the saved file, or a backup.
With git, against HEAD or index (or both / 3 color)


By itself, it could be a great tool.

For the moment I could use a full source diff tool, like the one that comes
with TortoiseGit, winmerge, meld, etc. :)

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


Re: [Lazarus] LazGitGui a git tool.

2023-07-29 Thread Jesus Reyes A. via lazarus

On 29-jul-23 4:55 a. m., Juha Manninen via lazarus wrote:


Same with logcache. I am in Git Lazarus source directory but it asks for a 
parameter.
[juha@juha-fp30 lazarus]$ ../lazgitgui/logcache
a file or directory of a git repository is needed
[juha@juha-fp30 lazarus]$


Indeed, logcache is supposed to work like LazGitGui, but it need only to locate 
the .git directory,
while LazGitGui could implement using the specified dir or file to limit 
working on that path and
not in the whole repository.

But logcache program is only a way to test the structure of the log cache, not 
really needed for LazGitGui


These are standalone applications.
An idea for future development :
An IDE plugin that runs "git blame" for an active editor source file and shows 
a HashID for each line.


Blaming is something I would like to add, but more the way it works in 
TortoiseGit and less
than 'git gui'/gitk where it is a mess (IMO) in the mean time, this 
functionality is somewhat
supplied by the File History feature found in the yet to document log window 
where you can view
the commit changes as a diff, or look how was the work tree at that particular 
moment, clicking
any file in those views will enable the [FH] button that shows the selected 
file history. In gitk
you have to invoke it from the command line and the same in TortoiseGit 
although it's done in
a through the file browser interface


I never understood the traditional revision control plugins that allow commits 
from the IDE. What is the benefit? I have anyways saved and tested all my 
changes when I want to commit. I can as well start a proper commit tool from 
outside the IDE. There is no true integration, the IDE plugin is only started 
from a different place.


I think it promotes a workflow where you commit often and short commits, but it 
is true that almost
always you have to someway find the window where you pick your changes and 
actually do it which is
not too different to invoke an external tool.


Juha


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


Re: [Lazarus] LazGitGui a git tool.

2023-07-29 Thread Jesus Reyes A. via lazarus

On 29-jul-23 3:28 a. m., Juha Manninen via lazarus wrote:


I tested it. Quite nice!


I'm glad you liked.


One issue: lazgitgui requires a filename as a cmd line parameter but does not use it. You 
should be able to run it without parameters just like "git gui".
Juha


This can be worked out, if no file or dir is passed on it could use the 
current working directory. I will added to the list. Jesus Reyes A.
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] LazGitGui a git tool.

2023-07-29 Thread Jesus Reyes A. via lazarus

Hi all,

Probably by now everyone already has their favorite git tool, I had it 
too, but anyway looking for a way to have basic repository information 
and show it through some add-on or plugin in Lazarus (and that it will 
work everywhere) I started this tool.


The more functions I added, the more I got away form the original goal 
(or closer I don't know).


Meanwhile I thought it could be useful for someone else and so if 
someone wants to try it, it is available in a gitlab repository at 
https://gitlab.com/jramx/lazgitgui


Git has so many great features and it is both tempting and challenging 
to continue adding them to this tool, anyway, this is what is available 
at the moment (what I think is the most basic functionality). I know I 
suck at writing documentation, but there is some in the docs directory 
to get you started.


Please try it and let me know how it works for you.

Regards.

Jesus Reyes A.

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


Re: [Lazarus] Lazreport variables

2020-05-06 Thread Jesus Reyes A. via lazarus
En Sun, 03 May 2020 11:03:12 -0500, Santiago A. via lazarus  
 escribió:



Hi:

I want to write a report where even lines are written with no background  
and odd lines with a light >gray background.
The idea is an memo (MemoBackground) in the background of the masterData  
Band that is gray and I >set visible or invisible, according with the  
line.


I have created a report variable "LineCounter"

In the ColumnHeader band (the report has two columns) I have a Script
Begin
LineCounter:=0;
end;
In the GorupHeader header I have this script
Begin
LineCounter:=0;
end;
In the masterData band Script:
begin
LineCounter:=LineCounter+1;
MemoBackground.visible:=(LineCounter mod 2 = 0);
end



Probably the easiest way of doing what you want is using an empty memo  
object sized to the extent you want for the background row, any other  
field on the band should be 'above' the background memo (you can just  
select the background memo and press the 'send to bottom' tool button),  
any field on the band should be transparent color. Then edit the  
background memo and use this script:


if [LINE#] mod 2 = 0 then
  FillColor := clGray
else
  FillColor := clWhite;

As written and because the variable Line# starts at 1, the first line will  
be white.


You can apply this method to any existing report as it doesn't require  
modifying the source code of your application.


Regards.

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


Re: [Lazarus] Grids micro issue

2019-05-18 Thread Jesus Reyes A. via lazarus
En Thu, 16 May 2019 18:43:06 -0500, AlexeyT via lazarus  
 escribió:



procedure TCustomGrid.AutoAdjustColumns;
   For i:=0 to ColCount do
 AutoAdjustColumn(i);

//must be ColCount-1


Fixed in r61242. Thanks.

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


Re: [Lazarus] Universal FontDialog for LCL

2019-03-19 Thread Jesus Reyes A. via lazarus



Because 'it works'. At least, on my machine. ;)


:)



The only way to catch all problems in the wild, is to release it into  
the wild. I think it's viable to use trunk for that.


Did you try to fix it?


Indeed.

Does the initial-setup dialog show you the option to create a new fppkg  
configuration? Does that work?


Yes but it doesn't work, the error message say:
"Problem with Fppkg Configuration"
"Failed to create a new fppkg configuration. You will
have to fix the configuration manually or reinstall
Free Pascal"

There is a message in the log: "Error: the configuration is corrupt."


Is the prefix for the fpc-installation filled?


It is: C:\Users\Jesus\dev


Are there any other paths in the drop-down?



No


Using the "browse" button I selected the install dir of my trunk compiler  
which according to the help text (the one that contains the fpmkinst dir)  
is "C:\Users\Jesus\dev\fpcbin", it makes not difference or perhaps the  
same message "Error: the configuration is corrupt." appears.



And, after you have re-created the config-files, what does 'fppkg  
listsettings' on the terminal show you? And 'fppkg list -d'?




Using fpc trunk:

(In the following:
APPDIR=C:\Users\Jesus\AppData\Local\FreePascal\fppkg
BINDIR=c:\Users\Jesus\dev\fpcbin\bin\i386-win32
)

BINDIR>fppkg listsettings
Warning: Configuration file is in an old format
Warning: Failed to write compiler-configuration file  
"APPDIR\config\default": Backup of file "APPDIR\config\default" to file  
"APPDIR\config\default.bak" failed.
Warning: Failed to write compiler-configuration file  
"APPDIR\config\default": Backup of file "APPDIR\config\default" to file  
"APPDIR\config\default.bak" failed.

Settings from configuration-files:
 Global-section:
  RemoteMirrorsURL:  http://www.freepascal.org/repository/mirrors.xml
  RemoteRepository:  auto
  LocalRepository:   "{AppConfigDir}" -> "APPDIR\"
  BuildDir:  "{LocalRepository}build\" -> "APPDIR\build\"
  ArchivesDir:   "{LocalRepository}archives\" -> "APPDIR\archives\"
  CompilerConfigDir: "{LocalRepository}config\" -> "APPDIR\config\"
  DefaultCompilerConfig: "default"
  FPMakeCompilerConfig:  "default"
  Downloader:lnet
 Commandline-section:
 -section:
  Name: global
  Description:  "global"
  Dir:  "\" -> "\"
  Prefix:   "" -> ""
  InstallRepository:""
 -section:
  Name: local
  Description:  "local"
  Dir:  "APPDIR\\" -> "APPDIR\\"
  Prefix:   "APPDIR\" -> "APPDIR\"
  InstallRepository:""
Using compiler configuration file "APPDIR\config\default":
 Compiler: "BINDIR\fpc.exe"
 Target:   i386-win32
 Version:  3.3.1
 GlobalPrefix: "" -> ""
 LocalPrefix:  "{LocalRepository}" -> "APPDIR\"
 GlobalInstallDir: "{GlobalPrefix}\" -> "\"
 LocalInstallDir:  "{LocalPrefix}\" -> "APPDIR\\"
 Options:  ""
Using fpmake-building compiler configuration file "APPDIR\config\default":
 Compiler: "BINDIR\fpc.exe"
 Target:   i386-win32
 Version:  3.3.1
 GlobalPrefix: "" -> ""
 LocalPrefix:  "{LocalRepository}" -> "APPDIR\"
 GlobalInstallDir: "{GlobalPrefix}\" -> "\"
 LocalInstallDir:  "{LocalPrefix}\" -> "APPDIR\\"
 Options:  ""


BINDIR>fppkg list -d
Start loading configuration file "APPDIR\fppkg.cfg"
Warning: Configuration file is in an old format
Loaded global configuration from "APPDIR\fppkg.cfg"
Settings from configuration-files:
 Global-section:
  RemoteMirrorsURL:  http://www.freepascal.org/repository/mirrors.xml
  RemoteRepository:  auto
  LocalRepository:   "{AppConfigDir}" -> "APPDIR\"
  BuildDir:  "{LocalRepository}build\" -> "APPDIR\build\"
  ArchivesDir:   "{LocalRepository}archives\" -> "APPDIR\archives\"
  CompilerConfigDir: "{LocalRepository}config\" -> "APPDIR\config\"
  DefaultCompilerConfig: "default"
  FPMakeCompilerConfig:  "default"
  Downloader:lnet
 Commandline-section:
Loading compiler configuration from "APPDIR\config\default"
Configuration file "APPDIR\config\default" is updated with new  
configuration settings

Creating Backup File "APPDIR\config\default.bak"
Warning: Failed to write compiler-configuration file  
"APPDIR\config\default": Backup of file "APPDIR\config\default" to file  
"APPDIR\config\default.bak" failed.

Using compiler configuration file "APPDIR\config\default":
 Compiler: "BINDIR\fpc.exe"
 Target:   i386-win32
 Version:
 GlobalPrefix: "" -> ""
 LocalPrefix:  "{LocalRepository}" -> "APPDIR\"
 GlobalInstallDir: "{GlobalPrefix}\" -> "\"
 LocalInstallDir:  "{LocalPrefix}\" -> "APPDIR\\"
 Options:  ""
Loading compiler configuration for fpmake building from  
"APPDIR\config\default"
Configuration file "APPDIR\config\default" is updated with new  
configuration settings

Creating Backup File "APPDIR\config\default.bak"
Warning: Failed to write compiler-configuration file  
"APPDIR\config\defa

Re: [Lazarus] Universal FontDialog for LCL

2019-03-15 Thread Jesus Reyes A. via lazarus
En Mon, 11 Mar 2019 07:01:33 -0600, Michael Van Canneyt via lazarus  
 escribió:





On Mon, 11 Mar 2019, Kostas Michalopoulos via lazarus wrote:


On Fri, Mar 8, 2019 at 12:55 PM Juha Manninen via lazarus
 wrote:

Everybody wants to include their custom components in LCL. Why?


Most likely because it is much easier to have a single "batteries
included" installer that provides everything you need out of the box
now and much more likely to be there and working in the future (since
it is part of the codebase that the Lazarus devs are compiling against
after every modification), than chase after packages provided by
others who may or may not keep them available and up to date (keeping
your own copies can solve the "available" part, but then you take
unofficial ownership of the package for the "up to date" part).


Exactly.

Relying on packages somewhere in the cloud can lead to nasty surprises.
I've been bitten by npm ("packaging on steroids") more than once when
developing browser-based apps, and I am very reluctant to use such  
mechanisms.

You're constantly chasing version numbers for no good reason.



BTW Is not fppkg something like npm?

and BTW although not for MVC but, can fppkg-lazarus integration be removed  
until it just works? I would like not to see the config lazarus IDE dialog  
to open on every launch just because fppkg is not setup right (Error: the  
Fppkg configuration is corrupt. et al), and there is no way the user can  
fix it (when you are not using 'by default' the default fpc install).


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


lazarus@lists.lazarus-ide.org

2018-08-10 Thread Jesus Reyes A. via Lazarus






The top-left of the paper canvas is 0,0 and coincide with the area of  
the

whole paper. Any drawing outside of this area would be clipped. Some
printers also do not allow drawing outside of the working area.


This does not correspond to my findings.

I did many tests (using a lot of paper in the process) and found
that (0,0) is the origin of the printable area, NOT the paper area.



Yes sorry I got confused. The origin should be the printable area.




About why the selectprinter demo is wrong have to check, last time I did
it worked fine in windows, linux at least, IIRC.


Well, definitely not today on a HP laserjet P2015n, linux mint, 64bit,  
GTK2.

I can send a picture of the produced output if you want :-)



Tested again, it seems to work in my old hp laserjet 1200, the linux mint  
I have in a virtualbox was not able to connect through usb apparently due  
a driver problem in my pc, so I compiled the program saved it in a usb  
stick and boot a xubuntu live session which detected the hp 1200 printer  
without problems, ran the selectprinter app and after changed the paper  
size which defaulted to A4 (mine is Letter) it printed correctly the demo.  
I would took a picture of it but the toner is so old that its barely  
noticeable but I checked with a ruler and the measures were +- 0.5-1.0 mm,  
acceptable to me.


My guess is that your problem might be a bad PPD file for your printer,  
check the *ImageableArea values for your selected paper, the  
*PaperDimension first value minus the *ImageableArea third value should be  
the same as the the *ImageableArea first value (for symmetrical printable  
margins). You can also try another printer driver if available.


Jesus Reyes A.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


lazarus@lists.lazarus-ide.org

2018-08-08 Thread Jesus Reyes A. via Lazarus
En Sat, 28 Jul 2018 08:05:31 -0500, Michael Van Canneyt via Lazarus  
 escribió:




Hi,

The selectprinter demo prints a kind of test page.

However, on linux the rectangle it draws on the page seems to be off. The
left margin seems to be about right, but the bottom and top margins fall  
off

the page.

If I try to code something myself, I would code it like this:

procedure TMainForm.GetPageRect(Out PageRect : TRect);

   Function ToPixels(aUnit,ares : Integer) : Integer;

   begin
 if PSDemo.Units in [pmDefault,pmMillimeters] then
   // 1/1000 of a mm
   Result:=Round(((aUnit div 1000) / 25.4) * Ares)
 else
   Result:=aUnit * Ares
   end;

Var
   LM,RM,TM,BM,H,W : Integer;

begin
   H:=Printer.PaperSize.Height;
   W:=Printer.PaperSize.Width;
   LM:=ToPixels(PSDemo.MarginLeft,Printer.XDPI);
   RM:=ToPixels(PSDemo.MarginRight,Printer.XDPI);
   TM:=ToPixels(PSDemo.MarginLeft,Printer.YDPI);
   BM:=ToPixels(PSDemo.MarginBottom,Printer.YDPI);
   PageRect:=Rect(LM,TM,W-RM,H-BM);
end;

PSDemo is a TPageSetupDialog. The values displayed by the lazarus test
program match more or less what my code gets. Similarly, if I draw a  
rectangle with the rectangle defined as above, the bottom-right falls  
off the page.


So the question is: what is the origin of the printer canvas ? Top-left  
corner of the paper (What it should be IMO ?)

Or is it the Top-left corner of the printable area of the page ?



The top-left of the paper canvas is 0,0 and coincide with the area of the  
whole paper. Any drawing outside of this area would be clipped. Some  
printers also do not allow drawing outside of the working area.



How to obtain the origin of the printable area ?
Is the PageWidth/Pageheight relative to this origin ?




The printable area should be Printer.PaperSize.PaperRect.WorkRect


Or is there something else wrong in the printer class or the demo code ?
(using GTK2, 64-bit)



Should not matter in this case but it seems TM is using the left margin  
instead of the top margin.
As the TPageSetupDialog works with the current printer just need to check  
that selected printer is not changed after TPageSetupDialog execution.


About why the selectprinter demo is wrong have to check, last time I did  
it worked fine in windows, linux at least, IIRC.


Jesus Reyes A.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] LazReport - Build variable or field names in script

2018-05-15 Thread Jesus Reyes A. via Lazarus
En Tue, 15 May 2018 10:58:57 -0500, Gabor Boros via Lazarus  
 escribió:



Hi All,

I can build variable

TEXT := '[PAGE_LNG_' + [LNG_ID] + ']: [PAGE#]';

and field

TEXT := '[BDS.PAGE_LNG_' + [LNG_ID] + ']: [PAGE#]';

names in this way.

LNG_ID is a report variable with a numeric value and the showed captions  
or used field names depends on it. I try to eliminate the if then else  
if then else if then else ... chains which give back the result depend  
on the language.


Is this the good/safe solution? Any simpler/better exists?

Gabor


As CASE OF is not implemented, that's the way of doing it. By using the  
OnGetValue event you might get more control on selecting the right values  
based on the LNG_ID, or even using a user defined function could work also.


Jesus Reyes A.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] How to use two different versions of FPC

2018-05-12 Thread Jesus Reyes A. via Lazarus
En Fri, 11 May 2018 08:40:28 -0500, patspiper via Lazarus  
 escribió:



On 11/05/18 16:17, Joost van der Sluis via Lazarus wrote:

On 05/10/2018 04:35 PM, patspiper via Lazarus wrote:


Attached snapshot is work in progress


Sorry, but I don't think this is an improvement. For new users this  
looks like a nightmare. It should be hidden, at least, imho. Or better:  
make it a plugin.


As Mattias has pointed out, it is a plugin (IDE package), and definitely  
not for the faint of heart.


Once one creates a standardized folder hierarchy for the different fpc  
versions, it becomes a matter of a few clicks to switch versions.


Stephano



An easy way to switch the compiler is nice, but I think that it would be  
nicer if it could be organized in compiler profiles so you can have  
compilers with the same version but with or without debug info or compiled  
with different options. Then a compiler profile could be  
specified/selected by build mode so it could be stored in the session or  
the project file. :)


Jesus Reyes A.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] DBGrid - Patch review request

2016-12-14 Thread Jesus Reyes A. via Lazarus
On Wed, 14 Dec 2016 06:27:18 -0600, Gabor Boros via Lazarus  
 wrote:



Hi All,

I do not want to disturb the developers but don't know which is the best  
practice. Wait or not wait. For example issue 28597. Wait more than a  
year then wrote to the list about it and Zeljko fixed on same day (on  
Saturday!).


So, I created a patch for help record reordering feature in my  
application with DBGrid and an example project for demonstration. Please  
review, comment (good, bad, never ever), ...


http://bugs.freepascal.org/view.php?id=31061

Gabor


I'm sorry, I have been too busy lately, I hope to find time to review it  
this weekend if nobody does it sooner.


Jesus Reyes A.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] ActiveX, TOLEControl

2016-11-28 Thread Jesus Reyes A. via Lazarus
En Wed, 19 Oct 2016 11:07:35 -0500, Dennis via Lazarus  
 escribió:





LacaK via Lazarus wrote:






Hi *,

I need help with OCX component (not visual I guess), which I need use  
in Lazarus application (to control another application, which  
supplies this OCX control).
I have imported type library using importtl.exe (new unit was created  
successfully)


Then in program I have created instance:
  v := CreateOleObject('SCAPS.ScSamlightClientCtrl');
or
  intf := CreateComObject(CLASS_ScSamlightClientCtrl) as  
_DSamlight_client_ctrl_ocx;

What is the type of your V or intf  variable?


V: OLEVariant;
intf: _DSamlight_client_ctrl_ocx;

I am wild guessing maybe they are not proper referenced type so the  
object is created and then immediately freed.


There is something strange behind scene. I have tried various methods:
I remember in Delphi, I sometimes have to call CoInitialize and  
CoUninitialize.

Not sure if FPC has to do the same.
Have you tried that?

Dennis



--
Usando el cliente de correo de Opera: http://www.opera.com/mail/
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus