Common Questions and Answers
Zinc Interface Library, Version 1.01


                        COMMON QUESTIONS AND ANSWERS

The following are answers to questions commonly asked by ZIL users:

Q1.  How much room on my hard disk will Zinc Interface Library take?

A.   Just over two megabytes.

Q2.  How large will a typical application program be using ZIL?

A.   An application program using most of the classes and utilities of Zinc
Interface Library is typically about 125K to 200K in size.

Q3.  I have a graphics adapter installed in my computer, but the example and
tutorial programs only run in text mode.  Why?

A.   The BGI (Borland Graphics Interface) files must be in the PATH in order to
be found by the executable file.  Without these files, a graphics driver can't
be installed.  (The demonstration program DEMO.EXE has the BGI files linked
into the executable file, and therefore does not need them at run time.)  The
BGI files are located in the TC\BGI directory. (See question 14)

Q4.  Does ZIL support "Super VGA" modes? (1024 x 760 pixels, 256 colors, etc.)

A.   No.  ZIL currently supports the graphics drivers and modes that Borland
supports with BGI (Borland Graphic Interface.)  These can be found on pages
275 and 276 of the Turbo C++ Reference Guide.

Q5.  For my application I need to choose which graphics mode will be used
rather than default to the highest possible resolution.  Is this possible?

A.   Yes.  The graphics driver and graphics mode can be given as parameters
to the UI_DOS_BGI_DISPLAY constructor.  See the header file UI_DSP.HPP.  A
list of the possible graphics drivers and graphics modes can be found on pages
275 and 276 of the Turbo C++ Reference Guide.
     For Example, the following code would initialize a CGA display in the
graphics mode CGAC2:

     UI_DOS_BGI_DISPLAY *display = new UI_DOS_BGI_DISPLAY(CGA, CGAC2);

Q6.  Is it possible to implement scrollable lists with ZIL?

A.   Yes.  Use the UIW_MATRIX class to create scrollable lists.  In order to
accomplish this, however, you must have Version 1.01 (maintenance release) of
Zinc Interface Library.  Any window object (UIW_...) can be added to a matrix. 
If the MXF_ROWS_FILL or MXF_COLUMNS_FILL flag is set, then objects added to
the matrix will automatically be positioned in the matrix.  Any number of
objects can be added to the matrix and the cursor keys, or the optional
scroll bar can be used to scroll up and down to view all of the object.

Q7.  How can I support Dual Monitors with ZIL?

A.   Construct a UI_DISPLAY object, a UI_EVENT_MANAGER object, and a
UI_WINDOW_MANAGER object for each display.  The first display to be
constructed will be the primary display, while the second display to be
constructed will be the secondary display.  The UI_BIOS_KEYBOARD, and
UI_MS_MOUSE class objects should only be attached to one event manager at a
time.  

Q8.  Why doesn't DataGet work correctly for me?  (I get garbage back.)

A.   DataGet must be used before the window object is destroyed.  If escape
is used to close a window, the window and all objects that have been added to
the window will be destroyed.  (The flag WOF_NO_ALLOCATE_DATA can be set in
order for the programmer to allocate and delete the data associated with a
field as needed.)

Q9.  How do I compile and link programs that use ZIL with the IDE (Borland's
Integrated Development Environment)?

A.   Do the following:

     1)Set the memory model to large in the Options|Compiler|Code Generation
menu of the IDE.  (Large model is recommended for most applications.)

     2)In the Options|Directories menu of the IDE, set the Include directories
to include ZINC\INCLUDE and TC\INCLUDE, and set the Library directories to
include ZINC\LIB and TC\LIB.  (More than one directory can be included in a
field by using a semicolon, for example:  [C:ZINC\INCLUDE;C:TC\INCLUDE     ]).

     3)Create a project by selecting Open Project and entering a project name 
(for example: hello.prj).     

     4)Press <Ins> to add items to the project list, and add the source file
(ex: hello.cpp) and ZILL.LIB (ZILL.LIB for large memory model; ZILC.LIB for
compact memory model, etc.).

     5)You should now be able to compile, link and run your program by
selecting RUN or by pressing <Ctrl F9>.

Q10. How can I re-display the information associated with a window object or
with an entire window?

A.   Use DataSet to redisplay the information associated with a window object,
or use windowManager>Add to redisplay an entire window and all of the objects
attached to the window.  If a window that has already been added to the window
manager is again added, then the display will be updated to reflect any
changes that may have been made within the window. 

Q11. Is it possible to draw graphics objects inside of windows?

A.   Yes.  To do so, a new display class should be derived from
UI_DOS_BGI_DISPLAY, and a new class or classes should be derived from the
UI_WINDOW_OBJECT or UIW_WINDOW classes.  This has been done in an example
(GRAPH.ZIP) on Zinc Software's Bulletin Board System for those who have
modems.

Q12. How can I use overlays (VROOM) with Zinc Interface Library?

A.   This can only be done using large model (ZILL.LIB).  The ZILL.LIB file
must be ZIL version 1.01 (the maintenance release).  The '-Y' compiler option
must be used with the modules which are part of the application using overlays
but which will not actually be overlaid.  The '-YO' compiler option must be
used with all modules which will be overlaid.

Q13. Several of the member functions for the display classes require an
integer parameter called screenID.  I don't understand how this is used. 
There is also a function in some of the examples called 'regionDefine' for
which I have no explanation.

A.   There is an integer variable 'screenID' which is a protected member of
the UI_WINDOW_OBJECT class.  Every window object that is added to the window
manager receives a unique (positive) value for screenId.  The display is
divided into regions (see UI_REGION).  The object 'regionList' is a member of
the UI_DISPLAY class, and contains a list of all regions and their associated
screenID's for the given display.  When a function such as Fill or Rectangle,
which require screenId and region parameters, is called, the function will
only draw to regions in 'regionList' which match screenId and overlap the
region parameter.  The function RegionDefine is a public member of the
UI_DISPLAY class and adds a region with the given screenId to
'regionList.'  For general applications of ZIL it is not necessary to know
these details.

Q14. When I try to make the demo by typing 'make,' or 'make demo.exe' in the
demo directory, I get the linker error 'can't find egavga.obj' (or cga.obj
etc.).

A.   The demonstration program links the BGI (Borland Graphic Interface) files
into the executable file. If this were not done, the BGI files would have to
be in the current directory or in the PATH for DEMO.EXE to run in graphics
mode.  In order to link the BGI files, however, object (.obj) files must be
made from them.  To do this, the utility 'BGIOBJ.EXE' is used.  Inside of the
TC\BGI directory type 'bgiobj egavga' to make the file 'egavga.obj' from the
file 'egavga.bgi' (and similarly for cga.obj etc.).

Q15. I get an 'Out of Memory' error when I try to compile my program.  Is
there anything I can do about this?

A.   Try compiling with separate modules and eliminating inline code from any
class definitions.  Also, don't use too many plus (+) operators in a single
statement.  
     For ex:  
               *window + object1 + object2 + .... + object12;

     Could be written as:

               *window + object1 + object2 + object3 + object4;
               *window + object5 + object6 + object7 + object8;
               *window + object9 + object10 + object11 + object12;

     Too many plus operators in one statement can cause an 'out of memory'
error.

Q16. When I link my programs I get various warnings such as 'module xxxx
conflicts with module xxxx ...'  What is the cause of this?

A.   These warnings are caused by the C++ Linker when debugger information is
being used.  If recompiled without debug information the warnings should
disappear.  Such warning messages can be ignored.

Q17. I keep getting the Linker Error 'Segment exceeds 64K.'  What is wrong?

A.   You probably need to use large memory model.  Make sure the memory model
is set correctly (Options|Compiler|Code Generation menu of IDE, or -ml option
for command line compiler) and that you are linking with the correct Zinc
Library (ZILL.LIB for large model).

Q18. I get lots of linker errors of the form 'Undefined symbol UI_...'
whenever I try to link an application using ZIL.  

A.   Make sure that you have included the correct Zinc Library (ZILL.LIB for
large model) in you project file.  (See question Q7.)

Q19. Why does ZIL seem slow?

A.   Zinc Interface Library is a little slow as is typical of GUI's.  A couple
of factors that make it seem slow are its true object oriented approach, and
the fact that this version depends on Borland's BGI.

Q20. I want to create a window that the user will not be able to delete at run
time.  How can I do this?

A.   Use the flag WOAF_LOCKED when you construct your window.

Q21. My program hangs when I use my global variables 'windowManager',
'eventManager', or 'display' from within member functions of classes derived 
from UIW_WINDOW_OBJECT.

A.   The class UI_WINDOW_OBJECT includes the following member variables:

          UI_WINDOW_MANAGER *windowManager;
          UI_EVENT_MANAGER *eventManager;
          UI_DISPLAY *display;

     Any global variables of these types should have different names.  Zinc
Software uses an underscore (_) to denote global variables, for example:

UI_WINDOW_MANAGER *_windowManager;

Suppose you have a global UI_WINDOW_MANAGER pointer called windowManager, and
you derive a class from UIW_WINDOW as shown below:


     UI_WINDOW_MANAGER *windowManger;  // This causes the bug.

// The above statement should be:
//   UI_WINDOW_MANAGER *_windowManager;

     class MY_WINDOW : public UIW_WINDOW
     {
          MY_WINDOW(void) : UIW_WINDOW(5, 5, 20, 10, , NMF_NO_FLAGS,
               WOF_NO_FLAGS)
          {
               this
                    + UIW_BORDER
                    + UIW_MINIMIZE_BUTTON
                    + UIW_MAXIMIZE_BUTTON
                    + UIW_SYSTEM_BUTTON
                    + UIW_TITLE("My Window");

               *windowManager + this;  //This statement will hang the program.

// The statement above is equivalent to the following statement:
//             *(this->windowManager) + this;
          }
     }

     The pointer 'windowManager' is interpreted as the member variable of
UI_WINDOW_OBJECT (from which UIW_WINDOW is derived) instead of the global
windowManager variable.  This pointer remains NULL until the object is added
to a window manager.
