#include "FWCE.ch"
#Define EVENT_SIP 224
REQUEST DBFCDX
Static lsave:=.f.
FUNCTION Main()
local oDlgClient , oTabs
local oLbx
local cVar
local aHBitMaps:=Array( 5 )
local n
aHBitMaps:= { ReadBitmap( 0, CurDir() +"Level1.bmp" ), ; // BitMaps de 14 x 32
ReadBitmap( 0, CurDir() +"\Level2.bmp" ), ;
ReadBitmap( 0, CurDir() +"\Level3.bmp" ), ;
ReadBitmap( 0, CurDir() +"\Level4.bmp" ),;
ReadBitmap( 0, CurDir() +"\Level5.bmp" ) }
USE ( CurDir() + "\Clientes" ) VIA "DBFCDX"
if RecCount() == 0
APPEND BLANK
endif
if ! File( CurDir() + "\CliName.CDX" )
INDEX ON Clientes->Nombre TO ( CurDir() + "\CliName" )
endif
Clientes->(DbSetIndex( CurDir() + "\CliName" ))
Clientes->( OrdSetFocus( "\CliName" ) )
Clientes->( DbGoTop() )
DEFINE DIALOG oDlgClient TITLE "Kunden"
@ 0, 0 LISTBOX oLbx FIELDS aHBitmaps[ Max( 1, Clientes->Nivel ) ],;
Clientes->Nombre,;
Clientes->Telefono,;
Str( Clientes->Edad, 3 ) ;
HEADERS "L", "Cognome e nome", "Telefono", "Ombrellone" ;
FIELDSIZES 16, 95, 80, 8 ;
SIZE 105, 135 OF oDlgClient
oLbx:nClrPane := { || If( OrdKeyNo() % 2 == 0, RGB( 230, 230, 230), RGB( 190, 215, 190 ) ) }
oLbx:nClrForeHead:=CLR_BLUE
*oLbx::bKeyDown :={|nKey| Val_nKey(nKey,oDlg)}
oDlgClient:bSettingChange := {|uVal|PocketEvent( uVal,oDlgClient,olbx ) }
ACTIVATE DIALOG oDlgClient;
ON INIT ( SetOKButton( oDlgClient:hWnd ),;
DlgFullScreen( oDlgClient:hWnd ), ;
oDlgClient:SetMenu( DialogBar(oDlgClient,oLbx) ) )
AEval( aHBitmaps, { | hBmp | DeleteObject( hBmp ) } )
Clientes->(DbCloseArea())
RETU NIL
function EditClient( oLbx, lAppend )
local oDlg, oFld,oFont, oFont1
lFivePro = "F" $ Clientes->Productos
lDialog = "D" $ Clientes->Productos
lObjects = "O" $ Clientes->Productos
nNivel = max( 1, Clientes->Nivel )
cName = Clientes->Nombre
cAddress = Clientes->Direccion
cPhone = Clientes->Telefono
nAge = Clientes->Edad
DEFINE FONT oFont NAME "Arial" SIZE 0, -8
DEFINE FONT oFont1 NAME "Arial" SIZE 0, -68
ShowKeyboard()
DEFINE DIALOG oDlg TITLE If( lAppend, "New", "Update" )
@ 0, 0 FOLDER oFld PROMPTS "Generale", "Dettagli", "Note" ;
SIZE 119,95
@ 1, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] SIZE 40,10
@ 2, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] SIZE 40,10
/*@ 11, 0 SAY "&Indirizzo:" OF oFld:aDialogs[ 1 ] PIXEL
@ 12, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] PIXEL
@ 13, 0 SAY "&Indirizzo:" OF oFld:aDialogs[ 1 ] PIXEL
@ 14, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] PIXEL
@ 15, 0 SAY "&Indirizzo:" OF oFld:aDialogs[ 1 ] PIXEL
@ 16, 0 SAY "&Cliente :" OF oFld:aDialogs[ 1 ] PIXEL
@ 17, 0 SAY "&Indirizzo:" OF oFld:aDialogs[ 1 ] PIXEL
/* @ 1, 0 GET cName OF oFld:aDialogs[ 1 ] size 40,10
@ 1, 6 GET cAddress OF oFld:aDialogs[ 1 ] size 40,10
@ 3, 1 TO 7, 8 LABEL "&Products" OF oFld:aDialogs[ 1 ]
@ 4, 2 CHECKBOX lFivePro PROMPT "&FivePro" OF oFld:aDialogs[ 1 ] size 40,10
@ 5, 2 CHECKBOX lDialog PROMPT "&Dialog" OF oFld:aDialogs[ 1 ] size 40,10
@ 6, 2 CHECKBOX lObjects PROMPT "&Objects"OF oFld:aDialogs[ 1 ] size 40,10
* @ 0.5, 1 GET cName1 SIZE 60, 20 OF oFld:aDialogs[ 1 ]
*/
ACTIVATE DIALOG oDlg ;
ON INIT ( DlgFullScreen( oDlg:hWnd ), oDlg:SetMenu( DialogButtons(oDlg) ) )
HideKeyboard()
msginfo(lSave)
IF lSave :=.t.
? "I'here"
ELSE
? "I'm not here"
ENDIF
return nilBest
function DialogButtons(oDlg)
local oMenu
DEFINE MENU oMenu RESOURCE 102 ;
BITMAPS 10 ; // bitmap resources ID
IMAGES 2 // number of images in the bitmap
REDEFINE MENUITEM ID 110 OF oMenu ACTION (lsave:=.t., MsgInfo( "Nuovo inserimento" ), oDlg:end())
REDEFINE MENUITEM ID 120 OF oMenu ACTION (lsave:=.f.,MsgInfo( "Annulla operazione" ),oDlg:end() )
return oMenu
static Function DialogBar(oDlgClient,oLbx)
local oMenu
DEFINE MENU oMenu RESOURCE 103 ;
BITMAPS 11 ; // bitmap resources ID
IMAGES 6 // number of images in the bitmap
REDEFINE MENUITEM ID 113 OF oMenu ACTION MsgInfo( "new" )
REDEFINE MENUITEM ID 114 OF oMenu ACTION MsgInfo( "edit" )
REDEFINE MENUITEM ID 115 OF oMenu ACTION MsgInfo( "del" )
REDEFINE MENUITEM ID 116 OF oMenu ACTION MsgInfo( "nseek ")
REDEFINE MENUITEM ID 117 OF oMenu ACTION MsgInfo( "PRINT" )
REDEFINE MENUITEM ID 118 OF oMenu ACTION oDlgClient:End()
return oMenu
STATIC FUNCTION PocketEvent( uVal,oDlg,olbx )
*----------------------------------
DO CASE
CASE uVal == EVENT_SIP ; Dimensiona(oDlg,olbx)
ENDCASE
RETU NIL
*---------------------------
STATIC FUNCTION Dimensiona(oDlg,olbx)
*---------------------------
IF SipInfo()
MoveWindow( oDlg:hWnd, 25, 0, 240, 187 )
if olbx != NIL
olbx:nheight:=185
endif
ELSE
DlgFullScreen( oDlg:hWnd )
if olbx != NIL
olbx:nheight:=240
endif
ENDIF
oDlg:Refresh()
RETU NIL
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
#include <aygshell.h>
HB_FUNC( DLGFULLSCREEN )
{
SHINITDLGINFO shidi;
memset( &shidi, 0, sizeof( SHINITDLGINFO ) );
shidi.dwMask = SHIDIM_FLAGS;
shidi.hDlg = ( HWND ) hb_parnl( 1 );
shidi.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;
SHInitDialog( &shidi );
}
HB_FUNC( SETOKBUTTON )
{
SHINITDLGINFO shidi;
shidi.dwMask = SHIDIM_FLAGS;
shidi.hDlg = ( HWND ) hb_parnl( 1 );
shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIZEDLGFULLSCREEN;
SHInitDialog( &shidi );
}
#pragma ENDDUMP