A page can be removed from an object's Settings notebook by overriding the ancestors' method that inserts it. The Settings notebook for YourObject class inherits the General, Window, MyPage_1, and MyPage_2 pages defined by its ancestors, MyObject and WPObject. YourObject class might have requirements for MyPage_1 but not MyPage_2. To remove MyPage_2 from YourObject's Settings notebook, YourObject must override the method inherited from MyObject that adds MyPage_2 to the Settings notebook, and return SETTINGS_PAGE_REMOVED without calling the parent method. The following sample code shows how to remove a page from an object's notebook:

/*********************  Method Overrides  ****************************/

SOM_Scope ULONG SOMLINK YourObject_wpAddAnotherPage(
                           YourObject *somSelf HWND hwndNotebook)
{
  .
  .
  .

  /* Remove the page from the Settings notebook */
  return (SETTINGS_PAGE_REMOVED);
}

The same technique can be used to replace or to remove the General page from an object's Settings notebook by overriding wpAddSettingsPages and wpAddObjectGeneralPage. The override to wpAddSettingsPages calls wpAddObjectGeneralPage. To remove the General page, the override to wpAddObjectGeneralPage returns SETTINGS_PAGE_REMOVED without calling the parent method. To replace the General page with another page, the override to wpAddObjectGeneralPage calls wpInsertSettingsPage without calling the parent method.


[Back] [Next]