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>wset() window function</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  WSET()                                                     Window Function
 Purpose..: Set a window condition
-------------------------------------------------------------------------------
 Syntax...: wSet( [<uWin>], <nSet>, [<uNewSet>] ) --> uPrevSet

 Arguments: [<uWin>]   = the string identifier of the window
                         OR the reference to the window structure
                         returned as an array by wNew() or wArray().
                         If not passed, the function will operate on
                         the window in focus.

            <nSet>     = setting to be changed. Not all the
                          possible settings are defined. You will have
                          to do any other ones.

            Set Manifest Constants as found in FW_MAIN.CH
            ------------------------------------------------------
            FW_MAIN.CH            Description
            ------------------------------------------------------
            _WSET_CANCLOSE  0     TRUE|FALSE
            _WSET_CANZOOM   1     TRUE|FALSE
            _WSET_CANMOVE   2     TRUE|FALSE
            _WSET_CANSIZE   3     TRUE|FALSE

            _WSET_ACTIVE    4     TRUE|FALSE

            _WSET_SAVSCR    5     saved screen variable
            _WSET_COLOR     6     window overall color

            _WSET_SAYROW    7     row where say info is stored
            _WSET_SAYCOL    8     column where say info is stored
            _WSET_SAYTXT    9     text in say if exists
            _WSET_SAYCLR    10    say color
            _WSET_SAYCHR    11    current delimiter for say
                                  line feeds

            _WSET_CONDITION 12    WZ_MIN|WZ_MAX|WZ_REST
            ------------------------------------------------------


            [<uNewSet>] = Subset to which to be changed.
                          Notice that this is prefaced with
                          the letter, u. You have to know what
                          you want to change. If it is a color, make
                          sure that this value is a colour string. Or,
                          perhaps, a logical switch or a numeric for
                          a frame change or whatever.

                          Here are some examples which come with
                          the library. Use them as a model for
                          defining your own.

           #xtranslate wCanClose( <uWinID> ) ;
                          => ;
                          ( wSet( <uWinID>, _WSET_CANCLOSE ) )

           #xtranslate wCanMove( <uWinID> ) ;
                          => ;
                          ( wSet( <uWinID>, _WSET_CANMOVE ) )

           #xtranslate wCanSize( <uWinID> ) ;
                       => ;
                       ( wSet( <uWinID>, _WSET_CANSIZE ) )

           #xtranslate wCanZoom( <uWinID> ) ;
                          => ;
                          ( wSet( <uWinID>, _WSET_CANZOOM ) )

           #xtranslate wIsActive( <uWinID> ) ;
                          => ;
                          ( wSet( <uWinID>, _WSET_ACTIVE ) )

           #xtranslate wIsMax( <uWinID> ) ;
                          => ;
                          ( wSet( <uWinID>, _WSET_CONDITION ) == WZ_MAX )

           #xtranslate wIsMin( <uWinID> ) ;
                          => ;
                          ( wSet( <uWinID>, _WSET_CONDITION ) == WZ_MIN )

           #xtranslate wIsRest( <uWinID> ) ;
                          => ;
                          ( wSet( <uWinID>, _WSET_CONDITION ) == WZ_REST )

 Returns..: uPrevSet is the previous Set. This applies, as well,
            should you send the third parameter, <uNewSet>.

 Remark...: As stated, there are some of manifest constants
            in FW_MAIN.CH that work with this new function. It
            behaves consistently with Nantucket Set functions in
            that, if a new <uNewSet> parameter is sent, the current
            Set is retrieved. If a new Set is sent, the previous
            Set is returned.

            This is a preferable way of changing NON-STOCK elements
            of a window over retrieving a reference to the window
            array with wArray() and "winging" it.

 Source...: WSET.PRG
-------------------------------------------------------------------------------
 Example..: . One particularly useful purpose for wSet() is
              when you have some window GETs to be READ and you want
              to disable window SIZEing and ZOOMing. This example
              does just that. It disables sizing and zooming, then
              redraws the window to reflect those changes, READs the
              GETs, then restores the window SETs and redraws the
              window display to reflect the restored sets.

            lSavSize := wSet( , _WSET_CANSIZE, .F. )
            lSavZoom := wSet( , _WSET_CANZOOM, .F. )
            wRedraw()

            READ MOUSE IN WINDOW

            wSet( , _WSET_CANSIZE, lSavSize )
            wSet( , _WSET_CANZOOM, lSavZoom )
            wRedraw()

See Also: wNew() wReDraw()

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