-
Notifications
You must be signed in to change notification settings - Fork 0
/
CustomParams.cpp
108 lines (95 loc) · 2.51 KB
/
CustomParams.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/* CustomParams.cpp
* Just as with all the other SDKs, EDIF
* supports the creation and use of custom,
* you-defined parameters. Your own dialog,
* your own display string, your own sense
* of control. Read the MMF2SDK Help file
* for more information. To use custom
* parameters with EDIF, the parameter type
* must be "Custom" or "Custom#" where # is
* the number of the custom parameter.
* Functions defined here:
* InitParameter
* EditParameter
* GetParameterString
*/
#include "Common.h"
/* InitParameter
* Like with the editdata, this data will
* be written as-is to disk and later read
* back. The most you can store is defined
* by PARAM_EXTMAXSIZE, which currently is
* 512 bytes. Use them wisely!
*/
void MMF2Func InitParameter(mv *mV, short ID, paramExt *ParamData)
{
#ifndef RUN_ONLY
//store data in ParamData->pextData
//store the size of the data in ParamData->pextSize
#endif
}
// Example of custom parameter setup proc
// --------------------------------------
/*
#ifndef RUN_ONLY
BOOL CALLBACK SetupProc(HWND hDlg, UINT msgType, WPARAM wParam, LPARAM lParam)
{
paramExt* pExt;
switch (msgType)
{
case WM_INITDIALOG: // Init dialog
// Save edptr
SetWindowLong(hDlg, DWL_USER, lParam);
pExt=(paramExt*)lParam;
SetDlgItemText(hDlg, IDC_EDIT, pExt->pextData);
return TRUE;
case WM_COMMAND: // Command
// Retrieve edptr
pExt = (paramExt *)GetWindowLong(hDlg, DWL_USER);
switch (wmCommandID)
{
case IDOK: // Exit
GetDlgItemText(hDlg, IDC_EDIT, pExt->pextData, 500);
pExt->pextSize=sizeof(paramExt)+strlen(pExt->pextData)+1;
EndDialog(hDlg, TRUE);
return TRUE;
default:
break;
}
break;
default:
break;
}
return FALSE;
}
#endif
*/
/* EditParameter
* This is where you actually bring up
* the dialog and take input from
* the user and store it.
*/
void MMF2Func EditParameter(mv _far *mV, short code, paramExt* pExt)
{
#ifndef RUN_ONLY
// Example
// -------
// DialogBoxParam(hInstLib, MAKEINTRESOURCE(DB_TRYPARAM), mV->mvHEditWin, SetupProc, (LPARAM)(LPBYTE)pExt);
#endif
}
/* GetParameterString
* This is where you give MMF2 the display
* string for your custom parameter. Remember,
* this is the display for ONE PARAMETER. It
* will appear amongst all the other parameter
* displays depending on the A/C's display
* string.
*/
void MMF2Func GetParameterString(mv _far *mV, short code, paramExt* pExt, LPSTR pDest, short size)
{
#ifndef RUN_ONLY
// Example
// -------
// wsprintf(pDest, "Super parameter %s", pExt->pextData);
#endif
}