🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #1649

Alignment question

#1649
From: 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
Technical Details
Message-ID: <174@fields.UUCP>
Path: arc1-ca.pugleaf.net!sparky!uunet!fields!fields.CIN.OH.US

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!fields!fields.CIN.OH.US
From: jdf@fields.CIN.OH.US (Jon Fields)
Newsgroups: comp.windows.interviews
Subject: Alignment question
Message-ID: <174@fields.UUCP>
Date: 9 Jan 93 04:07:48 GMT
Sender: jdf@fields.UUCP
Distribution: usa
Organization: 5080 Kugler Mill Rd, Cincinnati, OH 45236
Lines: 46