KwikPeg Manuals
Home
PegIcon
Examples
Examples
Index
Index


Members
Styles
(none)
Signals
(none)
Overview Derived from class PegThing

The PegIcon class provides a simple bitmap display object. A PegIcon object can be used to represent another object.

The PegIcon object can be assigned a pointer to another object which the PegIcon object is to represent. In this case, the PegIcon object acts as a proxy for the other object, called the proxy object. When the PegIcon is selected, it will add its proxy object to the parent of the PegIcon and then destroy itself, eliminating the PegIcon object which has served its purpose.

A window object uses a PegIcon object as a proxy when the window is minimized. For example, a PegDecoratedWindow object will create an instance of a PegIcon when the window is minimized. The PegIcon object is added to the window's parent and the window is then removed from its parent.

A PegIcon object with no proxy object assigned to it can be used as a simple mechanism for displaying a PegBitmap bitmap image.



 See Also

Bitmap Structure (PegBitmap)


Top of page


 Members

Constructors:

PegIcon(PegThing *pProxy,
  PegBitmap *pbitmap = NULL,
  WORD wId = 0, WORD wStyle = FF_NONE)

This constructor creates a PegIcon which represents (is proxy for) another object.

PegIcon(const PegRect &Rect,
  PegBitmap *pbitmap,
  WORD wId = 0, WORD wStyle = FF_NONE)

This constructor creates a PegIcon that will simply display a bitmap. The size and location of the bitmap is determined by parameter Rect.

PegIcon(PegBitmap *pbitmap,
  WORD wId = 0, WORD wStyle = FF_NONE)

This constructor creates a PegIcon that will display a bitmap. The icon will adjust its size to match the bitmap dimensions. Your application can immediately use the Resize() function to position the icon.

 

Public Functions:

virtual void Draw(void)

The PegIcon class overrides the Draw() function to draw the icon bitmap.

virtual PegBitmap *GetIcon(void){return mpBitmap;}

This inline function returns the address of the PegBitmap object which describes the bitmap associated with the PegIcon.

virtual PegThing *GetProxy(void) {return mpProxy;}

This inline function returns the address of the object that is represented by the PegIcon.

virtual SIGNED Message(const PegMessage &Mesg)

The PegIcon class catches PM_LBUTTONUP messages.

virtual void SetIcon(PegBitmap *nbm) { mpBitmap = nbm;}

This inline function can be used to assign the PegBitmap object to be used as the PegIcon bitmap.

virtual void SetProxy(PegThing *pNew) {mpProxy = pNew;}

This inline function can be used to assign or alter the object represented by the PegIcon object.


Top of page


 Examples

The following are examples of PegIcon objects:




Top of page
KwikPeg Manuals
Home
Index
Index

 
Copyright © 2000-2003