An object's Settings notebook is created by the Workplace Shell by calling the object's wpAddSettingsPages. Adding pages to the Settings notebook that a class has inherited from its ancestors is accomplished by overriding wpAddSettingsPages and by calling a new method that inserts the page. The new method calls wpInsertSettingsPage to insert the page into the object's notebook. The following sample code shows how to insert pages to an object's notebook:
/************************** New Method ****************************/ SOM_Scope ULONG SOMLINK MyObject_wpAddAnotherPage( MyObject *somSelf, HWND hwndNotebook) { PAGEINFO pageinfo; . . /* Setup the page information data structure for my new page */ . . /* Add the page to the Settings notebook */ return _wpInsertSettingsPage(somSelf, hwndNotebook, &pageinfo); } /************************ Method Overrides *************************/ SOM_Scope BOOL32 SOMLINK MyObject_wpAddSettingsPage ( MyObject *somSelf, HWND hwndNotebook) { . . if (parent_wpAddSettingsPage (somSelf, hwndNotebook) && _wpAddAnotherPage (somSelf, hwndNotebook)) return (TRUE); /* Page added successfully */ else return (FALSE); /* Something failed */ }
New pages for an object's Settings notebook can be placed at the top or bottom of pages inherited from the object's ancestor classes. By calling parent_wpAddSettingsPages before calling the new wpAddAnotherPage, the new page is added to the top of the Settings notebook, above pages inherited from ancestor classes. If the sequence is reversed, the new page is added to the bottom of the Settings notebook, below pages inherited from ancestor classes.
When a new page is added to the Settings notebook, any changes made to the object's instance data can be refreshed from the file system, via wpCnrRefreshDetails. This instance method causes all currently visible RECORDCORE structures to be refreshed with the current object details.