case ResetButton:\r
fprintf(debugFP, "[ %26.26s ]", opt.name);\r
case Message:\r
+ default:\r
break;\r
}\r
}\r
case PathName:\r
case Slider:\r
case Spin: stop++;\r
+ default:\r
case Message: ; // cannot happen\r
}\r
nextOption++;\r
if(!stop)\r
nextType = Button; // kudge to flush remaining checks and combos undistorted\r
// Take a new line if a spin follows combos or checks, or when we encounter a textbox\r
- if((combos+checks || nextType == TextBox) && layout&1) {\r
+ if((combos+checks || nextType == TextBox || nextType == FileName || nextType == PathName) && layout&1) {\r
layoutList[layout++] = -1;\r
}\r
// The last check or combo before a spin will be put on the same line as that spin (prefix)\r
}\r
// if a combo is followed by a textbox, it must stay at the end of the combo/checks list to appear\r
// immediately above the textbox, so treat it as check. (A check would automatically be and remain there.)\r
- if(nextType == TextBox && lastType == ComboBox)\r
+ if((nextType == TextBox || nextType == FileName || nextType == PathName) && lastType == ComboBox)\r
checkList[checks++] = comboList[--combos];\r
// Now append the checks behind the (remaining) combos to treat them as one group\r
for(i=0; i< checks; i++)\r
layoutList[layout++] = -1;\r
layoutList[layout++] = comboList[2*right];\r
}\r
- if(nextType == TextBox) {\r
+ if(nextType == TextBox || nextType == FileName || nextType == PathName) {\r
// A textBox is double width, so must be left-adjusted, and the right column remains empty\r
breaks[layout/2] = lastType == Button ? 0 : 100;\r
layoutList[layout++] = -1;\r
SetDlgItemInt( hDlg, 2001+2*i, cps->option[j].value, TRUE );\r
break;\r
case TextBox:\r
+ case FileName:\r
+ case PathName:\r
SetDlgItemText( hDlg, 2001+2*i, cps->option[j].textValue );\r
break;\r
case CheckBox:\r
ofn.lpstrFilter = filter;\r
ofn.lpstrFile = buf;\r
ofn.nMaxFile = sizeof(buf);\r
- ofn.lpstrTitle = _("Choose Book");\r
+ ofn.lpstrTitle = _("Choose File");\r
ofn.Flags = OFN_FILEMUSTEXIST | OFN_LONGNAMES | OFN_HIDEREADONLY;\r
\r
if( GetOpenFileName( &ofn ) ) {\r
SetDlgItemText( hDlg, i+3, buf );\r
}\r
+ } else\r
+ if(j == -3) {\r
+ if( BrowseForFolder( _("Choose Folder:"), buf ) ) {\r
+ SetDlgItemText( hDlg, i+3, buf );\r
+ }\r
}\r
+ return TRUE;\r
if(j < 0) break;\r
if( activeCps->option[j].type == SaveButton)\r
GetOptionValues(hDlg, activeCps);\r
AddControl(x, y+1, 95, 9, 0x0082, SS_ENDELLIPSIS | WS_VISIBLE | WS_CHILD, i);\r
AddControl(x+95, y, 50, 11, 0x0081, ES_AUTOHSCROLL | ES_NUMBER | WS_BORDER | WS_VISIBLE | WS_CHILD | WS_TABSTOP, i+1);\r
break;\r
-// case TextBox:\r
+ case TextBox:\r
AddControl(x, y+1, 95, 9, 0x0082, SS_ENDELLIPSIS | WS_VISIBLE | WS_CHILD, i);\r
AddControl(x+95, y, 190, 11, 0x0081, ES_AUTOHSCROLL | WS_BORDER | WS_VISIBLE | WS_CHILD | WS_TABSTOP, i+1);\r
break;\r
- case TextBox: // For now all text edits get a browse button, as long as -file and -path options are not yet implemented\r
case FileName:\r
case PathName:\r
AddControl(x, y+1, 95, 9, 0x0082, SS_ENDELLIPSIS | WS_VISIBLE | WS_CHILD, i);\r
AddControl(x+95, y, 180, 11, 0x0081, ES_AUTOHSCROLL | WS_BORDER | WS_VISIBLE | WS_CHILD | WS_TABSTOP, i+1);\r
AddControl(x+275, y, 20, 12, 0x0080, BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, i-2);\r
- layoutList[i/2-1] = -2;\r
+ layoutList[i/2-1] = -2 - (type == PathName);\r
break;\r
case CheckBox:\r
AddControl(x, y, 145, 11, 0x0080, BS_AUTOCHECKBOX | WS_VISIBLE | WS_CHILD | WS_TABSTOP, i);\r
case SaveButton:\r
AddControl(x-2, y, 65, 13, 0x0080, BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD, i);\r
case Message:\r
+ default:\r
break;\r
}\r
\r