- Code: Select all Expand view
- #include "FiveTouch.ch"
function Main()
MsgInfo( "Hello world from Harbour iOS" )
return nil
http://wiki.fivetechsoft.com/doku.php?id=fivetouch_english
#include "FiveTouch.ch"
function Main()
MsgInfo( "Hello world from Harbour iOS" )
return nil
#include "FiveTouch.ch"
static oBar, oActionAdd, oActionEdit, oActionDel, oActionShare, oActionClose
//----------------------------------------------------------------------------//
function Main()
local oDlg := QDialog(), oBtn1, oBtn2, oBtn3, oBtn4
local oLayout := QVBoxLayout()
QApplication():SetStyleSheet( DarkOrangeStyle() )
SetWndMain( oDlg )
BuildDataBases()
oDlg:SetLayout( oLayout )
oLayout:AddWidget( oBtn1 := QPushButton( oDlg ) )
oBtn1:SetText( "Clients" )
oBtn1:SetFixedHeight( 100 )
oBtn1:Connect( "clicked()", { || Clients() } )
oLayout:AddWidget( oBtn2 := QPushButton( oDlg ) )
oBtn2:SetText( "Items" )
oBtn2:SetFixedHeight( 100 )
oBtn2:Connect( "clicked()", { || Items() } )
oLayout:AddWidget( oBtn3 := QPushButton( oDlg ) )
oBtn3:SetText( "Invoices" )
oBtn3:SetFixedHeight( 100 )
oBtn3:Connect( "clicked()", { || SelFile() } )
oLayout:AddWidget( oBtn4 := QPushButton( oDlg ) )
oBtn4:SetText( "Exit" )
oBtn4:SetFixedHeight( 100 )
oBtn4:Connect( "clicked()", { || oDlg:Done( 1 ) } )
oDlg:Exec()
return nil
//----------------------------------------------------------------------------//
function Clients()
local oDlg, oBrw
local oLayout := QVBoxLayout()
SELECT Clients
DEFINE DIALOG oDlg
oDlg:SetLayout( oLayout )
@ 0, 0 BROWSE oBrw OF oDlg ;
SIZE 400, 300 ;
HEADERS "First", "Last" ;
FIELDS FIELD->First, FIELD->Last
oLayout:AddWidget( oBrw )
BuildButtonBar( oLayout, oDlg )
ACTIVATE DIALOG oDlg
return nil
//----------------------------------------------------------------------------//
function Items()
local oDlg, oBrw
local oLayout := QVBoxLayout()
SELECT Items
DEFINE DIALOG oDlg
oDlg:SetLayout( oLayout )
@ 0, 0 BROWSE oBrw OF oDlg ;
SIZE 400, 300 ;
HEADERS "Item ID", "Name" ;
FIELDS FIELD->Itemid, FIELD->Name
oLayout:AddWidget( oBrw )
BuildButtonBar( oLayout, oDlg )
ACTIVATE DIALOG oDlg
return nil
//----------------------------------------------------------------------------//
function BuildButtonBar( oLayout, oDlg )
oLayout:AddWidget( oBar := QToolbar() )
oBar:SetIconSize( QSize( 58, 58 ) )
oActionAdd = oBar:AddAction( QIcon( QPixmap( ":/images/bitmaps/add.png" ):Scaled( 64, 64 ) ) , "Add" )
oActionAdd:Connect( "triggered()", { || MsgInfo( "Add" ) } )
oBar:AddAction( QIcon( QPixmap( ":/images/bitmaps/edit.png" ):Scaled( 64, 64 ) ), "Edit" )
oBar:AddAction( QIcon( QPixmap( ":/images/bitmaps/delete.png" ):Scaled( 64, 64 ) ), "Del" )
oBar:AddAction( QIcon( QPixmap( ":/images/bitmaps/share.png" ):Scaled( 64, 64 ) ), "Share" )
oActionClose = oBar:AddAction( QIcon( QPixmap( ":/images/bitmaps/close.png" ):Scaled( 64, 64 ) ), "Close" )
oActionClose:Connect( "triggered()", { || oDlg:End() } )
return nil
//----------------------------------------------------------------------------//
function BuildDataBases()
local n
if ! File( "clients.dbf" )
DbCreate( "clients.dbf",;
{ { "FIRST", "C", 20, 0 },;
{ "LAST", "C", 20, 0 } } )
USE clients
DbAppend()
clients->First := "Homer"
clients->Last := "Simpson"
DbAppend()
clients->First := "Bart"
clients->Last := "Simpson"
DbCommit()
USE
endif
if ! File( "items.dbf" )
DbCreate( "items.dbf",;
{ { "ITEMID", "C", 20, 0 },;
{ "NAME", "C", 20, 0 } } )
USE items
for n = 1 to 100
DbAppend()
items->ItemId := Str( n )
items->Name := "any name"
next
DbCommit()
USE
endif
USE clients
USE items NEW
return nil
//----------------------------------------------------------------------------//
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 29 guests