Icon Class | |
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
Namespace:
VO
Assembly:
VOGUIClasses (in VOGUIClasses.dll) Version: 2.19
Syntax The Icon type exposes the following members.
Constructors
| Name | Description |
---|
| Icon |
Construct an icon.
|
TopMethods
| Name | Description |
---|
| Destroy |
Provide a method to de-instantiate an Icon object.
(Overrides Destroy.) |
| Handle |
Return the handle for an icon.
|
TopFields 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 |
---|
An icon's size and color range is system-dependent. |
Examples
The following example demonstrates the use of one of the standard icons:
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:
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