93 lines
3.7 KiB
C++
93 lines
3.7 KiB
C++
//---------------------------------------------------------------------------
|
|
#ifndef LetreroDigitalH
|
|
#define LetreroDigitalH
|
|
//---------------------------------------------------------------------------
|
|
#include <vcl\SysUtils.hpp>
|
|
#include <vcl\Controls.hpp>
|
|
#include <vcl\Classes.hpp>
|
|
#include <vcl\Forms.hpp>
|
|
|
|
//---------------------------------------------------------------------------
|
|
class PACKAGE TLetreroDigital : public TGraphicControl
|
|
{
|
|
private:
|
|
TBorderStyle FBorderStyle; // Con borde o sin borde
|
|
TBrush *FBrush; // Para el relleno del fondo
|
|
TColor cLED_ON; // Color de la LED encendida y
|
|
TColor cLED_OFF; // apagada
|
|
|
|
|
|
|
|
AnsiString FFuente; // Fuente a utilizar ( RAW Format 8x16 )
|
|
AnsiString FCadena; // Cadena a mostrar
|
|
char BitByte; // Contador de digito actual a cero
|
|
char currByte; // Posición dentro de la frase
|
|
int AX, AY; // Ancho X, e Y
|
|
unsigned int Flen; // Longitud de la frase
|
|
int TAMx, TAMy; // Ancho y Alto de las fuentes ( 8 x 16: Deft. )
|
|
char *ptr_char; // Puntero a la fuente fija RAW.
|
|
bool FActivarLD;
|
|
TTimer *FPulsoReloj;
|
|
int FFrecReloj;
|
|
|
|
enum TFPitchFnt { f_16x16, f_16x8, f_8x16, f_8x8 };
|
|
TFPitchFnt FPitchFnt;
|
|
|
|
// Cambia la relación segun indice
|
|
void __fastcall SetTAMg( TFPitchFnt Index );//, int Index );
|
|
|
|
// Evento OnChange, dirigido a la siguiente función:
|
|
void __fastcall CambioAtributo( TObject * Sender );
|
|
|
|
// Dibujo del letrero digital (Desde cero SI/NO)
|
|
void __fastcall DibujaLD( bool RESET );
|
|
void __fastcall OnTimerHandler(TObject *Sender);
|
|
|
|
|
|
protected:
|
|
// Redefinimos el método Paint, que será llamado cada vez
|
|
// que sea necesario redibujar el componente.
|
|
void __fastcall Paint();
|
|
public:
|
|
// Cambia la relación ALTO/ANCHO "at Run Time".
|
|
void __fastcall SetAx( int NuevoValor );
|
|
void __fastcall SetAy( int NuevoValor );
|
|
void __fastcall SetBrush( TBrush *NuevoValor );
|
|
void __fastcall SetBorderStyle( TBorderStyle NuevoValor );
|
|
void __fastcall SetLED_Color( TColor NuevoValorON, TColor NuevoValorOFF );
|
|
// Tipo de letra RAW
|
|
void __fastcall SetFont( AnsiString NuevoValor );
|
|
// Cambia la relación ALTO/ANCHO.
|
|
void __fastcall SetTAM( int NuevoTAMx, int NuevoTAMy );
|
|
// Cambia la cadena a mostrar: "at RunTime"
|
|
void __fastcall SetCadena( AnsiString NuevaCadena );
|
|
// Frecuencia del reloj
|
|
void __fastcall SetFrecReloj( int NuevoReloj );
|
|
|
|
__fastcall TLetreroDigital(TComponent* Owner);
|
|
__fastcall ~TLetreroDigital();
|
|
__published:
|
|
__property TBorderStyle BorderStyle = { read = FBorderStyle, write = SetBorderStyle, default=bsSingle };
|
|
__property TBrush *Brush = { read = FBrush, write = SetBrush };
|
|
__property TColor LED_ON = { read = cLED_ON, write = cLED_ON, default = clBlack };
|
|
__property TColor LED_OFF = { read = cLED_OFF, write = cLED_OFF, default = clYellow };
|
|
|
|
__property int FrecReloj = { read = FFrecReloj, write = SetFrecReloj, default = 100 };
|
|
|
|
|
|
|
|
__property Left ;
|
|
__property Top ;
|
|
__property Width = { default = 96 };
|
|
__property Height = { default = 32 };
|
|
|
|
__property TFPitchFnt PitchFuente = { read = FPitchFnt, write = SetTAMg };
|
|
__property AnsiString FuenteRAW = { read = FFuente, write = SetFont };
|
|
__property AnsiString Letrero = { read = FCadena, write = SetCadena };
|
|
__property int AmplitudX = { read = AX , write = SetAx , default = 2 };
|
|
__property int AmplitudY = { read = AY , write = SetAy , default = 2 };
|
|
// __property bool ActivarLD = { read = FPulsoReloj -> Enabled, write = FPulsoReloj -> Enabled };
|
|
};
|
|
//---------------------------------------------------------------------------
|
|
#endif
|