}
static void win_draw_text(void *handle, int x, int y, int fonttype,
}
static void win_draw_text(void *handle, int x, int y, int fonttype,
- int fontsize, int align, int colour, char *text)
+ int fontsize, int align, int colour,
+ const char *text)
-static char *frontend_set_config(frontend *fe, int which, config_item *cfg)
+static const char *frontend_set_config(
+ frontend *fe, int which, config_item *cfg)
{
if (which < CFG_FRONTEND_SPECIFIC) {
return midend_set_config(fe->me, which, cfg);
} else if (which == CFG_PRINT) {
{
if (which < CFG_FRONTEND_SPECIFIC) {
return midend_set_config(fe->me, which, cfg);
} else if (which == CFG_PRINT) {
- fe->printcurr = cfg[4].ival;
- fe->printsolns = cfg[5].ival;
- fe->printcolour = fe->game->can_print_in_colour && cfg[6].ival;
+ fe->printcurr = cfg[4].u.boolean.bval;
+ fe->printsolns = cfg[5].u.boolean.bval;
+ fe->printcolour = fe->game->can_print_in_colour &&
+ cfg[6].u.boolean.bval;
/* Control coordinates should be specified in dialog units. */
HWND mkctrl(frontend *fe, int x1, int x2, int y1, int y2,
LPCTSTR wclass, int wstyle,
/* Control coordinates should be specified in dialog units. */
HWND mkctrl(frontend *fe, int x1, int x2, int y1, int y2,
LPCTSTR wclass, int wstyle,
mkctrl(fe, col2l, col2r, y, y + 12,
TEXT("EDIT"), WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL,
0, "", (j->ctlid = id++));
mkctrl(fe, col2l, col2r, y, y + 12,
TEXT("EDIT"), WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL,
0, "", (j->ctlid = id++));
mkctrl(fe, col1l, col2r, y + 1, y + 11, TEXT("BUTTON"),
BS_NOTIFY | BS_AUTOCHECKBOX | WS_TABSTOP,
0, i->name, (j->ctlid = id++));
mkctrl(fe, col1l, col2r, y + 1, y + 11, TEXT("BUTTON"),
BS_NOTIFY | BS_AUTOCHECKBOX | WS_TABSTOP,
0, i->name, (j->ctlid = id++));
CBS_DROPDOWNLIST | CBS_HASSTRINGS,
0, "", (j->ctlid = id++));
{
CBS_DROPDOWNLIST | CBS_HASSTRINGS,
0, "", (j->ctlid = id++));
{
- SendMessage(ctl, CB_SETCURSEL, i->ival, 0);
+ SendMessage(ctl, CB_SETCURSEL, i->u.choices.selected, 0);
- char *err = frontend_set_config(fe, fe->cfg_which, fe->cfg);
+ const char *err = frontend_set_config(
+ fe, fe->cfg_which, fe->cfg);
if (err) {
MessageBox(hwnd, err, "Validation error",
if (err) {
MessageBox(hwnd, err, "Validation error",
GetDlgItemText(fe->cfgbox, j->ctlid, buffer, lenof(buffer));
#endif
buffer[lenof(buffer)-1] = '\0';
GetDlgItemText(fe->cfgbox, j->ctlid, buffer, lenof(buffer));
#endif
buffer[lenof(buffer)-1] = '\0';
} else if (i->type == C_BOOLEAN &&
(HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DBLCLK)) {
} else if (i->type == C_BOOLEAN &&
(HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DBLCLK)) {
#ifndef _WIN32_WCE
HWND mkctrl(frontend *fe, int x1, int x2, int y1, int y2,
char *wclass, int wstyle,
#ifndef _WIN32_WCE
HWND mkctrl(frontend *fe, int x1, int x2, int y1, int y2,
char *wclass, int wstyle,
{
HWND ret;
ret = CreateWindowEx(exstyle, wclass, wtext,
{
HWND ret;
ret = CreateWindowEx(exstyle, wclass, wtext,
ctl = mkctrl(fe, col2l, col2r, y, y+height*3/2,
"EDIT", WS_TABSTOP | ES_AUTOHSCROLL,
WS_EX_CLIENTEDGE, "", (j->ctlid = id++));
ctl = mkctrl(fe, col2l, col2r, y, y+height*3/2,
"EDIT", WS_TABSTOP | ES_AUTOHSCROLL,
WS_EX_CLIENTEDGE, "", (j->ctlid = id++));
mkctrl(fe, col1l, col2r, y, y+height, "BUTTON",
BS_NOTIFY | BS_AUTOCHECKBOX | WS_TABSTOP,
0, i->name, (j->ctlid = id++));
mkctrl(fe, col1l, col2r, y, y+height, "BUTTON",
BS_NOTIFY | BS_AUTOCHECKBOX | WS_TABSTOP,
0, i->name, (j->ctlid = id++));
CBS_DROPDOWNLIST | CBS_HASSTRINGS,
WS_EX_CLIENTEDGE, "", (j->ctlid = id++));
{
CBS_DROPDOWNLIST | CBS_HASSTRINGS,
WS_EX_CLIENTEDGE, "", (j->ctlid = id++));
{
SendMessage(ctl, CB_RESETCONTENT, 0, 0);
SendMessage(ctl, CB_RESETCONTENT, 0, 0);
- SendMessage(ctl, CB_SETCURSEL, i->ival, 0);
+ SendMessage(ctl, CB_SETCURSEL, i->u.choices.selected, 0);
if (msg)
MessageBox(hwnd, msg, "Unable to solve",
MB_ICONERROR | MB_OK);
if (msg)
MessageBox(hwnd, msg, "Unable to solve",
MB_ICONERROR | MB_OK);
"supported by this program";
} else {
me = midend_for_new_game(fe, gamelist[i], NULL,
"supported by this program";
} else {
me = midend_for_new_game(fe, gamelist[i], NULL,
if (err) {
MessageBox(hwnd, err, "Error", MB_ICONERROR|MB_OK);
if (err) {
MessageBox(hwnd, err, "Error", MB_ICONERROR|MB_OK);