Derived from: nothing
Declared in: layoutMatrix.h
Library: libBeGUI.so
The LayoutMatrix Class controls the sizing and placement of gadgets in a window. They know about their own sizes and positions, so other LayoutMatrices may be positioned with respect to them.
Note: 
All instances of the LayoutMatrix Class will be automatically attached to the WindowGuts which is passed in the constructor method. When the WindowGuts is done with the LayoutMatrix it will delete the LayoutMatrix. It is therefore manditory to create the LayoutMatrix using the "new" allocator.
This is the constructor. The first parameter, ui32paramFlags, lets the class know how all it's gadgets will be sized. There are only two choices, SAMESIZE and BESTSIZE. SAMESIZE tells the class to make every LayoutMatrixItem in the class occupy the same space as all others. This makes for nice looking tables of buttons. BESTSIZE lets the class calculate the least possible size for each layoutMatrixItem and sizes them accordingly. This is very useful when a number of irregularly shaped object are grouped together, like buttons, checkboxes, and color controls.
The next two parameters, ui32paramRows and ui32paramColumns let the class know how you want the items arranged. For instance, if the class contains 12 LayoutMatrixItems and you want them arranged in a single long line, set ui32paramRows equal to 1 and ui32paramColumns equal to 12. Or, if you want 3 LayoutMatrixItems across and 4 down, set ui32paramRows equal to 4 and ui32paramColumns equal to 3. The critical thing is that the number of LayoutMatrixItems in the class must be equal to the product of ui32paramRows and ui32paramColumns (ui32paramRows * ui32paramColumns). A sanity check for this is not in place--I will probably put one in place soon, as there will be a crash if the rule is not followed!
The final parameter, wpparamWindowGuts let's the class know to which window (see WindowGuts)it belongs so that it may attach itself to that window's list of LayoutMatrices.
This is the destructor. It just deletes some internal lists.
This is the real work horse of the class. It calculates all it's LayoutMatrixItem sizes and positions. It calculates it's own size and stores this information for your future use. It readies itself to be placed in the position specified by fparamMatrixLeft and fparamMatrixTop. It uses the semaphore to insure that all it's calculations are finished before the next LayoutMatrix starts it's calculations, as the second LayoutMatrix may well use values from the first LayoutMatrix.
Overview
[method summary]
LayoutMatrix()
LayoutMatrix(const uint32 ui32paramFlags,
const uint32 ui32paramRows,
const uint32 ui32paramColumns,
WindowGuts * wpparamWindowGuts);
~LayoutMatrix()
~LayoutMatrix();
Calc()
void Calc(const float fparamMatrixLeft,
const float fparamMatrixTop,
sem_id paramSemID);
for version 1.0.1
Copyright © 1998-1999 Ed Musgrove Be Developer #2076. All rights reserved.
edgar@harbornet.com
emusgrov@linknet.kitsap.lib.wa.us
Last modified January 19, 1999.