clovishulse Posted January 12, 2017 Share Posted January 12, 2017 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; Quote Link to comment Share on other sites More sharing options...
Skepsis IT Posted January 12, 2017 Share Posted January 12, 2017 Hi, you don't need to implement such components because mostly all components of unigui had already a label and you can select where to be placed (top, left etc) Check the properties for label staff Regards Quote Link to comment Share on other sites More sharing options...
clovishulse Posted January 13, 2017 Author Share Posted January 13, 2017 Hi. Yes, I know the label properties. But it's just an example. Should not my example work? Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.