Recent

Author Topic: [RESOLVED] Installed package DBGridController but component not showing in IDE  (Read 703 times)

gponym

  • Newbie
  • Posts: 3
[RESOLVED:  The component now shows in proper place in Component Palette.  This resolves the immediate issue although it fails to account for why the registration logic present in DBGridController package was not honored by Lazarus.

Per separate forum question linked by  n7800, I clicked on "Restore Defaults" in Tools / Options... / Environment / Component Palette" .  Afterward the component was visible in Component Palette.

Afterward, I looked without learning anything helpful at each file changed in the project at that "Restore Defaults" moment to discover a relevant reference to DBGridController.  So it remains a mystery what had misfired during package installation.]


Using Lazarus 4.2.0 Online Package Manager today I installed current DBGridController (v. 1.0.3) package.  Problem is, I can't find the component anywhere in the IDE, so I don't see how to actually use it.

I've searched the web and learned a bit about the package "Register" procedure, the IDE Component Palette, the "Code Explorer, Components" IDE window, and locations of package files.  However, I cannot resolve the issue.

Below is a quick summary of what I've done and observed plus system version info.  Any suggestions or questions appreciated.

[I'm new to Laz so may have omitted some crucial information, or troubleshooting step.]

Lazarus 4.2.0 IDE was installed 3 days prior.  It appears to be working fine on a couple of small projects involving DBGrid and SQLite.

I installed the package (DBGridController 1.0.3) twice.  I removed the "/home/gp/.lazarus/onlinepackagemanager/packages/DBGridController" directory after the first install had a problem.  The second install seemed to go well.

see attachment: dbgridcontroller-pkg-status-laz-OPM-scrcap...

I rebuilt the IDE twice after the second time installing package.  It looks okay - except I can't find the component anywhere in the IDE (see attachments).

see attachments:
datacontrols-component-palette-laz...
search-for-grid-in-component+code-explorer-window-laz...
tools-options-environment-component-palette-data-controls-laz...

I searched "/home/gp/.lazarus/onlinepackagemanager/packages/DBGridController/" directory for "Register" and found:

Code: Bash  [Select][+][-]
  1. $ pwd
  2. ~/.lazarus/onlinepackagemanager/packages/DBGridController
  3. $ egrep Register *
  4. DBGridController.lpk:        <HasRegisterProc Value="True"/>
  5. DBGridController.pas:procedure Register;
  6. DBGridController.pas:  RegisterUnit('dxDBGridController', @dxDBGridController.Register);
  7. DBGridController.pas:  RegisterPackage('DBGridController', @Register);
  8. dxDBGridController.pas:Procedure Register;
  9. dxDBGridController.pas:Procedure Register;
  10. dxDBGridController.pas:   RegisterComponents('Data Controls', [TdxDBGridController]);
  11. ...
  12.  

Here is the heart of the Register code in dxDBGridController.pas:
Code: Pascal  [Select][+][-]
  1. Procedure Register;
  2.  
  3. Implementation
  4.  
  5. Procedure Register;
  6. Begin
  7.    RegisterComponents('Data Controls', [TdxDBGridController]);
  8. End;
  9.  


____ VERSION INFO
Lazarus: 4.2.0
Free Pascal: 3.2.2
DBGridController: 1.0.3
OS: MX-Linux 23
Linux nyx 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64 GNU/Linux

____ ATTACHMENTS
datacontrols-component-palette-laz...
dbgridcontroller-pkg-status-laz-OPM-scrcap...
search-for-grid-in-component+code-explorer-window-laz...
tools-options-environment-component-palette-data-controls-laz...
« Last Edit: September 18, 2025, 07:09:21 pm by gponym »

wp

  • Hero Member
  • *****
  • Posts: 13213
Re: Installed package DBGridController but component not showing in IDE
« Reply #1 on: September 16, 2025, 06:58:32 pm »
I just installed the DBGridController from OPM into Laz 4.2 (Windows), and the component appears on the "Data Controls" palette (BTW, you can find out in the "RegisterComponents" call)

n7800

  • Hero Member
  • *****
  • Posts: 554
  • Lazarus IDE contributor
    • GitLab profile
Re: Installed package DBGridController but component not showing in IDE
« Reply #2 on: September 17, 2025, 01:58:56 am »
Reminds of this problem: https://forum.lazarus.freepascal.org/index.php?topic=71362

There are two possible solutions (resetting the palette settings and marking the unit as registered), perhaps this will help.

wp

  • Hero Member
  • *****
  • Posts: 13213
Re: Installed package DBGridController but component not showing in IDE
« Reply #3 on: September 17, 2025, 09:20:32 am »
marking the unit as registered
What does this mean? The package type is marked as "Designtime and runtime", the component unit (dxDBGridController.pas) does contain a registration procedure Register, it is marked by the green triangle in the package editor, and there is a package unit dbgridcontroller.pas. I don't know of any other errors that I've made for failed component registration.

I tested installation of the package under MX Linux 23.5 --> the DBGridController component does appear on the DBControls palette as expected.

So far I have seen components disappearing from the palette only some time after I had dragged components to a different palette in "Tools" > "Options" > "Component palette". In this case clicking "Restore defaults" on the same page helped to make them reappear (this probably is what you call "reset palette settings")

WooBean

  • Sr. Member
  • ****
  • Posts: 299
Re: Installed package DBGridController but component not showing in IDE
« Reply #4 on: September 17, 2025, 11:20:05 am »
Only a picture - I am trying to understand what is unclear.
Platforms: Win7/64, Linux Mint 22.1 Xia

wp

  • Hero Member
  • *****
  • Posts: 13213
Re: Installed package DBGridController but component not showing in IDE
« Reply #5 on: September 17, 2025, 12:21:48 pm »
Yes, but that's checked in the DBGridController package (and without it, there would not be a green arrow in the icon of the unit containing the Register call).

n7800

  • Hero Member
  • *****
  • Posts: 554
  • Lazarus IDE contributor
    • GitLab profile
Re: Installed package DBGridController but component not showing in IDE
« Reply #6 on: September 17, 2025, 03:31:14 pm »
marking the unit as registered
What does this mean? The package type is marked as "Designtime and runtime", the component unit (dxDBGridController.pas) does contain a registration procedure Register, it is marked by the green triangle in the package editor, and there is a package unit dbgridcontroller.pas.

Yes, in the topic I linked, there was an issue with the "Register unit" checkbox. In that thread, like some other users, I also successfully installed the package. And I also saw the "Register unit" checkbox checked.

However, for some reason, the user didn't have that checkbox checked... So I assumed there was some issue with it, possibly related to this topic.

gponym

  • Newbie
  • Posts: 3
Re: Installed package DBGridController but component not showing in IDE
« Reply #7 on: September 17, 2025, 03:40:56 pm »
Thank you!  That worked - now see the icon in Data Controls palette!

Unfortunately, I did not perform a controlled test.   :(  I'd like to know what had gone wrong.  Shucks.

File listing shows that these files changed at the same moment I did "Reset Defaults" in Tools / Options... / Environment / Component Palette" .  However I looked at each file in vain to discover a relevant reference to DBGridController.
Code: Bash  [Select][+][-]
  1. -rw-r--r--  1 gp gp    139 Sep 17 08:26 anchordockingoptions.xml
  2. -rw-r--r--  1 gp gp  11776 Sep 17 08:26 jcfsettings.cfg
  3. -rw-r--r--  1 gp gp    326 Sep 17 08:26 helpoptions.xml
  4. -rw-r--r--  1 gp gp    126 Sep 17 08:26 codetoolsoptions.xml
  5. -rw-r--r--  1 gp gp    803 Sep 17 08:26 codeexploreroptions.xml
  6.  


Reminds of this problem: https://forum.lazarus.freepascal.org/index.php?topic=71362

There are two possible solutions (resetting the palette settings and marking the unit as registered), perhaps this will help.

 

TinyPortal © 2005-2018