X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwsettings.c;h=2cce2e0bb7af545cb924df6fc620dd1cc7c8b7a6;hb=475bba1329094bb261b1017251900883c31b0f5c;hp=b3e41cd8fa9aa6b24fa647034929233c09c42895;hpb=75a6740777dacce0256aa85aecfad5c9861ac5b5;p=xboard.git diff --git a/winboard/wsettings.c b/winboard/wsettings.c index b3e41cd..2cce2e0 100644 --- a/winboard/wsettings.c +++ b/winboard/wsettings.c @@ -551,13 +551,15 @@ void AddControl(int x, int y, int w, int h, int type, int style, int n) void AddOption(int x, int y, Control type, int i) { - int extra; + int extra, num = ES_NUMBER; switch(type) { + case Slider+100: + num = 0; // needs text control for accepting negative numbers case Slider: case Spin: AddControl(x, y+1, 95, 9, 0x0082, SS_ENDELLIPSIS | WS_VISIBLE | WS_CHILD, i); - AddControl(x+95, y, 50, 11, 0x0081, ES_AUTOHSCROLL | ES_NUMBER | WS_BORDER | WS_VISIBLE | WS_CHILD | WS_TABSTOP, i+1); + AddControl(x+95, y, 50, 11, 0x0081, ES_AUTOHSCROLL | num | WS_BORDER | WS_VISIBLE | WS_CHILD | WS_TABSTOP, i+1); break; case TextBox: extra = 13*activeList[layoutList[i/2]].min; // when extra high, left-align and put description text above it @@ -625,7 +627,8 @@ CreateDialogTemplate(int *layoutList, int nr, Option *optionList) } j = layoutList[i]; if(j >= 0) { - AddOption(x+155-150*(i&1), y+13*(i>>1)+5, optionList[j].type, 2*i); + int neg = (optionList[j].type == Spin && optionList[j].min < 0 ? 100 : 0); // flags spin with negative range + AddOption(x+155-150*(i&1), y+13*(i>>1)+5, optionList[j].type + neg, 2*i); // listboxes have the special power to adjust the width of the column they are in if(optionList[j].type == ListBox) x -= optionList[j].value, template.header.cx -= optionList[j].value; } @@ -977,7 +980,7 @@ void TourneyPopup(HWND hwnd) { int n = NamesToList(firstChessProgramNames, engineList, engineMnemonic, ""); autoinc = appData.loadGameIndex < 0 || appData.loadPositionIndex < 0; - twice = FALSE; swiss = appData.tourneyType < 0; + twice = appData.loadGameIndex == -2 || appData.loadPositionIndex == -2; swiss = appData.tourneyType < 0; tourneyOptions[0].max = n; snprintf(title, MSG_SIZ, _("Tournament and Match Options")); ASSIGN(tfName, appData.tourneyFile[0] ? appData.tourneyFile : MakeName(appData.defName));