home *** CD-ROM | disk | FTP | other *** search
- //lRegen_FileHeading
- //lRegen_FileHeading
-
- /********************************************************************
- *
- * Source File: idodialo.c
- * Author:
- * Module: Source for idoiface application
- * Program Desc:
- * Date: Thu Mar 07 18:40:47 1996
- * Language: ANSI C
- *
- ********************************************************************/
-
- #include ".\idoiface.h"
-
-
- //lRegen_Variables
-
- BOOL bMsg = FALSE;
-
- //lRegen_Variables
-
- LRESULT CALLBACK EXPORT fnidodialogWndProc(HWND, UINT, WPARAM, LPARAM);
-
- int fnidodialog(HWND hClientWnd, UINT iData, void FAR *lpData)
- {
- VIEW hViewidodialog;
- HWND hWndidodialog;
- //lRegen_BeginFunction
- //lRegen_BeginFunction
-
-
- //lRegen_InitDlg
- //lRegen_InitDlg
-
- if(NULL == (hViewidodialog = vwCreateMDIChildView(hInstance,
- MAKEINTRESOURCE(idodialog),
- hClientWnd,
- fnidodialogWndProc,
- NULL)))
- return FALSE;
-
-
- //lRegen_InitView
- //lRegen_InitView
- if((hWndidodialog = vwShowMDIChildView(hViewidodialog)) == (HWND)-1)
- {
- MessageBox(NULL, "Unable to display view", "System Error",
- MB_SYSTEMMODAL | MB_ICONHAND | MB_OK);
- return FALSE;
- }
-
- //lRegen_TermView
- //lRegen_TermView
- return(TRUE);
- }
-
- LRESULT CALLBACK EXPORT fnidodialogWndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
- {
- GETVIEW;
- WORD CtlId;
- WORD Notify;
- HWND CtlWnd;
- //lRegen_WindowProcVariables
-
- #define WUM_ADDITEMS WM_USER + 345
-
- //lRegen_WindowProcVariables
-
- switch(uMessage)
- {
- //lRegen_WndProc
-
-
- case WM_USER + 24 :
-
- idoSetEditMode(GetDlgItem(hWnd, IDC_IDO), TRUE);
- idoSetToolsPalette(GetDlgItem(hWnd, IDC_IDO), TRUE);
-
- break;
-
-
- case WUM_ADDITEMS :
-
- /*
- * Enter IDo into edit mode.
- */
- idoSetEditMode(GetDlgItem(hWnd, IDC_IDO), TRUE);
-
- /*
- * Add an entity.
- */
- idoAddEntityFromClass(GetDlgItem(hWnd, IDC_IDO), 15, "15L", "Generic", "First Item", 0, 0, 0, 0);
-
- /*
- * Add an entity.
- */
- idoAddEntityFromClass(GetDlgItem(hWnd, IDC_IDO), 25, "25L", "Generic", "Second Item", 0, 0, 0, 0);
-
-
- /*
- * Add a relation from First Item to Second Item.
- */
- idoAddRelationFromClass(GetDlgItem(hWnd, IDC_IDO), 35, "35L", "Is Related", "Is Related To",
- 15, "15L",
- 25, "25L");
-
- /*
- * Delete a relation from First Item to Second Item.
- */
- // idoDeleteRelation(GetDlgItem(hWnd, IDC_IDO), 35, "35L");
-
- /*
- * Terminate edit mode in IDO.
- */
- idoSetEditMode(GetDlgItem(hWnd, IDC_IDO), FALSE);
-
- break; // end of WUM_ADDITEMS
-
- // *****************************************************************
- // *****************************************************************
-
- case IDOM_NOTIFY_CLICK_RELATION :
- /*
- * We are notified that a relation was clicked
- */
- IDO_n_ClickRelation(GetDlgItem(hWnd, IDC_IDO), lParam);
- break;
-
- case IDOM_NOTIFY_CLICK_ENTITY :
- /*
- * We are notified that an entity was clicked
- */
- IDO_n_ClickEntity(GetDlgItem(hWnd, IDC_IDO), lParam);
- break;
-
- case IDOM_NOTIFY_CLICK_IDO :
- /*
- * We are notified that the IDO was clicked
- */
- IDO_n_ClickIDO(GetDlgItem(hWnd, IDC_IDO), lParam);
- break;
-
-
- case IDOM_NOTIFY_BEFOREDISPLAYHELP :
- /*
- * We are notified that the help file is to be displayed
- */
- // SendMessage(GetDlgItem(hWnd, IDC_IDO), IDOM_NOTIFYRESULT, 1, 1);
- break;
-
- case IDOM_NOTIFY_BEFOREDISPLAYOPTIONSMENU :
- /*
- * We are notified that the options menu is to be displayed
- */
- // SendMessage(GetDlgItem(hWnd, IDC_IDO), IDOM_NOTIFYRESULT, 1, 1);
- break;
-
- case IDOM_NOTIFY_DISPLAYMANAGERULESBUTTON :
- /*
- * Hide rules button if rules are not being enforced.
- */
- if(!idoGetRulesEnforced(GetDlgItem(hWnd, IDC_IDO)))
- idoCancelAction(GetDlgItem(hWnd, IDC_IDO));
- break;
-
- case IDOM_NOTIFY_BEFOREDIAGRAMLOADED :
- case IDOM_NOTIFY_DIAGRAMLOADED :
- case IDOM_NOTIFY_BEFOREDIAGRAMSAVED :
- case IDOM_NOTIFY_DIAGRAMSAVED :
- case IDOM_NOTIFY_BEFOREDIAGRAMRESET :
- case IDOM_NOTIFY_DIAGRAMRESET :
- case IDOM_NOTIFY_BEFOREPALETTELOADED :
- case IDOM_NOTIFY_PALETTELOADED :
- case IDOM_NOTIFY_BEFOREPALETTESAVED :
- case IDOM_NOTIFY_PALETTESAVED :
- case IDOM_NOTIFY_BEFOREPALETTERESET :
- case IDOM_NOTIFY_PALETTERESET :
- IDO_n_FileIO(uMessage, (LPSTR)lParam);
- break;
-
- case IDOM_NOTIFY_RELATIONDELETEREQUEST :
- /*
- * We are notified that a relation is about to be deleted.
- */
- if(bMsg)
- IDO_n_DeleteRelationRequest(GetActiveIDO(), wParam, (LPLINE_CLASS_STRUCT)(LPVOID)lParam);
- break;
-
- case IDOM_NOTIFY_RELATIONDELETED :
- /*
- * We are notified that a relation has been deleted.
- */
- if(bMsg)
- IDO_n_DeletedRelation((LPLINE_CLASS_STRUCT)(LPVOID)lParam);
- break;
-
- case IDOM_NOTIFY_RELATIONADDREQUEST :
- /*
- * We are notified that a relation is about to be added.
- */
- if(bMsg)
- IDO_n_AddRelationRequest(GetActiveIDO(), wParam, (LPLINE_CLASS_STRUCT)(LPVOID)lParam);
- break;
-
- case IDOM_NOTIFY_RELATIONADDED :
- /*
- * We are notified that a relation has been added.
- */
- if(bMsg)
- IDO_n_AddedRelation((LPLINE_CLASS_STRUCT)(LPVOID)lParam);
- break;
-
- case IDOM_NOTIFY_INVALIDEDITEVENT :
- /*
- * We are notified that an attempt was made to alter the IDO
- * even though we are not in edit mode.
- */
- IDO_n_InvalidEditEvent();
- break;
-
- case IDOM_NOTIFY_ENTITYADDREQUEST :
- /*
- * We are notified that an entity is about to be added.
- */
- if(bMsg)
- IDO_n_AddEntityRequest(GetActiveIDO(), wParam, (LPENTITY_CLASS_STRUCT)(LPVOID)lParam);
- break;
-
- case IDOM_NOTIFY_ENTITYADDED :
- /*
- * We are notified that an entity has been added.
- */
- if(bMsg)
- IDO_n_AddedEntity((LPENTITY_CLASS_STRUCT)(LPVOID)lParam);
- break;
-
- case IDOM_NOTIFY_ENTITYDELETEREQUEST :
- /*
- * We are notified that an entity is about to be deleted.
- */
- if(bMsg)
- IDO_n_DeleteEntityRequest(GetActiveIDO(), wParam, (LPENTITY_CLASS_STRUCT)(LPVOID)lParam);
- break;
-
- case IDOM_NOTIFY_ENTITYDELETED :
- /*
- * We are notified that an entity has been deleted.
- */
- if(bMsg)
- IDO_n_DeletedEntity((LPENTITY_CLASS_STRUCT)(LPVOID)lParam);
- break;
-
-
- case WM_MDIACTIVATE :
- if(wParam)
- {
- idoSetToolsPalette(GetDlgItem(hWnd, IDC_IDO), TRUE);
- }
- else
- {
- idoSetToolsPalette(GetDlgItem(hWnd, IDC_IDO), FALSE);
- }
- break;
-
- //lRegen_WndProc
-
- case WM_INITDIALOG :
- //Regen_WM_INITDIALOG
-
- // PostMessage(hWnd, WUM_ADDITEMS, 0, 0L);
-
-
- //Regen_WM_INITDIALOG
- return TRUE;;
-
- case WM_CREATE :
- //Regen_WM_CREATE
-
- /*
- * Create the control. Save the window handle from CreateInstance.
- */
- gData.hWndIDO = IDO_CreateInstance(hWnd, gData.hApp, IDC_IDO,
- 5,5,35,35);
-
- /*
- * Display an error message if the control was not created.
- */
- if(!gData.hWndIDO)
- MessageBox(hWnd, "Error creating pvIDO control.", "System Error", MB_OK | MB_ICONSTOP);
-
- PostMessage(hWnd, WM_USER + 24, 0, 0L);
- //Regen_WM_CREATE
- break;
-
- case WM_ERASEBKGND :
- //Regen_WM_ERASEBKGND
- return 0;
- //Regen_WM_ERASEBKGND
- break;
-
- case WM_SIZE :
- //Regen_WM_SIZE
- {
- RECT rect;
-
-
- /*
- * Reposition the control so it takes up the entire client area of the dialog.
- */
- GetClientRect(hWnd, &rect);
- IDO_Move(GetDlgItem(hWnd, IDC_IDO), 0, 0, rect.right, rect.bottom);
- }
- //Regen_WM_SIZE
- break;
-
- case WM_COMMAND :
- #ifdef WIN32
- CtlId = LOWORD(wParam);
- Notify = HIWORD(wParam);
- CtlWnd = (HWND)lParam;
- #else
- CtlId = wParam;
- Notify = HIWORD(lParam);
- CtlWnd = (HWND)LOWORD(lParam);
- #endif
- switch(CtlId)
- {
- //Regen_CustomCommand
- case IDC_IDO :
-
- switch(Notify)
- {
-
- case IDON_SELCHANGE :
- ReadColor(); // color palette
- break;
-
- }
-
- break;
- //Regen_CustomCommand
- }
- break;
-
- case WM_DESTROY :
- //Regen_WM_Destroy
- //Regen_WM_Destroy
- break;
- }
- return DefMDIChildViewProc(hWnd, uMessage, wParam, lParam);
- }
-
- //Regen_CustomCode
- //Regen_CustomCode
-