Recent

Author Topic: NiceGrid for Lazarus  (Read 7913 times)

maurobio

  • Hero Member
  • *****
  • Posts: 640
  • Ecology is everything.
    • GitHub
Re: NiceGrid for Lazarus
« Reply #15 on: June 22, 2023, 09:05:50 pm »
Hi, @wp!!!

I am sorry, in a rush I didn't checked the demos! I just installed the component in Lazarus IDE and since it compiled fine, I assumed that it was working!

As I understood, the component has already been successfully ported from Delphi to Lazarus, before being lost. Can't this good work be re-done?

With warmest regards,
UCSD Pascal / Burroughs 6700 / Master Control Program
Delphi 7.0 Personal Edition
Lazarus 3.8 - FPC 3.2.2 on GNU/Linux Mint 19.1/20.3, Windows XP SP3, Windows 7 Professional, Windows 10 Home

GutoGT

  • New member
  • *
  • Posts: 9
Re: NiceGrid for Lazarus
« Reply #16 on: June 23, 2023, 01:27:47 am »
test without commented lines in windows.
when closing, error occurs: INT DIVIDE BY ZERO
other than that it looks perfect.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: NiceGrid for Lazarus
« Reply #17 on: June 23, 2023, 12:11:12 pm »
Thank you. However, it has the same issue as TraumtaenzerDieter's code above: When I run the sample projects, the mouse cursor disappears when it enters the grid. And when the application is closed there is a Divide-by-zero error.
Runs fine on Linux 64-bit Qt5. Will be hard to fix since Windows is a secondary citizen in my computer.

wp

  • Hero Member
  • *****
  • Posts: 13363
Re: NiceGrid for Lazarus
« Reply #18 on: June 23, 2023, 01:41:16 pm »
When I run the sample projects, the mouse cursor disappears when it enters the grid.
TNiceGrid uses a set of new cursors. Loading of these cursors from the resource, however, is commented out in the TNiceGrid.Create constructor. Uncomment this code (Screen.Cursors[...] := LoadCursor(...)), and the cursor will appear.

And when the application is closed there is a Divide-by-zero error.
This happens because there seems to be an invalid handle in WMKillFocus. Make sure that the Handle is allocated, and it will work:
Code: Pascal  [Select][+][-]
  1. procedure TNiceGrid.WMKillFocus(var Msg: TLMKillFocus);
  2. begin
  3.   if FEdit.HandleAllocated then                // <--- ADDED
  4.   begin                                        // <--- ADDED
  5.     if (Msg.FocusedWnd <> FEdit.Handle)
  6.       then ForceHideCaret;
  7.      DestroyCaret(FEdit.Handle);
  8.   end;                                         // <--- ADDED
  9.   CaretVisible := False;
  10.   if not IsEditing
  11.     then InvalidateCells;
  12. end;

wp

  • Hero Member
  • *****
  • Posts: 13363
Re: NiceGrid for Lazarus
« Reply #19 on: June 23, 2023, 05:27:02 pm »
I fixed these bugs and uploaded the package to the Lazarus Component and Code Repository (CCR) at sourceforge: https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/nicegrid/ (Install via SVN or the zip snapshot). Whoever is interested should test it so that I can propose addition to OPM.

paweld

  • Hero Member
  • *****
  • Posts: 1568
Re: NiceGrid for Lazarus
« Reply #20 on: June 24, 2023, 08:06:07 am »
@wp: change path to unit files in package options from ..\.. to ..\..\source
Best regards / Pozdrawiam
paweld

wp

  • Hero Member
  • *****
  • Posts: 13363
Re: NiceGrid for Lazarus
« Reply #21 on: June 24, 2023, 11:59:32 am »
Thank you - last minute changes before committing never are good...

Fixed this compilation issue, as well as
- missing palette icon for TNiceGridSync --> re-used the TNiceGrid icon like in the original package.
- component editor commented out --> is working now

BTW: @TraumTaenzerDieter, @maurobio: Do you know who made the Lazarus port that you posted? I'd like to mention it in the package.
« Last Edit: June 24, 2023, 12:08:43 pm by wp »

TraumTaenzerDieter

  • New Member
  • *
  • Posts: 33
Re: NiceGrid for Lazarus
« Reply #22 on: June 24, 2023, 12:40:05 pm »
Sorry, I could not find any other author mintioned than priyatna.org.

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: NiceGrid for Lazarus
« Reply #23 on: June 24, 2023, 01:07:41 pm »
@wp:
TraumTaenzerrDieter's version is the exact same as the one from the bitbucket repository from Leledumbo but I can't verify/read if Leledumbo did the actual conversion or that he (only) hosted it (and got the Lazarus converted version from somewhere else, see also https://forum.lazarus.freepascal.org/index.php/topic,10277.0.html).
Today is tomorrow's yesterday.

domasz

  • Hero Member
  • *****
  • Posts: 616
Re: NiceGrid for Lazarus
« Reply #24 on: June 24, 2023, 01:09:41 pm »
http://web.archive.org/web/20200121064904/http://priyatna.org/about-me.php

"My name is Priyatna. I'm a programmer as hobby and also as a profession. I live in northern area of Bandung, Indonesia"

That's how he calls himself. "priyatna.org" sounds a bit weird as an author.
« Last Edit: June 24, 2023, 01:12:31 pm by domasz »

maurobio

  • Hero Member
  • *****
  • Posts: 640
  • Ecology is everything.
    • GitHub
Re: NiceGrid for Lazarus
« Reply #25 on: June 24, 2023, 01:22:18 pm »
Hi, @wp!

The original source code of the original NiceGrid for Delphi mentions Mr. C. S. Phua (using an email form Myanmar) as a "contributor"; other than that, I could find no mention of who ported the component to Lazarus.

Interestingly, "priyatna" is a Russian word (приятно) which can be translated into English as "pleasant".

A nice linguistic mystery of which I am so fond of!  ;D

With warmest regards,
UCSD Pascal / Burroughs 6700 / Master Control Program
Delphi 7.0 Personal Edition
Lazarus 3.8 - FPC 3.2.2 on GNU/Linux Mint 19.1/20.3, Windows XP SP3, Windows 7 Professional, Windows 10 Home

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: NiceGrid for Lazarus
« Reply #26 on: June 24, 2023, 01:26:26 pm »
That's how he calls himself. "priyatna.org" sounds a bit weird as an author.
commonly used for both surname (https://forebears.io/surnames/priyatna) and family name (as an example: https://en.wikipedia.org/wiki/Kadek_Arel_Priyatna).

It has a nice meaning (https://www.nameslook.com/priyatna?utm_content=cmp-true)

edit: oh wait ... you were referring to the ".org" part  :-[
« Last Edit: June 24, 2023, 01:28:33 pm by TRon »
Today is tomorrow's yesterday.

maurobio

  • Hero Member
  • *****
  • Posts: 640
  • Ecology is everything.
    • GitHub
Re: NiceGrid for Lazarus
« Reply #27 on: June 24, 2023, 01:48:38 pm »
Hi, @TRon!

But what an interesting finding, sir!

The meaning of the word in Bahasa Indonesian (?) is much alike those in Russian! Unfortunately, the page you linked does not mention the etymology of the word, which could help us to trace its origins and relationships (although it dwells into "numerology" and "inner potentials" nonsense).

Best regards,
UCSD Pascal / Burroughs 6700 / Master Control Program
Delphi 7.0 Personal Edition
Lazarus 3.8 - FPC 3.2.2 on GNU/Linux Mint 19.1/20.3, Windows XP SP3, Windows 7 Professional, Windows 10 Home

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: NiceGrid for Lazarus
« Reply #28 on: June 24, 2023, 02:13:38 pm »
@maurobio:

Indeed that page is a bit focused on numerology. Perhaps this is a better read ? Unfortunately my knowledge on Russian is next to none  :-[
Today is tomorrow's yesterday.

maurobio

  • Hero Member
  • *****
  • Posts: 640
  • Ecology is everything.
    • GitHub
Re: NiceGrid for Lazarus
« Reply #29 on: June 24, 2023, 02:28:15 pm »
Hi, @TRon!

Nice page! It suggests that the word is of oriental origin indeed, what makes its presence in the Russian vocabulary (https://www.wordhippo.com/what-is/the-meaning-of/russian-word-e01e5615247f463fe87618938f062c9f8adde6a9.html) still more remarkable. The meaning (or at least one of them) in both Russian and several Indo languages are the same.

With warmest regards,
UCSD Pascal / Burroughs 6700 / Master Control Program
Delphi 7.0 Personal Edition
Lazarus 3.8 - FPC 3.2.2 on GNU/Linux Mint 19.1/20.3, Windows XP SP3, Windows 7 Professional, Windows 10 Home

 

TinyPortal © 2005-2018