Recent

Author Topic: Lazarus Release Candidate 1 of 4.0  (Read 25696 times)

TRon

  • Hero Member
  • *****
  • Posts: 3639
Re: Lazarus Release Candidate 1 of 4.0
« Reply #105 on: November 11, 2024, 03:20:39 pm »
I'd like to encourage the Lazarus maintainers to provide a "Lazarus 4.0 with trunk FPC 3.3" release in addition to the regular one with FPC 3.2. There are so many great features in trunk meanwhile, but it's horribly compilcated to get it working properly. So please, an FPC 3.3 with Lazarus 4.0 release would be a great option!

This is why tools like FpcUpDeluxe exist

Yes, but FpcUpDeluxe unfortunately uses an entirely different directory structure than official Lazarus releases. So it's not an option for me.
FPCUpDeluxe does that for good reason. BTW: You forgot to mention which revision exactly  :D
« Last Edit: November 11, 2024, 03:56:03 pm by TRon »
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

Rinzwind

  • New member
  • *
  • Posts: 7
Re: Lazarus Release Candidate 1 of 4.0
« Reply #106 on: November 13, 2024, 09:25:21 am »
Finally docked option choice at first start. To make it look even more modern:
1) make header style Line or Points instead of Frame3D. Just looks more pleasing and standard.
2) Remove standard component horizontal palette and instead make vertical Components section visible/docked by default.
3) Update font of Free Pascal Reference guide to match other help documentation. As is, it is ugly times new roman. Which is fine on paper, but not on screen.
4) And while we are at it... change the editor font to Consolas... ;
5) Release and Debug mode by default

And instantly everyone who tries Lazarus again will take it more serious, just because of these cosmetic changes.

« Last Edit: November 18, 2024, 11:59:22 am by Rinzwind »

andresayang

  • Full Member
  • ***
  • Posts: 115
Re: Lazarus Release Candidate 1 of 4.0
« Reply #107 on: November 13, 2024, 12:38:04 pm »
Hello,

Wonderful interface, really appreciate it.

Thanks a lots !

The only "bad" is that x86-64 "deb" files are build and compiled for Debian 12 and up, I can not use on my Debian 11 station (Library version incompatibilities)
« Last Edit: November 15, 2024, 02:54:21 pm by andresayang »
Linux, Debian 12
Lazarus: always latest release

essence-ciel

  • New Member
  • *
  • Posts: 17
Re: Lazarus Release Candidate 1 of 4.0
« Reply #108 on: November 16, 2024, 09:55:45 pm »
Hi,
Thanks for information. I totally remove Lazarus '4' of my computer and re-installed it. Now it works well.

Thanks for this new version...

essence-ciel

  • New Member
  • *
  • Posts: 17
Re: Lazarus Release Candidate 1 of 4.0
« Reply #109 on: November 17, 2024, 09:07:29 pm »
Hello,

About new version... Unless I'm mistaken, it's interesting to note the bizarre behavior of dBCombobox...

While one would expect to see an input field and a drop-down list of the table data referred to by the DataSource/DataField pair, the control only displays a single value, the rest of the list being devoid of any data.

Code: Pascal  [Select][+][-]
  1.   dBComboBox2.Items.Clear;
  2.   with DataModule1.TPays do
  3.   begin
  4.       Open;
  5.       while not EOF do
  6.       begin
  7.              dBComboBox2.AddItem(FieldValues['PaysN'], TObject(1));
  8.              Next;
  9.       end;
  10.   end;  

Even when trying to “feed” TStrings elements, nothing is displayed except the table name. However, with the same code and a ComboBox instead of a dBComboBox, it works correctly...

Is this normal behavior for this control?
If so, what's the difference between a Combobox and a dBCombobox? Apart from the fact that a Combobox, unlike a dBCombobox, displays the data indicated in Items...

Best regards

kitayets

  • Newbie
  • Posts: 1
Re: Lazarus Release Candidate 1 of 4.0
« Reply #110 on: November 22, 2024, 10:58:39 pm »
Hello,

there is the problem I've faced trying 4.0RC1 - the error occures when starting edit time "Design report" of the FPreport component.

Steps to reproduce:
 1. Install components "lazfpreportdesign", "lazidefpreport" from install/remove packages and rebuild IDE
 2. Create a new Application project
 3. Place FPReport or FPJSONReport component from FPReport component palette onto the form
 4. Right button click on the component and select "Design report" from popup menu
 5. the error "Access violation" occures!!!

Tested on win64 (windows 10 pro). On the previous version of Lasarus Frpeport works flawless.




dwarf

  • Newbie
  • Posts: 5
Re: Lazarus Release Candidate 1 of 4.0
« Reply #111 on: November 29, 2024, 07:22:11 pm »
I recently started using Lazarus. As a former VB6 programmer (then a long break), I immediately felt at home in Lazarus. And today I downloaded the RC 1 of 4.0 and installed it on a virtual Windows 10 PC. My interest was great, but so was my disappointment. And it concerns the DBGrid. A good product in itself. Connecting to the SQLite3 database was not a problem. New data records, changing and deleting data records - no problem. What I can't understand is why a problem that has existed for years has apparently not been solved again. For years, users have been asking how to change the column size with the mouse. Also the sorting of the columns. And for both problems they give a bunch of useless tips that don't work or are half the size of a program themselves. These two features have not been implemented over the years. There is the option 'dgColumnResize' for changing the column size with the mouse and if you move the mouse between two columns in the title, the mouse cursor changes and you can drag. But if you then let go, the column jumps back to its old position. And there is no setting/option for sorting. Both elements are elegantly implemented in the StringGrid. But with a SQLite database underneath, I don't want a StringGrid, I want the DBGrid. Implementing a StringGrid is time-consuming. The DBGrid is professional. With version 4 of Lazarus, you would have the opportunity to eliminate this shortcoming and make life easier for programmers. Thank you very much.

Translated with DeepL.com (free version)

Ich benutze seit Kurzem Lazarus. Als ehemaliger VB6-Programmierer (dann lange Pause), habe ich mich in Lazarus sofort zu Hause gefühlt. Und heute habe ich den RC 1 of 4.0 heruntergeladen und auf einem virtuellen Windows-10 PC installiert. Mein Interesse war gross, meine Enttäuschung ebenfalls. Und zwar betrifft es das DBGrid. An sich ein gutes Produkt. Die Verbindung zur SQLite3-Datenbank war keine Problem. Neue Datensätze, Datensätze ändern und löschen - kein Problem. Was ich nicht verstehen kann ist wieso ein Problem das seit Jahren besteht offenbar wieder nicht gelöst wurde. Seit Jahren fragen User wie man die Spaltengrösse mit der Maus ändern kann. Ebenso die Sortierung der Spalten. Und geben für beide Probleme einen Haufen nutzloser Tipps, die nicht funktionieren, oder selber ein halbes Programm gross sind. Über all die Jahre wurden die beiden Features nicht implementiert. Es gibt zwar für die Änderung der Spaltengrösse mit der Maus die Option 'dgColumnResize' und wenn man  im Titel  mit der Maus zwischen zwei Spalten fährt, ändert sich der Mauscursor und man kann ziehen. Doch wenn man dann loslässt, springt die Spalte in die alte Position zurück. Und zum Sortieren gibt es gar keine Einstellung/Option. Im StringGrid sind beide Elemente elegant realisiert. Aber mit einer SQLite-Datenbank darunter, will ich kein StringGrid, sondern das DBGrid. Ein StringGrid zu implementieren ist aufwändig. Das DBGrid ist professionell. Bei der Version 4 von Lazarus hättet ihr die Möglichkeit dieses Manko zu beseitigen und den Programmierern das Leben leichter zu machen. Danke.
« Last Edit: November 29, 2024, 07:30:51 pm by dwarf »

dsiders

  • Hero Member
  • *****
  • Posts: 1282
Re: Lazarus Release Candidate 1 of 4.0
« Reply #112 on: November 29, 2024, 09:57:58 pm »
I recently started using Lazarus. As a former VB6 programmer (then a long break), I immediately felt at home in Lazarus. And today I downloaded the RC 1 of 4.0 and installed it on a virtual Windows 10 PC. My interest was great, but so was my disappointment. And it concerns the DBGrid. A good product in itself. Connecting to the SQLite3 database was not a problem. New data records, changing and deleting data records - no problem. What I can't understand is why a problem that has existed for years has apparently not been solved again. For years, users have been asking how to change the column size with the mouse. Also the sorting of the columns. And for both problems they give a bunch of useless tips that don't work or are half the size of a program themselves. These two features have not been implemented over the years. There is the option 'dgColumnResize' for changing the column size with the mouse and if you move the mouse between two columns in the title, the mouse cursor changes and you can drag. But if you then let go, the column jumps back to its old position. And there is no setting/option for sorting. Both elements are elegantly implemented in the StringGrid. But with a SQLite database underneath, I don't want a StringGrid, I want the DBGrid. Implementing a StringGrid is time-consuming. The DBGrid is professional. With version 4 of Lazarus, you would have the opportunity to eliminate this shortcoming and make life easier for programmers. Thank you very much.

TDBGrid already has some of the features you mentioned. Look at the example in: examples/database/address_book/. It allows column resizing with the mouse. Columns can be moved using drag and drop. Ensure that both dgColumnMove and dgColumnResize are enabled in Options. If you're having problems with that, it is probably some other Option setting that prevents the actions like dbAutoSizeColumns.

Sorting in TDBGrid implies that something in the underlying data source is changed to implement the sort order. Like the active index for .DBF or an ORDER  BY clause in a SQL statement. There are no SortColumn or SortOrder properties - probably because the action is dataset- / database-specific. It has the TDBGrid.OnTitleClick event handler to detect a mouse click on a column header, and to perform whatever actions you need to perform ordering for the associated dataset though.

Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

dwarf

  • Newbie
  • Posts: 5
Re: Lazarus Release Candidate 1 of 4.0
« Reply #113 on: November 29, 2024, 11:06:32 pm »
I recently started using Lazarus. As a former VB6 programmer (then a long break), I immediately felt at home in Lazarus. And today I downloaded the RC 1 of 4.0 and installed it on a virtual Windows 10 PC. My interest was great, but so was my disappointment. And it concerns the DBGrid. A good product in itself. Connecting to the SQLite3 database was not a problem. New data records, changing and deleting data records - no problem. What I can't understand is why a problem that has existed for years has apparently not been solved again. For years, users have been asking how to change the column size with the mouse. Also the sorting of the columns. And for both problems they give a bunch of useless tips that don't work or are half the size of a program themselves. These two features have not been implemented over the years. There is the option 'dgColumnResize' for changing the column size with the mouse and if you move the mouse between two columns in the title, the mouse cursor changes and you can drag. But if you then let go, the column jumps back to its old position. And there is no setting/option for sorting. Both elements are elegantly implemented in the StringGrid. But with a SQLite database underneath, I don't want a StringGrid, I want the DBGrid. Implementing a StringGrid is time-consuming. The DBGrid is professional. With version 4 of Lazarus, you would have the opportunity to eliminate this shortcoming and make life easier for programmers. Thank you very much.

TDBGrid already has some of the features you mentioned. Look at the example in: examples/database/address_book/. It allows column resizing with the mouse. Columns can be moved using drag and drop. Ensure that both dgColumnMove and dgColumnResize are enabled in Options. If you're having problems with that, it is probably some other Option setting that prevents the actions like dbAutoSizeColumns.

Sorting in TDBGrid implies that something in the underlying data source is changed to implement the sort order. Like the active index for .DBF or an ORDER  BY clause in a SQL statement. There are no SortColumn or SortOrder properties - probably because the action is dataset- / database-specific. It has the TDBGrid.OnTitleClick event handler to detect a mouse click on a column header, and to perform whatever actions you need to perform ordering for the associated dataset though.

Thank you for your answer. Interestingly, if I set 'DragMode' to 'dmManual' and activate dgColumnMove and dgColumnResize, then I can move the columns 😁 but not resize them. I noticed this this morning and immediately switched it off again because I don't want to move the columns.
As far as sorting is concerned, I have written a routine that takes ASC and DESC into account for each column. But if you click in the title bar, the program always gives a wrong column name. No matter which column you select, the program always returns the same column name. Namely always 'Addresse'. The first column. No matter which column you click on. But if you click below the title line, in the data area, everything works fine. If it weren't for this 'error', sorting would not be a problem. I can't figure it out. I will look tomorrow for this example/database/address book that you recommended

In DBGrid1TitleClick:
var
i:Integer;
TmpFeldName:String='';

Begin
TmpFeldName:=Form1.DBGrid1.SelectedField.FieldName;
Showmessage('Spaltenname: ' + TmpFeldname + ' ' + DBGrid1SortOrder);

if DBGrid1SortOrder='ASC' Then
Begin

   if TmpFeldName='Adresse' THEN Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Adresse ASC';
   if TmpFeldName='Termin' then Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Termin ASC';
   if TmpFeldName='Währung' then Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Währung ASC';
   if TmpFeldName='Betrag' then Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Betrag ASC';
   if TmpFeldName='Konto' then Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Konto ASC';
   if TmpFeldName='Belastungskonto' then Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Belastungskonto ASC';
   if TmpFeldName='Bezeichnung' then Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Bezeichnung ASC';
   if TmpFeldName='Buchungstext' then Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Buchungstext ASC';
   if TmpFeldName='Zahlungsgrund' then Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Zahlungsgrund ASC';
   DBGrid1SortOrder:='DESC';
end

else if DBGrid1SortOrder='DESC' Then
Begin
   if TmpFeldName='Adresse' THEN Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Adresse DESC';
   if TmpFeldName='Termin' then Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Termin DESC';
   if TmpFeldName='Währung' then Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Währung DESC';
   if TmpFeldName='Betrag' then Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Betrag DESC';
   if TmpFeldName='Konto' then Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Konto DESC';
   if TmpFeldName='Belastungskonto' then Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Belastungskonto DESC';
   if TmpFeldName='Bezeichnung' then Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Bezeichnung DESC';
   if TmpFeldName='Buchungstext' then Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Buchungstext DESC';
   if TmpFeldName='Zahlungsgrund' then Form1.SQLquery1.SQl.Text:='SELECT * from tbl_Bankzahlungen ORDER BY Zahlungsgrund DESC';
    DBGrid1SortOrder:='ASC';
end;

TmpFeldname:='';                                                           

« Last Edit: November 29, 2024, 11:16:03 pm by dwarf »

Sieben

  • Sr. Member
  • ****
  • Posts: 365
Re: Lazarus Release Candidate 1 of 4.0
« Reply #114 on: November 29, 2024, 11:25:41 pm »
You have to use the Column that OnTitleClick gives you to determine the FieldName:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.DBGrid1TitleClick(Column: TColumn);
  2. begin
  3.   TmpFeldName := Column.FieldName;
  4.   //

Or you have to update the SelectedField property by:
Code: Pascal  [Select][+][-]
  1.   DBGrid1.SelectedIndex := Column.Index;
Lazarus 2.2.0, FPC 3.2.2, .deb install on Ubuntu Xenial 32 / Gtk2 / Unity7

dseligo

  • Hero Member
  • *****
  • Posts: 1412
Re: Lazarus Release Candidate 1 of 4.0
« Reply #115 on: November 30, 2024, 12:18:57 am »
Thank you for your answer. Interestingly, if I set 'DragMode' to 'dmManual' and activate dgColumnMove and dgColumnResize, then I can move the columns 😁 but not resize them. I noticed this this morning and immediately switched it off again because I don't want to move the columns.
As far as sorting is concerned, I have written a routine that takes ASC and DESC into account for each column. But if you click in the title bar, the program always gives a wrong column name. No matter which column you select, the program always returns the same column name. Namely always 'Addresse'. The first column. No matter which column you click on. But if you click below the title line, in the data area, everything works fine. If it weren't for this 'error', sorting would not be a problem. I can't figure it out. I will look tomorrow for this example/database/address book that you recommended

You are doing something wrong at your side. Next time prepare test project which shows your problem so we can help you more easily (now we have to guess what you are doing). Some additional data also helps sometimes (OS, bitness, Lazarus version and bitness and similar).

I prepared and attached project which does what you want (I included some test data, too).
All changes to DBGrid are done in code, so you can cleary see what is set. Nothing is set in DBGrid in GUI (you can test this if you delete DBGrid from form and put it there again).
Columns can be resized, positions of columns can't be changed and correct column name is displayed when clicked on title.

I tested with Lazarus 3.4 and 3.6 on Windows 11, but I think that this should work on Lazarus 4.0RC and on other OS-es too.
« Last Edit: November 30, 2024, 12:22:01 am by dseligo »

dwarf

  • Newbie
  • Posts: 5
Re: Lazarus Release Candidate 1 of 4.0
« Reply #116 on: November 30, 2024, 12:41:32 am »
You have to use the Column that OnTitleClick gives you to determine the FieldName:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.DBGrid1TitleClick(Column: TColumn);
  2. begin
  3.   TmpFeldName := Column.FieldName;
  4.   //

Or you have to update the SelectedField property by:
Code: Pascal  [Select][+][-]
  1.   DBGrid1.SelectedIndex := Column.Index;

Thank you, Sieben. The 'TmpFeldName := Column.FieldName' was the solution. I now get the correct column name. Super!
« Last Edit: November 30, 2024, 12:49:28 am by dwarf »

dwarf

  • Newbie
  • Posts: 5
Re: Lazarus Release Candidate 1 of 4.0
« Reply #117 on: November 30, 2024, 01:42:51 am »
Thank you for your answer. Interestingly, if I set 'DragMode' to 'dmManual' and activate dgColumnMove and dgColumnResize, then I can move the columns 😁 but not resize them. I noticed this this morning and immediately switched it off again because I don't want to move the columns.
As far as sorting is concerned, I have written a routine that takes ASC and DESC into account for each column. But if you click in the title bar, the program always gives a wrong column name. No matter which column you select, the program always returns the same column name. Namely always 'Addresse'. The first column. No matter which column you click on. But if you click below the title line, in the data area, everything works fine. If it weren't for this 'error', sorting would not be a problem. I can't figure it out. I will look tomorrow for this example/database/address book that you recommended

You are doing something wrong at your side. Next time prepare test project which shows your problem so we can help you more easily (now we have to guess what you are doing). Some additional data also helps sometimes (OS, bitness, Lazarus version and bitness and similar).

I prepared and attached project which does what you want (I included some test data, too).
All changes to DBGrid are done in code, so you can cleary see what is set. Nothing is set in DBGrid in GUI (you can test this if you delete DBGrid from form and put it there again).
Columns can be resized, positions of columns can't be changed and correct column name is displayed when clicked on title.

I tested with Lazarus 3.4 and 3.6 on Windows 11, but I think that this should work on Lazarus 4.0RC and on other OS-es too.

Thank you. But I think that our two 'projects' are quite far apart. I also work with DBGrid, but underneath I use SQLite3. Not with CSV files. And with SQlite the DBGrid seems to react differently

dseligo

  • Hero Member
  • *****
  • Posts: 1412
Re: Lazarus Release Candidate 1 of 4.0
« Reply #118 on: November 30, 2024, 02:01:36 am »
Thank you for your answer. Interestingly, if I set 'DragMode' to 'dmManual' and activate dgColumnMove and dgColumnResize, then I can move the columns 😁 but not resize them. I noticed this this morning and immediately switched it off again because I don't want to move the columns.
As far as sorting is concerned, I have written a routine that takes ASC and DESC into account for each column. But if you click in the title bar, the program always gives a wrong column name. No matter which column you select, the program always returns the same column name. Namely always 'Addresse'. The first column. No matter which column you click on. But if you click below the title line, in the data area, everything works fine. If it weren't for this 'error', sorting would not be a problem. I can't figure it out. I will look tomorrow for this example/database/address book that you recommended

You are doing something wrong at your side. Next time prepare test project which shows your problem so we can help you more easily (now we have to guess what you are doing). Some additional data also helps sometimes (OS, bitness, Lazarus version and bitness and similar).

I prepared and attached project which does what you want (I included some test data, too).
All changes to DBGrid are done in code, so you can cleary see what is set. Nothing is set in DBGrid in GUI (you can test this if you delete DBGrid from form and put it there again).
Columns can be resized, positions of columns can't be changed and correct column name is displayed when clicked on title.

I tested with Lazarus 3.4 and 3.6 on Windows 11, but I think that this should work on Lazarus 4.0RC and on other OS-es too.

Thank you. But I think that our two 'projects' are quite far apart. I also work with DBGrid, but underneath I use SQLite3. Not with CSV files. And with SQlite the DBGrid seems to react differently

No, underlying database doesn't matter in this case.
I adapted example to use SQlite now and it behaves the same. I assure you it behaves the same with MySQL, MSSQL, MariaDB (because I use them regularly).

dwarf

  • Newbie
  • Posts: 5
Re: Lazarus Release Candidate 1 of 4.0
« Reply #119 on: November 30, 2024, 02:59:02 am »
Thank you for your answer. Interestingly, if I set 'DragMode' to 'dmManual' and activate dgColumnMove and dgColumnResize, then I can move the columns 😁 but not resize them. I noticed this this morning and immediately switched it off again because I don't want to move the columns.
As far as sorting is concerned, I have written a routine that takes ASC and DESC into account for each column. But if you click in the title bar, the program always gives a wrong column name. No matter which column you select, the program always returns the same column name. Namely always 'Addresse'. The first column. No matter which column you click on. But if you click below the title line, in the data area, everything works fine. If it weren't for this 'error', sorting would not be a problem. I can't figure it out. I will look tomorrow for this example/database/address book that you recommended

You are doing something wrong at your side. Next time prepare test project which shows your problem so we can help you more easily (now we have to guess what you are doing). Some additional data also helps sometimes (OS, bitness, Lazarus version and bitness and similar).

I prepared and attached project which does what you want (I included some test data, too).
All changes to DBGrid are done in code, so you can cleary see what is set. Nothing is set in DBGrid in GUI (you can test this if you delete DBGrid from form and put it there again).
Columns can be resized, positions of columns can't be changed and correct column name is displayed when clicked on title.

I tested with Lazarus 3.4 and 3.6 on Windows 11, but I think that this should work on Lazarus 4.0RC and on other OS-es too.

Thank you. But I think that our two 'projects' are quite far apart. I also work with DBGrid, but underneath I use SQLite3. Not with CSV files. And with SQlite the DBGrid seems to react differently

No, underlying database doesn't matter in this case.
I adapted example to use SQlite now and it behaves the same. I assure you it behaves the same with MySQL, MSSQL, MariaDB (because I use them regularly).

Hello dseligo. Thank you very much. You are right. I will 'take apart' your test example and try to understand it. I wanted to switch to the StringGrid tomorrow. It already has all the features I want 'out of the box'. Now I can try to work with your example. Since I'm still new to Freepascal/Lazarus, I haven't got the special stuff down yet.

 

TinyPortal © 2005-2018