0

I have created a number of non-visual components, and created appropriate bitmaps and added them through Projects|Resources and images. I see the images in the Tool palette and in the structure window, but I get nothing but grab-handles in the forms designer.

I have not really got any code that is relevant. The image below shows what I see

enter image description here

PS I do not have visual components hidden!

Update

Code as requested

uses
  System.SysUtils,
  System.Classes,
  System.Generics.Collections,
  System.IOUtils,
  UnitListComponents,
  FMX.Types,
  FMX.Controls;
  //FMX.Edit,
  //FMX.Listbox;

  TSigFile7BaseProperty = class(TControl)
  private
    ...
  end;

  TSigFile7File = class( TSigFile7BaseProperty )
  private
  protected
  public
  published
    property Text;
    property SaveAsRelativeFileName;
  end;
Dsm
  • 5,870
  • 20
  • 24
  • 1
    Sure there's relevant code. You say they're "non-visual" but I have a feeling that might be a misleading term. Do they descend from a `TControl`? Or directly from a `TComponent`? Can you provide a minimal component definition similar to your problematic ones? I've written a custom control for Firemonkey with no problems at all. – Jerry Dodge Oct 06 '15 at 15:53
  • You didn't show any code – David Heffernan Oct 06 '15 at 18:57
  • @Jerry When I said I have no relevant code I meant that I did not think the code was relevant here. I have modified question to include code. To answer your question, it is descended from TControl. – Dsm Oct 07 '15 at 08:35

1 Answers1

3

The problem is that your component is a descendant from TControl which is the base class for a visual FMX components and not nonvisual components.

For making of nonvisual components you should use TComponent as a base class instead.

Here is a link to a video made by Ray Konopka about creating a custom Fire Monkey components which should provide you with some more information about this topic

http://firemonkeytutorial.com/creating-custom-delphi-firemonkey-components/

PS: When I started making of custom components for the first time I first spent a lot of time studying from which component classes do similar components inherits from.

SilverWarior
  • 7,372
  • 2
  • 16
  • 22
  • Thank you Silver Warrior. I'll try this. I thought that I would need to descend from TFMXObject or lower which TComponent is not, so thank you for correcting that misconception. All of the examples I could find, including the reference you give, are for visual components. Is that because non-visual components are not considered to be Firemonkey, I wonder? – Dsm Oct 08 '15 at 08:10
  • Unfortunately I cannot use TComponent - I need the Children property, but I can use TFMXObject (which certainly, TLang, for example is descended from). This is better, in that a blank square is shown (rather than nothing at all), but I am marking as solved because it at least shows me where I was going wrong. – Dsm Oct 08 '15 at 08:34
  • 1
    Update - My other problem was that I forgot that the top left pixel in a bitmap is taken as the transparency colour.... Now works perfectly. – Dsm Oct 08 '15 at 14:01