Recent

Author Topic: SpkToolbar Designtime Issues  (Read 6333 times)

wp

  • Hero Member
  • *****
  • Posts: 13578
SpkToolbar Designtime Issues
« on: May 27, 2012, 09:04:49 pm »
When setting up a SpkToolbar at designtime I came across a strange streaming error:

Create a new project and add a TSpkToolbar to the form. Doubleclick on the toolbar and add a tab. Then compile and run. The program will crash with an EClassNotFound exception saying that class TSpkTab is not found. The lfm file is correct, but the member "SpkTab1:TSpkTab" is missing in the declaration of the form. When I add this declaration manually (along with the unit spkt_Tab in which TSpkTab resides) the program runs fine.

Moveover, when I "cut" the SpkToolbar to the clipboard, paste it back into the form, compile and run, the program runs fine also. But now I see in the form declaration two SpkTab members: SpkTab1, SpkTab2.

Any idea what's wrong?

wp

  • Hero Member
  • *****
  • Posts: 13578
Re: SpkToolbar Designtime Issues
« Reply #1 on: May 31, 2012, 10:11:17 pm »
Missing declarations in the form file were due to nameless subcontrols of the SpkToolbar.

After fixing this another issue came up: when controls are added by means of the "contents designer" their corresponding units are not added to the uses clause. Of course this can be done manually, but it is annoying. I've never come across such an issue. What is the correct way how a component achieves that its unit is "used"?

Duplication of controls by "cut&paste" was caused by not deleting them properly in the contents designer. I could fix some of the inconsistencies, but sometimes I end up in a crash of Lazarus. I think some of the problems have their origin in the fact that the owner of the subcontrols (tab, pane, buttons) is not the SpkToolbar, but the owner of the SpkToolbar. In my eyes this is an error-prone design.

I'll do some more tests and then I will post the modified component in its current state.

JD

  • Hero Member
  • *****
  • Posts: 1913
Re: SpkToolbar Designtime Issues
« Reply #2 on: June 02, 2012, 11:04:23 am »
I just tried the SVN version of SpkToolbar and I can confirm the bugs you found. I also had to manually add "spkt_Pane" to my test project's "unit1.pas" uses clause and "SpkPane1: TSpkPane" to the TForm1 class declaration in order to get the panes in the tabs. See screenshot.

The component needs a lot of work. It looks good though.
« Last Edit: June 02, 2012, 11:13:00 am by JD »
Linux Mint - Lazarus 4.6/FPC 3.2.2,
Windows - Lazarus 4.6/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

wp

  • Hero Member
  • *****
  • Posts: 13578
Re: SpkToolbar Designtime Issues
« Reply #3 on: June 02, 2012, 11:47:35 pm »
I just posted a corrected set of units in another thread (http://www.lazarus.freepascal.org/index.php/topic,17126.0.html). The new version finally makes the component editor usable, two tweaks are left, though.

 

TinyPortal © 2005-2018