home *** CD-ROM | disk | FTP | other *** search
- //lRegen_FileHeading
- //lRegen_FileHeading
-
- /********************************************************************
- *
- * Source File: settext.c
- * Author:
- * Module:
- * Program Desc:
- * Date: Mon Feb 19 13:11:39 1996
- * Language: ANSI C
- *
- ********************************************************************/
-
- #include ".\idoiface.h"
-
-
- //lRegen_Variables
- //lRegen_Variables
-
- VIEW hViewsettext;
- HWND hWndsettext;
- LRESULT CALLBACK EXPORT fnsettextWndProc(HWND, UINT, WPARAM, LPARAM);
-
- int fnsettext(HWND hParentWnd, UINT iData, void FAR *lpData)
- {
- int ReturnCode;
-
- //lRegen_BeginFunction
- ENTITY entity;
-
- if(!idoGetCurrentEntity(GetActiveIDO(), &entity))
- {
- // no current entity
- return FALSE;
- }
- //lRegen_BeginFunction
-
- //lRegen_InitDlg
- //lRegen_InitDlg
-
- if(NULL == (hViewsettext = vwCreateView(hInstance,
- MAKEINTRESOURCE(settext),
- hParentWnd,
- (VIEWPROC)fnsettextWndProc,
- NULL)))
- {
- //lRegen_Create
- //lRegen_Create
- return FALSE;
- }
- //lRegen_InitView
- //lRegen_InitView
- if((ReturnCode = vwShowModalView(hViewsettext)) == -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 fnsettextWndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
- {
- GETVIEW;
- WORD CtlId;
- WORD Notify;
- HWND CtlWnd;
-
- //lRegen_WindowProcVariables
-
- char szText[100+1];
- ENTITY entity;
-
- //lRegen_WindowProcVariables
-
- switch(uMessage)
- {
- //lRegen_WndProc
- //lRegen_WndProc
-
- case WM_INITDIALOG :
- //lRegen_InitDialogBegin
- /*
- * Get text from the current entity.
- */
- if(idoGetCurrentEntity(GetActiveIDO(), &entity))
- {
- SetDlgItemText(hWnd, IDC_TEXT, idoEntityGetText(&entity));
- }
-
- //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_TEXT :
- //Regen_IDC_TEXT
- //Regen_IDC_TEXT
- break;
-
- case IDOK :
- //Regen_IDOK
- {
- GetDlgItemText(hWnd, IDC_TEXT, szText, 100);
-
- /*
- * Set text on the current entity.
- */
- if(idoGetCurrentEntity(GetActiveIDO(), &entity))
- {
- idoEntitySetText(&entity, szText);
- idoEntityRepaint(&entity);
- // InvalidateRect(GetActiveIDO(), NULL, FALSE);
- // UpdateWindow(GetActiveIDO());
- }
- }
- //Regen_IDOK
- break;
-
- case IDCANCEL :
- //Regen_IDCANCEL
- //Regen_IDCANCEL
- 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
-