Jump to content

Create additional components


leandroavila74
 Share

Recommended Posts

Hello Farshad,

 

need a help, a kind of step by step how to create components that inherit from the current framework.

I tried to do something simple that works perfectly in the Delphi VCL but I know that is different in a UNIGUI and would like to help if possible.

because the code below does not work?

 

Leandro

 

==================================================

 

unit UniPictureGallery;

 

interface

 

uses

SysUtils, Classes, Controls, uniGUIBaseClasses, uniGUIClasses, uniGUITypes,

uniPanel, Graphics;

 

type

TUniPictureGallery = class(TUniPanel)

PanelRight : TUniPanel;

PanelLeft : TUniPanel;

private

protected

public

constructor Create(AOwner: TComponent); override;

published

end;

 

procedure Register;

 

implementation

 

procedure Register;

begin

RegisterComponents('uniGUI Extended', [TUniPictureGallery]);

end;

 

{ TUniPictureGallery }

 

constructor TUniPictureGallery.Create(AOwner: TComponent);

begin

 

inherited Create(AOwner);

 

PanelRight:=TUniPanel.Create(self);

PanelRight.Width:=100;

PanelRight.Align := alRight;

PanelRight.Parent := Self;

 

PanelLeft:=TUniPanel.Create(self);

PanelLeft.Width:=100;

PanelLeft.Align := alLeft;

PanelLeft.Parent := Self;

 

end;

 

end.

Link to comment
Share on other sites

1st question:

 

uniGUI version?

 

I'm using the version 0.85.0.862

 

I made a change and apparently ran into runtime

but in so he does not draw the design that draws on runtime

 

=============================================================

 

constructor TUniPictureGallery.Create(AOwner: TComponent);

begin

 

inherited Create(AOwner);

 

PanelRight:=TUniPanel.Create(self);

PanelRight.Width:=100;

PanelRight.Align := alRight;

PanelRight.Parent := Self;

PanelRight.Color := clwhite;

 

InsertControl(PanelRight);

 

PanelLeft:=TUniPanel.Create(self);

PanelLeft.Width:=100;

PanelLeft.Align := alLeft;

PanelLeft.Parent := Self;

PanelLeft.Color := clyellow;

 

InsertControl(PanelLeft);

 

end;

post-8-0-43926500-1306961338_thumb.jpg

post-8-0-88307200-1306961345_thumb.jpg

post-8-0-38925200-1306961352_thumb.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...