New Issue!!
I've put together three TLabeledEdit Controls plus a Tlabel, inside Tpanel control. I've called the new control, TPanelG3
That is the code:
unit PanelG3;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls;
type
TPanelG3 = class(TPanel)
private
{ Private declarations }
FControlX : TLabeledEdit;
FControlY : TLabeledEdit;
FControlZ : TLabeledEdit;
FControlLabel : TLabel;
protected
{ Protected declarations }
public
{ Public declarations }
constructor Create(AOwner : TComponent) ; override;
destructor Destroy; override;
// property ControlX: TLabeledNumberEdit read FControl1;
// property ControlY: TLabeledNumberEdit read FControl2;
// property ControlZ: TLabeledNumberEdit read FControl3;
published
{ Published declarations }
property ControlX: TLabeledEdit read FControlX;
property ControlY: TLabeledEdit read FControlY;
property ControlZ: TLabeledEdit read FControlZ;
property ControlLabel: TLabel read FControlLabel;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Standard',[TPanelG3]);
end;
constructor TPanelG3.Create(AOwner : TComponent);
begin (* Parametros iniciales de Provisional*)
inherited Create (AOwner);
Height := 136;
Width := 176;
ClientHeight := 132;
ClientWidth := 172;
Constraints.MaxHeight:=136;
Constraints.MaxWidth :=176;
Constraints.MinHeight:=136;
Constraints.MinWidth :=176;
Align := alCustom;
BevelInner := bvLowered;
BevelOuter := bvLowered;
BorderStyle := bsSingle;
(* FControlX - Parametros iniciales del PRIMER Subcontrol dentro de TGRoupBox*)
FControlX:= TLabeledEdit.Create(Self);
FControlX.Parent:= Self;
FControlX.SetSubComponent(true);
FControlX.ControlStyle := FControlX.ControlStyle - [csNoDesignSelectable];
FControlX.Name := 'X';
FControlX.Left := 36;
FControlX.Height := 23;
FControlX.Top := 20;
FControlX.Width := 130;
(* FControlY - Parametros iniciales del SEGUNDO Subcontrol dentro de TGRoupBox*)
FControlY:= TLabeledEdit.Create(Self);
FControlY.Parent:= Self;
FControlY.SetSubComponent(true);
FControlY.ControlStyle := FControlY.ControlStyle - [csNoDesignSelectable];
FControlY.Name := 'Y';
FControlY.Left := 36;
FControlY.Height := 23;
FControlY.Top := 59;
FControlY.Width := 130;
(* FControlZ - Parametros iniciales del TERCER Subcontrol dentro de TGRoupBox*)
FControlZ:= TLabeledEdit.Create(Self);
FControlZ.Parent:= Self;
FControlZ.SetSubComponent(true);
FControlZ.ControlStyle := FControlZ.ControlStyle - [csNoDesignSelectable];
FControlZ.Name := 'Z';
FControlZ.Left := 36;
FControlZ.Height := 23;
FControlZ.Top := 98;
FControlZ.Width := 130;
(* FControlLabel - Parametros iniciales del CUARTO Subcontrol dentro de TGRoupBox*)
FControlLabel:= TLabel.Create(Self);
FControlLabel.Parent:= Self;
FControlLabel.SetSubComponent(true);
FControlLabel.ControlStyle := FControlLabel.ControlStyle - [csNoDesignSelectable];
FControlLabel.Name := 'Etiqueta';
FControlLabel.Left := 129;
FControlLabel.Height := 31;
FControlLabel.Top := -2;
FControlLabel.Width := 37;
FControlLabel.Align := alCustom;
FControlLabel.Alignment := taRightJustify;
FControlLabel.AutoSize := False;
FControlLabel.BidiMode := bdRightToLeftNoAlign;
FControlLabel.Caption := 'XYZ';
FControlLabel.ParentBidiMode := False;
FControlLabel.ParentColor := False;
end;
destructor TPanelG3.Destroy;
begin
FControlLabel.Free;
FControlZ.Free;
FControlY.Free;
FControlX.Free;
inherited Destroy;
end;
end.
I can compile the code without any problems. I can take one/two/.. of these new controls, and I can put them in a new form, without any problems, but when I compile the new form, the IDE hangs up completely, without any error messages.
What's wrong in my code? (If I change TLabeledEdit to TEdit, all works properly. Is my code wrong, or is the TLabeledEdit code, wrong?
Regards