When in the course of ListBoxes, the list of items to be displayed is longer than the available vertical space, the developer will usually provide a vertical scrollbar. The problem comes when that ListBox, like our Protocol and Methods lists, are dynamic, and sometimes need a scrollbar and sometimes do not. It's not a big problem, however, since a scrollbar will disable itself if there is nothing to scroll. Indeed, the Pollock scrollbars work like that. None the less, having a widget thing taking up space on your UI is at best, ugly, and at worse, frustrating to the user.
Pollock solves that problem by allowing any pane that supports scrollbars to use dynamic scrollbars. That is, when the scrollbar would otherwise be disabled, it instead automatically disappears, only re-showing itself when needed. Like all of Pollock, it is fairly easy to use this feature:
The above is published as version 1.12 in the Package named "PollockBlog" on the Cincom public repository.
As you see, first we turn on the scrollbar we want, and then we tell them to be dynamic... actually, the order of those commands, as with most of Pollock is not important. Now, we open our browser:
ClassHierarchyBrowser open
And as a test, we select the class Object. We instantly see that the scrollbar for the protocol list appears. If we select the one protocol, such as "accessing", the method list has not enough items to show the scrollbar. So, let's hold down the shift key, and click on a protocol about 4 or 5 down from "accessing". Again, without hesitation, the method scrollbar turns on, being now it has something to scroll.
Now for a bit of honesty. Right now, the TextEdit is in non-word wrap mode, and I wanted to add a horizontal scrollbar, and have it dynamic too. Unfortunately, several months ago I gutted the frame system in Pollock, and rewrote it to be dynamic, where, before, it was static. Seems I was very careful about doing the right thing with all of the Enumeration Panes when I fixed that, and just today, realized I wasn't as careful with the TextEdit. Basically, right now, if you turn on horizontal scrollbars for a TextEdit, they just sit there until you try to edit the text.
Accidentally, that plays into my plans. Next session, I wanted to show how to turn on WordWrap for TextEdit anyway. So, we'll just move ahead with that, and the following three sessions, MainMenu, Toolbar and Popup Menus.
After that, I will be taking a bit of time away from the blog, first to finish work on the TabControl, and to fix the scrollbar problem, as well as the "all bold" problem in the TextEdit that Vassili found. Then, I'll come back and show you how to use and add a TabControl, so we can switch between Class and Instance views for our browser