Skip to content

Instantly share code, notes, and snippets.

Created October 10, 2013 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6917817 to your computer and use it in GitHub Desktop.
Save anonymous/6917817 to your computer and use it in GitHub Desktop.
TPanelTouchTime Componente delphi para el manejo de horas en pantallas Táctil
unit MiPanelTouchHour;
//***************************************************
// JLGT 08/10/2013 Para horas en pantallas tactil
//***************************************************
interface
uses
SysUtils, Classes, Controls, ExtCtrls, Stdctrls, Windows, Graphics, Math, Forms, Buttons, Dialogs;
type //Creamos los Tipos necesarios
TSeparation = 0..2;
TModel12_24 = (Hour_12,Hour_24);
TPanelTouchTime = class(TPanel)
private
FSpace : TSeparation; //Espacio de separación entre contadores y botones
FValue : String; //Valor que devuelve
FTipo : TModel12_24; //Mostramos 12 o 24 horas
FImagenUp : TPicture;
FImagenDown : TPicture;
FTimeIn : TTime;
FAllTransparent : Boolean;
FValidar : Boolean;
FOnTimeChange : TNotifyEvent;
FOnButonUpClick : TNotifyEvent;
FOnButtonDownClick : TNotifyEvent;
FColorFondoNumbers : TColor;
//Variables de uso
Fhour1,Fhour2,FSeparador1,FMin1,Fmin2,Fseparador2,FSec1,Fsec2: TLabel; //Corresponden a 88:88:88
Fbutup1,Fbutup2,Fbutup3,Fbutup4,Fbutup5,Fbutup6:TImage; //Botones para subir
FButDown1,FButDown2,FButDown3,FButDown4,FButDown5,FButDown6: TImage; //Botones para bajar
procedure setSpace(const Value:TSeparation);
procedure setValue(const Value:String);
procedure setTipo(const value:TModel12_24);
procedure setImagenUp(const Value:TPicture);
procedure setImagenDown(const Value:TPicture);
procedure setTimeIn(const Value:TTime);
procedure setAllTransparent(const Value:Boolean);
procedure setValidar(const Value:Boolean);
procedure TimeChange(Sender : TObject); virtual;
procedure setColorFondoNumbers(const Value:TColor);
protected
{ Protected declarations }
//////////////////////////////////////////////////////////////
procedure Paint();override; //Sobre escribe el pintado del panel
procedure UpClick (Sender: TObject); virtual;
procedure DownClick (Sender: TObject); virtual;
procedure validarHora(Hora:string);
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
destructor Destroy(); override;
published
property OnButtonUpClick :TNotifyEvent read FOnButonUpClick write FOnButonUpClick;
property OnButtonDownClick :TNotifyEvent read FOnButtonDownClick write FOnButtonDownClick;
property Space :TSeparation read FSpace write SetSpace;
property Value :String read FValue write SetValue;
property ImagenUp :TPicture read FImagenUp write SetImagenUp;
property ImagenDown :TPicture read FImagenDown write SetImagenDown;
property TimeIn :TTime read FTimeIn write setTimeIn;
property AllTransparent :Boolean read FAllTransparent write setAllTransparent;
property Validar :Boolean read FValidar write SetValidar;
property OnTimeChange :TNotifyEvent read FOnTimeChange write FOnTimeChange;
property ColorFondoNumbers :TColor read FColorFondoNumbers write SetColorFondoNumbers;
property Tipo :TModel12_24 read FTipo write setTipo;
end;
procedure Register;
var VarCambio:Boolean;
implementation
procedure Register;
begin
RegisterComponents('Touch', [TPanelTouchTime]);
end;
{ TPanelTouchTime }
constructor TPanelTouchTime.Create(AOwner: TComponent);
begin
inherited;
FSpace :=1;
FValue :='';
FImagenUp :=TPicture.Create;
FImagenDown :=TPicture.Create;
Width :=315;
Height :=130;
FTimeIn :=Now;
VarCambio :=false;
Caption :=' ';
FAllTransparent :=True;
FValidar :=True;
FColorFondoNumbers :=clBtnFace;
FTipo :=Hour_12;
//-------------------------------------[ H O R A S ]---------------------------------
Fbutup1 :=TImage.Create(Self);
with Fbutup1 do begin
Parent:=Self;
Left:=11;
Width:=35;
Height:=35;
Top:=11;
Picture:=FImagenUp;
Center:=True;
Proportional:=True;
Transparent:=FAllTransparent;
Stretch:=True;
OnClick:=UpClick;
end;
Fhour1 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente
with Fhour1 do begin
Parent := self; //Lo emparentamos al panel
Width:=35;
Height:=35;
Top := 47; //
Left := 11; ///
Font := Self.Font;
ParentColor:=False;
Transparent:=FAllTransparent;
AutoSize:=False;
ParentFont:=False;
Ctl3D:=false;
Alignment:=taCenter;
Layout:=tlCenter;
Caption := Copy(TimeToStr(FTimeIn),1,1); //
end;
FButDown1 :=TImage.Create(Self);
with FButDown1 do begin
Parent:=Self;
Left:=11;
Width:=35;
Height:=35;
Top:=85;
Picture:=FImagenDown;
Center:=True;
Proportional:=True;
Transparent:=FAllTransparent;
Stretch:=True;
OnClick:=DownClick;
end;
Fbutup2 :=TImage.Create(Self);
with Fbutup2 do begin
Parent:=Self;
Left:=48;
Width:=35;
Height:=35;
Top:=11;
Picture:=FImagenUp;
Center:=True;
Proportional:=True;
Transparent:=FAllTransparent;
Stretch:=True;
OnClick:=UpClick;
end;
Fhour2 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente
with Fhour2 do begin
Parent := self; //Lo emparentamos al panel
Top := 48; //
Width:=35;
Height:=35;
Font := Self.Font;
ParentColor:=False;
Transparent:=FAllTransparent;
AutoSize:=False;
Alignment:=taCenter;
Layout:=tlCenter;
Left := 48; ///
Caption := Copy(TimeToStr(FTimeIn),2,1); //
end;
FButDown2 :=TImage.Create(Self);
with FButDown2 do begin
Parent:=Self;
Left:=48;
Width:=35;
Height:=35;
Top:=85;
Picture:=FImagenDown;
Center:=True;
Proportional:=True;
Transparent:=FAllTransparent;
Stretch:=True;
OnClick:=DownClick;
end;
//-------------------------------------[ P R I M E R S E P A R A D O R ]---------------------------------
FSeparador1 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente
with FSeparador1 do begin
Parent := self; //Lo emparentamos al panel
Top := 48; //
Width:=35;
Height:=35;
Left :=85 ; ///
ParentColor:=False;
Font := Self.Font;
Transparent:=FAllTransparent;
AutoSize:=False;
Alignment:=taCenter;
Layout:=tlCenter;
Caption := Copy(TimeToStr(FTimeIn),3,1); //
end; //-------------------------------------------Fin primer separador
//-------------------------------------[ M I N U T O S ]---------------------------------
Fbutup3 :=TImage.Create(Self);
with Fbutup3 do begin
Parent:=Self;
Left:=122;
Width:=35;
Height:=35;
Top:=11;
Picture:=FImagenUp;
Center:=True;
Proportional:=True;
Transparent:=FAllTransparent;
Stretch:=True;
OnClick:=UpClick;
end;
FMin1 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente
with FMin1 do begin
Parent := self; //Lo emparentamos al panel
Top := 48; //
Width:=35;
Height:=35;
Left := 122; ///
Font := Self.Font;
ParentColor:=False;
Transparent:=FAllTransparent;
AutoSize:=False;
Alignment:=taCenter;
Layout:=tlCenter;
Caption := Copy(TimeToStr(FTimeIn),4,1); //
end;
FButDown3 :=TImage.Create(Self);
with FButDown3 do begin
Parent:=Self;
Left:=122;
Width:=35;
Height:=35;
Top:=85;
Picture:=FImagenDown;
Center:=True;
Proportional:=True;
Transparent:=FAllTransparent;
Stretch:=True;
OnClick:=DownClick;
end;
Fbutup4 :=TImage.Create(Self);
with Fbutup4 do begin
Parent:=Self;
Left:=159;
Width:=35;
Height:=35;
Top:=11;
Picture:=FImagenUp;
Center:=True;
Proportional:=True;
Transparent:=FAllTransparent;
Stretch:=True;
OnClick:=UpClick;
end;
Fmin2 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente
with Fmin2 do begin
Parent := self; //Lo emparentamos al panel
Top := 48; //
Width:=35;
Height:=35;
Left := 159; ///
Font := Self.Font;
ParentColor:=False;
Transparent:=FAllTransparent;
AutoSize:=False;
Alignment:=taCenter;
Layout:=tlCenter;
Caption := Copy(TimeToStr(FTimeIn),5,1); //
end;
FButDown4 :=TImage.Create(Self);
with FButDown4 do begin
Parent:=Self;
Left:=159;
Width:=35;
Height:=35;
Top:=85;
Picture:=FImagenDown;
Center:=True;
Proportional:=True;
Transparent:=FAllTransparent;
Stretch:=True;
OnClick:=DownClick;
end;
//-------------------------------------[ S E G U N D O S E P A R A D O R ]---------------------------------
Fseparador2 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente
with Fseparador2 do begin
Parent := self; //Lo emparentamos al panel
Top := 48; //
Width:=35;
Height:=35;
Left := 196; ///
Font := Self.Font;
ParentColor:=False;
Transparent:=FAllTransparent;
AutoSize:=False;
Alignment:=taCenter;
Layout:=tlCenter;
Caption := Copy(TimeToStr(FTimeIn),6,1); //
end; //-------------------------------------------Fin segundo separador
//-------------------------------------[ S E G U N D O S ]---------------------------------
Fbutup5 :=TImage.Create(Self);
with Fbutup5 do begin
Parent:=Self;
Left:=233;
Width:=35;
Height:=35;
Top:=11;
Picture:=FImagenUp;
Center:=True;
Proportional:=True;
Transparent:=FAllTransparent;
Stretch:=True;
OnClick:=UpClick;
end;
FSec1 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente
with FSec1 do begin
Parent := self; //Lo emparentamos al panel
Top := 47; //
Width:=35;
Height:=35;
Left := 233; ///
Font := Self.Font;
ParentColor:=False;
Transparent:=FAllTransparent;
AutoSize:=False;
Alignment:=taCenter;
Layout:=tlCenter;
Caption := Copy(TimeToStr(FTimeIn),7,1); //
end;
FButDown5 :=TImage.Create(Self);
with FButDown5 do begin
Parent:=Self;
Left:=233;
Width:=35;
Height:=35;
Top:=83;
Picture:=FImagenDown;
Center:=True;
Proportional:=True;
Transparent:=FAllTransparent;
Stretch:=True;
OnClick:=DownClick;
end;
Fbutup6 :=TImage.Create(Self);
with Fbutup6 do begin
Parent:=Self;
Left:=270;
Width:=35;
Height:=35;
Top:=11;
Picture:=FImagenUp;
Center:=True;
Proportional:=True;
Transparent:=FAllTransparent;
Stretch:=True;
OnClick:=UpClick;
end;
Fsec2 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente
with Fsec2 do begin
Parent := self; //Lo emparentamos al panel
Top := 47; //
Width:=35;
Height:=35;
Left := 270; ///
Font := Self.Font;
ParentColor:=False;
Transparent:=FAllTransparent;
AutoSize:=False;
Alignment:=taCenter;
Layout:=tlCenter;
Caption := Copy(TimeToStr(FTimeIn),8,1); //
end;
FButDown6 :=TImage.Create(Self);
with FButDown6 do begin
Parent:=Self;
Left:=270;
Width:=35;
Height:=35;
Top:=83;
Picture:=FImagenDown;
Center:=True;
Proportional:=True;
Transparent:=FAllTransparent;
Stretch:=True;
OnClick:=DownClick;
end;
end;
procedure TPanelTouchTime.TimeChange(Sender: TObject);
//------------------------------------------------------------------------------
//***********************************************************[ TimeChage ]****
//------------------------------------------------------------------------------
begin
if Assigned(FOnTimeChange) then FOnTimeChange(Sender);
end;
destructor TPanelTouchTime.Destroy;
begin
FImagenUp.Free;
FImagenDown.Free;
Fhour1.Free;
Fhour2.Free;
FSeparador1.Free;
FMin1.Free;
Fmin2.Free;
Fseparador2.Free;
FSec1.Free;
Fsec2.Free;
Fbutup1.Free;
Fbutup2.Free;
Fbutup3.Free;
Fbutup4.Free;
Fbutup5.Free;
Fbutup6.Free;
FButDown1.Free;
FButDown2.Free;
FButDown3.Free;
FButDown4.Free;
FButDown5.Free;
FButDown6.Free;
inherited;
end;
procedure TPanelTouchTime.Paint;
//------------------------------------------------------------------------------
//*****************************************************************[ PAINT ]****
//------------------------------------------------------------------------------
var imagen:TImage;
dd,du,s1,md,mu,s2,am,ac:Integer; //posiciones horzontales
a1,a2,a3:Integer; //Altos
ElCaption:string;
VarMHora:TTime;
begin
inherited;
if VarCambio=false then
begin
if FTipo=Hour_24 then
begin
VarMHora:=StrToTime(FormatDateTime('hh:nn:ss AM/PM',FTimeIn));
end else VarMHora:=StrToTime(FormatDateTime('hh:nn:ss',FTimeIn));
Fhour1.Caption:=Copy(TimeToStr(VarMHora),1,1);
Fhour2.Caption:=Copy(TimeToStr(VarMHora),2,1);
FSeparador1.Caption:=Copy(TimeToStr(VarMHora),3,1);
FMin1.Caption:=Copy(TimeToStr(VarMHora),4,1);
Fmin2.Caption:=Copy(TimeToStr(VarMHora),5,1);
Fseparador2.Caption:=Copy(TimeToStr(VarMHora),6,1);
FSec1.Caption:=Copy(TimeToStr(VarMHora),7,1);
Fsec2.Caption:=Copy(TimeToStr(VarMHora),8,1);
validarhora(Fhour1.Caption+Fhour2.Caption+FSeparador1.Caption+
FMin1.Caption+Fmin2.Caption+Fseparador2.Caption+
FSec1.Caption+Fsec2.Caption);
dd:=11;
a1:=11;
case Space of
0:begin
du:=47;
s1:=83;
md:=119;
mu:=155;
s2:=191;
am:=227;
ac:=263;
a2:=47;
a3:=83;
Width:=308;
Height:=128;
end;
1:begin
du:=48;
s1:=85;
md:=122;
mu:=159;
s2:=196;
am:=233;
ac:=270;
a2:=48;
a3:=85;
Width:=315;
Height:=130;
end;
2:begin
du:=49;
s1:=87;
md:=125;
mu:=163;
s2:=201;
am:=239;
ac:=277;
a2:=49;
a3:=87;
Width:=322;
Height:=132;
end;
end;
with Fbutup1 do begin
Picture:=FImagenUp;
Transparent:=FAllTransparent;
Top:=a1;
Left:=dd
end;
with Fhour1 do begin
Transparent:=FAllTransparent;
Color:=FColorFondoNumbers;
Font:=Self.Font;
Top:=a2;
Left:=dd;
end;
with FButDown1 do begin
Picture:=FImagenDown;
Transparent:=FAllTransparent;
Top:=a3;
Left:=dd
end;
with Fbutup2 do begin
Picture:=FImagenUp;
Transparent:=FAllTransparent;
Top:=a1;
Left:=du
end;
with Fhour2 do begin
Transparent:=FAllTransparent;
Color:=FColorFondoNumbers;
Font:=Self.Font;
Top:=a2;
Left:=du;
end;
with FButDown2 do begin
Picture:=FImagenDown;
Transparent:=FAllTransparent;
Top:=a3;
Left:=du
end;
with FSeparador1 do begin
Transparent:=FAllTransparent;
Color:=FColorFondoNumbers;
Font:=Self.Font;
Top:=a2;
Left:=s1;
end;
with Fbutup3 do begin
Picture:=FImagenUp;
Transparent:=FAllTransparent;
Top:=a1;
Left:=md;
end;
with FMin1 do begin
Transparent:=FAllTransparent;
Color:=FColorFondoNumbers;
Font:=Self.Font;
Top:=a2;
Left:=md;
end;
with FButDown3 do begin
Picture:=FImagenDown;
Transparent:=FAllTransparent;
Top:=a3;
Left:=md;
end;
with Fbutup4 do begin
Picture:=FImagenUp;
Transparent:=FAllTransparent;
Top:=a1;
Left:=mu;
end;
with Fmin2 do begin
Transparent:=FAllTransparent;
Color:=FColorFondoNumbers;
Font:=Self.Font;
Top:=a2;
Left:=mu;
end;
with FButDown4 do begin
Picture:=FImagenDown;
Transparent:=FAllTransparent;
Top:=a3;
Left:=mu;
end;
with FSeparador2 do begin
Transparent:=FAllTransparent;
Color:=FColorFondoNumbers;
Font:=Self.Font;
Top:=a2;
Left:=s2;
end;
with Fbutup5 do begin
Picture:=FImagenUp;
Transparent:=FAllTransparent;
Top:=a1;
Left:=am;
end;
with FSec1 do begin
Transparent:=FAllTransparent;
Color:=FColorFondoNumbers;
Font:=Self.Font;
Top:=a2;
Left:=am;
end;
with FButDown5 do begin
Picture:=FImagenDown;
Transparent:=FAllTransparent;
Top:=a3;
Left:=am;
end;
with Fbutup6 do begin
Picture:=FImagenUp;
Transparent:=FAllTransparent;
Top:=a1;
Left:=ac;
end;
with Fsec2 do begin
Transparent:=FAllTransparent;
Color:=FColorFondoNumbers;
Font:=Self.Font;
Top:=a2;
Left:=ac;
end;
with FButDown6 do begin
Picture:=FImagenDown;
Transparent:=FAllTransparent;
Top:=a3;
Left:=ac;
end;
VarCambio:=True;
end;
end;
procedure TPanelTouchTime.setSpace(const Value: TSeparation);
//------------------------------------------------------------------------------
//*****************************************************************[ SPACE ]****
//------------------------------------------------------------------------------
begin
if FSpace<>value then FSpace:=Value;
VarCambio:=False;
Invalidate;
End;
procedure TPanelTouchTime.SetValue(const Value: String);
//------------------------------------------------------------------------------
//*****************************************************************[ VALUE ]****
//------------------------------------------------------------------------------
begin
if FValue<>value then FValue:=Value;
VarCambio:=False;
Invalidate;
End;
function Numerovalido(Mvalue,tipo:Integer;up:Boolean=True):string;
//------------------------------------------------------------------------------
//**********************************************************[ Numerovalido ]****
//------------------------------------------------------------------------------
begin //0:= para 0-2 (dias) 1:=0..1 (meses) 2:=0..9 (Para el resto)
if up then
begin
case tipo of
0:if Mvalue>=2 then Mvalue:=0 else Mvalue:=Mvalue+1;
1:if Mvalue>=5 then Mvalue:=0 else Mvalue:=Mvalue+1;
2:if Mvalue>=9 then Mvalue:=0 else Mvalue:=Mvalue+1;
end;
end;
if up=false then
begin
case tipo of
0:if Mvalue<=0 then Mvalue:=2 else Mvalue:=Mvalue-1;
1:if Mvalue<=0 then Mvalue:=5 else Mvalue:=Mvalue-1;
2:if Mvalue<=0 then Mvalue:=9 else Mvalue:=Mvalue-1;
end;
end;
Result:=IntToStr(Mvalue);
end;
procedure TPanelTouchTime.UpClick(Sender: TObject);
//------------------------------------------------------------------------------
//*************************************************************[ UPCLICK ]****
//------------------------------------------------------------------------------
begin
if Sender=Fbutup1 then Fhour1.Caption:=Numerovalido(StrToInt(Fhour1.Caption),0);
if Sender=Fbutup2 then Fhour2.Caption:=Numerovalido(StrToInt(Fhour2.Caption),2);
if Sender=Fbutup3 then FMin1.Caption:=Numerovalido(StrToInt(FMin1.Caption),1);
if Sender=Fbutup4 then Fmin2.Caption:=Numerovalido(StrToInt(Fmin2.Caption),2);
if Sender=Fbutup5 then FSec1.Caption:=Numerovalido(StrToInt(FSec1.Caption),1);
if Sender=Fbutup6 then Fsec2.Caption:=Numerovalido(StrToInt(Fsec2.Caption),2);
validarhora(Fhour1.Caption+Fhour2.Caption+FSeparador1.Caption+
FMin1.Caption+Fmin2.Caption+Fseparador2.Caption+
FSec1.Caption+Fsec2.Caption);
if Assigned(FOnButonUpClick) then FOnButonUpClick(Sender);
end;
procedure TPanelTouchTime.validarHora(Hora: string);
//------------------------------------------------------------------------------
//**********************************************************[ validarfecha ]****
//------------------------------------------------------------------------------
var xHora:TTime;
begin
if FValidar then
begin
try
xHora:=StrToTime(hora);
FValue:=TimeToStr(xHora);
TimeChange(Self);
except
Case Application.MessageBox(pchar( 'La hora introducida no es valida'+#13#10
+#13#10+'¿Desea usar la hora actual?' +#13#10),pchar('hora no valida'),4+16+0)of
6:begin
FValue:=TimeToStr(Now); //Si
Fhour1.Caption:=Copy(TimeToStr(now),1,1);
Fhour2.Caption:=Copy(TimeToStr(now),2,1);
FSeparador1.Caption:=Copy(TimeToStr(now),3,1);
FMin1.Caption:=Copy(TimeToStr(now),4,1);
Fmin2.Caption:=Copy(TimeToStr(now),5,1);
Fseparador2.Caption:=Copy(TimeToStr(now),6,1);
FSec1.Caption:=Copy(TimeToStr(now),7,1);
Fsec2.Caption:=Copy(TimeToStr(now),8,1);
TimeChange(Self);
end;
end;
end;
end else TimeChange(Self);
end;
procedure TPanelTouchTime.DownClick(Sender: TObject);
//------------------------------------------------------------------------------
//***********************************************************[ DownClick ]****
//------------------------------------------------------------------------------
begin
if Sender=FButDown1 then Fhour1.Caption:=Numerovalido(StrToInt(Fhour1.Caption),0, False);
if Sender=FButDown2 then Fhour2.Caption:=Numerovalido(StrToInt(Fhour2.Caption),2, False);
if Sender=FButDown3 then FMin1.Caption:=Numerovalido(StrToInt(FMin1.Caption),1, False);
if Sender=FButDown4 then Fmin2.Caption:=Numerovalido(StrToInt(Fmin2.Caption),2, False);
if Sender=FButDown5 then FSec1.Caption:=Numerovalido(StrToInt(FSec1.Caption),1, False);
if Sender=FButDown6 then Fsec2.Caption:=Numerovalido(StrToInt(Fsec2.Caption),2, False);
validarhora(Fhour1.Caption+Fhour2.Caption+FSeparador1.Caption+
FMin1.Caption+Fmin2.Caption+Fseparador2.Caption+
FSec1.Caption+Fsec2.Caption);
if Assigned(FOnButtonDownClick) then FOnButtonDownClick(Sender);
end;
procedure TPanelTouchTime.setTimeIn(const Value: Ttime);
//------------------------------------------------------------------------------
//****************************************************************[ TimeIn ]****
//------------------------------------------------------------------------------
var VarMHora:TTime;
begin
if FTimeIn<>Value then
begin
FtimeIn:=Value;
if FTipo=Hour_24 then
begin
VarMHora:=StrToTime(FormatDateTime('hh:nn:ss AM/PM',FTimeIn));
end else VarMHora:=StrToTime(FormatDateTime('hh:nn:ss',FTimeIn));
Fhour1.Caption:=Copy(TimeToStr(VarMHora),1,1);
Fhour2.Caption:=Copy(TimeToStr(VarMHora),2,1);
FSeparador1.Caption:=Copy(TimeToStr(VarMHora),3,1);
FMin1.Caption:=Copy(TimeToStr(VarMHora),4,1);
Fmin2.Caption:=Copy(TimeToStr(VarMHora),5,1);
Fseparador2.Caption:=Copy(TimeToStr(VarMHora),6,1);
FSec1.Caption:=Copy(TimeToStr(VarMHora),7,1);
Fsec2.Caption:=Copy(TimeToStr(VarMHora),8,1);
validarhora(Fhour1.Caption+Fhour2.Caption+FSeparador1.Caption+
FMin1.Caption+Fmin2.Caption+Fseparador2.Caption+
FSec1.Caption+Fsec2.Caption);
VarCambio:=False;
Invalidate;
end;
end;
procedure TPanelTouchTime.setTipo(const value: TModel12_24);
begin
if FTipo<>value then FTipo:=value;
VarCambio:=False;
Invalidate;
end;
procedure TPanelTouchTime.SetAllTransparent(const Value: Boolean);
//------------------------------------------------------------------------------
//***********************************************************[ TRANSPARENT ]****
//------------------------------------------------------------------------------
begin
if FAllTransparent<>value then FAllTransparent:=Value;
VarCambio:=False;
Invalidate;
End;
procedure TPanelTouchTime.SetImagenUp(const Value: TPicture);
//------------------------------------------------------------------------------
//**************************************************************[ IMAGENUP ]****
//------------------------------------------------------------------------------
begin
FImagenUp.Assign(Value);
VarCambio:=False;
Invalidate;
End;
procedure TPanelTouchTime.SetImagenDown(const Value: TPicture);
//------------------------------------------------------------------------------
//************************************************************[ IMAGENDOWN ]****
//------------------------------------------------------------------------------
begin
FImagenDown.Assign(Value);
VarCambio:=False;
Invalidate;
End;
procedure TPanelTouchTime.SetValidar(const Value: Boolean);
//------------------------------------------------------------------------------
//***************************************************************[ VALIDAR ]****
//------------------------------------------------------------------------------
begin
if FValidar<>value then FValidar:=Value;
VarCambio:=False;
Invalidate;
End;
procedure TPanelTouchTime.SetColorFondoNumbers(const Value: TColor);
//------------------------------------------------------------------------------
//*****************************************************************[ COLORFONDONUMBERS ]****
//
//------------------------------------------------------------------------------
begin
if FColorFondoNumbers<>value then FColorFondoNumbers:=Value;
VarCambio:=False;
Invalidate
End;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment