
On Wed, Jul 1, 2009 at 4:41 PM, Stewart, Robert<Robert.Stewart@sig.com> wrote:
Felipe Magno de Almeida wrote:
[snip]
I've started with a layout system implementation.
One layout mechanism that I've found very easy to use and easy enough to implement is a "spring tab" which I first saw in Borland's Sprint word processor eons ago. (I realize I'm crossing domains, but I think the idea applies readily.) The notion of a spring tab is that it exerts equal force on each side to separate things.
Put a spring tab against the left side and a widget on its right and the widget is right aligned. Reverse the two and the widget is left aligned. Surround a widget with spring tabs to center it.
I liked. I wanted something like this for spacing. I kinda liked the spring name. But I'm not sure spring tabs as-is are generic enough. I wanted to create the minimum features required, and as generic (or primitive) as possible, which could attend almost all people.
If you juxtapose spring tabs, they act as though there is a zero space, invisible widget between them. Thus, <ST><ST>widget<ST> puts the widget 2/3 of the way across the horizontal extent.
Why 2/3 if there's four widgets?
Anyway, the idea is that they are relatively trivial widgets that can be assembled together quickly to get a reasonable arrangement that adapts as a window is resized. Perhaps that's a tool to include in your library.
Probably. But I wanted something more generic. Maybe the proportion can be assigned. Also vertical springs are needed. And I'm not sure I want it to be a widget. It doesn't have most operations a window has. It only occupies space. And what happens if two widgets are side-by-side to a spring. Should it press both? Do we link springs with widgets? I see a window as having a depth dimension, should springs press work on a layer, or all depths of a window?
_____ Rob Stewart robert.stewart@sig.com Software Engineer, Core Software using std::disclaimer; Susquehanna International Group, LLP http://www.sig.com
[snip] Thanks for your suggestion, -- Felipe Magno de Almeida