X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=dialogs.c;h=07eba9be6b5eac8543ec1f6b08c4061bc8c7ecd6;hb=6a2d6f12088f0352f67165564871c56a92c37a2f;hp=586e62895853d42d1922e5dd0d015798541bf885;hpb=77a587355e8fb421964949184eea7e51d61f5d61;p=xboard.git diff --git a/dialogs.c b/dialogs.c index 586e628..07eba9b 100644 --- a/dialogs.c +++ b/dialogs.c @@ -1454,13 +1454,13 @@ static int count; static void PromoPick P((int n)); static Option promoOptions[] = { -{ 0, 0, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, "" }, -{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, "" }, -{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, "" }, -{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, "" }, -{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, "" }, -{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, "" }, -{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, "" }, +{ 0, 0, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, NULL }, +{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, NULL }, +{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, NULL }, +{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, NULL }, +{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, NULL }, +{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, NULL }, +{ 0, SAME_ROW, 0, NULL, (void*) &PromoPick, NULL, NULL, Button, NULL }, { 0, SAME_ROW | NO_OK, 0, NULL, NULL, "", NULL, EndMark , "" } }; @@ -1489,8 +1489,9 @@ PromoPick (int n) static void SetPromo (char *name, int nr, char promoChar) { - safeStrCpy(promoOptions[nr].name, name, MSG_SIZ); + ASSIGN(promoOptions[nr].name, name); promoOptions[nr].value = promoChar; + promoOptions[nr].min = SAME_ROW; } void @@ -1526,6 +1527,7 @@ PromotionPopUp () SetPromo(_("Defer"), --count, '='); SetPromo(_("Promote"), --count, '+'); } + promoOptions[count].min = 0; GenericPopUp(promoOptions + count, "Promotion", PromoDlg, BoardWindow, NONMODAL, 0); } @@ -1762,6 +1764,8 @@ DisplayTitle (char *text) if (text == NULL) text = ""; + if(partnerUp) { SetDialogTitle(DummyDlg, text); return; } + if (*text != NULLCHAR) { safeStrCpy(icon, text, sizeof(icon)/sizeof(icon[0]) ); safeStrCpy(title, text, sizeof(title)/sizeof(title[0]) ); @@ -1842,7 +1846,7 @@ PMSelect (int n) else EditPositionMenuEvent(pieceMenuTranslation[n - W_MENUW][values[n]], pmFromX, pmFromY); } -int +static void CCB (int n) { shiftKey = (ShiftKeys() & 3) != 0; @@ -1909,6 +1913,7 @@ Exp (int n, int x, int y) if(but3) MovePV(x, y, lineGap + BOARD_HEIGHT * (squareSize + lineGap)); return NULL; } + if(n != 10 && PopDown(PromoDlg)) fromX = fromY = -1; // user starts fiddling with board when promotion dialog is up shiftKey = ShiftKeys(); controlKey = (shiftKey & 0xC) != 0; shiftKey = (shiftKey & 3) != 0; @@ -1978,12 +1983,13 @@ Option dualOptions[] = { // auxiliary board window void SlavePopUp () { + int size = BOARD_WIDTH*(squareSize + lineGap) + lineGap; // copy params from main board dualOptions[0].choice = mainOptions[W_WHITE].choice; dualOptions[1].choice = mainOptions[W_BLACK].choice; - dualOptions[3].value = mainOptions[W_BOARD].value; - dualOptions[3].max = dualOptions[2].max = mainOptions[W_BOARD].max; // board size - dualOptions[0].max = dualOptions[1].max = mainOptions[W_WHITE].max; // clock width + dualOptions[3].value = BOARD_HEIGHT*(squareSize + lineGap) + lineGap; + dualOptions[3].max = dualOptions[2].max = size; // board width + dualOptions[0].max = dualOptions[1].max = size/2 - 3; // clock width GenericPopUp(dualOptions, "XBoard", DummyDlg, BoardWindow, NONMODAL, 1); } @@ -2278,7 +2284,7 @@ DirSelProc (int n, int sel) } } -FILE * +void Browse (DialogClass dlg, char *label, char *proposed, char *ext, Boolean pathFlag, char *mode, char **name, FILE **fp) { int j=0; @@ -2292,8 +2298,7 @@ Browse (DialogClass dlg, char *label, char *proposed, char *ext, Boolean pathFla browseOptions[6].textValue = (char*) (pathFlag ? NULL : &FileSelProc); // disable file listbox during path browsing ListDir(pathFlag); currentCps = NULL; - if(GenericPopUp(browseOptions, label, BrowserDlg, dlg, MODAL, 0)) { - } + GenericPopUp(browseOptions, label, BrowserDlg, dlg, MODAL, 0); SetWidgetLabel(&browseOptions[9], FileTypes[j]); }