Created
October 10, 2013 12:49
-
-
Save anonymous/6917794 to your computer and use it in GitHub Desktop.
TPanelTouchDouble Componente delphi para el manejo de fechas en pantallas Táctil
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit MiPanelTouchDouble; | |
//*************************************************** | |
// JLGT 10/10/2013 Para Double en pantallas tactil | |
//*************************************************** | |
interface | |
uses | |
SysUtils, Classes, Controls, ExtCtrls, Stdctrls, Windows, Graphics, Math, Forms, Buttons, Dialogs; | |
type //Creamos los Tipos necesarios | |
TSeparation = 0..5; | |
TNumbersDigit = 1..10; | |
TDdecimals = 0..4; | |
TPanelTouchDouble = class(TPanel) | |
private | |
FSpace : TSeparation; //Espacio de separación entre contadores y botones | |
FValue : String; //Valor que devuelve | |
FRound : Integer; | |
FNumberIn : Double; | |
FNumbersDigit : TNumbersDigit; | |
FImagenUp : TPicture; | |
FImagenDown : TPicture; | |
FAllTransparent : Boolean; | |
FOnChange : TNotifyEvent; | |
FOnButonUpClick : TNotifyEvent; | |
FOnButtonDownClick : TNotifyEvent; | |
FColorFondoNumbers : TColor; | |
FNumbersDecimals : TDdecimals; | |
//Variables de uso | |
FN1,FN2,Fn3,FN4,Fn5,Fn6,Fn7,Fn8,fn9,fn10,fn11,fn12,fn13,fn14,FSeparator: TLabel; | |
Fbutup1,Fbutup2,Fbutup3,Fbutup4,Fbutup5,Fbutup6,Fbutup7,Fbutup8,Fbutup9,Fbutup10,Fbutup11,Fbutup12,Fbutup13,Fbutup14:TImage; //Botones para subir | |
FButDown1,FButDown2,FButDown3,FButDown4,FButDown5,FButDown6,FButDown7,FButDown8,FButDown9,FButDown10,FButDown11,FButDown12,FButDown13,FButDown14: TImage; //Botones para bajar | |
procedure setSpace(const Value:TSeparation); | |
procedure setValue(const Value:String); | |
procedure setNumbersDigit(const value:TNumbersDigit); | |
procedure setImagenUp(const Value:TPicture); | |
procedure setImagenDown(const Value:TPicture); | |
procedure setNumberIn(const Value:Double); | |
procedure setAllTransparent(const Value:Boolean); | |
procedure Change(Sender : TObject); virtual; | |
procedure setColorFondoNumbers(const Value:TColor); | |
procedure setRound(const Value:Integer); | |
procedure setNumbersDecimals(const Value:TDdecimals); | |
protected | |
{ Protected declarations } | |
////////////////////////////////////////////////////////////// | |
procedure Paint();override; //Sobre escribe el pintado del panel | |
procedure UpClick (Sender: TObject); virtual; | |
procedure DownClick (Sender: TObject); virtual; | |
procedure ValorNumero; | |
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 NumberIn :Double read FNumberIn write setNumberIn; | |
property AllTransparent :Boolean read FAllTransparent write setAllTransparent; | |
property OnChange :TNotifyEvent read FOnChange write FOnChange; | |
property ColorFondoNumbers :TColor read FColorFondoNumbers write SetColorFondoNumbers; | |
property NumbersDigit :TNumbersDigit read FNumbersDigit write setNumbersDigit; | |
property Round :Integer read FRound write SetRound; | |
property NumbersDecimals :TDdecimals read FNumbersDecimals write SetNumbersDecimals; | |
end; | |
procedure Register; | |
var VarCambio:Boolean; | |
ValorDouble:Double; | |
implementation | |
procedure Register; | |
begin | |
RegisterComponents('Touch', [TPanelTouchDouble]); | |
end; | |
{ TPanelTouchTime } | |
Function XCeros(text:string;Cant,Decimales:integer):string; | |
var | |
valor,valor2,x,I, dig1, contador:integer; | |
dev,con,cade1,cade2:string; | |
begin | |
con:=''; | |
contador:=0; | |
valor:=length(text); | |
for I := 0 to valor - 1 do if text[i]=',' then contador:=I; | |
valor2:=Valor-Contador; | |
cade1:=Copy(text,1,contador-1); | |
cade2:=Copy(text,Contador+1,valor); | |
Valor:=Length(cade1); | |
if Decimales>0 then dig1:=Cant-(Decimales+1) else dig1:=Cant; | |
if valor<dig1 then | |
begin | |
for x:=1 to (dig1-valor) do | |
begin | |
con:=con+'0'; | |
end; | |
dev:=con+Cade1; | |
end else dev:=Cade1; | |
if Decimales>0 then | |
begin | |
valor:=Length(cade2); | |
con:=''; | |
for x:=1 to (Decimales-valor) do | |
begin | |
con:=con+'0'; | |
end; | |
dev:=dev+','+cade2+con; | |
end; | |
result:=dev; | |
end; | |
constructor TPanelTouchDouble.Create(AOwner: TComponent); | |
var Spacelat,SpaceVert:Integer; | |
begin | |
inherited; | |
FSpace :=1; | |
FValue :=''; | |
FImagenUp :=TPicture.Create; | |
FImagenDown :=TPicture.Create; | |
FNumberIn :=0; | |
VarCambio :=false; | |
Caption :=' '; | |
FAllTransparent :=True; | |
FNumbersDigit :=5; | |
FColorFondoNumbers :=clBtnFace; | |
FRound :=40; | |
Fbutup1 :=TImage.Create(Self); | |
Spacelat:=11; | |
SpaceVert:=11; | |
FNumbersDecimals :=2; | |
with Fbutup1 do begin | |
Parent:=Self; | |
Left:=Spacelat; | |
Width:=FRound; | |
Height:=FRound; | |
Top:=SpaceVert; | |
Picture:=FImagenUp; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=UpClick; | |
Visible:=True; | |
end; | |
FN1 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente | |
with FN1 do begin | |
Parent := self; //Lo emparentamos al panel | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+FRound+FSpace+1; // | |
Left := Spacelat; /// | |
Font := Self.Font; | |
ParentColor:=False; | |
Transparent:=FAllTransparent; | |
AutoSize:=False; | |
ParentFont:=False; | |
Ctl3D:=false; | |
Alignment:=taCenter; | |
Layout:=tlCenter; | |
Caption := Copy(XCeros(FloatToStr(FNumberIn),FNumbersDigit,FNumbersDecimals),1,1); // | |
Visible:=True; | |
end; | |
FButDown1 :=TImage.Create(Self); | |
with FButDown1 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; // | |
Left := Spacelat; /// | |
Picture:=FImagenDown; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=DownClick; | |
Visible:=True; | |
end; | |
if FNumbersDigit>=2 then Spacelat:=Spacelat+FRound+FSpace+1; | |
Fbutup2 :=TImage.Create(Self); | |
with Fbutup2 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
Picture:=FImagenUp; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=UpClick; | |
if FNumbersDigit>=2 then Visible:=true else Visible:=False; | |
end; | |
FN2 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente | |
with Fn2 do begin | |
Parent := self; //Lo emparentamos al panel | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+FRound+FSpace+1; // | |
Left := Spacelat; /// | |
Font := Self.Font; | |
ParentColor:=False; | |
Transparent:=FAllTransparent; | |
AutoSize:=False; | |
Alignment:=taCenter; | |
Layout:=tlCenter; | |
Caption := Copy(XCeros(FloatToStr(FNumberIn),FNumbersDigit,FNumbersDecimals),2,1); // | |
if FNumbersDigit>=2 then Visible:=true else Visible:=False; | |
end; | |
FButDown2 :=TImage.Create(Self); | |
with FButDown2 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
Picture:=FImagenDown; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=DownClick; | |
if FNumbersDigit>=2 then Visible:=true else Visible:=False; | |
end; | |
if FNumbersDigit>=3 then Spacelat:=Spacelat+FRound+FSpace+1; | |
Fbutup3 :=TImage.Create(Self); | |
with Fbutup3 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
Picture:=FImagenUp; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=UpClick; | |
if FNumbersDigit>=3 then Visible:=true else Visible:=False; | |
end; | |
Fn3 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente | |
with Fn3 do begin | |
Parent := self; //Lo emparentamos al panel | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
Font := Self.Font; | |
ParentColor:=False; | |
Transparent:=FAllTransparent; | |
AutoSize:=False; | |
Alignment:=taCenter; | |
Layout:=tlCenter; | |
Caption := Copy(XCeros(FloatToStr(FNumberIn),FNumbersDigit,FNumbersDecimals),3,1); // | |
if FNumbersDigit>=3 then Visible:=true else Visible:=False; | |
end; | |
FButDown3 :=TImage.Create(Self); | |
with FButDown3 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
Picture:=FImagenDown; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=DownClick; | |
if FNumbersDigit>=3 then Visible:=true else Visible:=False; | |
end; | |
if FNumbersDigit>=4 then Spacelat:=Spacelat+FRound+FSpace+1; | |
Fbutup4 :=TImage.Create(Self); | |
with Fbutup4 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
Picture:=FImagenUp; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=UpClick; | |
if FNumbersDigit>=4 then Visible:=true else Visible:=False; | |
end; | |
FN4 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente | |
with FN4 do begin | |
Parent := self; //Lo emparentamos al panel | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+2; | |
Left := Spacelat; | |
Font := Self.Font; | |
ParentColor:=False; | |
Transparent:=FAllTransparent; | |
AutoSize:=False; | |
Alignment:=taCenter; | |
Layout:=tlCenter; | |
Caption := Copy(XCeros(FloatToStr(FNumberIn),FNumbersDigit,FNumbersDecimals),4,1); // | |
if FNumbersDigit>=4 then Visible:=true else Visible:=False; | |
end; | |
FButDown4 :=TImage.Create(Self); | |
with FButDown4 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
Picture:=FImagenDown; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=DownClick; | |
if FNumbersDigit>=4 then Visible:=true else Visible:=False; | |
end; | |
if FNumbersDigit>=5 then Spacelat:=Spacelat+FRound+FSpace+1; | |
Fbutup5 :=TImage.Create(Self); | |
with Fbutup5 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
Picture:=FImagenUp; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=UpClick; | |
if FNumbersDigit>=5 then Visible:=true else Visible:=False; | |
end; | |
Fn5 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente | |
with Fn5 do begin | |
Parent := self; //Lo emparentamos al panel | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
Font := Self.Font; | |
ParentColor:=False; | |
Transparent:=FAllTransparent; | |
AutoSize:=False; | |
Alignment:=taCenter; | |
Layout:=tlCenter; | |
Caption := Copy(XCeros(FloatToStr(FNumberIn),FNumbersDigit,FNumbersDecimals),5,1); // | |
if FNumbersDigit>=5 then Visible:=true else Visible:=False; | |
end; | |
FButDown5 :=TImage.Create(Self); | |
with FButDown5 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
Picture:=FImagenDown; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=DownClick; | |
if FNumbersDigit>=5 then Visible:=true else Visible:=False; | |
end; | |
if FNumbersDigit>=6 then Spacelat:=Spacelat+FRound+FSpace+1; | |
Fbutup6 :=TImage.Create(Self); | |
with Fbutup6 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
Picture:=FImagenUp; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=UpClick; | |
if FNumbersDigit>=6 then Visible:=true else Visible:=False; | |
end; | |
Fn6 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente | |
with Fn6 do begin | |
Parent := self; //Lo emparentamos al panel | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
Font := Self.Font; | |
ParentColor:=False; | |
Transparent:=FAllTransparent; | |
AutoSize:=False; | |
Alignment:=taCenter; | |
Layout:=tlCenter; | |
Caption :=''; | |
if FNumbersDigit>=6 then Visible:=true else Visible:=False; | |
end; | |
FButDown6 :=TImage.Create(Self); | |
with FButDown6 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
Picture:=FImagenDown; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=DownClick; | |
if FNumbersDigit>=6 then Visible:=true else Visible:=False; | |
end; | |
if FNumbersDigit>=7 then Spacelat:=Spacelat+FRound+FSpace+1; | |
Fbutup7 :=TImage.Create(Self); | |
with Fbutup7 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
Picture:=FImagenUp; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=UpClick; | |
if FNumbersDigit>=7 then Visible:=true else Visible:=False; | |
end; | |
Fn7 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente | |
with Fn7 do begin | |
Parent := self; //Lo emparentamos al panel | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
Font := Self.Font; | |
ParentColor:=False; | |
Transparent:=FAllTransparent; | |
AutoSize:=False; | |
Alignment:=taCenter; | |
Layout:=tlCenter; | |
Caption :=''; | |
if FNumbersDigit>=7 then Visible:=true else Visible:=False; | |
end; | |
FButDown7 :=TImage.Create(Self); | |
with FButDown7 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
Picture:=FImagenDown; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=DownClick; | |
if FNumbersDigit>=7 then Visible:=true else Visible:=False; | |
end; | |
if FNumbersDigit>=8 then Spacelat:=Spacelat+FRound+FSpace+1; | |
Fbutup8 :=TImage.Create(Self); | |
with Fbutup8 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
Picture:=FImagenUp; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=UpClick; | |
if FNumbersDigit>=8 then Visible:=true else Visible:=False; | |
end; | |
Fn8 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente | |
with Fn8 do begin | |
Parent := self; //Lo emparentamos al panel | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
Font := Self.Font; | |
ParentColor:=False; | |
Transparent:=FAllTransparent; | |
AutoSize:=False; | |
Alignment:=taCenter; | |
Layout:=tlCenter; | |
Caption :=''; | |
if FNumbersDigit>=8 then Visible:=true else Visible:=False; | |
end; | |
FButDown8 :=TImage.Create(Self); | |
with FButDown8 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
Picture:=FImagenDown; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=DownClick; | |
if FNumbersDigit>=8 then Visible:=true else Visible:=False; | |
end; | |
if FNumbersDigit>=9 then Spacelat:=Spacelat+FRound+FSpace+1; | |
Fbutup9 :=TImage.Create(Self); | |
with Fbutup9 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
Picture:=FImagenUp; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=UpClick; | |
if FNumbersDigit>=9 then Visible:=true else Visible:=False; | |
end; | |
Fn9 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente | |
with Fn9 do begin | |
Parent := self; //Lo emparentamos al panel | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
Font := Self.Font; | |
ParentColor:=False; | |
Transparent:=FAllTransparent; | |
AutoSize:=False; | |
Alignment:=taCenter; | |
Layout:=tlCenter; | |
Caption :=''; | |
if FNumbersDigit>=9 then Visible:=true else Visible:=False; | |
end; | |
FButDown9 :=TImage.Create(Self); | |
with FButDown9 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
Picture:=FImagenDown; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=DownClick; | |
if FNumbersDigit>=9 then Visible:=true else Visible:=False; | |
end; | |
if FNumbersDigit>=10 then Spacelat:=Spacelat+FRound+FSpace+1; | |
Fbutup10 :=TImage.Create(Self); | |
with Fbutup10 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
Picture:=FImagenUp; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=UpClick; | |
if FNumbersDigit>=10 then Visible:=true else Visible:=False; | |
end; | |
Fn10 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente | |
with Fn10 do begin | |
Parent := self; //Lo emparentamos al panel | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
Font := Self.Font; | |
ParentColor:=False; | |
Transparent:=FAllTransparent; | |
AutoSize:=False; | |
Alignment:=taCenter; | |
Layout:=tlCenter; | |
Caption :=''; | |
if FNumbersDigit>=10 then Visible:=true else Visible:=False; | |
end; | |
FButDown10 :=TImage.Create(Self); | |
with FButDown10 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
Picture:=FImagenDown; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=DownClick; | |
if FNumbersDigit>=10 then Visible:=true else Visible:=False; | |
end; | |
if FNumbersDecimals>0 then Spacelat:=Spacelat+FRound+FSpace+1; | |
FSeparator :=TLabel.Create(self); //Creamos un label dentro de nuestro componente | |
with FSeparator do begin | |
Parent := self; //Lo emparentamos al panel | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
Font := Self.Font; | |
ParentColor:=False; | |
Transparent:=FAllTransparent; | |
AutoSize:=False; | |
Alignment:=taCenter; | |
Layout:=tlCenter; | |
Caption :=','; | |
if FNumbersDecimals>0 then Visible:=true else Visible:=False; | |
end; | |
if FNumbersDecimals>=1 then Spacelat:=Spacelat+FRound+FSpace+1; | |
Fbutup11 :=TImage.Create(Self); | |
with Fbutup11 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
Picture:=FImagenUp; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=UpClick; | |
if FNumbersDecimals>=1 then Visible:=true else Visible:=False; | |
end; | |
Fn11 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente | |
with Fn11 do begin | |
Parent := self; //Lo emparentamos al panel | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
Font := Self.Font; | |
ParentColor:=False; | |
Transparent:=FAllTransparent; | |
AutoSize:=False; | |
Alignment:=taCenter; | |
Layout:=tlCenter; | |
Caption :=''; | |
if FNumbersDecimals>=1 then Visible:=true else Visible:=False; | |
end; | |
FButDown11 :=TImage.Create(Self); | |
with FButDown11 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
Picture:=FImagenDown; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=DownClick; | |
if FNumbersDecimals>=1 then Visible:=true else Visible:=False; | |
end; | |
if FNumbersDecimals>=2 then Spacelat:=Spacelat+FRound+FSpace+1; | |
Fbutup12 :=TImage.Create(Self); | |
with Fbutup12 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
Picture:=FImagenUp; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=UpClick; | |
if FNumbersDecimals>=2 then Visible:=true else Visible:=False; | |
end; | |
Fn12 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente | |
with Fn12 do begin | |
Parent := self; //Lo emparentamos al panel | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
Font := Self.Font; | |
ParentColor:=False; | |
Transparent:=FAllTransparent; | |
AutoSize:=False; | |
Alignment:=taCenter; | |
Layout:=tlCenter; | |
Caption :=''; | |
if FNumbersDecimals>=2 then Visible:=true else Visible:=False; | |
end; | |
FButDown12 :=TImage.Create(Self); | |
with FButDown12 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
Picture:=FImagenDown; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=DownClick; | |
if FNumbersDecimals>=2 then Visible:=true else Visible:=False; | |
end; | |
if FNumbersDecimals>=3 then Spacelat:=Spacelat+FRound+FSpace+1; | |
Fbutup13 :=TImage.Create(Self); | |
with Fbutup13 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
Picture:=FImagenUp; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=UpClick; | |
if FNumbersDecimals>=3 then Visible:=true else Visible:=False; | |
end; | |
Fn13 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente | |
with Fn13 do begin | |
Parent := self; //Lo emparentamos al panel | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
Font := Self.Font; | |
ParentColor:=False; | |
Transparent:=FAllTransparent; | |
AutoSize:=False; | |
Alignment:=taCenter; | |
Layout:=tlCenter; | |
Caption :=''; | |
if FNumbersDecimals>=3 then Visible:=true else Visible:=False; | |
end; | |
FButDown13 :=TImage.Create(Self); | |
with FButDown13 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
Picture:=FImagenDown; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=DownClick; | |
if FNumbersDecimals>=3 then Visible:=true else Visible:=False; | |
end; | |
if FNumbersDecimals>=4 then Spacelat:=Spacelat+FRound+FSpace+1; | |
Fbutup14 :=TImage.Create(Self); | |
with Fbutup14 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
Picture:=FImagenUp; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=UpClick; | |
if FNumbersDecimals>=4 then Visible:=true else Visible:=False; | |
end; | |
Fn14 :=TLabel.Create(self); //Creamos un label dentro de nuestro componente | |
with Fn14 do begin | |
Parent := self; //Lo emparentamos al panel | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
Font := Self.Font; | |
ParentColor:=False; | |
Transparent:=FAllTransparent; | |
AutoSize:=False; | |
Alignment:=taCenter; | |
Layout:=tlCenter; | |
Caption :=''; | |
if FNumbersDecimals>=4 then Visible:=true else Visible:=False; | |
end; | |
FButDown14 :=TImage.Create(Self); | |
with FButDown14 do begin | |
Parent:=Self; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
Picture:=FImagenDown; | |
Center:=True; | |
Proportional:=True; | |
Transparent:=FAllTransparent; | |
Stretch:=True; | |
OnClick:=DownClick; | |
if FNumbersDecimals>=4 then Visible:=true else Visible:=False; | |
end; | |
end; | |
procedure TPanelTouchDouble.Change(Sender: TObject); | |
//------------------------------------------------------------------------------ | |
//*****************************************************************[ Chage ]**** | |
//------------------------------------------------------------------------------ | |
begin | |
if Assigned(FOnChange) then FOnChange(Sender); | |
end; | |
destructor TPanelTouchDouble.Destroy; | |
begin | |
FImagenUp.Free; | |
FImagenDown.Free; | |
Fn1.Free; | |
FN2.Free; | |
Fn3.Free; | |
FN4.Free; | |
Fn5.Free; | |
Fn6.Free; | |
Fn7.Free; | |
Fn8.Free; | |
Fn9.Free; | |
fn10.Free; | |
fn11.Free; | |
fn12.Free; | |
fn13.Free; | |
fn14.Free; | |
Fbutup1.Free; | |
Fbutup2.Free; | |
Fbutup3.Free; | |
Fbutup4.Free; | |
Fbutup5.Free; | |
Fbutup6.Free; | |
Fbutup7.Free; | |
Fbutup8.Free; | |
Fbutup9.Free; | |
Fbutup10.Free; | |
Fbutup11.Free; | |
Fbutup12.Free; | |
Fbutup13.Free; | |
Fbutup14.Free; | |
FButDown1.Free; | |
FButDown2.Free; | |
FButDown3.Free; | |
FButDown4.Free; | |
FButDown5.Free; | |
FButDown6.Free; | |
FButDown7.Free; | |
FButDown8.Free; | |
FButDown9.Free; | |
FButDown10.Free; | |
FButDown11.Free; | |
FButDown12.Free; | |
FButDown13.Free; | |
FButDown14.Free; | |
inherited; | |
end; | |
procedure TPanelTouchDouble.Paint; | |
//------------------------------------------------------------------------------ | |
//*****************************************************************[ PAINT ]**** | |
//------------------------------------------------------------------------------ | |
var imagen:TImage; | |
n1,n2,n3,n4,n5,n6,n7,n8,n9,n10:Integer; //posiciones horzontales | |
a1,a2,a3:Integer; //Altos | |
SpaceVert,Spacelat, i, varITotalDigitos, VarIContadorDigitos:Integer; | |
begin | |
inherited; | |
if VarCambio=false then | |
begin | |
// for I := 1 to FNumbersDigit do FormatoFormat:=ForymatoFormat+'0'; | |
// if FNumbersDecimals>0 then FormatoFormat:=FormatoFormat+'.'; | |
// for I := 1 to FNumbersDecimals do FormatoFormat:=FormatoFormat+'0'; | |
varITotalDigitos:=FNumbersDigit+1+FNumbersDecimals; | |
ValorNumero; | |
SpaceVert:=11; | |
Spacelat:=11; | |
VarIContadorDigitos:=1; | |
with Fbutup1 do begin | |
Picture:=FImagenUp; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
Visible:=True; | |
end; | |
with FN1 do begin | |
Transparent:=FAllTransparent; | |
Color:=FColorFondoNumbers; | |
Font:=Self.Font; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
Visible:=True; | |
Caption := Copy(XCeros(FloatToStr(ValorDouble),varITotalDigitos,FNumbersDecimals),VarIContadorDigitos,1); | |
end; | |
with FButDown1 do begin | |
Picture:=FImagenDown; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
Visible:=True; | |
Caption | |
end; | |
if FNumbersDigit>=2 then | |
begin | |
Spacelat:=Spacelat+FRound+FSpace+1; | |
VarIContadorDigitos:=VarIContadorDigitos+1; | |
end; | |
with Fbutup2 do begin | |
Picture:=FImagenUp; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
if FNumbersDigit>=2 then Visible:=True else Visible:=False; | |
end; | |
with Fn2 do begin | |
Transparent:=FAllTransparent; | |
Color:=FColorFondoNumbers; | |
Font:=Self.Font; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
if FNumbersDigit>=2 then | |
begin | |
Caption := Copy(XCeros(FloatToStr(ValorDouble),varITotalDigitos,FNumbersDecimals),VarIContadorDigitos,1); | |
Visible:=True; | |
end else | |
begin | |
Caption:=''; | |
Visible:=False; | |
end; | |
end; | |
with FButDown2 do begin | |
Picture:=FImagenDown; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
if FNumbersDigit>=2 then Visible:=True else Visible:=False; | |
end; | |
if FNumbersDigit>=3 then | |
begin | |
Spacelat:=Spacelat+FRound+FSpace+1; | |
VarIContadorDigitos:=VarIContadorDigitos+1; | |
end; | |
with Fbutup3 do begin | |
Picture:=FImagenUp; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
if FNumbersDigit>=3 then Visible:=True else Visible:=False; | |
end; | |
with Fn3 do begin | |
Transparent:=FAllTransparent; | |
Color:=FColorFondoNumbers; | |
Font:=Self.Font; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
if FNumbersDigit>=3 then | |
begin | |
Caption := Copy(XCeros(FloatToStr(ValorDouble),varITotalDigitos,FNumbersDecimals),VarIContadorDigitos,1); | |
Visible:=True; | |
end else | |
begin | |
Caption:=''; | |
Visible:=False; | |
end; | |
end; | |
with FButDown3 do begin | |
Picture:=FImagenDown; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
if FNumbersDigit>=3 then Visible:=True else Visible:=False; | |
end; | |
if FNumbersDigit>=4 then | |
begin | |
Spacelat:=Spacelat+FRound+FSpace+1; | |
VarIContadorDigitos:=VarIContadorDigitos+1; | |
end; | |
with Fbutup4 do begin | |
Picture:=FImagenUp; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
if FNumbersDigit>=4 then Visible:=True else Visible:=False; | |
end; | |
with Fn4 do begin | |
Transparent:=FAllTransparent; | |
Color:=FColorFondoNumbers; | |
Font:=Self.Font; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
if FNumbersDigit>=4 then | |
begin | |
Caption := Copy(XCeros(FloatToStr(ValorDouble),varITotalDigitos,FNumbersDecimals),VarIContadorDigitos,1); | |
Visible:=True; | |
end else | |
begin | |
Caption:=''; | |
Visible:=False; | |
end; | |
end; | |
with FButDown4 do begin | |
Picture:=FImagenDown; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
if FNumbersDigit>=4 then Visible:=True else Visible:=False; | |
end; | |
if FNumbersDigit>=5 then | |
begin | |
Spacelat:=Spacelat+FRound+FSpace+1; | |
VarIContadorDigitos:=VarIContadorDigitos+1; | |
end; | |
with Fbutup5 do begin | |
Picture:=FImagenUp; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
if FNumbersDigit>=5 then Visible:=True else Visible:=False; | |
end; | |
with Fn5 do begin | |
Transparent:=FAllTransparent; | |
Color:=FColorFondoNumbers; | |
Font:=Self.Font; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
if FNumbersDigit>=5 then | |
begin | |
Caption := Copy(XCeros(FloatToStr(ValorDouble),varITotalDigitos,FNumbersDecimals),VarIContadorDigitos,1); | |
Visible:=True; | |
end else | |
begin | |
Caption:=''; | |
Visible:=False; | |
end; | |
end; | |
with FButDown5 do begin | |
Picture:=FImagenDown; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
if FNumbersDigit>=5 then Visible:=True else Visible:=False; | |
end; | |
if FNumbersDigit>=6 then | |
begin | |
Spacelat:=Spacelat+FRound+FSpace+1; | |
VarIContadorDigitos:=VarIContadorDigitos+1; | |
end; | |
with Fbutup6 do begin | |
Picture:=FImagenUp; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
if FNumbersDigit>=6 then Visible:=True else Visible:=False; | |
end; | |
with Fn6 do begin | |
Transparent:=FAllTransparent; | |
Color:=FColorFondoNumbers; | |
Font:=Self.Font; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
if FNumbersDigit>=6 then | |
begin | |
Caption := Copy(XCeros(FloatToStr(ValorDouble),varITotalDigitos,FNumbersDecimals),VarIContadorDigitos,1); | |
Visible:=True; | |
end else | |
begin | |
Caption:=''; | |
Visible:=False; | |
end; | |
end; | |
with FButDown6 do begin | |
Picture:=FImagenDown; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
if FNumbersDigit>=6 then Visible:=True else Visible:=False; | |
end; | |
if FNumbersDigit>=7 then | |
begin | |
Spacelat:=Spacelat+FRound+FSpace+1; | |
VarIContadorDigitos:=VarIContadorDigitos+1; | |
end; | |
with Fbutup7 do begin | |
Picture:=FImagenUp; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
if FNumbersDigit>=7 then Visible:=True else Visible:=False; | |
end; | |
with Fn7 do begin | |
Transparent:=FAllTransparent; | |
Color:=FColorFondoNumbers; | |
Font:=Self.Font; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
if FNumbersDigit>=7 then | |
begin | |
Caption := Copy(XCeros(FloatToStr(ValorDouble),varITotalDigitos,FNumbersDecimals),VarIContadorDigitos,1); | |
Visible:=True; | |
end else | |
begin | |
Caption:=''; | |
Visible:=False; | |
end; | |
end; | |
with FButDown7 do begin | |
Picture:=FImagenDown; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
if FNumbersDigit>=7 then Visible:=True else Visible:=False; | |
end; | |
if FNumbersDigit>=8 then | |
begin | |
Spacelat:=Spacelat+FRound+FSpace+1; | |
VarIContadorDigitos:=VarIContadorDigitos+1; | |
end; | |
with Fbutup8 do begin | |
Picture:=FImagenUp; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
if FNumbersDigit>=8 then Visible:=True else Visible:=False; | |
end; | |
with Fn8 do begin | |
Transparent:=FAllTransparent; | |
Color:=FColorFondoNumbers; | |
Font:=Self.Font; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
if FNumbersDigit>=8 then | |
begin | |
Caption := Copy(XCeros(FloatToStr(ValorDouble),varITotalDigitos,FNumbersDecimals),VarIContadorDigitos,1); | |
Visible:=True; | |
end else | |
begin | |
Caption:=''; | |
Visible:=False; | |
end; | |
end; | |
with FButDown8 do begin | |
Picture:=FImagenDown; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
if FNumbersDigit>=8 then Visible:=True else Visible:=False; | |
end; | |
if FNumbersDigit>=9 then | |
begin | |
Spacelat:=Spacelat+FRound+FSpace+1; | |
VarIContadorDigitos:=VarIContadorDigitos+1; | |
end; | |
with Fbutup9 do begin | |
Picture:=FImagenUp; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
if FNumbersDigit>=9 then Visible:=True else Visible:=False; | |
end; | |
with Fn9 do begin | |
Transparent:=FAllTransparent; | |
Color:=FColorFondoNumbers; | |
Font:=Self.Font; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
if FNumbersDigit>=9 then | |
begin | |
Caption := Copy(XCeros(FloatToStr(ValorDouble),varITotalDigitos,FNumbersDecimals),VarIContadorDigitos,1); | |
Visible:=True; | |
end else | |
begin | |
Caption:=''; | |
Visible:=False; | |
end; | |
end; | |
with FButDown9 do begin | |
Picture:=FImagenDown; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
if FNumbersDigit>=9 then Visible:=True else Visible:=False; | |
end; | |
if FNumbersDigit>=10 then | |
begin | |
Spacelat:=Spacelat+FRound+FSpace+1; | |
VarIContadorDigitos:=VarIContadorDigitos+1; | |
end; | |
with Fbutup10 do begin | |
Picture:=FImagenUp; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
if FNumbersDigit>=10 then Visible:=True else Visible:=False; | |
end; | |
with Fn10 do begin | |
Transparent:=FAllTransparent; | |
Color:=FColorFondoNumbers; | |
Font:=Self.Font; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
if FNumbersDigit>=10 then | |
begin | |
Caption := Copy(XCeros(FloatToStr(ValorDouble),varITotalDigitos,FNumbersDecimals),VarIContadorDigitos,1); | |
Visible:=True; | |
end else | |
begin | |
Caption:=''; | |
Visible:=False; | |
end; | |
end; | |
with FButDown10 do begin | |
Picture:=FImagenDown; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
if FNumbersDigit>=10 then Visible:=True else Visible:=False; | |
end; | |
if FNumbersDecimals>0 then | |
begin | |
Spacelat:=Spacelat+FRound+FSpace+1; | |
VarIContadorDigitos:=VarIContadorDigitos+1; | |
end; | |
with FSeparator do begin | |
Transparent:=FAllTransparent; | |
Color:=FColorFondoNumbers; | |
Font:=Self.Font; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
if FNumbersDigit>=10 then | |
begin | |
Caption := Copy(XCeros(FloatToStr(ValorDouble),varITotalDigitos,FNumbersDecimals),VarIContadorDigitos,1); | |
Visible:=True; | |
end else | |
begin | |
Caption:=''; | |
Visible:=False; | |
end; | |
end; | |
if FNumbersDecimals>=1 then | |
begin | |
Spacelat:=Spacelat+FRound+FSpace+1; | |
VarIContadorDigitos:=VarIContadorDigitos+1; | |
end; | |
with Fbutup11 do begin | |
Picture:=FImagenUp; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
if FNumbersDecimals>=1 then Visible:=True else Visible:=False; | |
end; | |
with Fn11 do begin | |
Transparent:=FAllTransparent; | |
Color:=FColorFondoNumbers; | |
Font:=Self.Font; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
if FNumbersDecimals>=1 then | |
begin | |
Caption := Copy(XCeros(FloatToStr(ValorDouble),varITotalDigitos,FNumbersDecimals),VarIContadorDigitos,1); | |
Visible:=True; | |
end else | |
begin | |
Caption:=''; | |
Visible:=False; | |
end; | |
end; | |
with FButDown11 do begin | |
Picture:=FImagenDown; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
if FNumbersDecimals>=1 then Visible:=True else Visible:=False; | |
end; | |
if FNumbersDecimals>=2 then | |
begin | |
Spacelat:=Spacelat+FRound+FSpace+1; | |
VarIContadorDigitos:=VarIContadorDigitos+1; | |
end; | |
with Fbutup12 do begin | |
Picture:=FImagenUp; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
if FNumbersDecimals>=2 then Visible:=True else Visible:=False; | |
end; | |
with Fn12 do begin | |
Transparent:=FAllTransparent; | |
Color:=FColorFondoNumbers; | |
Font:=Self.Font; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
if FNumbersDecimals>=2 then | |
begin | |
Caption := Copy(XCeros(FloatToStr(ValorDouble),varITotalDigitos,FNumbersDecimals),VarIContadorDigitos,1); | |
Visible:=True; | |
end else | |
begin | |
Caption:=''; | |
Visible:=False; | |
end; | |
end; | |
with FButDown12 do begin | |
Picture:=FImagenDown; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
if FNumbersDecimals>=2 then Visible:=True else Visible:=False; | |
end; | |
if FNumbersDecimals>=3 then | |
begin | |
Spacelat:=Spacelat+FRound+FSpace+1; | |
VarIContadorDigitos:=VarIContadorDigitos+1; | |
end; | |
with Fbutup13 do begin | |
Picture:=FImagenUp; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
if FNumbersDecimals>=3 then Visible:=True else Visible:=False; | |
end; | |
with Fn13 do begin | |
Transparent:=FAllTransparent; | |
Color:=FColorFondoNumbers; | |
Font:=Self.Font; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
if FNumbersDecimals>=3 then | |
begin | |
Caption := Copy(XCeros(FloatToStr(ValorDouble),varITotalDigitos,FNumbersDecimals),VarIContadorDigitos,1); | |
Visible:=True; | |
end else | |
begin | |
Caption:=''; | |
Visible:=False; | |
end; | |
end; | |
with FButDown13 do begin | |
Picture:=FImagenDown; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
if FNumbersDecimals>=3 then Visible:=True else Visible:=False; | |
end; | |
if FNumbersDecimals>=4 then | |
begin | |
Spacelat:=Spacelat+FRound+FSpace+1; | |
VarIContadorDigitos:=VarIContadorDigitos+1; | |
end; | |
with Fbutup14 do begin | |
Picture:=FImagenUp; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert; | |
Left := Spacelat; | |
if FNumbersDecimals>=4 then Visible:=True else Visible:=False; | |
end; | |
with Fn14 do begin | |
Transparent:=FAllTransparent; | |
Color:=FColorFondoNumbers; | |
Font:=Self.Font; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound)+(FSpace)+1; | |
Left := Spacelat; | |
if FNumbersDecimals>=4 then | |
begin | |
Caption := Copy(XCeros(FloatToStr(ValorDouble),varITotalDigitos,FNumbersDecimals),VarIContadorDigitos,1); | |
Visible:=True; | |
end else | |
begin | |
Caption:=''; | |
Visible:=False; | |
end; | |
end; | |
with FButDown14 do begin | |
Picture:=FImagenDown; | |
Transparent:=FAllTransparent; | |
Width:=FRound; | |
Height:=FRound; | |
Top := SpaceVert+(FRound*2)+(FSpace*2)+2; | |
Left := Spacelat; | |
if FNumbersDecimals>=4 then Visible:=True else Visible:=False; | |
end; | |
if FNumbersDecimals>0 then Self.Width:=20+(FRound*(FNumbersDigit+FNumbersDecimals+1)+(FNumbersDigit+FNumbersDecimals+1)+(FNumbersDigit+FNumbersDecimals+1)) | |
else Self.Width:=20+(FRound*(FNumbersDigit)+(FNumbersDigit)+(FNumbersDigit)); | |
Self.Height:=SpaceVert+(FRound*3)+(FSpace*2)+12; | |
FValue:=FloatToStr(ValorDouble); | |
VarCambio:=True; | |
FValue:=FloatToStr(ValorDouble); | |
end; | |
end; | |
procedure TPanelTouchDouble.setSpace(const Value: TSeparation); | |
//------------------------------------------------------------------------------ | |
//*****************************************************************[ SPACE ]**** | |
//------------------------------------------------------------------------------ | |
begin | |
if FSpace<>value then FSpace:=Value; | |
VarCambio:=False; | |
Invalidate; | |
End; | |
procedure TPanelTouchDouble.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 TPanelTouchDouble.UpClick(Sender: TObject); | |
//------------------------------------------------------------------------------ | |
//*************************************************************[ UPCLICK ]**** | |
//------------------------------------------------------------------------------ | |
begin | |
if Sender=Fbutup1 then FN1.Caption:=Numerovalido(StrToInt(FN1.Caption),2); | |
if Sender=Fbutup2 then FN2.Caption:=Numerovalido(StrToInt(FN2.Caption),2); | |
if Sender=Fbutup3 then Fn3.Caption:=Numerovalido(StrToInt(Fn3.Caption),2); | |
if Sender=Fbutup4 then FN4.Caption:=Numerovalido(StrToInt(FN4.Caption),2); | |
if Sender=Fbutup5 then Fn5.Caption:=Numerovalido(StrToInt(Fn5.Caption),2); | |
if Sender=Fbutup6 then Fn6.Caption:=Numerovalido(StrToInt(Fn6.Caption),2); | |
if Sender=Fbutup7 then Fn7.Caption:=Numerovalido(StrToInt(Fn7.Caption),2); | |
if Sender=Fbutup8 then Fn8.Caption:=Numerovalido(StrToInt(Fn8.Caption),2); | |
if Sender=Fbutup9 then Fn9.Caption:=Numerovalido(StrToInt(Fn9.Caption),2); | |
if Sender=Fbutup10 then Fn10.Caption:=Numerovalido(StrToInt(Fn10.Caption),2); | |
if Sender=Fbutup11 then Fn11.Caption:=Numerovalido(StrToInt(Fn11.Caption),2); | |
if Sender=Fbutup12 then Fn12.Caption:=Numerovalido(StrToInt(Fn12.Caption),2); | |
if Sender=Fbutup13 then Fn13.Caption:=Numerovalido(StrToInt(Fn13.Caption),2); | |
if Sender=Fbutup14 then Fn14.Caption:=Numerovalido(StrToInt(Fn14.Caption),2); | |
if Assigned(FOnButonUpClick) then FOnButonUpClick(Sender); | |
ValorNumero; | |
Change(Self); | |
end; | |
procedure TPanelTouchDouble.ValorNumero; | |
//------------------------------------------------------------------------------ | |
//***********************************************************[ ValorNumero ]**** | |
//------------------------------------------------------------------------------ | |
var ValorEnString,ValorDecimal:String; | |
begin | |
ValorEnString:=''; | |
ValorDecimal:=''; | |
case FNumbersDigit of | |
1:ValorEnString:=fn1.Caption; | |
2:ValorEnString:=fn1.Caption+fn2.Caption; | |
3:ValorEnString:=fn1.Caption+fn2.Caption+fn3.Caption; | |
4:ValorEnString:=fn1.Caption+fn2.Caption+fn3.Caption+fn4.Caption; | |
5:ValorEnString:=fn1.Caption+fn2.Caption+fn3.Caption+fn4.Caption+fn5.Caption; | |
6:ValorEnString:=fn1.Caption+fn2.Caption+fn3.Caption+fn4.Caption+fn5.Caption+fn6.Caption; | |
7:ValorEnString:=fn1.Caption+fn2.Caption+fn3.Caption+fn4.Caption+fn5.Caption+fn6.Caption+fn7.Caption; | |
8:ValorEnString:=fn1.Caption+fn2.Caption+fn3.Caption+fn4.Caption+fn5.Caption+fn6.Caption+fn7.Caption+fn8.Caption; | |
9:ValorEnString:=fn1.Caption+fn2.Caption+fn3.Caption+fn4.Caption+fn5.Caption+fn6.Caption+fn7.Caption+fn8.Caption+fn9.Caption; | |
10:ValorEnString:=fn1.Caption+fn2.Caption+fn3.Caption+fn4.Caption+fn5.Caption+fn6.Caption+fn7.Caption+fn8.Caption+fn9.Caption+fn10.Caption; | |
end; | |
case FNumbersDecimals of | |
1:ValorDecimal:=ValorDecimal+','+Fn11.Caption; | |
2:ValorDecimal:=ValorDecimal+','+Fn11.Caption+Fn12.Caption; | |
3:ValorDecimal:=ValorDecimal+','+Fn11.Caption+Fn12.Caption+Fn13.Caption; | |
4:ValorDecimal:=ValorDecimal+','+Fn11.Caption+Fn12.Caption+Fn13.Caption+Fn14.Caption; | |
end; | |
ValorDouble:=StrToFloat(ValorEnString+ValorDecimal); | |
FValue:=FloatToStr(ValorDouble); | |
end; | |
procedure TPanelTouchDouble.DownClick(Sender: TObject); | |
//------------------------------------------------------------------------------ | |
//***********************************************************[ DownClick ]**** | |
//------------------------------------------------------------------------------ | |
begin | |
if Sender=FButDown1 then FN1.Caption:=Numerovalido(StrToInt(FN1.Caption),2, False); | |
if Sender=FButDown2 then FN2.Caption:=Numerovalido(StrToInt(FN2.Caption),2, False); | |
if Sender=FButDown3 then Fn3.Caption:=Numerovalido(StrToInt(Fn3.Caption),2, False); | |
if Sender=FButDown4 then FN4.Caption:=Numerovalido(StrToInt(FN4.Caption),2, False); | |
if Sender=FButDown5 then Fn5.Caption:=Numerovalido(StrToInt(Fn5.Caption),2, False); | |
if Sender=FButDown6 then Fn6.Caption:=Numerovalido(StrToInt(Fn6.Caption),2, False); | |
if Sender=FButDown7 then Fn7.Caption:=Numerovalido(StrToInt(Fn7.Caption),2, False); | |
if Sender=FButDown8 then Fn8.Caption:=Numerovalido(StrToInt(Fn8.Caption),2, False); | |
if Sender=FButDown9 then Fn9.Caption:=Numerovalido(StrToInt(Fn9.Caption),2, False); | |
if Sender=FButDown10 then Fn10.Caption:=Numerovalido(StrToInt(Fn10.Caption),2, False); | |
if Sender=FButDown11 then Fn11.Caption:=Numerovalido(StrToInt(Fn11.Caption),2, False); | |
if Sender=FButDown12 then Fn12.Caption:=Numerovalido(StrToInt(Fn12.Caption),2, False); | |
if Sender=FButDown13 then Fn13.Caption:=Numerovalido(StrToInt(Fn13.Caption),2, False); | |
if Sender=FButDown14 then Fn14.Caption:=Numerovalido(StrToInt(Fn14.Caption),2, False); | |
if Assigned(FOnButtonDownClick) then FOnButtonDownClick(Sender); | |
ValorNumero; | |
Change(Self); | |
end; | |
procedure TPanelTouchDouble.setNumberIn(const Value: Double); | |
//------------------------------------------------------------------------------ | |
//**************************************************************[ NumberIn ]**** | |
//------------------------------------------------------------------------------ | |
var VarITotalDigitos:integer; | |
begin | |
if FNumberIn<>Value then | |
begin | |
if FNumbersDecimals>0 then VarITotalDigitos:=FNumbersDigit+FNumbersDecimals+1 else VarITotalDigitos:=FNumbersDigit; | |
FNumberIn:=Value; | |
if FNumbersDigit>=1 then FN1.Caption := Copy(XCeros(FloatToStr(FNumberIn),VarITotalDigitos,FNumbersDecimals),1,1); | |
if FNumbersDigit>=2 then FN2.Caption := Copy(XCeros(FloatToStr(FNumberIn),VarITotalDigitos,FNumbersDecimals),2,1); | |
if FNumbersDigit>=3 then FN3.Caption := Copy(XCeros(FloatToStr(FNumberIn),VarITotalDigitos,FNumbersDecimals),3,1); | |
if FNumbersDigit>=4 then FN4.Caption := Copy(XCeros(FloatToStr(FNumberIn),VarITotalDigitos,FNumbersDecimals),4,1); | |
if FNumbersDigit>=5 then FN5.Caption := Copy(XCeros(FloatToStr(FNumberIn),VarITotalDigitos,FNumbersDecimals),5,1); | |
if FNumbersDigit>=6 then FN6.Caption := Copy(XCeros(FloatToStr(FNumberIn),VarITotalDigitos,FNumbersDecimals),6,1); | |
if FNumbersDigit>=7 then FN7.Caption := Copy(XCeros(FloatToStr(FNumberIn),VarITotalDigitos,FNumbersDecimals),7,1); | |
if FNumbersDigit>=8 then FN8.Caption := Copy(XCeros(FloatToStr(FNumberIn),VarITotalDigitos,FNumbersDecimals),8,1); | |
if FNumbersDigit>=9 then FN9.Caption := Copy(XCeros(FloatToStr(FNumberIn),VarITotalDigitos,FNumbersDecimals),9,1); | |
if FNumbersDigit>=10 then FN10.Caption := Copy(XCeros(FloatToStr(FNumberIn),VarITotalDigitos,FNumbersDecimals),10,1); | |
if FNumbersDecimals>0 then FSeparator.Caption:= Copy(XCeros(FloatToStr(FNumberIn),VarITotalDigitos,FNumbersDecimals),FNumbersDigit+1,1); | |
if FNumbersDecimals>=1 then fn11.Caption:= Copy(XCeros(FloatToStr(FNumberIn),VarITotalDigitos,FNumbersDecimals),FNumbersDigit+2,1); | |
if FNumbersDecimals>=2 then fn12.Caption:= Copy(XCeros(FloatToStr(FNumberIn),VarITotalDigitos,FNumbersDecimals),FNumbersDigit+3,1); | |
if FNumbersDecimals>=3 then fn13.Caption:= Copy(XCeros(FloatToStr(FNumberIn),VarITotalDigitos,FNumbersDecimals),FNumbersDigit+4,1); | |
if FNumbersDecimals>=4 then Fn14.Caption:= Copy(XCeros(FloatToStr(FNumberIn),VarITotalDigitos,FNumbersDecimals),FNumbersDigit+5,1); | |
VarCambio:=False; | |
Invalidate; | |
end; | |
end; | |
procedure TPanelTouchDouble.setNumbersDigit(const value: TNumbersDigit); | |
//------------------------------------------------------------------------------ | |
//**********************************************************[ NumbersDigit ]**** | |
//------------------------------------------------------------------------------ | |
begin | |
if FNumbersDigit<>value then FNumbersDigit:=Value; | |
VarCambio:=False; | |
Invalidate; | |
End; | |
procedure TPanelTouchDouble.SetAllTransparent(const Value: Boolean); | |
//------------------------------------------------------------------------------ | |
//***********************************************************[ TRANSPARENT ]**** | |
//------------------------------------------------------------------------------ | |
begin | |
if FAllTransparent<>value then FAllTransparent:=Value; | |
VarCambio:=False; | |
Invalidate; | |
End; | |
procedure TPanelTouchDouble.SetImagenUp(const Value: TPicture); | |
//------------------------------------------------------------------------------ | |
//**************************************************************[ IMAGENUP ]**** | |
//------------------------------------------------------------------------------ | |
begin | |
FImagenUp.Assign(Value); | |
VarCambio:=False; | |
Invalidate; | |
End; | |
procedure TPanelTouchDouble.SetImagenDown(const Value: TPicture); | |
//------------------------------------------------------------------------------ | |
//************************************************************[ IMAGENDOWN ]**** | |
//------------------------------------------------------------------------------ | |
begin | |
FImagenDown.Assign(Value); | |
VarCambio:=False; | |
Invalidate; | |
End; | |
procedure TPanelTouchDouble.SetColorFondoNumbers(const Value: TColor); | |
//------------------------------------------------------------------------------ | |
//*****************************************************[ COLORFONDONUMBERS ]**** | |
//------------------------------------------------------------------------------ | |
begin | |
if FColorFondoNumbers<>value then FColorFondoNumbers:=Value; | |
VarCambio:=False; | |
Invalidate | |
End; | |
procedure TPanelTouchDouble.SetRound(const Value: Integer); | |
//------------------------------------------------------------------------------ | |
//*****************************************************************[ ROUND ]**** | |
//------------------------------------------------------------------------------ | |
begin | |
if FRound<>value then FRound:=Value; | |
VarCambio:=False; | |
Invalidate | |
End; | |
procedure TPanelTouchDouble.SetNumbersDecimals(const Value: TDdecimals); | |
//------------------------------------------------------------------------------ | |
//*******************************************************[ NUMBERSDECIMALS ]**** | |
//------------------------------------------------------------------------------ | |
begin | |
if FNumbersDecimals<>value then FNumbersDecimals:=Value; | |
VarCambio:=False; | |
Invalidate | |
End; | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment