Jump to content

WpAddClockDateTimePage: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:


==Syntax==
==Syntax==
<PRE>
  _wpAddClockDateTimePage(somSelf, hwndNotebook);
#define INCL_WINWORKPLACE
#include <os2.h>
 
WPClock    *somSelf;      /*  Pointer to the object on which the method is being invoked. */
HWND        hwndNotebook;  /*  Settings notebook handle. */
ULONG        rc;            /* Page identifier. */
 
rc = _wpAddClockDateTimePage(somSelf, hwndNotebook);
</PRE>


==Parameters==
==Parameters==
Line 34: Line 25:


==Example Code==
==Example Code==
Declaration:
<PRE>
#define INCL_WINWORKPLACE
#include <os2.h>
WPClock    *somSelf;      /*  Pointer to the object on which the method is being invoked. */
HWND        hwndNotebook;  /*  Settings notebook handle. */
ULONG        rc;            /*  Page identifier. */
rc = _wpAddClockDateTimePage(somSelf, hwndNotebook);
</PRE>
This example overrides the method to eliminate this page from the object's Settings notebook.
This example overrides the method to eliminate this page from the object's Settings notebook.
<PRE>
<PRE>
Line 49: Line 52:


==Related Methods==
==Related Methods==
*wpAddSettingsPages
*[[wpAddSettingsPages]]
*wpInsertSettingsPage
*[[wpInsertSettingsPage]]


[[Category:SOM Object Method]]
[[Category:Workplace Instance Methods]]

Latest revision as of 21:35, 1 September 2025

This instance method is called to allow the object to add the Date/Time page to its Settings notebook.

Syntax

_wpAddClockDateTimePage(somSelf, hwndNotebook);

Parameters

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

Return Code

rc (ULONG) - returns

  • Page identifier.
  • Error occurred
PageId
Identifier for the inserted page.

How to Override

This method should always be overridden in order to replace or remove the Date/Time page from the object's Settings notebook. To remove the page from the Settings notebook, the override method should return SETTINGS_PAGE_REMOVED without calling the parent method. To replace the page with another page, the override method should call the wpInsertSettingsPage method without calling the parent method.

Usage

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

Example Code

Declaration:

#define INCL_WINWORKPLACE
#include <os2.h>

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

rc = _wpAddClockDateTimePage(somSelf, hwndNotebook);

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

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

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

/*  return (parent_wpAddClockDateTimePage(somSelf,hwndNotebook)); */
    return ( SETTINGS_PAGE_REMOVED );
}

Related Methods