Mercurial > vim
comparison src/gui_w32.c @ 5225:8f983df0299f v7.4a.038
updated for version 7.4a.038
Problem: When using MSVC 2012 there are various issues, including GUI size
computations.
Solution: Use SM_CXPADDEDBORDER. (Mike Williams)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 21 Jul 2013 17:53:58 +0200 |
parents | 91d478da863e |
children | 47a09a572ea6 |
comparison
equal
deleted
inserted
replaced
5224:64ff75f97b41 | 5225:8f983df0299f |
---|---|
1692 /* Need to get the settings of the normal window. */ | 1692 /* Need to get the settings of the normal window. */ |
1693 GetWindowPlacement(s_hwnd, &wndpl); | 1693 GetWindowPlacement(s_hwnd, &wndpl); |
1694 } | 1694 } |
1695 | 1695 |
1696 /* compute the size of the outside of the window */ | 1696 /* compute the size of the outside of the window */ |
1697 win_width = width + GetSystemMetrics(SM_CXFRAME) * 2; | 1697 win_width = width + (GetSystemMetrics(SM_CXFRAME) + |
1698 win_height = height + GetSystemMetrics(SM_CYFRAME) * 2 | 1698 GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; |
1699 win_height = height + (GetSystemMetrics(SM_CYFRAME) + | |
1700 GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 | |
1699 + GetSystemMetrics(SM_CYCAPTION) | 1701 + GetSystemMetrics(SM_CYCAPTION) |
1700 #ifdef FEAT_MENU | 1702 #ifdef FEAT_MENU |
1701 + gui_mswin_get_menu_height(FALSE) | 1703 + gui_mswin_get_menu_height(FALSE) |
1702 #endif | 1704 #endif |
1703 ; | 1705 ; |
2544 RECT workarea_rect; | 2546 RECT workarea_rect; |
2545 | 2547 |
2546 get_work_area(&workarea_rect); | 2548 get_work_area(&workarea_rect); |
2547 | 2549 |
2548 *screen_w = workarea_rect.right - workarea_rect.left | 2550 *screen_w = workarea_rect.right - workarea_rect.left |
2549 - GetSystemMetrics(SM_CXFRAME) * 2; | 2551 - (GetSystemMetrics(SM_CXFRAME) + |
2552 GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; | |
2550 | 2553 |
2551 /* FIXME: dirty trick: Because the gui_get_base_height() doesn't include | 2554 /* FIXME: dirty trick: Because the gui_get_base_height() doesn't include |
2552 * the menubar for MSwin, we subtract it from the screen height, so that | 2555 * the menubar for MSwin, we subtract it from the screen height, so that |
2553 * the window size can be made to fit on the screen. */ | 2556 * the window size can be made to fit on the screen. */ |
2554 *screen_h = workarea_rect.bottom - workarea_rect.top | 2557 *screen_h = workarea_rect.bottom - workarea_rect.top |
2555 - GetSystemMetrics(SM_CYFRAME) * 2 | 2558 - (GetSystemMetrics(SM_CYFRAME) + |
2559 GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 | |
2556 - GetSystemMetrics(SM_CYCAPTION) | 2560 - GetSystemMetrics(SM_CYCAPTION) |
2557 #ifdef FEAT_MENU | 2561 #ifdef FEAT_MENU |
2558 - gui_mswin_get_menu_height(FALSE) | 2562 - gui_mswin_get_menu_height(FALSE) |
2559 #endif | 2563 #endif |
2560 ; | 2564 ; |
3180 else | 3184 else |
3181 { | 3185 { |
3182 /* Use our own window for the size, unless it's very small. */ | 3186 /* Use our own window for the size, unless it's very small. */ |
3183 GetWindowRect(s_hwnd, &rect); | 3187 GetWindowRect(s_hwnd, &rect); |
3184 maxDialogWidth = rect.right - rect.left | 3188 maxDialogWidth = rect.right - rect.left |
3185 - GetSystemMetrics(SM_CXFRAME) * 2; | 3189 - (GetSystemMetrics(SM_CXFRAME) + |
3190 GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; | |
3186 if (maxDialogWidth < DLG_MIN_MAX_WIDTH) | 3191 if (maxDialogWidth < DLG_MIN_MAX_WIDTH) |
3187 maxDialogWidth = DLG_MIN_MAX_WIDTH; | 3192 maxDialogWidth = DLG_MIN_MAX_WIDTH; |
3188 | 3193 |
3189 maxDialogHeight = rect.bottom - rect.top | 3194 maxDialogHeight = rect.bottom - rect.top |
3190 - GetSystemMetrics(SM_CXFRAME) * 2; | 3195 - (GetSystemMetrics(SM_CXFRAME) + |
3196 GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; | |
3191 if (maxDialogHeight < DLG_MIN_MAX_HEIGHT) | 3197 if (maxDialogHeight < DLG_MIN_MAX_HEIGHT) |
3192 maxDialogHeight = DLG_MIN_MAX_HEIGHT; | 3198 maxDialogHeight = DLG_MIN_MAX_HEIGHT; |
3193 } | 3199 } |
3194 | 3200 |
3195 /* Set dlgwidth to width of message. | 3201 /* Set dlgwidth to width of message. |