This directory demonstrates how to add the XbaeMatrix widget
to the palette of BuilderXcessory version 3.X. 

It contains an addWidget.c file which has the function to inform BX 
about the XbaeMatrix widget.

It also contains a Makefile which demonstrates how to rebuild a new
version of BX with the XbaeMatrix widget's libraries linked in. This
Makefile presumes that the directory above this one contains a
directory name "Xbae" which contains both the header file Matrix.h
as well as the library libXbae.a. You will probably have to change
that location to wherever you have the Xbae header file and library
located.

1) To rebuild BX with libXbae.a, fix the Makefile as specified above and type:

        make

2) This should build a new bx executable for you. Then you will need to
generate a WML (Widget Meta Language) file which describes the
XbaeMatrix widget. BX will do this for you with the -load option.
The makefile has a target which will generate an appropriate command
for you and which will put the WML file in a temporary local BX directory:

*For this to work, you must set the THIS_DIR variable in the Makefile to
be the path to the current directory, e.g. /usr/users/dave/xbaeBX35

If you would like it put this WML file in the default location 
($HOME/.builderXcessory/wml/user.wml), take out the
-local_directory option that the Makefile passes to BX.  To generate this 
wml file using the Makefile in this directory, type:

        make loadbx

You will notice that this sets up the Matrix widget as a five column
matrix. You may change this either by changing the default resources
that the makefile starts BX up with or within BX using styles.

3) You can then start up BX, using the Matrix default value resources.
The Makefile will generate this command for you if you type:

        make runbx

If you do not want to have to pass all the command line options to BX to
set up the Matrix resources, just add the file Resources to your .Xdefaults
or other resource file which gets picked up when you start up BX.

Note that if you want to change the XbaeMatrix resources in BX, some of
them like columns, columnLabels, etc, are dependent on each other and
the XbaeMatrix widget requires you to set them all at once. This means
that you will not be able to set them in the Resource editor, but will
have to set up a Style to set all of the resources at once. The file 
matrix_with_styles.uil in the bxcode directory demonstrates how to do this.

4) Finally, the default WML file that BX generates for the Matrix widget may not
have all the necessary data types for Matrix resources. The symptom for this
will be if you set resources like XmNcolumnLabels in BX, generate code, compile,
and run the application and get a run time core dump when the Matrix is created.
This is often not an issue because these Matrix resources are usually set
dynamically in code, rather than statically in BX. However, you can fix this if
you need to.  The problem is that the BX generated user.wml file has the wrong 
representation types for Matrix resources:

/* section from original user.wml file */
    XmNcolumnLabels : Argument {
        Type = identifier;
    };

    XmNcolumnWidths : Argument {
        Type = identifier;
    };

    XmNcolumnMaxLengths : Argument {
        Type = identifier;
    };
/* end section from original user.wml file */

/* fixed user.wml file */

    XmNcolumnLabels : Argument {
        Type = identifier;
        XtRname = "StringArray";
    };

    XmNcolumnWidths : Argument {
        Type = identifier;
        XtRname = "WidthArray";
    };

    XmNcolumnMaxLengths : Argument {
        Type = identifier;
        XtRname = "MaxLengthArray";
    };

/* end */

An example of a fixed up WML file can be found in:
./BXLocalDir/wml/user.wml.fixed

Good Luck!

Integrated Computer Solutions
201 Broadway
Cambridge, MA 02139
(617) 621-0060

