home *** CD-ROM | disk | FTP | other *** search
- //lRegen_FileHeading
- //lRegen_FileHeading
-
- /********************************************************************
- *
- * Source File: currente.c
- * Author:
- * Module:
- * Program Desc:
- * Date: Mon Feb 19 13:11:39 1996
- * Language: ANSI C
- *
- ********************************************************************/
-
- #include ".\idoiface.h"
-
-
- //lRegen_Variables
- //lRegen_Variables
-
- typedef struct tagCURRENTENTITYDATA
- {
- long x;
- }CURRENTENTITYDATA, FAR* LPCURRENTENTITYDATA;
-
- VIEW hViewcurrententity;
- HWND hWndcurrententity;
- // Data Pointer for Dialog control data elements
- HGLOBAL hcurrententityData = NULL;
- LPCURRENTENTITYDATA lpcurrententityData = NULL;
- LRESULT CALLBACK EXPORT fncurrententityWndProc(HWND, UINT, WPARAM, LPARAM);
-
- int fncurrententity(HWND hParentWnd, UINT iData, void FAR *lpData)
- {
- int ReturnCode;
-
- //lRegen_BeginFunction
- //lRegen_BeginFunction
-
- // Associate Data elements with view
- if(NULL == lpcurrententityData)
- {
- hcurrententityData = GlobalAlloc(GHND, sizeof(CURRENTENTITYDATA));
- if(NULL == hcurrententityData)
- return FALSE;
- lpcurrententityData = (LPCURRENTENTITYDATA)GlobalLock(hcurrententityData);
- }
- //lRegen_InitDlg
- //lRegen_InitDlg
-
- if(NULL == (hViewcurrententity = vwCreateView(hInstance,
- MAKEINTRESOURCE(currententity),
- hParentWnd,
- (VIEWPROC)fncurrententityWndProc,
- NULL)))
- {
- //lRegen_Create
- //lRegen_Create
- return FALSE;
- }
- vwSetFieldVar(hViewcurrententity, IDC_PVNUMERIC1, &lpcurrententityData->x);
- //lRegen_InitView
- //lRegen_InitView
- if((ReturnCode = vwShowModalView(hViewcurrententity)) == -1)
- {
- MessageBox(NULL, "Unable to display view", "System Error",
- MB_SYSTEMMODAL | MB_ICONHAND | MB_OK);
- return FALSE;
- }
-
- //lRegen_TermView
- //lRegen_TermView
- // Free Data Pointer for Dialog control data elements
- if(NULL != hcurrententityData)
- {
- GlobalUnlock(hcurrententityData);
- GlobalFree(hcurrententityData);
- hcurrententityData = 0;
- lpcurrententityData = NULL;
- }
- return(ReturnCode);
- }
-
- LRESULT CALLBACK EXPORT fncurrententityWndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
- {
- GETVIEW;
- WORD CtlId;
- WORD Notify;
- HWND CtlWnd;
-
- //lRegen_WindowProcVariables
- ENTITY entity;
- //lRegen_WindowProcVariables
-
- switch(uMessage)
- {
- //lRegen_WndProc
- //lRegen_WndProc
-
- case WM_INITDIALOG :
- //lRegen_InitDialogBegin
- {
- HWND hIDO = GetActiveIDO();
- char szNum[20+1];
-
-
- if(IsWindow(hIDO))
- {
- if(idoIterateEntityFirst(hIDO))
- while(idoIterateEntityNext(hIDO, &entity))
- {
- wsprintf(szNum, "%d", entity.id);
- SendDlgItemMessage(hWnd, IDC_EID, CB_ADDSTRING, 0, (LPARAM)(LPSTR)szNum);
- SendDlgItemMessage(hWnd, IDC_ENAME, CB_ADDSTRING, 0, (LPARAM)(LPSTR)entity.name);
- }
- }
-
- lpcurrententityData->x = idoGetNumberOfSelectedEntities(hIDO);
- }
- //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 IDC_ENAME :
- switch(Notify)
- {
- case CBN_SELCHANGE :
- //Regen_IDC_ENAME_CBN_SELCHANGE
- {
- int index;
-
- index = (int)SendDlgItemMessage(hWnd, IDC_ENAME, CB_GETCURSEL, 0, 0L);
- SendDlgItemMessage(hWnd, IDC_EID, CB_SETCURSEL, index, 0L);
- }
- //Regen_IDC_ENAME_CBN_SELCHANGE
- break;
-
- }
- break;
- case IDC_EID :
- switch(Notify)
- {
- case CBN_SELCHANGE :
- //Regen_IDC_EID_CBN_SELCHANGE
- {
- int index;
-
- index = (int)SendDlgItemMessage(hWnd, IDC_EID, CB_GETCURSEL, 0, 0L);
- SendDlgItemMessage(hWnd, IDC_ENAME, CB_SETCURSEL, index, 0L);
- }
- //Regen_IDC_EID_CBN_SELCHANGE
- break;
-
- }
- break;
- case IDOK :
- //Regen_IDOK
- {
- int index;
- char szNum[20+1];
-
-
- index = (int)SendDlgItemMessage(hWnd, IDC_ENAME, CB_GETCURSEL, 0, 0L);
- SendDlgItemMessage(hWnd, IDC_ENAME, CB_GETLBTEXT, index, (LPARAM)(LPSTR)entity.name);
- index = (int)SendDlgItemMessage(hWnd, IDC_EID, CB_GETCURSEL, 0, 0L);
- SendDlgItemMessage(hWnd, IDC_EID, CB_GETLBTEXT, index, (LPARAM)(LPSTR)szNum);
- entity.id = atoi(szNum);
-
-
- /*
- * Set Current Entity.
- */
- // idoSetCurrentEntity(GetActiveIDO(), &entity);
-
- }
- //Regen_IDOK
- break;
-
- case IDCANCEL :
- //Regen_IDCANCEL
- //Regen_IDCANCEL
- break;
-
- case IDC_PVNUMERIC1 :
- //Regen_IDC_PVNUMERIC1
- //Regen_IDC_PVNUMERIC1
- break;
-
- //lRegen_CustomCommand
- //lRegen_CustomCommand
- }
- break;
-
- case WM_DESTROY :
- //Regen_WM_Destroy
- //Regen_WM_Destroy
- // Free Data Pointer for Dialog control data elements
- if(NULL != hcurrententityData)
- {
- GlobalUnlock(hcurrententityData);
- GlobalFree(hcurrententityData);
- hcurrententityData = 0;
- lpcurrententityData = NULL;
- }
- break;
- }
- return DefViewProc(hWnd, uMessage, wParam, lParam);
- }
-
- //Regen_CustomCode
- //Regen_CustomCode
-