Page 1 of 1

Small request for WinBoard

PostPosted: 10 Jan 2020, 12:09
by F.Huber
Hi Harm,

it would be nice if you could make the area for the engine list in the dialog 'Engine > Load First/Second Engine ...'
a bit wider (maybe 50%) - if the list contains engines with quite long names (as in my CB-Emu/MessChess program
which uses Winboard), it's impossible to distinguish between different engines with similar names.
(I'm talking about your WinBoard-AA version, that you've updated frequently in the last weeks)

Usually I would do this myself with a resource editor, but just this dialog window does not appear in the
resources list of WinBoard (I'm curious how you made this dialog, because almost all other dialogs do
appear in a resource editor).

PS: I just saw that this problem also exists when selecting engines for a tournament. Although I don't
play engine tournaments, but many users of CB-Emu/MessChess actually do this with WinBoard.
And a different method: you could also add a horizontal scroll bar for these engine lists instead of making
the list wider, if this would be easier to implement.

Regards,
Franz

Re: Small request for WinBoard

PostPosted: 10 Jan 2020, 23:54
by H.G.Muller
When I implemented the Engine Settings dialogs, they could not be defined in the resources, because every engine needs a different dialog. So I had to make a 'generic dialog generator', which would design a dialog from the list of options received from the UCI engine. When I later added entirely new dialogs, it was much easier to use that same generic dialog generator on a predefined list of options to generate the Tournament and Load Engine dialogs. That was way more convenient than designing them by hand in the resource, where you have to spell out the coordinates and sizes of every control by the pixel. The generic dialog creator calculates all that from the type of control.

When comboboxes proved a rather annoying method for selecting engines, I extended the option-type repertoire with a 'listbox' element, something a UCI engine would never order, but which WinBoard can, for its own options. (And I also added 'label' options for putting fixed text in the dialogs.)

It should be simple to adapt the generic dialog creator so that it uses listboxes of a somewhat larger size, when it is asked to put one in a dialog. (The function AddOption() in wsettings.c is responsible for this.) I will have a look at it; I did this so long ago that I am not sure anymore how it works. A wider listbox probably also means that I have to alter the code that determines the total width of the dialog, and where it it locates all controls to the right of it. Strange thing is that the listbox is created with the parameter WS_HSCROLL as well as WS_VSCROLL, and yet there is no horizontal scroll bar.

Note that the listbox was designed to hold the nicknames of the engines, and since you can pick those yourselves, you could always make sure they are sufficiently short.

Re: Small request for WinBoard

PostPosted: 11 Jan 2020, 15:03
by H.G.Muller
It seems the following changes in wsettings.c will do the job:

- In AddOption(), case ListBox, second call to AddControl(), change its width argument 105 to 135.

This will make all listboxes wider, but will not shift what was displayer tot he right of it, so it will overlap. The dialogs including listboxes all make use of the normal mechanism to organize the dialog as two columns when the total number of options exceeds a certain limit. (Which is exceeded because the listbox counts as many.) Normally this creates two equally wide columns, though. Which, for the listboxes, seemed excessive. So I added a way for listbox requests to specify the column they are in should be reduced in width, on a case-by-case basis. With a wider listbox, they will have to be reduced less. This will have to be done (again in wsettings.c) in the dialog-descriptor arrays

- installOptions: 195 -> 165
- themeOptions: 195 -> 165
- tourneyOptions: 80 -> 50

Would a width of 135 be enough for you?

Re: Small request for WinBoard

PostPosted: 11 Jan 2020, 15:28
by F.Huber
H.G.Muller wrote:Would a width of 135 be enough for you?

I've just looked at Winboard's engine list used in CB-Emu/MessChess, and I guess this should indeed be enough.
But of course change it only, if it doesn't destroy anything else. ;)