Dialog procedure.
| 619 | |
| 620 | // Dialog procedure. |
| 621 | BOOL APIENTRY FilterDlgProc(HWND hDlg, UINT message, UINT wParam, LONG lParam) |
| 622 | { |
| 623 | char EditString[255]; |
| 624 | |
| 625 | switch (message) |
| 626 | { |
| 627 | // Initialize the dialog box |
| 628 | case WM_INITDIALOG: |
| 629 | { |
| 630 | switch (FilterType) |
| 631 | { |
| 632 | case ID_FILTER_PIXELIZE: |
| 633 | SetDlgItemText(hDlg, IDC_FILTER_DESC_TEXT, "Width of pixelized block:"); |
| 634 | SetDlgItemText(hDlg, IDC_FILTER_EDIT, "1"); |
| 635 | break; |
| 636 | case ID_FILTER_NOISE: |
| 637 | SetDlgItemText(hDlg, IDC_FILTER_DESC_TEXT, "Amount of noise threshold:"); |
| 638 | SetDlgItemText(hDlg, IDC_FILTER_EDIT, "1"); |
| 639 | break; |
| 640 | case ID_FILTERS_BLUR_AVERAGE: |
| 641 | SetDlgItemText(hDlg, IDC_FILTER_DESC_TEXT, "Number of iterations:"); |
| 642 | SetDlgItemText(hDlg, IDC_FILTER_EDIT, "1"); |
| 643 | break; |
| 644 | case ID_FILTERS_BLUR_GAUSSIAN: |
| 645 | SetDlgItemText(hDlg, IDC_FILTER_DESC_TEXT, "Number of iterations:"); |
| 646 | SetDlgItemText(hDlg, IDC_FILTER_EDIT, "1"); |
| 647 | break; |
| 648 | case ID_FILTER_GAMMACORRECT: |
| 649 | SetDlgItemText(hDlg, IDC_FILTER_DESC_TEXT, "Amount of gamma correction:"); |
| 650 | SetDlgItemText(hDlg, IDC_FILTER_EDIT, "1.0"); |
| 651 | break; |
| 652 | case ID_FILTER_SHARPEN: |
| 653 | SetDlgItemText(hDlg, IDC_FILTER_DESC_TEXT, "Sharpening factor:"); |
| 654 | SetDlgItemText(hDlg, IDC_FILTER_EDIT, "1.0"); |
| 655 | break; |
| 656 | |
| 657 | case ID_EDIT_UNDOLEVEL: |
| 658 | SetDlgItemText(hDlg, IDC_FILTER_DESC_TEXT, "Set level of undo:"); |
| 659 | SetDlgItemText(hDlg, IDC_FILTER_EDIT, "4"); |
| 660 | break; |
| 661 | |
| 662 | } |
| 663 | |
| 664 | return TRUE; |
| 665 | } |
| 666 | break; |
| 667 | |
| 668 | // Process command messages |
| 669 | case WM_COMMAND: |
| 670 | { |
| 671 | // Validate and Make the changes |
| 672 | if (LOWORD(wParam) == IDOK) { |
| 673 | GetDlgItemText(hDlg, IDC_FILTER_EDIT, EditString, 255); |
| 674 | FilterParamInt = atoi(EditString); |
| 675 | FilterParamFloat = (float)atof(EditString); |
| 676 | EndDialog(hDlg, TRUE); |
| 677 | } |
| 678 | if (LOWORD(wParam) == IDCANCEL) { |
nothing calls this directly
no outgoing calls
no test coverage detected