Jump to content

wpAddDeviceDevice1Page

From EDM2

This method is specific to Version 4, or higher, of the OS/2 operating system.

This instance method is called to allow an object to add the first Device page to the settings notebook.

Syntax

_wpAddDeviceDevice1Page(somSelf, hwndNotebook)

Parameters

somSelf (WPDevice *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPDevice.
hwndNotebook (HWND) - input
Settings notebook handle.

Returns

rc (ULONG) - returns
Page identifier.
0 Error occurred.
PageId Identifier for the inserted page.

Usage

This method must be called only from within an override of the wpAddSettingsPages method.

How to Override

This method should always be overridden to replace or remove the first Device page from the object's Settings notebook. To remove the page from the settings notebook, the override method must return SETTINGS_PAGE_REMOVED without calling the parent method. To replace the page with another page, the override method must call the wpInsertSettingsPage method without calling the parent method.

Example Code

#define INCL_WORKPLACE
#include <os2.h>

WPDevice     *somSelf;       /*  Pointer to the object on which the method is being invoked. */
HWND             hwndNotebook;  /*  Settings notebook handle. */
ULONG            rc;            /*  Page identifier. */

rc = _wpAddDeviceDevice1Page(somSelf, hwndNotebook);

This example overrides the method to eliminate this page from the object's Settings notebook.

SOM_Scope ULONG SOMLINK MyObj_wpAddDeviceDevice1Page(MyObj *somSelf,
                                              HWND hwndNotebook)

{
  /* MyObjData *somThis = MyObjGetData(somSelf); */
  MyObjMethodDebug("MyObj","MyObj_wpAddDeviceDevice1Page");

  /* return(parent_wpAddDeviceDevice1Page(somSelf,hwndNotebook)); */

  return(SETTINGS_PAGE_REMOVED);
}

Related Methods