Jump to content

WpAddClockAlarmPage: Difference between revisions

From EDM2
No edit summary
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
This method is specific to version 4, or higher, of the OS/2 operating system.
This instance method is called to allow the object to add the Alarm page to its Settings notebook.  
 
This instance method adds the standard type page to the Settings notebook.
This instance method is called to allow the object to add the Alarm page to its Settings notebook.


==Syntax==
==Syntax==
<PRE>
_wpAddClockAlarmPage(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 = _wpAddClockAlarmPage(somSelf, hwndNotebook);
</PRE>
==Parameters==
==Parameters==
; somSelf (WPClock *) - input : Pointer to the object on which the method is being invoked.
;somSelf (WPClock *) - input: Pointer to the object on which the method is being invoked.
 
:Points to an object of class WPClock.
Points to an object of class WPClock.  
;hwndNotebook (HWND) - input: Settings notebook handle.
 
; hwndNotebook (HWND) - input : Settings notebook handle.  


==Return Code==
==Return Code==
rc (ULONG) - returns
;rc (ULONG) - returns:
* Page identifier
* Error occurred


* Page identifier.
;PageId: Identifier for the inserted page.
* Error occurred.
 
; PageId : Identifier for the inserted page.


==How to Override==
==How to Override==
This method should always be overridden in order to remove or replace the Alarm page from the object's Settings notebook.
This method should always be overridden in order to remove or replace the Alarm 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.  
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==
==Usage==
This method must be called only from within an override of the wpAddSettingsPages method.  
This method must be called only from within an override of the wpAddSettingsPages method.


==Example Code==
==Example Code==
Definition.
<PRE>
#define INCL_WINWORKPLACE
#include <os2.h>
WPDataFile    *somSelf;      /*  Pointer to the object on which the method is being invoked. */
HWND            hwndNotebook;  /*  Settings notebook handle. */
ULONG          rc;            /*  Page indicator. */
rc = _wpAddBecomePage(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>
SOM_Scope ULONG  SOMLINK MyObj_wpAddClockAlarmPage(MyObj *somSelf,
SOM_Scope ULONG  SOMLINK MyObj_wpAddClockAlarmPage(MyObj *somSelf,
                 HWND hwndNotebook)
                 HWND hwndNotebook)
{
{
     /* MyObjData *somThis = MyObjGetData(somSelf); */
     /* MyObjData *somThis = MyObjGetData(somSelf); */
Line 52: Line 53:


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


[[Category:The OS/2 API Project]]
[[Category:SOM Object Method]]

Latest revision as of 04:46, 11 May 2025

This method is specific to version 4, or higher, of the OS/2 operating system.

This instance method adds the standard type page to the Settings notebook. This instance method is called to allow the object to add the Alarm page to its Settings notebook.

Syntax

_wpAddClockAlarmPage(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 remove or replace the Alarm 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

Definition.

#define INCL_WINWORKPLACE
#include <os2.h>

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

rc = _wpAddBecomePage(somSelf, hwndNotebook);

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

SOM_Scope ULONG   SOMLINK MyObj_wpAddClockAlarmPage(MyObj *somSelf,
                HWND hwndNotebook)
{
    /* MyObjData *somThis = MyObjGetData(somSelf); */
    MyObjMethodDebug("MyObj","MyObj_wpAddClockAlarmPage");

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

Related Methods

  • wpAddSettingsPages
  • wpInsertSettingsPage