Jump to content

WpInsertSettingsPage: Difference between revisions

From EDM2
No edit summary
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:wpInsertSettingsPage}}
{{DISPLAYTITLE:wpInsertSettingsPage}}
This instance method is called to insert a page into the object's Settings notebook.


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:
<pre>
<pre>
#define INCL_WINWORKPLACE
#define INCL_WINWORKPLACE
Line 13: Line 40:
ulPageId = _wpInsertSettingsPage(somSelf, hwndNotebook, ppageinfo);
ulPageId = _wpInsertSettingsPage(somSelf, hwndNotebook, ppageinfo);
</pre>
</pre>
In this example, a Settings notebook page is added to let the user modify the Last Worker's name.
<PRE>
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 );
}
</PRE>
==Related Methods==
    [[wpAddSettingsPages]]
[[Category:Workplace Instance Methods]]

Revision as of 22:56, 10 September 2025

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