home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 337_01 / read.me < prev    next >
Text File  |  1991-01-15  |  6KB  |  154 lines

  1.                            Source code
  2.  
  3.                 Designing Screen Interfaces in C
  4.  
  5.                    Yourdon Press/Prentice-Hall
  6.  
  7. This book covers the process of creating a screen/window library.
  8.  
  9. The screen/window library is then used to create various screen
  10. interfaces such as:
  11.  
  12. -Pop-up menus.
  13. -Moving light bar menus.
  14. -Multi-level moving light bar menus.
  15. -Pull-down menus.
  16. -Data input screens (with verification).
  17. -List selection (point & shoot /Hot key techniques).
  18. -Directory functions.
  19. -Context specific help screens.
  20. -Help screen builder.
  21.  
  22. These routines are coded so that they may easily be modified and
  23. used in your applications.
  24.  
  25. The full instructions for using this code are found in the book
  26. and will not be duplicated here.
  27.  
  28. If you have not read the book (shame on you), I have a few
  29. comments to help you get started.
  30.  
  31.  
  32. -This code will compile under all memory models of Borland Turbo C
  33.  and Microsoft QuickC.  Borland Turbo C++ users should see the
  34.  comments at the end of this document.
  35.  
  36.   To specify the compiler you are using, change the first
  37.   definition found in "mydef.h" to read:
  38.  
  39.       #define TURBOC
  40.            or
  41.       #define QUICKC
  42.  
  43.   Note: The default is "#define TURBOC"
  44.  
  45. -The file "mydef.h" contains all function prototypes and data
  46.  structures, and should be included in all your programs which use
  47.  the library functions.
  48.  
  49.  (ie: #include "mydef.h" )
  50.  
  51. -The source code for building the screen/window library are found
  52.  in the files having the specification "l_*.c".  These files should
  53.  be compiled and placed in a library called "mylib.lib " for
  54.  linkage with the sample code.  I have included an pre-compiled
  55.  small Turbo C library for your immediate use.
  56.  
  57.  NOTE: You should compile your sample programs using the same
  58.        memory model used to create the library.
  59.  
  60. -The function main() is found in the library module l_main.c.  The
  61.  sample code, and any code you create, should have the function
  62.  start(), which will be called from main().  The function start()
  63.  is the entry point for your programs.
  64.  
  65. -Turbo C project files (*.prj) are provided for each sample
  66.  program. The projects create the following programs:
  67.  
  68.  BARDEMO.PRJ       Sample moving light bar menu (Lotus 123 style).
  69.  BARDEMO2.PRJ      Multi-level moving light bar menu.
  70.  DIR-DEMO.PRJ      Directory window demo (point & shoot / Hot key).
  71.  HELPDEMO.PRJ      Context specific Help screen.
  72.  IN-DEMO.PRJ       Data input screen (with field editing).
  73.  LISTDEMO.PRJ      List selection demo (point & shoot / Hot key).
  74.  MAKEHELP.PRJ      Editor for creating help screens.
  75.  PANEL1.PRJ        Demonstrates non-overlapping windows (panels).
  76.  PANEL2.PRJ        "
  77.  PD-DEMO.PRJ       Pull-down menu system.
  78.  POPDEMO.PRJ       Pop-up menu.
  79.  TWO-WAY.PRJ       Demonstrates full/partial menu selection.
  80.  WINDEMO.PRJ       Demonstration of window creation/movement.
  81.  
  82.  
  83.  NOTE:  When running all sample menus, select the option "Print",
  84.         Which opens up sub-menus.  The other options, except
  85.         for "exit", do not have any real function.
  86.  
  87.  
  88.                    Copyright (c) Information.
  89. -----------------------------------------------------------------
  90.  
  91. You are free to use these programs in any software product you
  92. produce as long as:
  93.  
  94. -You include a credit line in your documentation or software.
  95. -You do not resell the screen/window library as a stand-alone
  96.  product. (You may however, charge a small processing fee for
  97.  distributing the code.)
  98.  
  99.                         Turbo C++ users:
  100. -----------------------------------------------------------------
  101.  
  102. At the time I write this, I have only had my copy of Borland's
  103. Turbo C++ for two days.   From my preliminary tests it appears
  104. that the screen/window library can be used from within a C++
  105. program.  The screen/window library (the l_*.c files), should be
  106. compiled as normal C code and placed in a regular C library. You
  107. can also use the precompiled library.
  108.  
  109. You should not rename the library files with the .CPP extension and
  110. attempt to compile them as C++ code.  There are no doubt conflicts
  111. with my variable names and reserved C++ words. There may also be
  112. different header files required. I plan to modify the code in the
  113. near future so that it will compile as C or C++ code.
  114.  
  115. There is one small problem with linking Standard C libraries with
  116. C++ code.  The symbol table for C modules contains only the names
  117. of the functions.  In C++, the symbol name for the functions
  118. combines the function name, argument types, etc, in a process known
  119. as "name mangling". This process allows for better type checking
  120. and is also known as "type safe linkage".
  121.  
  122. When the C++ tries to link in a standard C library to find the
  123. function gotoxy() for example, it looks for the "mangled" name in
  124. the library and does not find it.  The compiler reports a
  125. "undefined symbol" message.
  126.  
  127. Fortunately you can over ride the name mangling function as
  128. follows:
  129.  
  130. In your C++ code, when you include the "mydef.h" file, use the
  131. following statement:
  132.  
  133. extern "C" {
  134. #include "mydef.h"
  135. }
  136.  
  137. This tells the compiler that the functions defined by the
  138. prototypes found in "mydef.h", should be linked using the standard
  139. "C" type symbol names.
  140.  
  141. One other thing you must do is place the name of the screen/window
  142. library (mylib.lib ) at the beginning of your project file when in
  143. the IDE environment. If you fail to do so, you will get an error
  144. message that the compiler was unable to find main().
  145.  
  146. This appears to occur because the function main() is found in
  147. "mylib.lib" and not in the C++ code.
  148.  
  149.  
  150.  
  151. Jim Pinson 1/15/1991
  152.  
  153. CompuServe 73427,2424
  154.