From: H.G.Muller Date: Thu, 15 Oct 2015 18:45:41 +0000 (+0200) Subject: Use intermediate width menu bar in sizes 37 & 40 (WB) X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=7de6712304f5989001701e03f4c3c02fd3b60530;p=xboard.git Use intermediate width menu bar in sizes 37 & 40 (WB) Due to the increased number of main menus the menu bar wrapped to two lines in sizes slim and small (which did not use the single-letter 'tinyLayout' menu texts). An intermediate menu-bar format with 3-letter texts is now provided as well. --- diff --git a/winboard/defaults.h b/winboard/defaults.h index c608bc8..65a0812 100644 --- a/winboard/defaults.h +++ b/winboard/defaults.h @@ -56,8 +56,8 @@ #define GAME_FILT "Game files (*.pgn,*.gam)\0*.pgn;*.gam\0All files (*.*)\0*.*\0" #define DIAGRAM_FILT "bitmap files (*.bmp)\0*.bmp\0All files (*.*)\0*.*\0" #define SOUND_FILT "Wave files (*.wav)\0*.wav\0All files (*.*)\0*.*\0" -#define OUTER_MARGIN (tinyLayout ? 0 : 4) -#define INNER_MARGIN (tinyLayout ? 0 : 2) +#define OUTER_MARGIN (tinyLayout == 2 ? 0 : 4) +#define INNER_MARGIN (tinyLayout == 2 ? 0 : 2) #define MESSAGE_LINE_LEFTMARGIN 2 #define MESSAGE_TEXT_MAX 256 /*#define COLOR_ECHOOFF RGB(192,192,192)*/ diff --git a/winboard/jaws.c b/winboard/jaws.c index 3e70d67..5f2936f 100644 --- a/winboard/jaws.c +++ b/winboard/jaws.c @@ -270,7 +270,7 @@ InitJAWS() AdaptMenu(); menuBarText[0][8] = menuBarText[0][7]; menuBarText[0][7] = "&JAWS"; - for(i=0; i<9; i++) menuBarText[1][i] = menuBarText[0][i]; + for(i=0; i<9; i++) menuBarText[2][i] = menuBarText[1][i] = menuBarText[0][i]; } hAccelJAWS = CreateAcceleratorTable(acceleratorsJAWS, 14); diff --git a/winboard/winboard.c b/winboard/winboard.c index 670e391..7db641b 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -534,12 +534,12 @@ typedef struct { SizeInfo sizeInfo[] = { - { "tiny", 21, 0, 1, 1, 0, 0 }, - { "teeny", 25, 1, 1, 1, 0, 0 }, - { "dinky", 29, 1, 1, 1, 0, 0 }, - { "petite", 33, 1, 1, 1, 0, 0 }, - { "slim", 37, 2, 1, 0, 0, 0 }, - { "small", 40, 2, 1, 0, 0, 0 }, + { "tiny", 21, 0, 1, 2, 0, 0 }, + { "teeny", 25, 1, 1, 2, 0, 0 }, + { "dinky", 29, 1, 1, 2, 0, 0 }, + { "petite", 33, 1, 1, 2, 0, 0 }, + { "slim", 37, 2, 1, 1, 0, 0 }, + { "small", 40, 2, 1, 1, 0, 0 }, { "mediocre", 45, 2, 1, 0, 0, 0 }, { "middling", 49, 2, 0, 0, 0, 0 }, { "average", 54, 2, 0, 0, 0, 0 }, @@ -587,7 +587,7 @@ typedef struct { WNDPROC wndproc; } MyButtonDesc; -#define BUTTON_WIDTH (tinyLayout ? 16 : 32) +#define BUTTON_WIDTH (tinyLayout == 2 ? 16 : 32) #define N_BUTTONS 5 MyButtonDesc buttonDesc[N_BUTTONS] = @@ -601,8 +601,9 @@ MyButtonDesc buttonDesc[N_BUTTONS] = int tinyLayout = 0, smallLayout = 0; #define MENU_BAR_ITEMS 9 -char *menuBarText[2][MENU_BAR_ITEMS+1] = { +char *menuBarText[3][MENU_BAR_ITEMS+1] = { { N_("&File"), N_("&Edit"), N_("&View"), N_("&Mode"), N_("&Action"), N_("E&ngine"), N_("&Options"), N_("&Help"), NULL }, + { N_("&Fil"), N_("&Ed"), N_("&Vw"), N_("&Mod"), N_("&Act"), N_("E&ng"), N_("&Opt"), N_("&Hlp"), NULL }, { N_("&F"), N_("&E"), N_("&V"), N_("&M"), N_("&A"), N_("&N"), N_("&O"), N_("&H"), NULL }, }; @@ -1284,6 +1285,7 @@ LFfromMFP(LOGFONT* lf, MyFontParams *mfp) lf->lfOutPrecision = OUT_DEFAULT_PRECIS; + lf->lfClipPrecision = CLIP_DEFAULT_PRECIS; lf->lfQuality = DEFAULT_QUALITY; lf->lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE; @@ -2357,7 +2359,7 @@ InitDrawingSizes(BoardSize boardSize, int flags) if (tinyLayout != oldTinyLayout) { long style = GetWindowLongPtr(hwndMain, GWL_STYLE); - if (tinyLayout) { + if (tinyLayout == 2) { style &= ~WS_SYSMENU; InsertMenu(hmenu, IDM_Exit, MF_BYCOMMAND, IDM_Minimize, "&Minimize\tCtrl+F4"); @@ -2393,7 +2395,7 @@ InitDrawingSizes(BoardSize boardSize, int flags) ReleaseDC(hwndMain, hdc); /* Compute where everything goes */ - if((first.programLogo || second.programLogo) && !tinyLayout) { + if((first.programLogo || second.programLogo) && tinyLayout != 2) { /* [HGM] logo: if either logo is on, reserve space for it */ logoHeight = 2*clockSize.cy; leftLogoRect.left = OUTER_MARGIN; @@ -2514,7 +2516,7 @@ InitDrawingSizes(BoardSize boardSize, int flags) messageRect.top, BUTTON_WIDTH, messageSize.cy, hwndMain, (HMENU) buttonDesc[i].id, (HINSTANCE) GetWindowLongPtr(hwndMain, GWLP_HINSTANCE), NULL); - if (tinyLayout) { + if (tinyLayout == 2) { SendMessage(buttonDesc[i].hwnd, WM_SETFONT, (WPARAM)font[boardSize][MESSAGE_FONT]->hf, MAKELPARAM(FALSE, 0)); @@ -3991,6 +3993,7 @@ HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) } if( appData.highlightMoveWithArrow ) { + DrawArrowHighlight(hdcmem); } @@ -4511,6 +4514,7 @@ static int promoStyle; LRESULT CALLBACK Promotion(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { + char promoChar; switch (message) { @@ -7646,7 +7650,7 @@ DisplayAClock(HDC hdc, int timeRemaining, int highlight, if (twoBoards && partnerUp) return; if (appData.clockMode) { - if (tinyLayout) + if (tinyLayout == 2) snprintf(buf, sizeof(buf)/sizeof(buf[0]), "%c %s %s", color[0], TimeString(timeRemaining), flagFell); else snprintf(buf, sizeof(buf)/sizeof(buf[0]), "%s:%c%s %s", color, (logoHeight>0 ? 0 : ' '), TimeString(timeRemaining), flagFell);