From 34a0576d8c35328bf8df640b846201d32e64952e Mon Sep 17 00:00:00 2001 From: cpicanco Date: Mon, 21 Nov 2016 00:15:03 -0300 Subject: [PATCH] add player box visual element --- units/game_visual_elements.pas | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+), 0 deletions(-) create mode 100644 units/game_visual_elements.pas diff --git a/units/game_visual_elements.pas b/units/game_visual_elements.pas new file mode 100644 index 0000000..174a663 --- /dev/null +++ b/units/game_visual_elements.pas @@ -0,0 +1,73 @@ +unit game_visual_elements; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, Controls, StdCtrls, ExtCtrls; + +type + + { TPlayerBox } + + TPlayerBox = class (TGroupBox) + LabelLastColor : TLabel; + PanelLastColor : TPanel; + LabelLastRow : TLabel; + LabelLastRowCount : TLabel; + private + FID: string; + public + constructor Create(AOwner: TComponent;AID:string); reintroduce; + property ID : string read FID write FID; + end; + +resourcestring + CAP_ROW = 'Linhas:'; + CAP_COLOR = 'Cor:'; + CAP_NA = 'NA'; + CAP_WAINTING_FOR_PLAYER = 'Esperando Jogador...'; + +implementation + +{ TPlayerBox } + +constructor TPlayerBox.Create(AOwner: TComponent; AID: string); +begin + inherited Create(AOwner); + FID := AID; + AutoSize := True; + Caption := CAP_WAINTING_FOR_PLAYER; + with ChildSizing do + begin + ControlsPerLine := 2; + EnlargeHorizontal := crsHomogenousChildResize; + HorizontalSpacing := 30; + Layout := cclLeftToRightThenTopToBottom; + LeftRightSpacing := 20; + TopBottomSpacing := 20; + VerticalSpacing := 10; + end; + LabelLastColor := TLabel.Create(Self); + LabelLastColor.Caption := CAP_COLOR; + LabelLastColor.Parent := Self; + + PanelLastColor := TPanel.Create(Self); + PanelLastColor.Caption:=''; + //PanelLastColor.Color:= $0; + PanelLastColor.Parent:= Self; + + LabelLastRow:= TLabel.Create(Self); + LabelLastRow.Caption:=CAP_ROW; + LabelLastRow.Parent := Self; + + LabelLastRow:= TLabel.Create(Self); + LabelLastRow.Caption:=CAP_NA; + LabelLastRow.Parent := Self; + Enabled:= False; + //LabelLastRow.AutoSize := False; +end; + +end. + -- libgit2 0.21.2