Gets a number from the user Parameters: n - filled in the with return value title - the title for the input window prompt - the prompt for the input box Returns: false if cancel was pressed on the dialog, else true If false returned, n is unchanged
| 124 | // Returns: false if cancel was pressed on the dialog, else true |
| 125 | // If false returned, n is unchanged |
| 126 | bool InputNumber(int *n, char *title, char *prompt, CWnd *wnd) { |
| 127 | char buf[100] = ""; |
| 128 | CEditLineDialog dlg(title, prompt, buf, 1, wnd); |
| 129 | |
| 130 | if (dlg.DoModal() == IDOK) { |
| 131 | *n = atoi((char *)dlg.GetText()); |
| 132 | return 1; |
| 133 | } else |
| 134 | return 0; |
| 135 | } |
no test coverage detected