home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 16
/
CD_ASCQ_16_0994.iso
/
news
/
4611
/
fw16d.ins
/
SAMPLES
/
DBF01.PRG
< prev
next >
Wrap
Text File
|
1994-06-08
|
3KB
|
109 lines
// FiveWin - DataBase Objects Tutorial - 01
// FiveWin DataBase tools
#include "FiveWin.ch"
#include "Dbf01.ch"
static oWnd
//----------------------------------------------------------------------------//
function Main()
SET 3DLOOK ON
DEFINE WINDOW oWnd FROM 2, 2 TO 20, 70 ;
TITLE "Testing DataBase Objects" ;
MENU BuildMenu()
SET MESSAGE OF oWnd ;
TO "FiveWin - Object Oriented DataBase Management" CENTERED
oWnd:bLDblClick = { || MsgInfo( "Double Left Click" ) }
ACTIVATE WINDOW oWnd MAXIMIZED ;
VALID MsgYesNo( "Do you really want to end ?" )
return nil
//----------------------------------------------------------------------------//
function BuildMenu()
local oMenu
MENU oMenu
MENUITEM "&Clients"
MENU
MENUITEM "&Management..." ACTION Clients() ;
MESSAGE "Clients management dialog"
SEPARATOR
MENUITEM "&Exit Test..." ACTION oWnd:End() ;
MESSAGE "End doing this tutorial"
ENDMENU
ENDMENU
return oMenu
//----------------------------------------------------------------------------//
function Clients()
local oDbf, oDlg
USE Clients
DATABASE oDbf // We create a DBF Object based on the current Alias
// Now we can change WorkArea and the DBF Object
// automatically access its area !
DEFINE DIALOG oDlg RESOURCE "Clients" OF oWnd // Specify the container,
// to access its MsgBar !
REDEFINE GET oDbf:Name ID ID_NAME OF oDlg UPDATE ;
MESSAGE "Please type here the name of the customer"
// We directly use the Fields
// name, but we are working on
// a buffer ! This is perfect
// for Network management
REDEFINE GET oDbf:Adress ID ID_ADDRESS OF oDlg UPDATE ;
MESSAGE "Please type here the address of the customer"
REDEFINE CHECKBOX oDbf:Active ID ID_ACTIVE OF oDlg UPDATE ;
MESSAGE "Is the customer currently active"
REDEFINE BUTTON ID ID_NEW OF oDlg ;
ACTION ( oDbf:Blank(), oDlg:Update(), oDlg:aControls[ 1 ]:SetFocus() ) ;
MESSAGE "Add a new customer"
REDEFINE BUTTON ID ID_TOP OF oDlg ;
ACTION ( oDbf:GoTop(), oDlg:Update() ) ;
MESSAGE "Go to the first record of the DataBase"
REDEFINE BUTTON ID ID_PREV OF oDlg ;
ACTION ( oDbf:Skip( -1 ), oDlg:Update() ) ;
MESSAGE "Go to the previous record of the DataBase"
REDEFINE BUTTON ID ID_NEXT OF oDlg ;
ACTION ( oDbf:Skip(), oDlg:Update() ) ;
MESSAGE "Go to the next record of the DataBase"
REDEFINE BUTTON ID ID_BOTTOM OF oDlg ;
ACTION ( oDbf:GoBottom(), oDlg:Update() ) ;
MESSAGE "Go to the last record of the DataBase"
REDEFINE BUTTON ID ID_END OF oDlg ;
ACTION oDlg:End() ;
MESSAGE "End this dialog"
ACTIVATE DIALOG oDlg CENTERED
return nil
//----------------------------------------------------------------------------//