[h]Alternative Xojo Splitter solution[/h]
A “Splitter” represents a way of dynamically resizing two adjacent controls in a window so that one becomes larger or smaller relative to the other. The two controls don’t need to be of the same type, but they frequently are. A common example can be seen in Windows Explorer, when you want to change the ratio of the disk and directory folders in the left-hand pane (a.k.a. sub-window) relative to the files list in the right-hand pane. In this example, the two adjacent pane widths move East-West, but you can also find common examples which move adjacent panes North-South (e.g. in MS Word).
Paul Lefebvre of Xojo addresses this topic in the last ten minutes of his online video “Developing a Text Editor, part 2” (starts at around 49’:10" into the video). Thanks, Paul!
Prior to seeing Paul’s solution, I did manage to design an extremely simple yet effective alternative. The alternative shown in my “Slider Test” screenshots linked to below doesn’t comply with Microsoft’s de facto standard of being a Splitter physically located between the panes to be split, but there’s no reason why it couldn’t be placed there.
My solution is based on a vertical Slider control being used to adjust the relative panes’ Tops and Heights (or a horizontal Slider to adjust the Lefts and Widths). This solution may not be ideal for the purists, but it has the great advantages of a). of not suffering from the flicker which has been a common complaint on the forum when using more common paradigms and b). the mouse may be used on the Slider control itself, or the Up and Down keys on the keyboard may be used where precision is required, once the control has been selected by either the mouse or by tabbing through the controls. Also, IMHO, it looks, well, pretty
The default slider position (Screen Shot #1 below) has its Value set to 50, with its MaximumValue set to 100 - this ensures smoother travel of the panes than if lower numbers were to be used. For even greater precision using the keys, these values can be increased further (e.g. 500 and 1,000 respectively). At the half-way setting (default), you will see that both the upper and lower panes occupy an equal amount of the right-hand-side window real-estate.
Screen Shot #2 shows the positioning of the Slider in order for the bottom pane to occupy all of the real-estate; positioning the Slider at the other end of its range would result in the top pane occupying it all instead.
Screen Shot #3 shows the positioning of the Slider at a randomly chosen position.
I’d be happy to share the relevant (and very short) source code if requested.
My thanks go to Tim Streater and Paul Sondervan for their helpful comments.