X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwsettings.c;h=bbf9003605e46201f6719ac7eb6ff517822dd48c;hb=0278ebc80411a20fd23303156285e55ce8d2b0a5;hp=2cb488eece908fc8d4cbbb6ccddae5816e4397dd;hpb=5deaf4dafd42e67ed6c9037d40b9c7d777870e33;p=xboard.git diff --git a/winboard/wsettings.c b/winboard/wsettings.c index 2cb488e..bbf9003 100644 --- a/winboard/wsettings.c +++ b/winboard/wsettings.c @@ -1,4 +1,28 @@ /* + * woptions.h -- Options dialog box routines for WinBoard + * + * Copyright 2003, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free + * Software Foundation, Inc. + * + * ------------------------------------------------------------------------ + * + * GNU XBoard is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * GNU XBoard is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. * + * + *------------------------------------------------------------------------ + ** See the file ChangeLog for a revision history. */ + +/* * Engine-settings dialog. The complexity come from an attempt to present the engine-defined options * in a nicey formatted layout. To this end we first run a back-end pre-formatter, which will distribute * the controls over two columns (the minimum required, as some are double width). It also takes care of @@ -97,7 +121,7 @@ void LayoutOptions(int firstOption, int endOption, char *groupName, Option *optionList) { int i, b = strlen(groupName), stop, prefix, right, nextOption, firstButton = buttons; - Control lastType, nextType; + Control lastType, nextType=Label; nextOption = firstOption; while(nextOption < endOption) { @@ -357,7 +381,6 @@ int GetOptionValues(HWND hDlg, ChessProgramState *cps, Option *optionList) // read out all controls, and if value is altered, remember it and send it to the engine { - HANDLE hwndCombo; int i, k, new=0, changed=0, len; char **choices, newText[MSG_SIZ], buf[MSG_SIZ], *text; BOOL success; @@ -401,7 +424,6 @@ GetOptionValues(HWND hDlg, ChessProgramState *cps, Option *optionList) break; case ComboBox: choices = (char**) optionList[j].textValue; - hwndCombo = GetDlgItem(hDlg, 2001+2*i); success = GetDlgItemText( hDlg, 2001+2*i, newText, MSG_SIZ ); if(!success) break; new = -1; @@ -554,7 +576,7 @@ void AddOption(int x, int y, Control type, int i) int extra, num = ES_NUMBER; switch(type) { - case Slider+100: + case Spin+100: num = 0; // needs text control for accepting negative numbers case Slider: case Spin: @@ -865,8 +887,7 @@ int MatchOK() void PseudoOK(HWND hDlg) { - void (*saveOK)(); - saveOK = okFunc; okFunc = 0; + okFunc = 0; GetOptionValues(hDlg, activeCps, activeList); EndDialog( hDlg, 0 ); comboCallback = NULL; activeCps = NULL;