Icon Related Methods

A program or Workplace Shell object would call the following methods to get information about an object's icons. A Workplace Shell object would override these methods to define its icons.

┌──────────────────────────────┬──────────────────────────────┐
│Method Name                   │Description                   │
├──────────────────────────────┼──────────────────────────────┤
│wpQueryHandleFromContents     │Returns a handle to a known   │
│                              │system data type based on a   │
│                              │file's contents.  This is an  │
│                              │abstract method; subclasses   │
│                              │that describe files for which │
│                              │a system handle type exist    │
│                              │(such as WPIcon or WPBitmap)  │
│                              │should subclass this method.  │
├──────────────────────────────┼──────────────────────────────┤
│wpQueryIconData               │Returns the information that  │
│                              │defines the object's icon.    │
│                              │This overrides the class      │
│                              │default icon defined by       │
│                              │wpclsQueryIconData.           │
├──────────────────────────────┼──────────────────────────────┤
│wpclsQueryIconData            │Returns the information that  │
│                              │defines the class default     │
│                              │icon. This icon is associated │
│                              │with every object of this     │
│                              │class. This icon can be       │
│                              │changed for an individual     │
│                              │object if:                    │
│                              │                              │
│                              │o The object overrides        │
│                              │  wpQueryIconData.            │
│                              │o The wpSetIconData method    │
│                              │  is called.                  │
│                              │o The wpSetup method is called│
│                              │  with the ICONFILE or        │
│                              │  ICONRESOURCE keyword, or if │
│                              │  the user edits the icon on  │
│                              │  the General page of the     │
│                              │  Settings notebook.          │
│                              │                              │
│                              │For a folder class, this is   │
│                              │the closed folder icon.       │
├──────────────────────────────┼──────────────────────────────┤
│wpclsQueryIconDataN           │Returns the information that  │
│                              │defines the nth class default │
│                              │animation icon.               │
│                              │                              │
│                              │Note:                         │
│                              │This method is available only │
│                              │for a folder class.  It       │
│                              │defines the default open      │
│                              │folder icon for all objects   │
│                              │of this class.  This icon can │
│                              │be changed for an individual  │
│                              │object if wpSetup is called   │
│                              │with the ICONNFILE or         │
│                              │ICONNRESOURCE keyword, or if  │
│                              │the user edits the animation  │
│                              │icon on General page 2 of the │
│                              │Settings notebook.            │
└──────────────────────────────┴──────────────────────────────┘

A program or Workplace Shell object would call the following methods to get information about an object's icons. These methods are not normally overridden by the object.

┌──────────────────────────────┬──────────────────────────────┐
│Method Name                   │Description                   │
├──────────────────────────────┼──────────────────────────────┤
│wpQueryIcon                   │Returns the handle of the     │
│                              │object's icon.                │
├──────────────────────────────┼──────────────────────────────┤
│wpclsQueryIcon                │Returns the handle of the     │
│                              │class default icon. For a     │
│                              │folder class, this method     │
│                              │returns the handle of the     │
│                              │class' default closed folder  │
│                              │icon.                         │
├──────────────────────────────┼──────────────────────────────┤
│wpclsQueryIconN               │Returns the handle of the nth │
│                              │class default animation icon. │
│                              │This method is available only │
│                              │for a folder class. It returns│
│                              │the handle of the class'      │
│                              │default open folder icon.     │
└──────────────────────────────┴──────────────────────────────┘

A program or Workplace Shell object would call the following methods to change the icon for an object. These methods are not normally overridden by the object.

┌──────────────────────────────┬──────────────────────────────┐
│Method Name                   │Description                   │
├──────────────────────────────┼──────────────────────────────┤
│wpSetIcon                     │Sets the handle of the        │
│                              │object's icon. This handle is │
│                              │not saved in the persistent   │
│                              │data of the object, so it has │
│                              │effect until the object goes  │
│                              │dormant. This method affects  │
│                              │all open views of the object. │
│                              │For a folder object, wpSetIcon│
│                              │affects the icon displayed:   │
│                              │                              │
│                              │o In the title bar.           │
│                              │o On the Toolbar.             │
│                              │o On the General page 1 of    │
│                              │  the Settings notebook.      │
│                              │o In all containers if the    │
│                              │  object is closed.           │
│                              │  If the object is open, all  │
│                              │  containers continue to show │
│                              │  the object's animation      │
│                              │  icon.                       │
├──────────────────────────────┼──────────────────────────────┤
│wpSetIconData                 │Sets the definition for the   │
│                              │object's icon. This icon      │
│                              │definition is saved with the  │
│                              │persistent data of the object.│
│                              │It permanently changes the    │
│                              │object's icon. This method    │
│                              │automatically calls wpSetIcon │
│                              │to update the visual display  │
│                              │of the object's icon.         │
├──────────────────────────────┼──────────────────────────────┤
│wpSetProgIcon                 │Sets the visible icon         │
│                              │associated with the program   │
│                              │reference or program file     │
│                              │object. This method is        │
│                              │available only for a program  │
│                              │reference or program file     │
│                              │object.                       │
├──────────────────────────────┼──────────────────────────────┤
│wpclsSetIcon                  │Sets the handle of the default│
│                              │class icon.                   │
├──────────────────────────────┼──────────────────────────────┤
│wpclsSetIconData              │Sets the definition of the    │
│                              │default class icon.           │
└──────────────────────────────┴──────────────────────────────┘


[Back: Folder Related Methods]
[Next: Image File Related Methods]