Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FreshWin (c) Fresh Technologies - <b>wnew() window function</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  WNEW()                                                     Window Function
 Purpose..: Create a window instance
-------------------------------------------------------------------------------
 Syntax...: wNew( <cWin>, [<nTR>], [<nLC>], [<nBR>], ;
                   [<nRC>], [<cClr> [, <nStyle>]] ) --> aWindo

 Arguments: <cWin>     = the string identifier of the window.
                         There is no default.

            [<nTR>]    = top row.
            [<nLC>]    = left column.
            [<nBR>]    = bottom row.
            [<nRC>]    = right column.

            [<cClr>]   = color to be used as the window color.
                         At system startup, if no color is passed,
                         the default color will be the standard DOS
                         color of dull white on black. If wNew() is
                         used later in the system, the default color
                         will be that defined by the Clipper function,
                         SetColor(). This becomes the default color
                         for ALL window definition operations
                         unless other colors are defined.

            [<nStyle>] = style of window to create. If used,
                         appropriate corner icons will appear. They
                         will tell you which functions can be
                         invoked either through the keyboard or
                         using a mouse. See the first Remark section
                         below for more details. Window styles
                         can be stacked by delimiting them with
                         the plus ( + ) operator.

                              Valid styles, thus far, are:

            WINDOW STYLE Constants as found in FW_MAIN.CH
            ---------------------------------------------
            Value  FW_MAIN.CH     CLOSE  ZOOM  MOVE  SIZE
            ---------------------------------------------
             1     WS_CUA           X     X     X     X
             2     WS_BOX           X           X
             3     WS_DUMB
             4     WS_CLOSE         X
             5     WS_ZOOM                X
             6     WS_MOVE                      X
             7     WS_SIZE                            X
            ---------------------------------------------

 Remark...: Above, something of a option code scheme has been
            developed to save space. Each of the four words used
            across the top have a specific meaning.

            NONE  : You must invoke function calls such as wClose(),
                    wZoom(), wReSize() and wMove() to carry out
                    the four actions on a window. The keyboard/mouse
                    input will not work.

            CLOSE : The small square icon (.) will appear in the upper-
                    left corner of the window. Rather than using wClose(),
                    you can use the keyboard (ALT-F4) or click the mouse
                    on the small icon to close the window. Of course,
                    wClose() will also work.

                    If you close the window by clicking the mouse on
                    the closing icon (.) and you have used wClose(),
                    remember the command is still active. You must
                    name the window in wClose(). Otherwise, the command
                    will be applied to the window opened immediately
                    before the one clicked closed.

            ZOOM  : A pair of small icons (.. to maximize/minimize) will
                    appear in the upper-right corner of the window.
                    You can use either wZoom() or you can use the
                    keyboard (CTRL-F9 to minimize resulting in the icon .
                    or CTRL-F10 to maximize or to restore resulting in
                    the icon ..) or click the mouse on an icon to zoom
                    in the direction of interest.

            MOVE  : No small icon, but if you use the keyboard
                    (CTRL-F8) or click the mouse on the top bar of a
                    window, you can move the window around the screen.
                    Of course, wMove() will also work.

            SIZE  : The icon (.) will appear in the lower-right
                    corner of the window. Rather than using
                    wReSize(), you can use the keyboard (CTRL-F8)
                    or click the mouse on the small icon to resize
                    the window. Of course, wReSize() will also work.

 Returns..: <A> aWindo is the structure of the window returned in
            an array like that returned by wArray().

 Remark...: If no other functions follow wNew(),
            the window will use WS_DUMB, have no frame, display no title,
            store no text, carry no cargo, refer to no GetList, execute
            no codeblock and use no open/close or shadow effects. The size
            of the window will be the entire screen. The window colors
            will be "W/N" unless a Clipper SetColor() is detected.

            It is important to remember to put in the four commas, if
            you decide to make the window fill the whole screen. Given
            this, you do not need to use wFrame() to get a no border
            window. If you do use wFrame() for a full screen window,
            you may provoke an error.

            You cannot switch window styles unless you invoke wSet().

 Source...: WNEW.PRG
-------------------------------------------------------------------------------
 Example..: . The example uses wNew() along with wFrame()
              to create a back drop composed of the
              chr(176). By taking advantage of wFrame()'s ability
              to use custom frame types, we will use a nine character
              string composed of chr(176). The first eight represent the
              frame characters and the ninth represent a fill character.
              Another window is defined to show some other features.

            wNew     ( "DOS",,,,, "W+/N*" )
            wFrame   ( "DOS", "#########" )
            wHowClose( "DOS", B_VBLIND( 100 ) )

            wNew     ( "SunUp", 1, 3, 21, 76, cSUNUP_1, WS_CUA )
            wTitle   ( "SunUp", " Sun Box ", "W+/B" )
            wFrame   ( "SunUp", B_THICK, "GR+/B" )
            wHowOpen ( "SunUp", B_EXPLODEDN( 60 ) )
            wHowClose( "SunUp", B_IMPLODEUP( 60 ) )
            wShadow  ( "SunUp", B_SHADOW() )

            wOpen( "DOS" )
            ...
            wOpen( "SunUp" )

            . This is an example of window style stacking. The
              following window can be MOVEd and ZOOMed but not
              CLOSEd or SIZEd.

            wNew( "MyWin", 5, 5, 10, 20, "W+/B", WS_MOVE + WS_ZOOM )

 Note.....: By using character strings for our window
            identifiers, we alleviate the need to use memory
            variables for window handles. This gives us the
            ability to operate on a window in any routine or .PRG file
            without having to declare window handles as PUBLIC
            or STATIC.

See Also: wFrame() wTitle() wSet()

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