| 2436 | |
| 2437 | |
| 2438 | static int messageBoxWinConsole( |
| 2439 | char const * aTitle , /* NULL or "" */ |
| 2440 | char const * aMessage , /* NULL or "" may contain \n and \t */ |
| 2441 | char const * aDialogType , /* "ok" "okcancel" "yesno" "yesnocancel" */ |
| 2442 | char const * aIconType , /* "info" "warning" "error" "question" */ |
| 2443 | int aDefaultButton ) /* 0 for cancel/no , 1 for ok/yes , 2 for no in yesnocancel */ |
| 2444 | { |
| 2445 | char lDialogString[MAX_PATH_OR_CMD]; |
| 2446 | char lDialogFile[MAX_PATH_OR_CMD]; |
| 2447 | FILE * lIn; |
| 2448 | char lBuff[MAX_PATH_OR_CMD] = ""; |
| 2449 | (void)aIconType; |
| 2450 | |
| 2451 | strcpy(lDialogString, "dialog "); |
| 2452 | if (aTitle && strlen(aTitle)) |
| 2453 | { |
| 2454 | strcat(lDialogString, "--title \"") ; |
| 2455 | strcat(lDialogString, aTitle) ; |
| 2456 | strcat(lDialogString, "\" ") ; |
| 2457 | } |
| 2458 | |
| 2459 | if ( aDialogType && ( !strcmp( "okcancel" , aDialogType ) |
| 2460 | || !strcmp("yesno", aDialogType) || !strcmp("yesnocancel", aDialogType) ) ) |
| 2461 | { |
| 2462 | strcat(lDialogString, "--backtitle \"") ; |
| 2463 | strcat(lDialogString, "tab: move focus") ; |
| 2464 | strcat(lDialogString, "\" ") ; |
| 2465 | } |
| 2466 | |
| 2467 | if ( aDialogType && ! strcmp( "okcancel" , aDialogType ) ) |
| 2468 | { |
| 2469 | if ( ! aDefaultButton ) |
| 2470 | { |
| 2471 | strcat( lDialogString , "--defaultno " ) ; |
| 2472 | } |
| 2473 | strcat( lDialogString , |
| 2474 | "--yes-label \"Ok\" --no-label \"Cancel\" --yesno " ) ; |
| 2475 | } |
| 2476 | else if ( aDialogType && ! strcmp( "yesno" , aDialogType ) ) |
| 2477 | { |
| 2478 | if ( ! aDefaultButton ) |
| 2479 | { |
| 2480 | strcat( lDialogString , "--defaultno " ) ; |
| 2481 | } |
| 2482 | strcat( lDialogString , "--yesno " ) ; |
| 2483 | } |
| 2484 | else if (aDialogType && !strcmp("yesnocancel", aDialogType)) |
| 2485 | { |
| 2486 | if (!aDefaultButton) |
| 2487 | { |
| 2488 | strcat(lDialogString, "--defaultno "); |
| 2489 | } |
| 2490 | strcat(lDialogString, "--menu "); |
| 2491 | } |
| 2492 | else |
| 2493 | { |
| 2494 | strcat( lDialogString , "--msgbox " ) ; |
| 2495 | } |
no test coverage detected