home *** CD-ROM | disk | FTP | other *** search
- /*
- GIK/2 1.0.1 EWYBAEH.C 5621-432 (C) COPYRIGHT IBM CORP 1993. ALL RIGHTS RESERVED. LICENSED MATERIALS - PROPERTY OF IBM.
- */
- /**********************************************************************/
- /* */
- /* MODULE PROLOGUE */
- /* */
- /* COMPONENT NAME: C++ CLASS BROWSER EXAMPLE */
- /* */
- /* MODULE NAME: EWYBAEH.C */
- /* */
- /* DESCRIPTIVE NAME: C++ Parser */
- /* */
- /* PURPOSE: */
- /* */
- /* This module contains the event handling functions for the */
- /* C++ class browser example. */
- /* */
- /* COPYRIGHT: (C) 1993 IBM Corporation */
- /* */
- /* DISCLAIMER OF WARRANTIES. The following [enclosed] code is */
- /* sample code created by IBM Corporation. This sample code is not */
- /* part of any standard or IBM product and is provided to you solely */
- /* for the purpose of assisting you in the development of your */
- /* applications. The code is provided "AS IS", without */
- /* warranty of any kind. IBM shall not be liable for any damages */
- /* arising out of your use of the sample code, even if they have been */
- /* advised of the possibility of such damages. */
- /**********************************************************************/
-
- /*--------------------------------------------------------------------*/
- /* INCLUDE RELATED DEFINES */
- /*--------------------------------------------------------------------*/
-
- #define INCL_DOS /* OS/2 definitions */
- #define INCL_PM /* PM definitions */
-
- /*--------------------------------------------------------------------*/
- /* HEADER FILES */
- /*--------------------------------------------------------------------*/
-
- #include <os2.h> /* OS/2 header file */
- #include <ewyga.h> /* GIK/2 header file */
- #include "ewybadf.h" /* Generated header file */
- #include "ewybacc.h" /* toolcode */
-
- /*--------------------------------------------------------------------*/
- /* LOCAL FUNCTION PROTOTYPES */
- /*--------------------------------------------------------------------*/
-
- SHORT GSENTRY EvDoubleClick(DHND,SHORT,EVS_DOUBLE_CLICK *);
- SHORT GSENTRY EvExit(DHND,SHORT,EVS_EXIT *);
- SHORT GSENTRY EvOpen(DHND,SHORT,EVS_OPEN *);
-
- /**********************************************************************/
- /* EvDoubleClick */
- /* */
- /* Parameters: */
- /* DHND dhnd (I): Diagram handle. */
- /* SHORT ev_id (I): Identifies the event. */
- /* EVS_DOUBLE_CLICK *pEvs (I): Pointer to instance of event*/
- /* data type. */
- /* SHND shnd (I): Handle of the symbol */
- /* SHORT part_ref (I): Reference number of the symbol part*/
- /* USHORT button (I): Mouse button that is pressed */
- /* It is one of the following: */
- /* GS_MB1 */
- /* GS_MB2 */
- /* */
- /* Returns: */
- /* GS_NO Any changes made to symbols remain and the action */
- /* stops. */
- /* GS_NO_1 Any changes made to symbols remain and the action */
- /* stops. */
- /* GS_RESTORE Any changes made to symbols since the last undo */
- /* checkpoint are undone and the action stops. */
- /* GS_RESTORE_1 Any changes made to symbols since the last undo */
- /* checkpoint are undone and the action stops. */
- /* GS_YES The default processing continues. */
- /* */
- /* Description: */
- /* The function handles the event EV_DOUBLE_CLICK. */
- /* */
- /* (if the user double clicks mb1 on a class symbol, */
- /* the C++ class methods will be displayed) */
- /**********************************************************************/
-
- SHORT GSENTRY EvDoubleClick(DHND dhnd,SHORT ev_id,EVS_DOUBLE_CLICK *pEvs
- )
- {
-
- /********************************************************************/
- /* ** if button 1 doubleclicked, show the class methods ** */
- /********************************************************************/
-
- if (pEvs->button == GS_MB1)
- {
- ShowClassMethods(dhnd, pEvs->shnd);
- return GS_NO;
- }
- else
- return GS_YES;
- }
-
- /**********************************************************************/
- /* EvExit */
- /* */
- /* Parameters: */
- /* DHND dhnd (I): Diagram handle. */
- /* SHORT ev_id (I): Identifies the event. */
- /* EVS_EXIT *pEvs (I): Pointer to instance of event*/
- /* data type. */
- /* SHORT close (I): Indicator that specifies whether */
- /* the event is triggered during the */
- /* processing of the WM_CLOSE or the */
- /* WM_DESTROY message */
- /* It is one of the following: */
- /* GS_YES. The WM_CLOSE message is */
- /* processed. */
- /* GS_NO. The WM_DESTROY message is*/
- /* processed. */
- /* HAB hab (I): Handle to anchor block */
- /* HWND hwnd_client (I): Handle to client window */
- /* HWND hwnd_frame (I): Handle to frame window */
- /* SHORT delay_mode (I): Indicates whether the function */
- /* GsDelay is currently processing. */
- /* It is GS_YES or GS_NO */
- /* */
- /* Returns: */
- /* GS_NO Any changes made to symbols remain and the action */
- /* stops. */
- /* GS_NO_1 Any changes made to symbols remain and the action */
- /* stops. */
- /* GS_RESTORE Any changes made to symbols since the last undo */
- /* checkpoint are undone and the action stops. */
- /* GS_RESTORE_1 Any changes made to symbols since the last undo */
- /* checkpoint are undone and the action stops. */
- /* GS_YES The default processing continues. */
- /* */
- /* Description: */
- /* The function handles the event EV_EXIT. */
- /* */
- /* (just to prevent the ... save diagram ... message, which */
- /* is not needed in this example as the data comes from the */
- /* c++ header files) */
- /**********************************************************************/
-
- SHORT GSENTRY EvExit(DHND dhnd,SHORT ev_id,EVS_EXIT *pEvs)
- {
-
- /********************************************************************/
- /* ** to prevent the ... save diagram ... message stuff ** */
- /********************************************************************/
-
- GsPutDiagModify(dhnd, GS_NO);
- return GS_YES;
- }
-
- /**********************************************************************/
- /* EvOpen */
- /* */
- /* Parameters: */
- /* DHND dhnd (I): Diagram handle. */
- /* SHORT ev_id (I): Identifies the event. */
- /* EVS_OPEN *pEvs (I): Pointer to instance of event*/
- /* data type. */
- /* CHAR *pFile_spec (I/O): Pointer to a memory block of the */
- /* length GS_FILE_SPEC_LEN+1 bytes */
- /* At input, this member contains the */
- /* fully qualified file specification */
- /* that was selected with the Open */
- /* dialog box. At output, this member */
- /* specifies from where the diagram is*/
- /* opened. It can be one of the */
- /* following: */
- /* A full-qualified file */
- /* specification to open */
- /* A GSS_IO_HANDLER data instance */
- /* NULL to use the formerly defined */
- /* file specification. */
- /* */
- /* Returns: */
- /* GS_NO Any changes made to symbols remain and the action */
- /* stops. */
- /* GS_NO_1 Any changes made to symbols remain and the action */
- /* stops. */
- /* GS_REJECT The attempt to end the action is rejected and the */
- /* graphics editor retries the action processing. */
- /* GS_RESTORE Any changes made to symbols since the last undo */
- /* checkpoint are undone and the action stops. */
- /* GS_RESTORE_1 Any changes made to symbols since the last undo */
- /* checkpoint are undone and the action stops. */
- /* GS_YES The default processing continues. */
- /* */
- /* Description: */
- /* The function handles the event EV_OPEN. */
- /* */
- /* (overrides the standard diagram open, reads in a c++ header */
- /* file and draws the class structure) */
- /**********************************************************************/
-
- SHORT GSENTRY EvOpen(DHND dhnd,SHORT ev_id,EVS_OPEN *pEvs)
- {
-
- /********************************************************************/
- /* ** build new tree ** */
- /********************************************************************/
-
- BuildTree(dhnd, pEvs->pFile_spec);
- GsUpdateGraphics(dhnd);
- return GS_NO;
- }