The entire project (source and all) is public domain. 
I encourage any and all to use these routines,
expand the items represented, and clean up
any bugs or problems. If you do make changes,
please try to let me know what you have done.

To demonstrate layout I have released GUIZip and 
WordWrap on BeWare.  This version of GUIZip features
the new BeGUI, my customized, preferenced, font
sensitive set of layout routines for the Be Interface class
objects. BeGUI is my masters entry,  for spring 1998,
and relies on GUIZip to demonstrate many of it's talents.

Re-boot your machine, thus appeasing the demoGhods.

Launch the app, then use the "APP" menu to open 
preferences, now click on the "Font" button, openning the 
font control panel (and the Font Display window), now 
click on the "Bigger font" button a few times, watch the 
float gadget respond, enter a number in the float gadget
between 1 and 51000 (an artificial limit I set on max size) .
Close the preferences window, the Font Display and the 
Font control  panel will go away automatically (if you 
haven't already closed them). Font family and size has
been left as an exercise for the enthusiastic.

The original main window will automatically be "fixed".
Currently this means closing it and recalculating all the values 
then re-openning the window with the appropriate font change.

Now, re-open preferences, and chose one (or more) of
the color preference buttons. Each button brings access
to a demonstration item with a set of BColorControls
and röColour ColorWells (of my own simple creation)
which may be manipulated to change the underlaying
view, high and low colors of the given item. Mess about,
for some items only one or two of the colors have any really
obvious affect. Some items are more affected by the basic
view, high and low colors (the basic view is the scrolling
view which is under everything) than their own colors. 

When you have the colors exactly the way you like, close up 
the color window(s) and enjoy the experience of Zip (Unzip
is under construction for the time being, sorry :), an excellent
third part opportunity!) on the BeOS in a font and color
sensitive atmosphere. What, you say you have the colors
so messed up that nothing is ledgable? Never fear, the
defaults are available if you delete the stored "settings"
file (see below). I plan on adding "Cancel", "Save", "Use", 
"Default" and "Revert" eventually!

Use the button labeled "Zip" in the Main window to access
the Zip construction panel (if you wish to actually employ
this version, you must run it from a Terminal, the resulting
printf() output may be cut-and-pasted back into the terminal
to perform the desired Zipping). Observe the various layout
solutions, look at the labels . Close the window, oops,
sorry for the modal quit notice--got to have something
for the cli leary to experience. Go back and make the font
extremely small, try the Zip button again. Close the Zip
window (windows are not always "self-fixing", the main 
window is--by design, when a preference change is made,
the window will be updated when all preference activity
is deemed finished--ie. when you close the Preference
Panel). Make the font very large, now try the Zip window
again!

This concludes the program demonstration.

The source directory is composed of these files:
(Objects)        
mainWindow.cpp       
numSpecificWindows.h
GUIZip           
mainWindow.h        
 prefPanelWindow.cpp
GUIZip.dbg       
myApp.cpp        
prefPanelWindow.h
GUIZip.txt       
myApp.h          
preferences.h
GUIZip.xSYM     
 myButton.cpp         
readme.html
GUIZipMain.cpp      
 myButton.h       
readme.txt
_GUIZip.proj         
myCheckBox.cpp       
s2f.cpp
basicColorWindow.cpp     
myCheckBox.h         
s2f.h
basicColorWindow.h   
myColorControl.cpp   
s2uint32.cpp
beGUI_Version.h      
myColorControl.h     
s2uint32.h
colorControlMessages.h   
myPictureButton.cpp      
scrollView.cpp
colorWell.cpp        
myPictureButton.h   
 scrollView.h
colorWell.h      
myPopUpMenu.cpp      
specificColorWindow.cpp
documentation.txt    
myPopUpMenu.h        
specificColorWindow.h
fontData.cpp         
myPreferences.cpp   
 specificSwitches.txt
fontData.h       
myPreferences.h     
 stringGadget.cpp
fontDisplayWindow.cpp    
myRadioButton.cpp    
stringGadget.h
fontDisplayWindow.h  
myRadioButton.h      
textItem.cpp
fontPrefWindow.cpp  
 myRadioView.cpp      
textItem.h
fontPrefWindow.h     
myRadioView.h       
 versionID.h
intGadget.cpp        
myRoColor.h         
 warning.cpp
intGadget.h     
 myStatusBar.cpp     
 warning.h
layoutMatrix.cpp     
myStatusBar.h        
windowGuts.cpp
layoutMatrix.h       
myStringDrawer.cpp   
windowGuts.h
layoutMatrixItem.cpp    
 myStringDrawer.h    
 zipOptions.txt
layoutMatrixItem.h  
 myTextView.cpp       
zipWindow.cpp
libprefs.h      
 myTextView.h         
BeGUI.txt
zipWindow.h 

The concept is that one creates a LayoutMatrix (or more than 
one--they can place themselves based upon other matrix  
locations) then adds LayoutMatrixItems to it's internal list of 
items. Each item must be able to present it's preferred sizes 
(width and height) and must respond to MoveTo(). I have 
created MyButton, MyCheckBox, MyRadioPanel, 
MyPopUpMenu, etc.--all the current Interface classes, 
plus a couple of my own for specialized text handling. 
All are included.

The Matrix ctor gets passed a pair of ints for rows and
columns, then after adding all the items to it's list,
it is asked to Calc(), which is simply a set of calls
which ask each item to determine it's preferred size.
Then, using the row/col info, it places each item so that
every item is displayed in it's proper location. Two
sizing models are available, BESTSIZE (which makes 
each item it's smallest useful size) and SAMESIZE which 
makes each item occupy the amount of space as that 
of the largest. At present, I have yet to finish the nullItem 
class which will allow for placeholders in matrices, this 
should be almost trivial to add.

These matrices are then placed in a scrolling view
which is sized appropriately and then placed in a 
resizable window which is also sized appropriately.

Thanks to Jon Watte for Preferences.h,v 1.1 
and for libprefs! Preferences are an ongoing 
creation! Currently, all font information (thanks 
Dianne Hackborn <hackbod@lucent.com>, 
for FFont which I used as the basis of my font 
storage routine) is stored, font size may be set 
and previewed (style and family are next). The 
Font Display window remembers if it was on or 
off when the font control panel was last used. 
All gadgets have three BColorControls to adjust 
the individual High, Low, and View colors. These 
are all stored in preferences, which creates a file 
"settings" in:
/boot/home/config/settings/
by adding these directories:
_LP_x-EFM5-GUIZip/hierarchical/extendable
and placing it in "extendable". (Some editors insist 
on doing strange things to the underline character, 
the above directory with EFM5-GUIZIP starts with an
underscore and has another between th P and x-.)

-Ed Musgrove
BeDev# 2076
edgar@harbornet.com

