Click or drag to resize

Icon Class

X#
Create an icon, which is a small bitmap that the system displays for a window when it is iconized in its owner window.
Inheritance Hierarchy
Object
  VObject
    Icon

Namespace:  VO
Assembly:  VOGUIClasses (in VOGUIClasses.dll) Version: 2.19
Syntax
 CLASS Icon INHERIT VObject
Request Example View Source

The Icon type exposes the following members.

Constructors
  NameDescription
Public methodIcon
Construct an icon.
Top
Methods
  NameDescription
Public methodDestroy
Provide a method to de-instantiate an Icon object.
(Overrides Destroy.)
Public methodHandle
Return the handle for an icon.
Top
Fields
  NameDescription
Public fieldoCargo
Cargo slot.
(Inherited from VObject.)
Top
Remarks
X# provides a set of predefined icons, defined in Icon:Init(). Use the AppWindow:Icon property to assign an icon for each application window. Visual Object includes an Icon Editor which produces standard system icon files. There is also a large library of system icons. These icon files are compatible with the standard format on the system, so any other icon file or Icon Editor may also be used. To use such an icon file, create an icon resource with the RESOURCE statement and reference it when instantiating an icon. Refer to the IDE User Guide for more information on using and editing the standard icons.
Tip Tip
An icon's size and color range is system-dependent.
Examples
The following example demonstrates the use of one of the standard icons:
X#
1CLASS MyWindow INHERIT TopAppWindow
2METHOD Init() CLASS MyWindow
3SUPER:Init()
4SELF:Icon := Icon{ICONASTERISK}
This code fragment emphasizes three things: Any Init() method of a class that inherits must call SUPER:Init(). The pseudo-variable Icon is an access/assign pair in class AppWindow. ICONASTERISK identifies one of the standard icons. The following example provides an application window with a custom icon:
X#
1CLASS MyTopAppWin INHERIT TopAppWindow
2METHOD Init CLASS MyTopAppWin
3SUPER:Init()
4SELF:Icon := Icon{IDI_APPICON}
5RESOURCE IDI_APPICON ICON app.ico
In Windows, icons are defined in a resource entity using the keyword ICON, referencing the name of the file created by the Icon Editor.
See Also

Reference