Public Member Functions

SystemTrayIconComponent Class Reference

On Windows only, this component sits in the taskbar tray as a small icon. More...

Inherits Component.

List of all members.

Public Member Functions

 SystemTrayIconComponent ()
 ~SystemTrayIconComponent ()
 Destructor.
void setIconImage (const Image &newImage)
 Changes the image shown in the taskbar.
void setIconTooltip (const String &tooltip)
 Changes the tooltip that Windows shows above the icon.
void paint (Graphics &g)
 Components can override this method to draw their content.

Detailed Description

On Windows only, this component sits in the taskbar tray as a small icon.

To use it, just create one of these components, but don't attempt to make it visible, add it to a parent, or put it on the desktop.

You can then call setIconImage() to create an icon for it in the taskbar.

To change the icon's tooltip, you can use setIconTooltip().

To respond to mouse-events, you can override the normal mouseDown(), mouseUp(), mouseDoubleClick() and mouseMove() methods, and although the x, y position will not be valid, you can use this to respond to clicks. Traditionally you'd use a left-click to show your application's window, and a right-click to show a pop-up menu.


Constructor & Destructor Documentation

SystemTrayIconComponent::SystemTrayIconComponent (  )
SystemTrayIconComponent::~SystemTrayIconComponent (  )

Destructor.


Member Function Documentation

void SystemTrayIconComponent::setIconImage ( const Image newImage )

Changes the image shown in the taskbar.

void SystemTrayIconComponent::setIconTooltip ( const String tooltip )

Changes the tooltip that Windows shows above the icon.

void SystemTrayIconComponent::paint ( Graphics g ) [virtual]

Components can override this method to draw their content.

The paint() method gets called when a region of a component needs redrawing, either because the component's repaint() method has been called, or because something has happened on the screen that means a section of a window needs to be redrawn.

Any child components will draw themselves over whatever this method draws. If you need to paint over the top of your child components, you can also implement the paintOverChildren() method to do this.

If you want to cause a component to redraw itself, this is done asynchronously - calling the repaint() method marks a region of the component as "dirty", and the paint() method will automatically be called sometime later, by the message thread, to paint any bits that need refreshing. In Juce (and almost all modern UI frameworks), you never redraw something synchronously.

You should never need to call this method directly - to take a snapshot of the component you could use createComponentSnapshot() or paintEntireComponent().

Parameters:
gthe graphics context that must be used to do the drawing operations.
See also:
repaint, paintOverChildren, Graphics

Reimplemented from Component.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines