[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   DRAWBUTTON ( nRow, nCol, nColor1, nColor2, ;
                    aButton, lFormat, nPromptPos ) -> nChoice


   Draws Buttons defined in aButton ( see 'AlertBox' ).
   Buttons can be 'pushed' using the mouse or the keyboard.
   You can create up to 12 Buttons.

   Change 'focus' of each Button with the cursor-keys, left, right,
   up, down, home, end and enter are in charge.

   The ButtonType can be switched using

     SetPref ( C_GRAFBUTTON , {1 oder 2} )

   SetKey() 'trapped' keys will be recognized. This gives you the
   possibility to call your own UDF's, Help.prg or the Debugger while
   you are in the 'ButtonMenu'. You can even set the MouseKey K_MOUSE
   ( 255 ) to one of your own UDF's via Setkey().

   The Buttons and the 'Points of Interest' ( CloseIcon, MoveIcon etc.)
   will still return their own values ( see RETURN VALUES ).
   If you click on a non-defined area/position, your own function set by
   Setkey(K_MOUSE, {||MausFunc()}) will be called, because 255 (K_MOUSE)
   will be returned on these 'Points of NO Interest'.

   'Points of Interest' are overwriten by OpenMask()/OPENWIN FROM..
   so if you need them later, save them using Save_Mse and Rest_Mse
   to restore them, if you open a new Window using one of these functions !

   Setkey()-settings override Button-defined keys, that's why you shouldn't,
   for example, use the character 'B' as a HotKey for a Button and have a
   Setkey() statement for the same key.

   With this you can create ListBoxes. Users can move the ButtonPrompt
   with the cursor-keys and, at the same time, use the, originally for
   the Buttons defined, HotKeys to scroll up and down the List...

   What ? is this too fast ? haha...

   You'd best get into Demo.prg / the ListBox-Demo shows everything...




   PARAMETERS:

   nRow     BeginningRow
   nColumn  BeginningColumn
   nColor1  Clipper ColorCode for the Button (eg 112= B/W)
   nColor2  Clipper ColorCode for the HotKey (eg 116= R/w)
   aButton  Array containing a max. of 8 Buttons
   lFormat  Direction
                Horizontal (.f./default) or Vertical (.T.)
                always 2 Rows spaces between the Buttons.
   nPrompt  First PromptPosition, from 1 to, well...the last Button
                    A 3 would prompt the third Button first, for example.
                    ( If you have three Buttons <g> )

   RETURN VALUES:
   nButton                1-12     ( Key or Mouse )
   CloseButton or ESC     M_CLOSE  ( Mouse )
   MoveButton             M_MOVE
   ChoiButton             M_CHOI   If you don't have a ScrollBar for example,
   Scrollbar    Up        M_UP     there's no ReturnValue, see....
                Down      M_DOWN
                Left      M_LEFT
                Right     M_RIGHT


   EXAMPLE:

    LOCAL aButton := { 'Drive ~A:', 'Drive ~B:', 'Drive ~C:', 'E~xit' }

            nChoice := DrawButton( 14, 40, 46, 47, aButton, .t., 3)





See Also: GET AS PUSHBUTTON Save_Mse Rest_Mse
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson