home *** CD-ROM | disk | FTP | other *** search
- //lRegen_FileHeading
- //lRegen_FileHeading
-
- /********************************************************************
- *
- * Source File: delrel.c
- * Author:
- * Module:
- * Program Desc:
- * Date: Mon Feb 19 13:11:40 1996
- * Language: ANSI C
- *
- ********************************************************************/
-
- #include ".\idoiface.h"
-
-
- //lRegen_Variables
- //lRegen_Variables
-
- VIEW hViewdelrel;
- HWND hWnddelrel;
- LRESULT CALLBACK EXPORT fndelrelWndProc(HWND, UINT, WPARAM, LPARAM);
-
- int fndelrel(HWND hParentWnd, UINT iData, void FAR *lpData)
- {
- int ReturnCode;
-
- //lRegen_BeginFunction
- //lRegen_BeginFunction
-
- //lRegen_InitDlg
- //lRegen_InitDlg
-
- if(NULL == (hViewdelrel = vwCreateView(hInstance,
- MAKEINTRESOURCE(delrel),
- hParentWnd,
- (VIEWPROC)fndelrelWndProc,
- NULL)))
- {
- //lRegen_Create
- //lRegen_Create
- return FALSE;
- }
- //lRegen_InitView
- //lRegen_InitView
- if((ReturnCode = vwShowModalView(hViewdelrel)) == -1)
- {
- MessageBox(NULL, "Unable to display view", "System Error",
- MB_SYSTEMMODAL | MB_ICONHAND | MB_OK);
- return FALSE;
- }
-
- //lRegen_TermView
- //lRegen_TermView
- return(ReturnCode);
- }
-
- LRESULT CALLBACK EXPORT fndelrelWndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
- {
- GETVIEW;
- WORD CtlId;
- WORD Notify;
- HWND CtlWnd;
-
- //lRegen_WindowProcVariables
- //lRegen_WindowProcVariables
-
- switch(uMessage)
- {
- //lRegen_WndProc
- //lRegen_WndProc
-
- case WM_INITDIALOG :
- //lRegen_InitDialogBegin
- {
- HWND hIDO = GetActiveIDO();
- RELATION relation;
- char szNum[20+1];
-
-
- if(IsWindow(hIDO))
- {
- if(idoIterateRelationFirst(hIDO))
- while(idoIterateRelationNext(hIDO, &relation))
- {
- wsprintf(szNum, "%d", relation.id);
- SendDlgItemMessage(hWnd, IDC_RID, CB_ADDSTRING, 0, (LPARAM)(LPSTR)szNum);
- SendDlgItemMessage(hWnd, IDC_RNAME, CB_ADDSTRING, 0, (LPARAM)(LPSTR)relation.name);
- }
- }
- }
- //lRegen_InitDialogBegin
- //Regen_WM_InitDialog
- //Regen_WM_InitDialog
- return TRUE;
-
- 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)
- {
- case IDOK :
- //Regen_IDOK
- {
- RELATION relation;
- int index;
- char szNum[20+1];
- char szName[100+1];
- int num;
-
-
- index = (int)SendDlgItemMessage(hWnd, IDC_RNAME, CB_GETCURSEL, 0, 0L);
- SendDlgItemMessage(hWnd, IDC_RNAME, CB_GETLBTEXT, index, (LPARAM)(LPSTR)szName);
- index = (int)SendDlgItemMessage(hWnd, IDC_RID, CB_GETCURSEL, 0, 0L);
- SendDlgItemMessage(hWnd, IDC_RID, CB_GETLBTEXT, index, (LPARAM)(LPSTR)szNum);
- num = atoi(szNum);
-
-
- /*
- * Delete a relation.
- */
- idoGetRelation(GetActiveIDO(), num, szName, &relation);
- idoDeleteRelation(GetActiveIDO(), &relation);
- }
- //Regen_IDOK
- break;
-
- case IDCANCEL :
- //Regen_IDCANCEL
- //Regen_IDCANCEL
- break;
-
- case IDC_RNAME :
- switch(Notify)
- {
- case CBN_SELCHANGE :
- //Regen_IDC_RNAME_CBN_SELCHANGE
- {
- int index;
-
- index = (int)SendDlgItemMessage(hWnd, IDC_RNAME, CB_GETCURSEL, 0, 0L);
- SendDlgItemMessage(hWnd, IDC_RID, CB_SETCURSEL, index, 0L);
- }
- //Regen_IDC_RNAME_CBN_SELCHANGE
- break;
-
- }
- break;
- case IDC_RID :
- switch(Notify)
- {
- case CBN_SELCHANGE :
- //Regen_IDC_RID_CBN_SELCHANGE
- {
- int index;
-
- index = (int)SendDlgItemMessage(hWnd, IDC_RID, CB_GETCURSEL, 0, 0L);
- SendDlgItemMessage(hWnd, IDC_RNAME, CB_SETCURSEL, index, 0L);
- }
- //Regen_IDC_RID_CBN_SELCHANGE
- break;
-
- }
- break;
- //lRegen_CustomCommand
- //lRegen_CustomCommand
- }
- break;
-
- case WM_DESTROY :
- //Regen_WM_Destroy
- //Regen_WM_Destroy
- break;
- }
- return DefViewProc(hWnd, uMessage, wParam, lParam);
- }
-
- //Regen_CustomCode
- //Regen_CustomCode
-