diff options
| author | Eli Zaretskii | 2000-01-24 14:44:26 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2000-01-24 14:44:26 +0000 |
| commit | edf6aeb8901106f4a038a4c23b7cbe0fae853c93 (patch) | |
| tree | afacf6044fd0a048dbea450a9a394debecf472e6 /src | |
| parent | 9badad414d2265f01b26108dbfd966c9d384d70b (diff) | |
| download | emacs-edf6aeb8901106f4a038a4c23b7cbe0fae853c93.tar.gz emacs-edf6aeb8901106f4a038a4c23b7cbe0fae853c93.zip | |
(IT_menu_display): Truncate long menu lines at the right
screen boundary.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/msdos.c | 13 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6f52fa04804..e72c2250ea0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2000-01-24 Eli Zaretskii <eliz@is.elta.co.il> | ||
| 2 | |||
| 3 | * msdos.c (IT_menu_display): Truncate long menu lines at the right | ||
| 4 | screen boundary. | ||
| 5 | |||
| 1 | 2000-01-23 Jason Rumney <jasonr@gnu.org> | 6 | 2000-01-23 Jason Rumney <jasonr@gnu.org> |
| 2 | 7 | ||
| 3 | * w32fns.c (w32_defined_color): Apply gamma correction before | 8 | * w32fns.c (w32_defined_color): Apply gamma correction before |
diff --git a/src/msdos.c b/src/msdos.c index 3cd0d7e5a4e..fc1509b6010 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -3268,6 +3268,8 @@ IT_menu_display (XMenu *menu, int y, int x, int *faces) | |||
| 3268 | IT_update_begin (sf); | 3268 | IT_update_begin (sf); |
| 3269 | for (i = 0; i < menu->count; i++) | 3269 | for (i = 0; i < menu->count; i++) |
| 3270 | { | 3270 | { |
| 3271 | int max_width = width + 2; | ||
| 3272 | |||
| 3271 | IT_cursor_to (y + i, x); | 3273 | IT_cursor_to (y + i, x); |
| 3272 | enabled | 3274 | enabled |
| 3273 | = (!menu->submenu[i] && menu->panenumber[i]) || (menu->submenu[i]); | 3275 | = (!menu->submenu[i] && menu->panenumber[i]) || (menu->submenu[i]); |
| @@ -3292,13 +3294,18 @@ IT_menu_display (XMenu *menu, int y, int x, int *faces) | |||
| 3292 | p++; | 3294 | p++; |
| 3293 | } | 3295 | } |
| 3294 | } | 3296 | } |
| 3295 | 3297 | /* Don't let the menu text overflow into the next screen row. */ | |
| 3296 | for (; j < width; j++, p++) | 3298 | if (x + max_width > screen_size_X) |
| 3299 | { | ||
| 3300 | max_width = screen_size_X - x; | ||
| 3301 | text[max_width - 1].u.ch = '$'; /* indicate it's truncated */ | ||
| 3302 | } | ||
| 3303 | for (; j < max_width - 2; j++, p++) | ||
| 3297 | SET_CHAR_GLYPH (*p, ' ', face, 0); | 3304 | SET_CHAR_GLYPH (*p, ' ', face, 0); |
| 3298 | 3305 | ||
| 3299 | SET_CHAR_GLYPH (*p, menu->submenu[i] ? 16 : ' ', face, 0); | 3306 | SET_CHAR_GLYPH (*p, menu->submenu[i] ? 16 : ' ', face, 0); |
| 3300 | p++; | 3307 | p++; |
| 3301 | IT_write_glyphs (text, width + 2); | 3308 | IT_write_glyphs (text, max_width); |
| 3302 | } | 3309 | } |
| 3303 | IT_update_end (sf); | 3310 | IT_update_end (sf); |
| 3304 | IT_cursor_to (row, col); | 3311 | IT_cursor_to (row, col); |