-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CheckBoxList with Horizontal ScrollBar #485
Comments
I've also run into this issue! If this feature doesn't exist, I could hopefully provide a patch for it (although I might need a bit of guidance). |
Indeed, only vertical scroll is currently implemented: |
If I'm not mistaken, a CheckBoxList always is a vertical list of
checkboxes. That's why it scrolls only vertically.
A need to scroll such a list sideways means that one has provided too long
labels to each checkbox ;-)
…On Thu, May 28, 2020 at 3:14 PM Reinhard Pointner ***@***.***> wrote:
Indeed, only vertical scroll is currently implemented:
https://github.com/mabe02/lanterna/blob/master/src/main/java/com/googlecode/lanterna/gui2/AbstractListBox.java#L363
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#485 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABIDBMTBXYLMCHRAT3SMLBDRTZPTRANCNFSM4NMZFADA>
.
|
@avl42 correct :) In my case, the labels in the checkbox are file paths, which can be of variable length, and the checkbox has its own window (I implemented a checkboxListDialog, which I plan to submit upstream eventually :)) As a result, an exception would be thrown if the labels were so long that the checkbox list's window would expand past the size of the terminal (or something similar, I can give the exact stack tracer tonight). The workaround was to limit the size of the checkboxListDialog's window, however, this means that certain labels aren't fully-readable as they exceed the maximum-visible length. I'm not sure if this is a good enough use case to require horizontal scrollbars though, maybe there's a workaround? @rednoah what's your use case? I'm curious if you're facing a similar issue. |
Essentially the same use case as @AObuchow I suppose. File paths. Not generally a problem, but some users do have crazy long file paths for some reason, and then |
I'm tempted to think of "good ol' norton commander" or midnight commander
on unix. You have panels of files, and if filenames are too long, they are
shortened with maybe the begin, the end, or some middle part being replaced
by "..."
Even if the user needs to be able to see the full 256 chars or longer
filename, I'd probably instead let the labels themselves scroll (with
cursor right/left), while leaving the "[ ]" checkboxes fixed against
horizontal scrolling.
Unfortunately, however, if you need it, you need to implement it yourself,
as of Lanterna's current state.
…On Thu, May 28, 2020 at 4:25 PM Andrew O. ***@***.***> wrote:
@avl42 <https://github.com/avl42> correct :)
In my case, the labels in the checkbox are file paths, which can be of
variable length, and the checkbox has it's own window (I implemented a
checkboxListDialog, which I plan to submit upstream eventually :) )
As a result, an exception would be thrown if the labels were so long that
the checkbox list's window would expand past the size of the terminal (or
something similar, I can give the exact stack tracer tonight).
The workaround was to limit the size of the checkboxListDialog's window,
however, this means that certain labels aren't fully-readable as they
exceed the maximum-visible length.
I'm not sure if this is a good enough use case to require horizontal
scrollbars though, maybe there's a workaround?
@rednoah <https://github.com/rednoah> what's your use case? I'm curious
if you're facing a similar issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#485 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABIDBMSKVDJHRZ6ZRWS6633RTZX6DANCNFSM4NMZFADA>
.
|
I'm actually making a type of Norton Commander clone, and have this implemented with a
Okay I'll go with this approach. I assume there's no way to do this with a |
I've looked into |
@AObuchow yes, unfortunately there is no native support for horizontal scrolling of list item labels. There is a ScrollBar component you can use, but you'll have to implement your own renderer (with scrolling state) for the listbox and then hook that up to the scrollbar. |
@mabe02 that's fine with me :) I'll use the approach you described and let you know how it goes. |
Closing this issue in favour of the generic |
Does
CheckBoxList
support Horizontal Scrollbar? I can't seem to figure out how to make aList
that can scroll both vertically and horizontally.The text was updated successfully, but these errors were encountered: