Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- TSDWIN: Clipper 5.0 Interface Library - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

 twOpen( wT, wL, wB, wR, wColor, wSType, wFType,;
         wFill, wFColor, wTitle )
 ----------------------------------------------------------------------------
     This is the Constructor for the Window Class.

     It defines and displays a window for use. This is the workhorse
     function in TSDWIN. The first six parameters as well as the
     underlying region are carried as window information. If another
     window is opened later, the current window's contents are saved as
     well.

     The structure of the stack entry created by twOpen() is as
     follows:

            { wT, wL, wB, wR, ;                 Display Coordinates
              SAVESCREEN( sT, sL, sB, sR ), ;   Underlying Screen
              wColor, ;                         Window Text Colour
              wSType, ;                        Shadow Type
              wFType, ;                         Frame Type
              wFColor, ;                        Frame Colour (A or C)
              sT, sL, sB, sR, ;                 Underlying Screen
              Coords wCurrent, ;                       Current Display
              Screen wSaved, ;                         Screen for
              Resizing aTitle } )                        Titles Array

              Please remember that THIS is what you obtain a reference
              to when you use _twStack()!!!! If you are going to mess
              with the stack, please ask your wife for help, not me.

       Arguments:

     wT,wL
     wB,wR   - 'N' SCREEN Coordinates. Note that this is the only
                   function in TSDWIN.LIB   which uses actual screen
                   coordinates. twOpen works no matter which video mode
                   you choose with the Clipper SETMODE() function. All
                   these default to 0.

     wColor   - 'C' Clipper colour string or attribute.  Defaults to
                    SETCOLOR().

     wSType  - 'N' Window shadow type. Defaults to none.

     wFType   - 'N' Window box type. Defaults to none.

     wFill    - 'C' Window fill character. Defaults to none.

     wFColor  - 'C or A' If a character value is passed, it becomes the
                         frame colour for active and inactive windows.
                         If an array is passed, the first element is
                         used for active windows and the second for
                         inactive.

     wTitle   - 'C or A' If a character is passed, the title array on
                         the stack uses it for the top, centered value
                         of the title.

                         Titles Array Structure: 6 Elements,
                         Each element is a 2 element array

                         wTitle[1]:{"Center Top",    "Colour"}
                         wTitle[2]:{"  Left Top",    "Colour"}
                         wTitle[3]:{" Right Top",    "Colour"}
                         wTitle[4]:{"Center Bottom", "Colour"}
                         wTitle[5]:{"  Left Bottom", "Colour"}
                         wTitle[6]:{" Right Bottom", "Colour"}

                         If this parameter is NOT passed, an empty 6 by
                         2 array is created to hold it.

                         If an array is passed and each element is an
                         array, the first element becomes the title and
                         the second the colour. If only, say, a 6 by 1
                         array is passed, all title colours default to
                         the text colour for the window.

       Return:

     Current window handle

     Example:

     If you only use the first example in all your code, all the
     benefits of easy screen writes are available to you.  You never
     have to worry about colours, titles etc. The stack is your
     notepad, and it doesn't talk back!

     .............
     twOpen()

     Opens a window at 0, 0, MAXROW(), MAXCOL(),
         in SETCOLOR(),
         with NO shadow,
         and NO border,
         filled with spaces,
         border colour same a text colour,
         no headers or footers.


     .............
     twOpen(15,23,20,79)

     Opens a window at screen coordinates 15,23,20,79 clearing it to
     the current Clipper colour creating no shadow or border. If you
     are tempted to clear a region of the screen like this... DON'T.
     All you do is burn up memory and put information you probably will
     not use on the window stack.

     .............
     twOpen( 5, 10, 10, 67, "R/B*", 1, 6 )

     Opens a window at screen coordinates 5,10,10,67 and clears it to
     red/bright blue. Its shadow will emanate from the lower left
     corner and be bordered with a double single box with double lines
     emanating from the lower right corner.

     .............
     twOpen( 8, 45, 22, 55, "GR+/R", 3, 9, "#" )

     Opens a window at screen coordinates 8,45,22,55 filling it with
     character chr(177) in yellow/red. Its shadow will be centered on
     the lower right corner and it will be bordered with a solid box.

     .............
     twOpen( 3, 12, 10, 34, "w/n", 3, 3,, { "w+/n", "w/n" } )

     Opens a window at screen coordinates 3,12,10,34 in white on black,
     shadow at lower right, single-double border with intense white on
     black to be used when the window is active and white on black when
     it is not.

     FrameCol := {"w+/n","w/n"}
     tArray[1]:{"Center Top",    "w/b"}
     tArray[2]:{"  Left Top",    "w/r"}
     tArray[3]:{" Right Top",    "gr+/r"}
     tArray[4]:{"Center Bottom", "w+/g"}
     tArray[5]:{"  Left Bottom", "n/*gr"}
     tArray[6]:{" Right Bottom", "b/*w"}

     .............
     twOpen( 1, 5, 9, 67, "w/n", 3, 3, ".", FrameCol, tArray )

     Opens a window at screen coordinates 1,5,9,67 in white on black,
     filled with CHR( 7), shadow at lower right, single-double border
     with intense white on black to be used when the window is active
     and white on black when it is not with 6 titles displayed on
     opening.

     This last example shows twOpen() fully let out. It is probably a
     bit of a pain to learn to use it that way, but remember, you don't
     have to. If you do, you always have all that information at your
     fingertips.

See Also: twActivate() twDisplay() twPop() twClose() _twHandle()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson