Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FiveWin 1.9.2 - January 97 - // reviewing arrays - using fivewin twbrowse http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
// Reviewing arrays - using FiveWin TWBrowse

#include "FiveWin.ch"

//----------------------------------------------------------------------------//

function Main()

   local oDlg, oBrw
   local aSample := { "The standard", "has", "a name...",;
                      "CA-Clipper 5.", "Wellcome", "to", "FiveWin",;
                      "the CA-Clipper 5", "Windows", "Library" }
   local nItem := 1

   DEFINE DIALOG oDlg FROM 2, 2 TO 20, 50 TITLE "FiveWin TWBrowse Power!!!"

   @ 1, 2 LISTBOX oBrw FIELDS aSample[ nItem ] ;
      HEADERS "Reviewing Array" ;
      FIELDSIZES 200 ;
      OF oDlg ;
      SIZE 100, 100 ;
      ON CLICK MsgInfo( "Click" ) ;
      ON RIGHT CLICK ShowPopup( oBrw, nRow, nCol )

   oBrw:bGoTop    = { || nItem := 1 }
   oBrw:bGoBottom = { || nItem := Eval( oBrw:bLogicLen ) }
   oBrw:bSkip     = { | nWant, nOld | nOld := nItem, nItem += nWant,;
                        nItem := Max( 1, Min( nItem, Eval( oBrw:bLogicLen ) ) ),;
                        nItem - nOld }
   oBrw:bLogicLen = { || Len( aSample ) }
   oBrw:cAlias    = "Array"                // Just put something
   oBrw:bKeyChar  = { | nKey | MsgInfo( nKey ) } // Controlling keystrokes

   @ 1, 20 BUTTON "&End" OF oDlg ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED

return nil

//----------------------------------------------------------------------------//

function ShowPopup( oBrw, nRow, nCol )

   local oPopup

   MENU oPopup POPUP
      MENUITEM "&One"
      MENUITEM "&Two"
   ENDMENU

   ACTIVATE MENU oPopup OF oBrw AT nRow, nCol

return nil

//----------------------------------------------------------------------------//

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