-
Notifications
You must be signed in to change notification settings - Fork 0
/
Edittime.cpp
799 lines (687 loc) · 18.7 KB
/
Edittime.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
// ============================================================================
//
// This file contains routines that are handled only during the Edittime,
// under the Frame and Event editors.
//
// Including creating, display, and setting up your object.
//
// ============================================================================
#include "Common.h"
#if !defined(RUN_ONLY)
// PROPERTIES /////////////////////////////////////////////////////////////////
// Property identifiers
enum {
PROPID_SETTINGS = PROPID_EXTITEM_CUSTOM_FIRST,
// Example
// -------
// PROPID_TEXTTITLE,
// PROPID_TEXT,
// PROPID_CHECK,
// PROPID_COMBO,
// PROPID_COLOR,
};
// Example of content of the PROPID_COMBO combo box
//LPCSTR ComboList[] = {
// 0, // reserved
// MAKEINTRESOURCE(IDS_FIRSTOPTION),
// MAKEINTRESOURCE(IDS_SECONDOPTION),
// MAKEINTRESOURCE(IDS_THIRDOPTION),
// NULL
//};
// Property definitions
//
// Type, ID, Text, Text of Info box [, Options, Init Param]
//
PropData Properties[] = {
// Example
// -------
// PropData_Group (PROPID_TEXTTITLE, IDS_PROP_TEXTTITLE, IDS_PROP_TEXTTITLE),
// PropData_EditString (PROPID_TEXT, IDS_PROP_TEXT, IDS_PROP_TEXT_INFO),
// PropData_CheckBox (PROPID_CHECK, IDS_PROP_CHECK, IDS_PROP_CHECK_INFO),
// PropData_ComboBox (PROPID_COMBO, IDS_PROP_COMBO, IDS_PROP_COMBO, ComboList),
// PropData_Color (PROPID_COLOR, IDS_PROP_COLOR, IDS_PROP_COLOR_INFO),
// End of table (required)
PropData_End()
};
#endif // !defined(RUN_ONLY)
// ============================================================================
//
// ROUTINES USED UNDER FRAME EDITOR
//
// ============================================================================
// --------------------
// MakeIcon
// --------------------
// Called once object is created or modified, just after setup.
// Also called before showing the "Insert an object" dialog if your object
// has no icon resource
int WINAPI DLLExport MakeIconEx ( mv _far *mV, cSurface* pIconSf, LPTSTR lpName, fpObjInfo oiPtr, LPEDATA edPtr )
{
#ifndef RUN_ONLY
pIconSf->Delete();
pIconSf->Clone(*SDK->Icon);
pIconSf->SetTransparentColor(RGB(255, 0, 255));
#endif // !defined(RUN_ONLY)
return 0;
}
// --------------------
// CreateObject
// --------------------
// Called when you choose "Create new object". It should display the setup box
// and initialize everything in the datazone.
int WINAPI DLLExport CreateObject(mv _far *mV, fpLevObj loPtr, LPEDATA edPtr)
{
#ifndef RUN_ONLY
// Check compatibility
if ( IS_COMPATIBLE(mV) )
{
Edif::Init(mV, edPtr);
// Set default object settings
// edPtr->swidth = 48;
// edPtr->sheight = 48;
return 0;
}
#endif // !defined(RUN_ONLY)
// Error
return -1;
}
// --------------------
// EditObject
// --------------------
// Called when the user selects the Edit command in the object's popup menu
//
BOOL WINAPI EditObject (mv _far *mV, fpObjInfo oiPtr, fpLevObj loPtr, LPEDATA edPtr)
{
#ifndef RUN_ONLY
// Check compatibility
if ( IS_COMPATIBLE(mV) )
{
}
#endif // !defined(RUN_ONLY)
return FALSE;
}
// --------------------
// SetEditSize
// --------------------
// Called when the object has been resized
//
// Note: remove the comments if your object can be resized (and remove the comments in the .def file)
/*
BOOL WINAPI SetEditSize(LPMV mv, LPEDATA edPtr, int cx, int cy)
{
#ifndef RUN_ONLY
edPtr->swidth = cx;
edPtr->sheight = cy;
#endif // !defined(RUN_ONLY)
return TRUE; // OK
}
*/
// --------------------
// PutObject
// --------------------
// Called when each individual object is dropped in the frame.
//
void WINAPI DLLExport PutObject(mv _far *mV, fpLevObj loPtr, LPEDATA edPtr, ushort cpt)
{
#ifndef RUN_ONLY
#endif // !defined(RUN_ONLY)
}
// --------------------
// RemoveObject
// --------------------
// Called when each individual object is removed from the frame.
//
void WINAPI DLLExport RemoveObject(mv _far *mV, fpLevObj loPtr, LPEDATA edPtr, ushort cpt)
{
#ifndef RUN_ONLY
// Is the last object removed?
if (0 == cpt)
{
Edif::Free(edPtr);
// Do whatever necessary to remove our data
}
#endif // !defined(RUN_ONLY)
}
// --------------------
// DuplicateObject
// --------------------
// Called when an object is created from another one (note: should be called CloneObject instead...)
//
void WINAPI DLLExport DuplicateObject(mv __far *mV, fpObjInfo oiPtr, LPEDATA edPtr)
{
#ifndef RUN_ONLY
#endif // !defined(RUN_ONLY)
}
// --------------------
// GetObjectRect
// --------------------
// Returns the size of the rectangle of the object in the frame editor.
//
void WINAPI DLLExport GetObjectRect(mv _far *mV, RECT FAR *rc, fpLevObj loPtr, LPEDATA edPtr)
{
#ifndef RUN_ONLY
rc->right = rc->left + SDK->Icon->GetWidth(); // edPtr->swidth;
rc->bottom = rc->top + SDK->Icon->GetHeight(); // edPtr->sheight;
#endif // !defined(RUN_ONLY)
return;
}
// --------------------
// EditorDisplay
// --------------------
// Displays the object under the frame editor
//
void WINAPI DLLExport EditorDisplay(mv _far *mV, fpObjInfo oiPtr, fpLevObj loPtr, LPEDATA edPtr, RECT FAR *rc)
{
#ifndef RUN_ONLY
LPSURFACE Surface = WinGetSurface((int) mV->mvIdEditWin);
if(!Surface)
return;
SDK->Icon->Blit(*Surface, rc->left, rc->top, BMODE_TRANSP, BOP_COPY, 0);
#endif // !defined(RUN_ONLY)
}
// --------------------
// IsTransparent
// --------------------
// This routine tells MMF2 if the mouse pointer is over a transparent zone of the object.
//
extern "C" BOOL WINAPI DLLExport IsTransparent(mv _far *mV, fpLevObj loPtr, LPEDATA edPtr, int dx, int dy)
{
#ifndef RUN_ONLY
// Write your code here
#endif // !defined(RUN_ONLY)
return FALSE;
}
// --------------------
// PrepareToWriteObject
// --------------------
// Just before writing the datazone when saving the application, MMF2 calls this routine.
//
void WINAPI DLLExport PrepareToWriteObject(mv _far *mV, LPEDATA edPtr, fpObjInfo adoi)
{
#ifndef RUN_ONLY
// Write your code here
#endif // !defined(RUN_ONLY)
}
// --------------------
// GetFilters
// --------------------
BOOL WINAPI GetFilters(LPMV mV, LPEDATA edPtr, DWORD dwFlags, LPVOID pReserved)
{
#ifndef RUN_ONLY
// If your extension uses image filters
// if ( (dwFlags & GETFILTERS_IMAGES) != 0 )
// return TRUE;
// If your extension uses sound filters
// if ( (dwFlags & GETFILTERS_SOUNDS) != 0 )
// return TRUE;
#endif // RUN_ONLY
return FALSE;
}
// --------------------
// UsesFile
// --------------------
// Triggers when a file is dropped onto the frame
// Return TRUE if you can create an object from the given file
//
BOOL WINAPI DLLExport UsesFile (LPMV mV, LPTSTR fileName)
{
BOOL r = FALSE;
#ifndef RUN_ONLY
// Example: return TRUE if file extension is ".txt"
/*
LPSTR ext, npath;
if ( fileName != NULL )
{
if ( (ext=(LPSTR)malloc(_MAX_EXT)) != NULL )
{
if ( (npath=(LPSTR)malloc(_MAX_PATH)) != NULL )
{
strcpy(npath, fileName);
_splitpath(npath, NULL, NULL, NULL, ext);
if ( _stricmp(ext, ".txt") == 0 )
r = TRUE;
free(npath);
}
free(ext);
}
} */
#endif // !defined(RUN_ONLY)
return r;
}
// --------------------
// CreateFromFile
// --------------------
// Creates a new object from file
//
void WINAPI DLLExport CreateFromFile (LPMV mV, LPTSTR fileName, LPEDATA edPtr)
{
#ifndef RUN_ONLY
// Initialize your extension data from the given file
// edPtr->swidth = 48;
// edPtr->sheight = 48;
// Example: store the filename
// strcpy(edPtr->myFileName, fileName);
#endif // !defined(RUN_ONLY)
}
// ============================================================================
//
// PROPERTIES
//
// ============================================================================
// --------------------
// GetProperties
// --------------------
// Inserts properties into the properties of the object.
//
BOOL WINAPI DLLExport GetProperties(LPMV mV, LPEDATA edPtr, BOOL bMasterItem)
{
#ifndef RUN_ONLY
mvInsertProps(mV, edPtr, Properties, PROPID_TAB_GENERAL, TRUE);
#endif // !defined(RUN_ONLY)
// OK
return TRUE;
}
// --------------------
// ReleaseProperties
// --------------------
// Called when the properties are removed from the property window.
//
void WINAPI DLLExport ReleaseProperties(LPMV mV, LPEDATA edPtr, BOOL bMasterItem)
{
#ifndef RUN_ONLY
// Write your code here
#endif // !defined(RUN_ONLY)
}
// --------------------
// GetPropCreateParam
// --------------------
// Called when a property is initialized and its creation parameter is NULL (in the PropData).
// Allows you, for example, to change the content of a combobox property according to specific settings in the EDITDATA structure.
//
LPARAM WINAPI DLLExport GetPropCreateParam(LPMV mV, LPEDATA edPtr, UINT nPropID)
{
#ifndef RUN_ONLY
// Example
// -------
// if ( nPropID == PROPID_COMBO )
// {
// switch (edPtr->sType)
// {
// case TYPE1:
// return (LPARAM)ComboList1;
// case TYPE2:
// return (LPARAM)ComboList2;
// }
// }
#endif // !defined(RUN_ONLY)
return NULL;
}
// ----------------------
// ReleasePropCreateParam
// ----------------------
// Called after a property has been initialized.
// Allows you, for example, to free memory allocated in GetPropCreateParam.
//
void WINAPI DLLExport ReleasePropCreateParam(LPMV mV, LPEDATA edPtr, UINT nPropID, LPARAM lParam)
{
#ifndef RUN_ONLY
#endif // !defined(RUN_ONLY)
}
// --------------------
// GetPropValue
// --------------------
// Returns the value of properties that have a value.
// Note: see GetPropCheck for checkbox properties
//
LPVOID WINAPI DLLExport GetPropValue(LPMV mV, LPEDATA edPtr, UINT nPropID)
{
#ifndef RUN_ONLY
// Example
// -------
// switch (nPropID) {
//
// // Returns a color.
// case PROPID_COLOR:
// return new CPropDWordValue(edPtr->dwColor);
//
// // Returns a string
// case PROPID_TEXT:
// return new CPropDataValue(&edPtr->szText[0]);
//
// // Returns the value of the combo box
// case PROPID_COMBO:
// return new CPropDWordValue(edPtr->nComboIndex);
// }
#endif // !defined(RUN_ONLY)
return NULL;
}
// --------------------
// GetPropCheck
// --------------------
// Returns the checked state of properties that have a check box.
//
BOOL WINAPI DLLExport GetPropCheck(LPMV mV, LPEDATA edPtr, UINT nPropID)
{
#ifndef RUN_ONLY
// Example
// -------
// switch (nPropID) {
//
// // Return 0 (unchecked) or 1 (checked)
// case PROPID_CHECK:
// return edPtr->nCheck;
// }
#endif // !defined(RUN_ONLY)
return 0; // Unchecked
}
// --------------------
// SetPropValue
// --------------------
// This routine is called by MMF after a property has been modified.
//
void WINAPI DLLExport SetPropValue(LPMV mV, LPEDATA edPtr, UINT nPropID, LPVOID lParam)
{
#ifndef RUN_ONLY
// Gets the pointer to the CPropValue structure
CPropValue* pValue = (CPropValue*)lParam;
// Example
// -------
// switch (nPropID) {
//
// case PROPID_COMBO:
// // Simply grab the value
// edPtr->nComboIndex = ((CPropDWordValue*)pValue)->m_dwValue;
// break;
// case PROPID_COLOR:
// // Here too, gets the value
// edPtr->dwColor = ((CPropDWordValue*)pValue)->m_dwValue;
// break;
// case PROPID_TEXT:
// {
// // Gets the string
// LPSTR pStr = (LPSTR)((CPropDataValue*)pValue)->m_pData;
//
// // You can simply poke the string if your EDITDATA structure has a fixed size,
// // or have an adaptive size of structure like below
//
// // If the length is different
// if (strlen(pStr)!=strlen(edPtr->text))
// {
// // Asks MMF to reallocate the structure with the new size
// LPEDATA pNewPtr = (LPEDATA)mvReAllocEditData(mV, edPtr, sizeof(EDITDATA)+strlen(pStr));
//
// // If reallocation worked
// if (pNewPtr!=NULL)
// {
// // Copy the string
// edPtr=pNewPtr;
// strcpy(edPtr->text, pStr);
// }
// }
// else
// {
// // Same size : simply copy
// strcpy(edPtr->text, pStr);
// }
// }
// break;
// }
// You may want to have your object redrawn in the frame editor after the modifications,
// in this case, just call this function
// mvInvalidateObject(mV, edPtr);
#endif // !defined(RUN_ONLY)
}
// --------------------
// SetPropCheck
// --------------------
// This routine is called by MMF when the user modifies a checkbox in the properties.
//
void WINAPI DLLExport SetPropCheck(LPMV mV, LPEDATA edPtr, UINT nPropID, BOOL nCheck)
{
#ifndef RUN_ONLY
// Example
// -------
// switch (nPropID)
// {
// case PROPID_CHECK:
// edPtr->nCheck = nCheck;
// mvInvalidateObject(mV, edPtr);
// mvRefreshProp(mV, edPtr, PROPID_COMBO, TRUE);
// break;
// }
#endif // !defined(RUN_ONLY)
}
// --------------------
// EditProp
// --------------------
// This routine is called when the user clicks the button of a Button or EditButton property.
//
BOOL WINAPI DLLExport EditProp(LPMV mV, LPEDATA edPtr, UINT nPropID)
{
#ifndef RUN_ONLY
// Example
// -------
/*
if (nPropID==PROPID_EDITCONTENT)
{
if ( EditObject(mV, NULL, NULL, edPtr) )
return TRUE;
}
*/
#endif // !defined(RUN_ONLY)
return FALSE;
}
// --------------------
// IsPropEnabled
// --------------------
// This routine returns the enabled state of a property.
//
BOOL WINAPI IsPropEnabled(LPMV mV, LPEDATA edPtr, UINT nPropID)
{
#ifndef RUN_ONLY
// Example
// -------
/*
switch (nPropID) {
case PROPID_CHECK:
return (edPtr->nComboIndex != 0);
}
*/
#endif // !defined(RUN_ONLY)
return TRUE;
}
// ============================================================================
//
// TEXT PROPERTIES
//
// ============================================================================
// --------------------
// GetTextCaps
// --------------------
// Return the text capabilities of the object under the frame editor.
//
DWORD WINAPI DLLExport GetTextCaps(mv _far *mV, LPEDATA edPtr)
{
return 0; // (TEXT_ALIGN_LEFT|TEXT_ALIGN_HCENTER|TEXT_ALIGN_RIGHT|TEXT_ALIGN_TOP|TEXT_ALIGN_VCENTER|TEXT_ALIGN_BOTTOM|TEXT_FONT|TEXT_COLOR);
}
// --------------------
// GetTextFont
// --------------------
// Return the font used the object.
// Note: the pStyle and cbSize parameters are obsolete and passed for compatibility reasons only.
//
BOOL WINAPI DLLExport GetTextFont(mv _far *mV, LPEDATA edPtr, LPLOGFONT plf, LPTSTR pStyle, UINT cbSize)
{
#if !defined(RUN_ONLY)
// Example: copy LOGFONT structure from EDITDATA
// memcpy(plf, &edPtr->m_lf, sizeof(LOGFONT));
#endif // !defined(RUN_ONLY)
return TRUE;
}
// --------------------
// SetTextFont
// --------------------
// Change the font used the object.
// Note: the pStyle parameter is obsolete and passed for compatibility reasons only.
//
BOOL WINAPI DLLExport SetTextFont(mv _far *mV, LPEDATA edPtr, LPLOGFONT plf, LPCSTR pStyle)
{
#if !defined(RUN_ONLY)
// Example: copy LOGFONT structure to EDITDATA
// memcpy(&edPtr->m_lf, plf, sizeof(LOGFONT));
#endif // !defined(RUN_ONLY)
return TRUE;
}
// --------------------
// GetTextClr
// --------------------
// Get the text color of the object.
//
COLORREF WINAPI DLLExport GetTextClr(mv _far *mV, LPEDATA edPtr)
{
// Example
return 0; // edPtr->fontColor;
}
// --------------------
// SetTextClr
// --------------------
// Set the text color of the object.
//
void WINAPI DLLExport SetTextClr(mv _far *mV, LPEDATA edPtr, COLORREF color)
{
// Example
//edPtr->fontColor = color;
}
// --------------------
// GetTextAlignment
// --------------------
// Get the text alignment of the object.
//
DWORD WINAPI DLLExport GetTextAlignment(mv _far *mV, LPEDATA edPtr)
{
DWORD dw = 0;
#if !defined(RUN_ONLY)
// Example
// -------
/* if ( (edPtr->eData.dwFlags & ALIGN_LEFT) != 0 )
dw |= TEXT_ALIGN_LEFT;
if ( (edPtr->eData.dwFlags & ALIGN_HCENTER) != 0 )
dw |= TEXT_ALIGN_HCENTER;
if ( (edPtr->eData.dwFlags & ALIGN_RIGHT) != 0 )
dw |= TEXT_ALIGN_RIGHT;
if ( (edPtr->eData.dwFlags & ALIGN_TOP) != 0 )
dw |= TEXT_ALIGN_TOP;
if ( (edPtr->eData.dwFlags & ALIGN_VCENTER) != 0 )
dw |= TEXT_ALIGN_VCENTER;
if ( (edPtr->eData.dwFlags & ALIGN_BOTTOM) != 0 )
dw |= TEXT_ALIGN_BOTTOM;
*/
#endif // !defined(RUN_ONLY)
return dw;
}
// --------------------
// SetTextAlignment
// --------------------
// Set the text alignment of the object.
//
void WINAPI DLLExport SetTextAlignment(mv _far *mV, LPEDATA edPtr, DWORD dwAlignFlags)
{
#if !defined(RUN_ONLY)
// Example
// -------
/* DWORD dw = edPtr->eData.dwFlags;
if ( (dwAlignFlags & TEXT_ALIGN_LEFT) != 0 )
dw = (dw & ~(ALIGN_LEFT|ALIGN_HCENTER|ALIGN_RIGHT)) | ALIGN_LEFT;
if ( (dwAlignFlags & TEXT_ALIGN_HCENTER) != 0 )
dw = (dw & ~(ALIGN_LEFT|ALIGN_HCENTER|ALIGN_RIGHT)) | ALIGN_HCENTER;
if ( (dwAlignFlags & TEXT_ALIGN_RIGHT) != 0 )
dw = (dw & ~(ALIGN_LEFT|ALIGN_HCENTER|ALIGN_RIGHT)) | ALIGN_RIGHT;
if ( (dwAlignFlags & TEXT_ALIGN_TOP) != 0 )
dw = (dw & ~(ALIGN_TOP|ALIGN_VCENTER|ALIGN_BOTTOM)) | ALIGN_TOP;
if ( (dwAlignFlags & TEXT_ALIGN_VCENTER) != 0 )
dw = (dw & ~(ALIGN_TOP|ALIGN_VCENTER|ALIGN_BOTTOM)) | ALIGN_VCENTER;
if ( (dwAlignFlags & TEXT_ALIGN_BOTTOM) != 0 )
dw = (dw & ~(ALIGN_TOP|ALIGN_VCENTER|ALIGN_BOTTOM)) | ALIGN_BOTTOM;
edPtr->eData.dwFlags = dw;
*/
#endif // !defined(RUN_ONLY)
}
// ----------------------------------------------------------
// Custom Parameters
// ----------------------------------------------------------
// --------------------
// InitParameter
// --------------------
// Initialize the parameter.
//
void WINAPI InitParameter(mv _far *mV, short code, paramExt* pExt)
{
#if !defined(RUN_ONLY)
// Example
// -------
// strcpy(&pExt->pextData[0], "Parameter Test");
// pExt->pextSize = sizeof(paramExt) + strlen(pExt->pextData)+1;
#endif // !defined(RUN_ONLY)
}
// Example of custom parameter setup proc
// --------------------------------------
/*
#if !defined(RUN_ONLY)
BOOL CALLBACK DLLExport 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 // !defined(RUN_ONLY)
*/
// --------------------
// EditParameter
// --------------------
// Edit the parameter.
//
void WINAPI EditParameter(mv _far *mV, short code, paramExt* pExt)
{
#if !defined(RUN_ONLY)
// Example
// -------
// DialogBoxParam(hInstLib, MAKEINTRESOURCE(DB_TRYPARAM), mV->mvHEditWin, SetupProc, (LPARAM)(LPBYTE)pExt);
#endif // !defined(RUN_ONLY)
}
// --------------------
// GetParameterString
// --------------------
// Initialize the parameter.
//
void WINAPI GetParameterString(mv _far *mV, short code, paramExt* pExt, LPSTR pDest, short size)
{
#if !defined(RUN_ONLY)
// Example
// -------
// wsprintf(pDest, "Super parameter %s", pExt->pextData);
#endif // !defined(RUN_ONLY)
}