Hi.
I'm building custom components by adding UniLabel's to UniEdit, UniComboBox ...
I have similar components in VCL mode.
In the new components inherited from UniGui at design time the UniLabel components are shown correctly.
But at runtime the UniLabel components are not shown next to the UniEdit, UniComboBox ...
Can someone direct me so that I can evolve with this problem?
Are there any examples that might help me with this problem?
Thanks
Here are examples of source code:
unit CmpTest;
interface
uses
Windows, Messages, Classes, Controls, uniGUIClasses, uniEdit, uniLabel, SysUtils;
type
TCmpTest = class(TUniEdit)
private
FLabelCmp: TUniLabel;
procedure SetLabelPosition;
protected
procedure SetParent(AParent: TWinControl); override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure SetName(const Value: TComponentName); override;
procedure CMVisiblechanged(var Message: TMessage); message CM_VISIBLECHANGED;
procedure CMEnabledchanged(var Message: TMessage); message CM_ENABLEDCHANGED;
procedure CMBidimodechanged(var Message: TMessage); message CM_BIDIMODECHANGED;
public
constructor Create(AOwner: TComponent); override;
procedure SetBounds(ALeft: Integer; ATop: Integer; AWidth: Integer; AHeight: Integer); override;
published
property LabelCmp: TUniLabel read FLabelCmp;
end;
procedure register;
implementation
constructor TCmpTest.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
if not Assigned(FLabelCmp) then
begin
FLabelCmp := TUniLabel.Create(Self);
FLabelCmp.Parent := TWinControl(Self.Owner);
FLabelCmp.FreeNotification(Self);
end;
SetLabelPosition;
end;