🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.windows.interviews
1 messages
1 total messages Started by Jon Fields Sat, 09 Jan 1993 04:07
Alignment question
#1649
Author: Jon Fields
Date: Sat, 09 Jan 1993 04:07
46 lines
2600 bytes
How is it possible to place Labels, pieces of hglue, field editors,
and trailing pieces of hglue into hboxes, which are in turn put
into a vbox (or, maybe a TBComposition) so that the both the Labels
and Field editors are left-aligned, as shown in the following
diagram:

     Field headings (Labels) should be left aligned.
     |
     |
     |                       Field editors should be left aligned
     |                       |
     |                       |
     LLLLLLLLLLLLLLGGGGGGGGGGFFFFFFFFFFFFFFFFFFFGG
     LLLLLLLLGGGGGGGGGGGGGGGGFFFFFFFFFFFFFFGGGGGGG
     LLLLLLLLLLLLLLLLLLLLLGGGFFFFFFFFFFFFFFFFFFGGG   <- Vbox should have this
                                                        natural width, i.e. of
                                                        the hbox which contains
                                                        the middle piece of glue
                                                        of minimal, non-zero 
                                                        size.
     L = Label, G = Glue, F = Field Editor

In IV 2.6, I solved this problem using a Tray.  I'm now trying to
solve the same problem using the 3.1 classes, but a solution does
not seem obvious.
    
The only solution that I have been able to devise is to explicitly
calculate the natural width of the middle piece of glue, based on
the maximum width of labels in the vbox, and to make that width
fixed. However, I would much rather base the scheme somehow on
alignments, as I would like to be able to append these hboxes into
a TBComposition, so that the number of columns of hboxes could be
determined by the geometry of the window (e.g. a tall, narrow window
might have two columns of hboxes, but when resized to a wide, short
window, it would have four columns).

I'm trying to write a general purpose utility which can take an
undetermined number of label/field pairs, and can provide a pleasing
layout of these pairs into columns.   Any help you can provide would
be greatly appreciated. 

--

Internet: jdf@fields.cin.oh.us             Jonathan D. Fields     
    UUCP: ...!uunet!fields!jdf             5080 Kugler Mill Road
   Voice: 513-891-5081                     Cincinnati, Ohio 45236, USA
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads