Recent

Author Topic: [Solved] Visual component not appearing on palette  (Read 5331 times)

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 618
    • Double Dummy Solver - free download
[Solved] Visual component not appearing on palette
« on: October 25, 2023, 07:00:45 pm »
After years creating visual components, I'm now unable! My component does not appear on the palette. I've attached a simple descendent of a stringgrid component that is not working. Please - any ideas?
« Last Edit: October 26, 2023, 06:33:01 pm by bobonwhidbey »
Lazarus 3.8 FPC 3.2.2 x86_64-win64-win32/win64

wp

  • Hero Member
  • *****
  • Posts: 12905
Re: Visual component not appearing on palette
« Reply #1 on: October 25, 2023, 07:35:14 pm »
It depends on the package. You must add the unit to a package. Since your unit contains the registration procedure, you must check the "Register unit" box in the package editor; the unit's icon then gets a green right-ward arrow. - See the attached screenshot of the SynEdit package.

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 618
    • Double Dummy Solver - free download
Re: Visual component not appearing on palette
« Reply #2 on: October 25, 2023, 07:56:45 pm »
I think I've done that correctly.
Lazarus 3.8 FPC 3.2.2 x86_64-win64-win32/win64

wp

  • Hero Member
  • *****
  • Posts: 12905
Re: Visual component not appearing on palette
« Reply #3 on: October 25, 2023, 11:43:48 pm »
It is working here...

Well, maybe this one: If you rearranged the icons in the component palette in some way, the component palette may behave strangely. In this case, it helps to restore it to defaults (Tools > IDE Options > Editor Toolbar > Restore Defaults)

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 618
    • Double Dummy Solver - free download
Re: Visual component not appearing on palette
« Reply #4 on: October 26, 2023, 02:28:22 am »
Thanks for trying WP. No luck :(  I also tried moving the palette page but still no success.
Lazarus 3.8 FPC 3.2.2 x86_64-win64-win32/win64

Handoko

  • Hero Member
  • *****
  • Posts: 5458
  • My goal: build my own game engine using Lazarus
Re: Visual component not appearing on palette
« Reply #5 on: October 26, 2023, 04:09:57 am »
After making TStringGrid1 a package TestGrid.lpk, it works. Tested on Ubuntu 23.04 Lazarus 2.2.6.

Have you make it a package?
Lazarus main menu > Package > New Package

Or you can download and try package I made TestGrid.lpk.

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 618
    • Double Dummy Solver - free download
Re: Visual component not appearing on palette
« Reply #6 on: October 26, 2023, 05:12:26 am »
Still not working. All compiles fine but the component is not on any palette. Formerly I had just added this component to another package that had 32 files in it. I was hoping there might have been a file limitation. Of course this new package only has the one file in it.
« Last Edit: October 26, 2023, 05:14:17 am by bobonwhidbey »
Lazarus 3.8 FPC 3.2.2 x86_64-win64-win32/win64

Handoko

  • Hero Member
  • *****
  • Posts: 5458
  • My goal: build my own game engine using Lazarus
Re: Visual component not appearing on palette
« Reply #7 on: October 26, 2023, 05:47:09 am »
After the compiling you need to install the package:
In the package window > Use > Install

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 618
    • Double Dummy Solver - free download
Re: Visual component not appearing on palette
« Reply #8 on: October 26, 2023, 06:12:19 am »
yes - I did that
Lazarus 3.8 FPC 3.2.2 x86_64-win64-win32/win64

balazsszekely

  • Guest
Re: Visual component not appearing on palette
« Reply #9 on: October 26, 2023, 07:13:05 am »
You most likely already registered a component named TStringGrid1. Each component name must be unique. Try TStringGridEx instead:
Code: Pascal  [Select][+][-]
  1. procedure Register;
  2. begin
  3.   RegisterComponents('Bridge', [TStringGridEx]);
  4. end;

PS: If still not works, please attach the whole package.

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 618
    • Double Dummy Solver - free download
Re: Visual component not appearing on palette
« Reply #10 on: October 26, 2023, 05:22:31 pm »
Still no luck.  After I install the package all seems to go as expected, but the component does not appear on the Bridge page. I think there must be some Option that I've inadvertently clicked. I've made about a dozen visual components over the years and have never had this problem. Zip attached. I think this includes all that's necessary.
« Last Edit: October 26, 2023, 05:24:02 pm by bobonwhidbey »
Lazarus 3.8 FPC 3.2.2 x86_64-win64-win32/win64

Handoko

  • Hero Member
  • *****
  • Posts: 5458
  • My goal: build my own game engine using Lazarus
Re: Visual component not appearing on palette
« Reply #11 on: October 26, 2023, 05:43:29 pm »
No problem here, tested on Lazarus 2.2.6 Ubuntu Mate 23.04.
What are the OS and the version of Lazarus you using?

Can you find a new computer, your friend's computer perhaps? So you can test install Lazarus and the package.

If it works on other's computer but not on yours, if I were you I would do these:
1. Perform a clean installation of your Lazarus (totally remove and reinstall Lazarus)
2. Make sure the computer is virus free
3. Make sure its harddisk is fault free (run a disk test)
« Last Edit: October 26, 2023, 05:51:18 pm by Handoko »

wp

  • Hero Member
  • *****
  • Posts: 12905
Re: Visual component not appearing on palette
« Reply #12 on: October 26, 2023, 06:16:42 pm »
Rather than going to another computer you could first reset your configuration folder where the IDE stores all its settings. Obviously something strange has krept in, usually by user interaction which is forgotten later (very typical for me...; I do not believe that the Lazarus/FPC binaries have become defective). Go to "View" > "IDE Internals" > "About IDE" and find the name of the config folder in the line "Primary config directory". Close the IDE and rename this folder. Restart the IDE which will use default settings now (in order words: all your own settings, installed components etc will be gone; there may be an error message that installed component sources cannot be found - this is clear because the IDE now does not know them). Now install your new stringgrid - it should work, well, it MUST work... (If it does work reinstate your old settings, possibly one by one so that you can find out which one caused the issue).

If it does not work you still can create a separate Lazarus installation independent of your old one. You seem to be on Windows, and here you can select "Create a new secondary installation" on the 2nd page of the installer; in the "Select configuration folder" specify a name for a new config directory (the one that you renamed in the previous paragraph) - select a new empty folder so that both installations remain separate. And remove the checkmarks from all options for registration file types with Windows. Now you have a completely independent Lazarus installation - I have more than a dozen of them...

bobonwhidbey

  • Hero Member
  • *****
  • Posts: 618
    • Double Dummy Solver - free download
Re: Visual component not appearing on palette
« Reply #13 on: October 26, 2023, 06:32:25 pm »
I re-installed a new version after first uninstalling the old one. All seems to be working fine so it seems clear that I messed up a setting - some way. Now I need to re-install all my custom components.

Thanks everyone for your help.
Lazarus 3.8 FPC 3.2.2 x86_64-win64-win32/win64

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4596
  • I like bugs.
Re: Visual component not appearing on palette
« Reply #14 on: October 27, 2023, 06:11:07 pm »
I re-installed a new version after first uninstalling the old one. All seems to be working fine so it seems clear that I messed up a setting - some way. Now I need to re-install all my custom components.
Maybe install Lazarus 3.0 at the same go. IMO it should be released already. It has no show-stopper bugs and is surely better than 2.6.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018