============================================================================= EditSortDlgProc() Controls: 100-102 Radio Button 103-108 Check Box
| 6020 | // 103-108 Check Box |
| 6021 | // |
| 6022 | INT_PTR CALLBACK EditSortDlgProc ( HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam ) |
| 6023 | { |
| 6024 | static int *piSortFlags; |
| 6025 | static BOOL bEnableLogicalSort; |
| 6026 | switch ( umsg ) { |
| 6027 | case WM_INITDIALOG: { |
| 6028 | piSortFlags = ( int * ) lParam; |
| 6029 | if ( *piSortFlags & SORT_DESCENDING ) { |
| 6030 | CheckRadioButton ( hwnd, 100, 102, 101 ); |
| 6031 | } else if ( *piSortFlags & SORT_SHUFFLE ) { |
| 6032 | CheckRadioButton ( hwnd, 100, 102, 102 ); |
| 6033 | EnableWindow ( GetDlgItem ( hwnd, 103 ), FALSE ); |
| 6034 | EnableWindow ( GetDlgItem ( hwnd, 104 ), FALSE ); |
| 6035 | EnableWindow ( GetDlgItem ( hwnd, 105 ), FALSE ); |
| 6036 | EnableWindow ( GetDlgItem ( hwnd, 106 ), FALSE ); |
| 6037 | EnableWindow ( GetDlgItem ( hwnd, 107 ), FALSE ); |
| 6038 | } else { |
| 6039 | CheckRadioButton ( hwnd, 100, 102, 100 ); |
| 6040 | } |
| 6041 | if ( *piSortFlags & SORT_MERGEDUP ) { |
| 6042 | CheckDlgButton ( hwnd, 103, BST_CHECKED ); |
| 6043 | } |
| 6044 | if ( *piSortFlags & SORT_UNIQDUP ) { |
| 6045 | CheckDlgButton ( hwnd, 104, BST_CHECKED ); |
| 6046 | EnableWindow ( GetDlgItem ( hwnd, 103 ), FALSE ); |
| 6047 | } |
| 6048 | if ( *piSortFlags & SORT_UNIQUNIQ ) { |
| 6049 | CheckDlgButton ( hwnd, 105, BST_CHECKED ); |
| 6050 | } |
| 6051 | if ( *piSortFlags & SORT_NOCASE ) { |
| 6052 | CheckDlgButton ( hwnd, 106, BST_CHECKED ); |
| 6053 | } |
| 6054 | if ( GetProcAddress ( GetModuleHandle ( L"shlwapi" ), "StrCmpLogicalW" ) ) { |
| 6055 | if ( *piSortFlags & SORT_LOGICAL ) { |
| 6056 | CheckDlgButton ( hwnd, 107, BST_CHECKED ); |
| 6057 | } |
| 6058 | bEnableLogicalSort = TRUE; |
| 6059 | } else { |
| 6060 | EnableWindow ( GetDlgItem ( hwnd, 107 ), FALSE ); |
| 6061 | bEnableLogicalSort = FALSE; |
| 6062 | } |
| 6063 | if ( SC_SEL_RECTANGLE != SendMessage ( hwndEdit, SCI_GETSELECTIONMODE, 0, 0 ) ) { |
| 6064 | *piSortFlags &= ~SORT_COLUMN; |
| 6065 | EnableWindow ( GetDlgItem ( hwnd, 108 ), FALSE ); |
| 6066 | } else { |
| 6067 | *piSortFlags |= SORT_COLUMN; |
| 6068 | CheckDlgButton ( hwnd, 108, BST_CHECKED ); |
| 6069 | } |
| 6070 | CenterDlgInParent ( hwnd ); |
| 6071 | } |
| 6072 | return TRUE; |
| 6073 | case WM_COMMAND: |
| 6074 | switch ( LOWORD ( wParam ) ) { |
| 6075 | case IDOK: { |
| 6076 | *piSortFlags = 0; |
| 6077 | if ( IsDlgButtonChecked ( hwnd, 101 ) == BST_CHECKED ) { |
| 6078 | *piSortFlags |= SORT_DESCENDING; |
| 6079 | } |
nothing calls this directly
no test coverage detected