home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / fish / code_examples / filewindow_464 / filewindow2.doc < prev    next >
Text File  |  1991-03-09  |  9KB  |  221 lines

  1. ****************************************************************************
  2. *          FileWindow2.doc                   B.Schied,  Dec.12th, 1990     *
  3. ****************************************************************************
  4.  
  5.                INTRODUCTION
  6.                ------------
  7.  
  8.   FileWindow was created by Anders Bjerin first and was distributed as
  9.   public domain (AmigaLibDisk336).
  10.  
  11.   This type of FileRequester shows some great advantages like
  12.   --- quick reading of directories
  13.   --- selective reading of files by input of an extention
  14.   --- possibility of deleting of files
  15.   --- convenient length of source code (9996 Bytes, compiled with
  16.       Lattice-C-Compiler v5.04 using -O option)
  17.  
  18.   One one hand I was faszinated by Anders results, one the other hand I
  19.   felt that there could be introduced some improvements to upgrade
  20.   FileWindow's performance.
  21.  
  22.   My main goal was to get
  23.   +++  more device gadgets,
  24.   +++  a possibility for renaming files and directories,
  25.   +++  an alternative choice of using the RETURN-key for accepting and
  26.        the ESC-key for aborting actions,
  27.   +++  an improvement in logical structure, especially in
  28.   +++  usage of the system requester for logical mistakes only,
  29.   +++  ANSI-C transformed source code.
  30.  
  31.   Nevertheless object code length should not increase more than 20%.
  32.   Additionaly the new FileWindow should also be as easy as possible to use
  33.   again.
  34.   I think I accomplished this task by modifying FileWindow to
  35.  
  36.                      F  i  l  e  W  i  n  d  o  w  2   .
  37.                  ---------------------------------------
  38. ****************************************************************************
  39.  
  40.                WHAT'S NEW?
  41.                -----------
  42.  
  43. All FileWindow2's NEW FEATURES are compiled here:
  44.  
  45. --- 3 more device gadgets, totaly:
  46.     ram:  df0:  df1:  dh0: dh1: dh2:
  47.  
  48. --- A RENAME gadget
  49.  
  50. --- DELETE- or RENAME-actions can be completed by using OKAY gadget or
  51.     RETURN key. Automatically scince starting these options non sensefull
  52.     gadgets will be blocked up to the point where clicking them is
  53.     sensefull again.
  54.  
  55. --- FileWindow2 destinguishes between handling mistakes of the user and
  56.     handling advices.
  57.     handling mistakes will be answered by a system requester, handling
  58.     advices will be given on the drag bar in case of deleting or renaming
  59.     a file or a directory.
  60.  
  61. --- Selecting a file will now be accompanied by highlighting its name.
  62.  
  63. --- The ABORT gadget can either be used to abort a rename/delete action or
  64.     to close FileWindow2. Instead of using the ABORT gadget the ESC key can
  65.     be used too.
  66.  
  67. --- The TAKE gadget also acts in two ways:
  68.     - for picking a file name for your main program or
  69.     - to confirm a delete/rename action
  70.  
  71. --- I changed the name of some gadgets parallel to their slightly changed
  72.     meanings:
  73.  
  74.  
  75.           FileWindow                            FileWindow2
  76. -----------------------------------  -----------------------------------
  77. |#| TITLE                   |##|##|  | TITLE                     |##|##|
  78. -----------------------------------  -----------------------------------
  79. | df0: | df1: | dh0: | Ext:XXXXXX |  | ram: | df0: | df1: |            |
  80. |---------------------------------|  |---------------------------------|
  81. | Drawer: XXXXXXXXXXXXXXXXXXXX | <|  | dh0: | dh1: | dh2: | Ext:XXXXXX |
  82. -----------------------------------  -----------------------------------
  83. |                              |XX|  | Drawer: XXXXXXXXXXXXXXXXXXXX | <|
  84. |                              |XX|  -----------------------------------
  85. |                              |XX|  |                              |XX|
  86. |                              |XX|  |                              |XX|
  87. |        FILE DISPLAY          |XX|  |        FILE DISPLAY          |XX|
  88. |                              |xx|  |                              |XX|
  89. |                              |xx|  |                              |XX|
  90. |                              |xx|  |                              |xx|
  91. |---------------------------------|  |                              |xx|
  92. | File: XXXXXXXXXXXXXXXXXXXXXXXXX |  |                              |xx|
  93. |---------------------------------|  |---------------------------------|
  94. | LOAD | SAVE | DELETE |  CANCEL  |  | File: XXXXXXXXXXXXXXXXXXXXXXXXX |
  95. -----------------------------------  -----------------------------------
  96.                                      | TAKE  | ABORT | DELETE | RENAME |
  97.                                      -----------------------------------
  98.  
  99. There are still some more features which have been described in Anders's
  100. source code file "FileWindow/Example.c" on AmigaLibDisk 336.
  101. ****************************************************************************
  102.  
  103.  
  104.       ASSUMPTIONS FOR THE USE OF FILEWINDOW2'S SOURCE- OR OBJECT CODE
  105.       ---------------------------------------------------------------
  106.  
  107.   You may use 'FileWindow2' in your own programs, comercial or not.
  108.   Additionally you may alter the source code to fit your needs, and you
  109.   may spread it to anyone you like.
  110.  
  111.   But in all these cases you MUST INCLUDE a short info about the work of
  112.   Anders Bjerin and my efforts visible for all users in your software.
  113.   IGNORING THIS YOUR PROGRAM CONTAINS STOLEN SOURCE CODE!
  114.  
  115.   If you have any questions, ideas, programs (PD or your own) etc, or just
  116.   want to say hello, PLEASE WRITE TO ME or Anders Bjerin (Anders, I hope
  117.   your adress is still being correct):
  118.  
  119.            Anders Bjerin              Bernd Schied
  120.            Tulevagen 22               Vogelsbergstr. 1
  121.            181 41  LIDINGO            D-6200 Wiesbaden 68
  122.            SWEDEN                     Germany
  123.  
  124. ****************************************************************************
  125.  
  126.                HOW TO USE FileWindow2 FOR YOUR PROGRAMS
  127.                ----------------------------------------
  128.  
  129.      operation = FileWindow2( title, extension, x, y, screen, file );
  130.  
  131.   USHORT operation:       a variable which will contain a flag FileWindow2
  132.                           returned:    TAKE=500,  ABORT=900,  PANIC=1000
  133.   STRPTR title:           string containing the name of the FileWindow2
  134.                           written on its drag bar
  135.   STRPTR extension:       string to be used as a file extension
  136.   int    x:               x position of the FileWindow2
  137.   int    y:               y position of the FileWindow2
  138.   struct Screen *screen:  pointer to a screen if there exist one.
  139.   STRPTR file:            a string which will contain the file name
  140.                           together with the entire path.
  141.                           (For example: "df0:letters/payments.doc"
  142.   for example:
  143.         operation = FileWindow2("Load IFF file", 100, 40, NULL, "ram:")
  144.  
  145.  
  146.   The source code is distributed with the program so you can alter it to fit
  147.   your needs.
  148.  
  149.   There are no Image structures in the code, so FileWindow2 does not need
  150.   to be in the CHIP memory.
  151.  
  152.   Title is a string which will appear on the drag gadget. Write NULL if
  153.   you do not want any string there.
  154.  
  155.   Extension is a 7 character long string. 6 letters and '\0' sign.
  156.   If you give FileWindow2 a string, the program will only display the
  157.   files which endings match with your string. (Directories will always
  158.   be displayed.) If you do not want to use a file extension you simply
  159.   write NULL.
  160.  
  161.   The width of the window is 320 pixels which means that if you are using
  162.   a low resolution display (320 pixels) x should be initialized to be 0.
  163.   If you are using a high resolution display (640 pixels) x can be
  164.   between 0 and 320.
  165.  
  166.   Because of the FileWindow2's heighth of 180 pixels y can be between 0 and
  167.   20 on a NTSC screen (200 lines) or between 0 and 76 on a PAL screen
  168.   (256 lines).
  169.  
  170.   If your program is using a CUSTOM SCREEN you should give FileWindow2 a
  171.   pointer to your screen. Otherwise, if you are using a WBENCH SCREEN you
  172.   simply write NULL.
  173.  
  174.   File is a string which can already contain a file name with path if you
  175.   want. If the string is empty, FileWindow2 will start to display the
  176.   current directory.
  177.  
  178.   Please notice that no image data have been created. I used prototypes in
  179.   the source code. Thus FileWindow2.c can be compiled with -rr option of the
  180.   Lattice 5.04 compiler:
  181.  
  182.            lc -rr -O FileWindow2.c
  183.  
  184.   In case of using _main(void) and no IO to CLI window FileWindow2.o can
  185.   be linked to your main program (i.e. FileWindow2-Demo.o) with lcr.lib
  186.   instead of lc.lib plus amiga.lib, use:
  187.  
  188.            BLINK WITH FileWindow2-Demo.lnk
  189.  
  190.   which contains:
  191.  
  192.            FROM  LIB:c.o+FileWindow2-Demo.o+FileWindow2.o
  193.            TO    FileWindow2-Demo
  194.            LIB   LIB:lcm.lib+LIB:lcr.lib
  195.            ND SC SD 
  196.  
  197.  and get the following results:
  198.  
  199.            FileWindow2.c        60098 Bytes
  200.            FileWindow2.o        11612 or  11748 Bytes without -rr option
  201.            FileWindow2-Demo.c    7923 Bytes
  202.            FileWindow2-Demo.o    3068 Bytes
  203.            FileWindow2-Demo     14020 Bytes
  204.  
  205. Alternatively you can also use
  206.            FileWindow2.make   and   FileWindow2-Demo.make
  207. which do the same with additional compiling into
  208.            ram:MISTAKES1      and   ram:MISTAKES2.
  209. Then the text displayer MuchMore will be invoked and the Linker will
  210. finalize the work.
  211. ************************************************************************
  212.  
  213. TRY TO GENERATE ONE WAVE BY THROWING A STONE INTO THE WATER AND YOU
  214. WILL IMEDIATELY CREAT THOUSENDS OF NEW WAVES STARTING AT EACH POINT OF
  215. THE INITIAL CIRCLE. TRY TO BE THE STONE.
  216.  
  217.  
  218.  
  219.    Bernd Schied
  220.  
  221.