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 - // first works with browses http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
// First works with browses

#include "FiveWin.ch"

static oWnd

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

function Main()

   SET 3DLOOK ON

   DEFINE WINDOW oWnd FROM 1, 1 TO 22, 75 ;
      TITLE "Using a FiveWin quick browse" ;
      MENU  BuildMenu()

   SET MESSAGE OF oWnd ;
      TO "FiveWin - The xBase revolution" CENTERED ;
      CLOCK DATE KEYBOARD

   ACTIVATE WINDOW oWnd MAXIMIZED

return nil

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

function BuildMenu()

   local oMenu

   MENU oMenu
      MENUITEM "&Information"
      MENU
         MENUITEM   "&About..." ;
            ACTION  MsgAbout( "FiveWin Tutorial", FWCOPYRIGHT ) ;
            MESSAGE "Information about this program"

         SEPARATOR

         MENUITEM   "&End..."  ;
            ACTION  If( MsgYesNo( "Want to end ?" ), oWnd:End(),) ;
            MESSAGE "End this application"
      ENDMENU

      MENUITEM "&Files"
      MENU
         MENUITEM   "&Customers..." ;
            ACTION  Customers() ;
            MESSAGE "Customers maintainance"

         MENUITEM   "&Stock" ;
            ACTION  MsgInfo( "Your Stock control goes here" ) ;
            MESSAGE "Stock control"
      ENDMENU

      MENUITEM "&Utils"
      MENU
         MENUITEM   "&Calculator..." ;
            ACTION  WinExec( "Calc" ) ;
            MESSAGE "Run Windows calculator"

         MENUITEM   "C&alendar..." ;
            ACTION  WinExec( "Calendar" ) ;
            MESSAGE "Run Windows calendar"

         MENUITEM   "&Have some fun..." ;
            ACTION  WinExec( "Sol" ) ;
            MESSAGE "Play a game..."
      ENDMENU
   ENDMENU

return oMenu

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

function Customers()

   if ! File( "clientes.dbf" )
      DbCreate( "Clientes.dbf", { { "Nombre",    "C", 40, 0 },;
                                  { "Direccion", "C", 50, 0 },;
                                  { "Telefono",  "C", 12, 0 },;
                                  { "Edad",      "N",  2, 0 },;
                                  { "Productos", "C", 10, 0 },;
                                  { "Nivel",     "N",  2, 0 } } )
   endif
   
   USE Clientes
   if RecCount() == 0
      APPEND BLANK
   endif
   INDEX ON Clientes->Nombre TO CliNombr
   SET INDEX TO CliNombr
   GO TOP

   Browse( "Customers Control", "Cutomers info" )

   USE

return nil

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

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