Files
nethack/win/X11/X11-issues.txt
PatR 946df19ea2 \#perminv, 2 of 2: implementation
Add new '|' command, aka #perminv, which allows the player to
send menu scrolling keystrokes to the persistent inventory window.

Implemented for X11, where its usefulness is limited, and for
curses, where it is more needed and also more fully functional.
The interface can either prompt for one keystroke, act upon it,
and return to normal play, or it can loop for multiple keystrokes
until player types <return> or <escape>.  X11 does the former if
the 'slow' application resource is False so that prompting uses
popups, and the latter when 'slow' is True where prompting is in
a fixed spot and doesn't end up causing the persistent inventory
window to be stacked behind the map window.  curses always does
the loop-until-done approach.  It also accepts up and down arrow
keys to scroll one line at a time.

Also adds two new menu scrolling commands, menu_shift_right (key
'}' by default) and menu_shift_left ('{') if wincap2 flags contain
WC2_MENU_SHIFT.  Shifting allows different substrings of too-long
lines to be seen.

For X11, neither works because their handling requires a horizontal
scrollbar and for some reason that escapes me our menus don't have
one of those.  If they did, shifts could work for all menus but a
shifted window would hide the selection letters.  So shifting would
be most usefully done as:  pan right, read more of any long lines,
immediately pan back to the left.

For curses, they only apply to the persistent inventory window.
Shift right redraws it with class headers and inventory letters
shown normally but the item descriptions omit their leftmost
portion, showing more text towards the end.  Shift left reverses
that and does nothing if the beginning is already in view.  Forward
and backward scrolling while shifted leave the shift in place.
2021-03-13 18:18:53 -08:00

40 lines
2.1 KiB
Plaintext

When persistent inventory window is first populated, focus is given to
its window (behavior might be window manager-specific; it happens with
default window manager on OSX). Focus should be explicitly directed
back to the main window.
More focus: although the menu window gets focus, the menu inside that
window does not accept focus, so scrolling persistent inventory via
keyboard won't work. [Does not affect the new '|' command which takes
input via yn_function() rather than directly from the perm_invent menu.]
When persistent inventory window is displayed, an update that ought to
make it grow won't do so even if there is room on the screen for that.
It will add scrollbar(s) when not already there, and it can be resized
manually.
If the permsistent inventory window is manually made taller, it will
fill that space immediately. But if it is made wider, handling of the
extra space seems to be erratic and it is sometimes left blank until
window is dismissed and re-created via 'i' or toggling 'perm_invent'.
When the map is clipped, sometimes panning leaves a gap in the display.
Test case was with the map manually resized to avoid overlap with the
persistent inventory window (resizing added scrollbars which hadn't
been there previously). The level was fully mapped and hero was in a
room on the left side; clicking on horizontal scrollbar to pan to the
right rendered the map correctly. However, issuing a command that
caused the map to auto-pan back to show the hero didn't render it
correctly. A portion of map which had been hidden beneath the vertical
scrollbar while panned got moved into the middle of the window but got
shown there with a vertical strip of unrendered background that was
approximately half the width of the vertical scrollbar. It wasn't
inserted space in between two sides of map; it was undrawn map. If it
had been drawn, the map would have been normal.
Menus which have entries that are too wide to display have their wide
lines truncated rather than adding a horizontal scrollbar. Resizing
larger doesn't recover truncated text and resizing smaller truncates
even more.