Jump to content

wpInsertSettingsPage

From EDM2
Revision as of 22:56, 10 September 2025 by Martini (talk | contribs)

This instance method is called to insert a page into the object's Settings notebook.

Syntax

_wpInsertSettingsPage(somSelf, hwndNotebook, ppageinfo);

Parameters

somSelf (WPObject *) - input
Pointer to the object on which the method is being invoked.
Points to an object of class WPObject.
hwndNotebook (HWND) - input
Handle to the Settings notebook.
ppageinfo (PPAGEINFO) - input
Pointer to the notebook page information.

Returns

ulPageId (ULONG) - returns
Page identifier for the inserted page.
A return value of 0 indicates that an error occurred.

Usage

This method can be called only during the processing of the wpAddSettingsPages method.

How to Override

This method is generally not overridden.

Example Code

Declaration:

#define INCL_WINWORKPLACE
#include <os2.h>

WPObject  *somSelf;       /* Pointer to the object on which the method is being invoked. */
HWND       hwndNotebook;  /* Handle to the Settings notebook. */
PPAGEINFO  ppageinfo;     /* Pointer to the notebook page information. */
ULONG      ulPageId;      /* Page identifier for the inserted page. */

ulPageId = _wpInsertSettingsPage(somSelf, hwndNotebook, ppageinfo);

In this example, a Settings notebook page is added to let the user modify the Last Worker's name.

SOM_Scope BOOL SOMLINK myf_wpAddSettingsPages(MYFILE *somSelf, HWND hwndNotebook)

{
PAGEINFO pageinfo;

MYFILEData *somThis = MYFILEGetData(somSelf);
MYFILEMethodDebug("MYFILE","myf_wpAddSettingsPages");

parent_wpAddSettingsPages(somSelf, hwndNotebook);

memset((PCH)&pageinfo,0,sizeof(PAGEINFO));
pageinfo.cb               = sizeof(PAGEINFO);
pageinfo.hwndPage         = NULLHANDLE;
pageinfo.usPageStyleFlags = BKA_MAJOR;
pageinfo.usPageInsertFlags = BKA_FIRST;
pageinfo.pfnwp            = LastWorkerDlgProc;
pageinfo.resid            = hmod;
pageinfo.dlgid            = IDD_LASTWORKER;
pageinfo.pszName          = "LastWorker";
pageinfo.pCreateParams    = somSelf;
pageinfo.idDefaultHelpPanel = ID_HELP_LASTWORKER;
pageinfo.pszHelpLibraryName = szHelpLibrary;

return _wpInsertSettingsPage( somSelf, hwndNotebook, &pageinfo );
}

Related Methods

   wpAddSettingsPages