The CAR sample Workplace Shell object included in the Toolkit provides an example of how to create an object. CAR is a spin-off implementation of the CAR object example used in the Systems Application Architecture: Common User Access Guide to User Interface Design.
The CAR object has two views:
The Horn beep and Dashboard pages in the CAR's Settings notebook are dialog windows whose contents are defined in a dialog template in the CAR.RC resource file. The resources are appended to the binary CAR.DLL file. The help panels associated with the dialogs are defined in the CAR.HLP help library. The association between the help panels and the dialogs is established with the dialog template in the resource file.
CAR is a persistent object but not a part of the file system. Therefore, it is derived from the WPAbstract class, which is derived from the WPObject root Workplace Shell class. This means that CAR inherits the methods from WPAbstract, which, in turn, inherits all of the instance and class methods from WPObject. CAR defines new methods and overrides some instance and class methods inherited from both WPAbstract and WPObject. New methods defined for the CAR class are summarized in the following table:
┌──────────────────────┬─────────────────────────┐│Method Name │Description │ ├──────────────────────┼─────────────────────────┤ │carQueryInfo │Gets the CAR information.│ │ │It is called by the │ │ │dialog procedure to get │ │ │the latest CAR data when │ │ │the dialog window opened.│ ├──────────────────────┼─────────────────────────┤ │carSetInfo │Sets up the CAR │ │ │information. It is called│ │ │by the dialog procedure │ │ │to update the CAR data as│ │ │the user interacts with │ │ │the dialog window. │ ├──────────────────────┼─────────────────────────┤ │wpAddDashboardPage │Inserts the Dashboard │ │ │page into the Settings │ │ │notebook. It is called by│ │ │wpAddSettingsPages. │ ├──────────────────────┼─────────────────────────┤ │wpAddHornBeepPage │Inserts the Horn beep │ │ │page into the Settings │ │ │notebook. It is called by│ │ │wpAddSettingsPages. │ └──────────────────────┴─────────────────────────┘