Inherits TQWidget.
An LED widget.
Displays a round or rectangular light emitting diode.
It is configurable to five colors, the two on/off states and three styles (or "looks");
It may display itself in a performant flat view, a round view with light spot or a round view sunken in the screen.
KDE LED Widget
- Author
- Joerg Habenicht, Richard J. Moore (rich@.nosp@m.kde..nosp@m.org) 1998, 1999
Definition at line 45 of file kled.h.
Displays a flat, round or sunken LED.
Displaying the LED flat is less time and color consuming, but not so nice to see.
The sunken LED itself is (certainly) smaller than the round LED because of the 3 shading circles and is most time consuming. Makes sense for LED > 15x15 pixels.
Timings:
( AMD K5/133, Diamond Stealth 64 PCI Graphics, widgetsize 29x29 )
- flat Approximately 0.7 msec per paint
- round Approximately 2.9 msec per paint
- sunken Approximately 3.3 msec per paint
The widget will be updated on the next repaining event.
LED look.
Definition at line 90 of file kled.h.
Constructor with the ledcolor, ledstate, ledlook, the parent widget, and the name.
Differs from above only in the parameters, which configure all settings.
- Parameters
-
col | Initial color of the LED. |
state | Sets the State. |
look | Sets the Look. |
shape | Sets the Shape (rectangular or circular) |
parent | Will be handed over to TQWidget. |
name | Will be handed over to TQWidget. |
Constructor
Definition at line 83 of file kled.cpp.
void KLed::setColor |
( |
const TQColor & |
color | ) |
|
Set the color of the widget.
The Color is shown with the KLed::On state. The KLed::Off state is shown with TQColor.dark() method
The widget calls the update() method, so it will be updated when entering the main event loop.
- See also
- Color
- Parameters
-
color | New color of the LED. |
Sets the LED color.
Definition at line 578 of file kled.cpp.
void KLed::setDarkFactor |
( |
int |
darkfactor | ) |
|
Sets the factor to darken the LED in OFF state.
Same as TQColor::dark(). "darkfactor should be greater than 100, else the LED gets lighter in OFF state. Defaults to 300.
- See also
- TQColor
- Parameters
-
darkfactor | sets the factor to darken the LED. |
sets the factor to darken the LED.
Definition at line 601 of file kled.cpp.
void KLed::setLook |
( |
Look |
look | ) |
|
Sets the color of the widget.
The Color is shown with the KLed::On state. darkcolor is explicidly used for the off state of the LED. Normally you don't have to use this method, the setColor(const TQColor& color) is sufficient for the task.
The widget calls the update() method, so it will be updated when entering the main event loop.
- See also
- Color setColor()
- Parameters
-
color | New color of the LED used for on state. |
darkcolor | Dark color of the LED used for off state. |
Sets the light and dark LED color.
void setColor(const TQColor& color, const TQColor& darkcolor); Sets the look of the widget.
The look may be flat, round or sunken. The widget calls the update() method, so it will be updated when entering the main event loop.
- See also
- Look
- Parameters
-
Sets LED look.
Definition at line 617 of file kled.cpp.
void KLed::setOffColor |
( |
const TQColor & |
color | ) |
|
Set the off color of the widget.
The Color is shown with the KLed::On state. The KLed::Off state is shown with this color if set
The widget calls the update() method, so it will be updated when entering the main event loop.
Note that calling setColor will override this value
- See also
- Color
- Parameters
-
color | New off color of the LED. |
Sets the LED off color.
Definition at line 590 of file kled.cpp.