(Delphi7) Led Lampeggiante.

MrCamarium

Utente Attivo
24
1
CPU
Pentium IV 3 Gh
Scheda Madre
Biostar
HDD
150 Gb
RAM
1,5 Gb
PSU
400
Case
Trasparente
OS
Windows 7 e Linux Ubuntu
Avrei bisogno di un tuo aiuto:

Quando ren che è un label si trova al di sotto di 30 mi dovrebbe lampeggiare verde quando è tra 31 e 60 giallo e quando supera il 61 dovrebbe lampeggiare rosso come posso fare?

DESCRIPTION
-----------
Dynamic resizing is possible, but the 6 predefined versions are best.
Resizing upwards is acceptable, but resizing downwards results in loss of clarity.
Resizing requires a definition of the form
ALED1.width := NewWidth ;
ALED1.height := NewHeight ;
to be executed when the form is first drawn or after each change in the style
or colours.

Dynamic selection of the LED style is also possible (try doing that in hardware!)

Any defined system colour can be independently defined for the ON and OFF states.
Blinking (when ON state selected) is provided, with user selectable blink rate.

[Event]
OnClick,
*OnMouseEnter,
*OnMouseLeave,
*OnTimer(When Blink is true)
[Properties]
Blink(True or False),
FalseColor(when Value is false)(You can select any defined color),
Hint,
Interval(Blink Interval),
LedStyle(LEDSmall,LEDLarge,LEDSqSmall,LEDSqLarge,LEDVertical,LEDHorizontal),
ShowHints(True or False),
TrueColor(when Value is true)(You can select any defined color),
Value(True or False);

Focus Colour Control for LEDs

The OnMouseEnter and OnMouseLeave events can be used to provide focus indication
by changing the LED colour (eg changing from Lime/Green to Red/Maroon when the
mouse enters the LED region and reverting to Lime/Green on exit)

Suggested True (ON) and False (OFF) Colours for LEDs are:
TrueColor FalseColor
--------- ----------
Red Maroon
Yellow Olive
Lime Green
Fuchsia Purple
Aqua Teal
Blue Navy
White Gray
Silver Black

Click Control

Using the OnClick event allows clicking the LED to initiate any desired action,
such as starting/stopping a timer or counter.

This component has been successfully tested on Delphi2, Delphi3,Delphi4,Delphi5,Delphi6
Test code is not included. The component is simple and registers
as ALed in the Extras component panel.
 

MrCamarium

Utente Attivo
24
1
CPU
Pentium IV 3 Gh
Scheda Madre
Biostar
HDD
150 Gb
RAM
1,5 Gb
PSU
400
Case
Trasparente
OS
Windows 7 e Linux Ubuntu
Analizzando un programma scritto da Delphiruby e seguendo i vostri suggerimenti ho fatto in questo modo:
Codice:
procedure TForm2.Timer1Timer(Sender: TObject);
begin
ALed1.Value  := True;
ALed2.Value := True;
ALed3.Value := True;
end;
Ma adesso come faccio ad fare in modo che mi lampeggi solo quando si trovano tra questi valori?
0-30
31-60
oltre 61?
 

MrCamarium

Utente Attivo
24
1
CPU
Pentium IV 3 Gh
Scheda Madre
Biostar
HDD
150 Gb
RAM
1,5 Gb
PSU
400
Case
Trasparente
OS
Windows 7 e Linux Ubuntu
Codice:
var
numero,numero_da_controllare:integer;
begin
numero_da_Controllare := Ren.Caption;
numero := 30;
if numero_da_Controllare < numero then
ALed1.Value := True;
end;

Ho fatto cosi ma mi da questo errore:
Incompatible types: 'Integer' and 'TCaption'
come posso riparare l'errore?
 

MrCamarium

Utente Attivo
24
1
CPU
Pentium IV 3 Gh
Scheda Madre
Biostar
HDD
150 Gb
RAM
1,5 Gb
PSU
400
Case
Trasparente
OS
Windows 7 e Linux Ubuntu
Codice:
var
numero,numero_da_controllare:integer;
begin
numero_da_Controllare := StrToInt(Ren.Caption);
numero := 30;
if numero_da_Controllare < numero then
ALed1.Value := True;
end;

Risolto ho trovato nei miei appunti la soluzione.
 

Entra

oppure Accedi utilizzando
Discord Ufficiale Entra ora!

Discussioni Simili