FWH Power
// C:\TMETRO - BY Cesar SysCtrl Software 2021 - Muchas Gracias.
// METROWIN.PRG - Version 1.0 by Joao Santos - kapiabafwh@gmail.com - 10/09/2021
// Comenzar a aprender en la PANTALLA TACTIL: Me Encanta Fivewin.
/* // Original:
* SysCtrl Terminal Punto de Venta
* 01-Jun-2021
* BY Cesar SysCtrl Software 2021
* en este proyecto ya no usamos connect.ini
* la connexion la controlamos desde codigo
* Special thanks To: Cesar SysCtrl Software 2021
* Modificado em: 10/09/2021 - by Joao Santos - Covid 19 - Quarentine.
*/
#Include "Ambienty.ch"
#Include "xBrowse.ch"
#Include "Metropnl.ch"
// #Include ".\includes\scs.CH"
STATIC oMetro, oTools, oWait
STATIC nClrBack := CLR_GREEN
REQUEST HB_LANG_PT
REQUEST HB_CODEPAGE_PT850
ANNOUNCE RDDSYS
REQUEST OrdKeyNo, OrdKeyCount, OrdCreate, OrdKeyGoto
REQUEST DBFCDX, DBFFPT
FUNCTION Main()
LOCAL oWnd, oBar, oMetro, oBrush, cTitle := "Start", oServer, oQru, nRows
DEFINE WINDOW oWnd TITLE cTitle STYLE nOr( WS_POPUP, WS_MAXIMIZE ) ;
COLOR CLR_WHITE, CLR_GREEN ICON "TIMAO"
oMetro := MakeMetroPanel( oWnd ) // MENU
DEFINE BRUSH oBrush FILE '.\BACKUP.jpg' RESIZE UPDATE
oMetro:SetBrush( oBrush )
oBrush:End()
oMetro:bRClicked := { |r,c,f,o| msginfo( 'HWND' + NUMTOHEX( oWnd:hWnd, 8 ) ) }
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT( oWnd:nHeight := ScreenHeight(), oMetro:Show() )
RETURN NIL
STATIC FUNCTION MakeMetroPanel( oWnd ) // Professional Edition, yes sir!
LOCAL cTitle, oMetro, oBtn, oBtnEmp, oBtnSet, oBtnPerm, oBtnExit, oBtnLin
LOCAL oBtnRang, oBtnCli, oBtnArt, oBtnContr, oBtnStock, oBtnImp, oBtnMove
LOCAL oBtnLocal
cTitle := "SysCtrl PANEL - Via Touch Screen - Scroll Mouse Navigation - Version: 1.0"
DEFINE METROPANEL oMetro OF oWnd TITLE cTitle COLOR CLR_YELLOW, CLR_WHITE ;
ON CLICK( CIERRA_METROWIN( oWnd ) )
oMetro:lDesignMode := .T.
DEFINE METROBUTTON oBtnEmp OF oMetro ;
COLOR CLR_HBLUE, CLR_HGRAY ;
CAPTION "FiveTech" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\FiveTech.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 100, 100 ;
BODYTEXT "Datos; de la; Empresa" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION( Empresas() )
oBtnEmp:nClrCaption := CLR_HCYAN
oBtnEmp:cToolTip := "Datos de la Empresa FiveTech"
// EM RESTO.PRG INICIO - modelo inicial
DEFINE METROBUTTON oBtnSet OF oMetro ;
COLOR CLR_WHITE,RGB( 86, 177, 14 ) ;
CAPTION "Setup" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Image6.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 100, 100 ;
BODYTEXT "Configuración;de;SysCtrl POS" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION( Configurar() )
oBtnSet:nClrCaption := CLR_BLACK
DEFINE METROBUTTON oBtnPerm OF oMetro ;
COLOR RGB( 15, 15, 15 ),RGB( 213, 177, 1 ) ;
CAPTION "Users" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Image7.png" ;
SIZE 100, 100 ;
BMPALIGN "BOTTOMLEFT" ;
BODYTEXT "Control;de acceso;a los Usuarios" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION( Permisos() )
oBtnPerm:nClrCaption := CLR_HBLUE
oBtnPerm:cToolTip := "Control de acceso a los Usuarios"
DEFINE METROBUTTON oBtnLin OF oMetro ;
COLOR RGB( 15, 15, 15 ),RGB( 219, 239, 107 ) ;
CAPTION "Categories" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Pan_Setting.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 100, 100 ;
BODYTEXT "Cátalogo;Linea;Productos" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION( Lineas() )
oBtnLin:nClrCaption := RGB(255,0,255)
oBtnLin:cToolTip := "Cátalogo Linea Productos"
DEFINE METROBUTTON oBtnRang OF oMetro ;
COLOR RGB( 255, 255, 128 ),RGB( 202, 7, 218 ) ;
CAPTION "Re-Arrange" ;
ALIGN "TOPCENTER" ;
BODYTEXT "By Just;Drag && Drop" ;
TEXTALIGN "MIDDLECENTER"
oBtnRang:nClrCaption := CLR_WHITE
oBtnRang:cToolTip := "By Just Drag && Drop"
DEFINE METROBUTTON oBtnCli OF oMetro ;
COLOR CLR_WHITE,RGB( 2, 174, 224 ) ;
CAPTION "Customers" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Image3.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 100, 100 ;
BODYTEXT "Catálogo;de;Clientes" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION( Clientes() )
oBtnCli:nClrCaption := CLR_MAGENTA //RGB(255,0,255)
oBtnCli:cToolTip := "Catálogo de Clientes"
DEFINE METROBUTTON oBtnArt OF oMetro ;
COLOR RGB( 15,15,15 ),RGB( 255, 255, 255 ) ;
CAPTION "Artigos" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Image8.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 100, 100 ;
BODYTEXT "descripcion" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION( Artics() )
oBtnArt:nClrCaption := RGB( 255, 0, 255 )
oBtnArt:cToolTip := "Descripcion de Artics"
DEFINE METROBUTTON oBtnContr OF oMetro ;
COLOR RGB( 255,255,255 ),RGB( 220, 53, 69 ) ;
CAPTION "Contratos" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Image13.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 100, 100 ;
BODYTEXT "Cadastro; Contratos; Arrendamiento";
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION( Contratos() )
oBtnContr:nClrCaption := RGB(0,0,0)
oBtnContr:cToolTip := "Cadastro de Contratos y Arrendamiento"
DEFINE METROBUTTON oBtnStock OF oMetro ;
COLOR CLR_WHITE,RGB( 2, 70, 133 ) ;
CAPTION "Stock" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Image2.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 100, 100 ;
BODYTEXT "Control;de;Inventarios" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE
oBtnStock:nClrCaption := RGB(255,255,255)
oBtnStock:cToolTip := "Control de Inventarios"
DEFINE METROBUTTON oBtnImp OF oMetro ;
COLOR CLR_BLACK,CLR_WHITE ;
CAPTION "SysCtrl Reports" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Printer.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 100, 100 ;
BODYTEXT "Centro;de;Impresión" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION( msginfo("Reports") )
oBtnImp:nClrCaption := CLR_HRED
oBtnImp:cToolTip := "Centro;de;Impresión"
DEFINE METROBUTTON oBtnLocal OF oMetro ;
COLOR CLR_WHITE, RGB(255, 255, 255) ;
CAPTION "Commerce" +CRLF+ "Locales" ;
ALIGN "TOPRIGHT" ;
GROUP 2 ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Image8.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 80, 80 ;
ACTION( Locales() )
oBtnLocal:nClrCaption := CLR_BLACK
oBtnLocal:cToolTip := "Commerce Locales"
// EM RESTO.PRG FIM
DEFINE METROBUTTON oBtnMove OF oMetro ;
COLOR CLR_BLACK, CLR_HRED ;
CAPTION "Salida" ;
ALIGN "TOPRIGHT" ;
GROUP 2 ;
BITMAP "c:\fwh1905\bitmaps\TOUCH.BMP" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 80, 80 ;
ACTION( CIERRA_METROWIN( oWnd ) )
oBtnMove:bOnMove := { |o,b| logfile( cFileSetExt( ExeName(), "log" ), { b:nTop, b:nLeft } ) }
@ 40,10 BTNBMP oBtnExit FILE "c:\fwh1905\bitmaps\metro\END.bmp" ;
SIZE 60, 60 PIXEL OF oMetro CENTER NOBORDER TRANSPARENT ;
ACTION( CIERRA_METROWIN( oWnd ) )
oBtnExit:cToolTip := "Salida - Exit - Cancelar"
RETURN( oMetro )
STATIC FUNCTION MetroFiles( oWnd )
LOCAL oMetro, n, oBtn
LOCAL aDir := Directory( "*.*" )
DEFINE METROPANEL oMetro OF oWnd TITLE "Files" ;
COLOR CLR_WHITE, nClrBack
for n := 1 to Min( Len( aDir ), 20 )
oMetro:AddButton( .t., nil, aDir[ n ][ 1 ],nil,nil,nil,"..\metro\files.bmp" )
next
oMetro:bRClicked := { || MsgInfo( "click" ), oMetro:SwitchTo( oMetro:oParent ) }
@ 40,10 BTNBMP oBtn FILE "c:\fwh\bitmaps\metro\metro-back-48.png","","",;
"c:\fwh\bitmaps\metro\back-black-48.png" ;
SIZE 60,60 PIXEL OF oMetro CENTER NOBORDER TRANSPARENT ;
ACTION oMetro:SwitchTo( oMetro:oParent )
RETURN( oMetro )
STATIC FUNCTION ImageFiles( oWnd )
LOCAL oMetro, aFiles, aFile, oBtn
aFiles := Directory( "..\bitmaps\AlphaBmp\*.bmp" )
DEFINE METROPANEL oMetro OF oWnd TITLE "Bitmaps" ;
COLOR CLR_WHITE, nClrBack
for each aFile in aFiles
DEFINE METROBUTTON OF oMetro ;
CAPTION aFile[ 1 ] ALIGN 'BOTTOMCENTER' ;
BITMAP "..\bitmaps\AlphaBmp\" + aFile[ 1 ] ;
BMPALIGN "TOPCENTER"
next
oMetro:bLClicked := { || msginfo( "click" ) }
@ 40,10 BTNBMP oBtn FILE "c:\fwh\bitmaps\metro\metro-back-48.png","","",;
"c:\fwh\bitmaps\metro\back-black-48.png" ;
SIZE 60,60 PIXEL OF oMetro CENTER NOBORDER TRANSPARENT ;
ACTION oMetro:SwitchTo( oMetro:oParent )
RETURN( oMetro )
FUNCTION UserConnection()
LOCAL cQry
LOCAL oDlg
LOCAL oGet[10]
LOCAL oBtn[ 10 ]
LOCAL oVar := array( 10 )
LOCAL oBrush
LOCAL oQry
LOCAL lVal := .f.
LOCAL oSay1
LOCAL oFont
LOCAL cClave1 := ""
LOCAL nCol := 75
LOCAL nSt := 55
LOCAL oImg
LOCAL cFile := ".\bmps\ScUser.jpg"
oVar[ 1 ] := space(15)
oVar[ 2 ] := space(40)
oVar[ 3 ] := space(15)
DEFINE BRUSH oBrush COLOR nRGB( 255, 255, 255 )
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-12 BOLD
DEFINE DIALOG oDlg SIZE 525, 250 brush oBrush FONT oFont
oDlg:lTransparent := .t.
oDlg:cTitle := "SysCtrl Connection:"
@ 0,1 XIMAGE oImg filename cFile SIZE 70,70 NOBORDER OF oDlg
@ 10, nCol SAY "Clave Usuario :" OF oDlg pixel
@ 10, nCol+nSt GET oGet[ 1] VAR oVar[ 1 ] of oDlg SIZE 60, 12 PICTURE "@!k" PIXEL ;
VALID ( ChkUser1( oVar, oGet, oSay1 ) )
@ 25, nCol SAY "Nombre :" OF oDlg pixel
@ 25, nCol+nSt GET oGet[ 2] VAR oVar[ 2 ] of oDlg SIZE 120, 12 PICTURE "@!k" PIXEL
@ 40, nCol SAY FWString("Password:") OF oDlg pixel
@ 40, nCol+nSt GET oGet[ 3] VAR oVar[ 3 ] of oDlg SIZE 60, 12 PICTURE "@!k" ;
PIXEL PASSWORD
@ 85, 80 BTNBMP oBtn[1] PROMPT "Connect" SIZE 50, 30 OF oDlg ;
ACTION ( lVal := .t. , oDlg:end() ) RESOURCE "ACEPTAR" PIXEL TOP FLAT
@ 85, 145 BTNBMP oBtn[2] PROMPT "Cancel" SIZE 50, 30 OF oDlg ;
ACTION ( lVal := .f. , oDlg:end() ) CANCEL RESOURCE "CANCELAR" PIXEL TOP FLAT
oDlg:lHelpIcon := .f.
ACTIVATE DIALOG oDlg CENTERED ON INIT oGet[1]:SetFocus()
IF lVal
lVal := .f.
oQry := hMain["server"]:Query( "SELECT * FROM users WHERE user=" + C_SIMPLE + alltrim( oVar[ 1 ] ) + C_SIMPLE )
cClave1 := decrypt( oQry:FieldGet('pasw1') )
nRows := oQry:RecCount()
IF nRows=0
lVal := .f.
ENDIF
/*
if cstr2(cClave1) == cstr2(oVar[3])
lVal := .t.
endif
*/
oQry:end()
ENDIF
RETURN ( lVal )
FUNCTION ChkUser1( oVar, oGet, oSay1 )
LOCAL nRows, oQry
IF Empty( oVar[ 1 ] )
RETURN .t.
ENDIF
oQry := hMain["server"]:Query( "SELECT * FROM users WHERE user=" + C_SIMPLE + alltrim( oVar[ 1 ] ) + C_SIMPLE )
nRows := oQry:RecCount()
IF nRows > 0 //ya existe
oVar[2] := oQry:FieldGet('username')
hMain["user"] := oVar[1]
hMain["username"] := oVar[2]
hMain["admin"] := oQry:FieldGet('admin')
oGet[2]:disable()
oGet[2]:Refresh()
ENDIF
oQry:END()
oQry := NIL
RETURN( .T. )
FUNCTION CATALOGOUSUARIOS()
RETURN (.T.)
STATIC FUNCTION ExitTo( cExe )
IF File( cExe )
WinExec( cExe )
WndMain():End()
ELSE
MsgInfo( cExe + " not found" )
ENDIF
RETURN NIL
INIT PROCEDURE ScSets()
HB_GCALL( .F. )
/*
// Para establecer código de página a Español (Ordenación, etc..)
REQUEST HB_CODEPAGE_ESWIN
REQUEST HB_LANG_ES
HB_LANGSELECT( 'ES' )
*/
HB_LANGSELECT( 'PT' ) // Default language is now Portuguese
HB_SETCODEPAGE( "PT850" )
RDDSETDEFAULT("DBFCDX")
SET CENTURY ON
SET DATE BRITISH
SET TIME FORMAT TO "HH:MM:SS"
SET EPOCH TO YEAR( DATE() ) - 30
SET SOFTSEEK OFF
SET WRAP ON
SETCANCEL( .F. )
SET CONFIRM OFF
SET DELETED ON
SET _3DLOOK ON
SET UNIQUE OFF
SET ESCAPE OFF
SET EXACT ON
SET EXCLUSIVE OFF
SET MULTIPLE OFF
SetBalloon( .T. ) // Balloon shape required for tooltips
oSkinB = TSkinButton():New()
oSkinB:nClrBorder0_N := RGB( 249, 194, 179 )
oSkinB:nClrBorder1_N := RGB( 181, 61, 29 )
// ESTA EM: TESTSK1.PRG - VIDE: COLORS.CH - aPubGrad
// Verde Oliva... Fica good RGB(109, 135, 100) // Bordas Vermelhas.
oSkinB:aClrNormal := { { 0.2, RGB( 000, 128, 000 ), RGB( 000, 128, 000 ) }, ;
{ 0.8, RGB( 109, 135, 100 ), RGB( 109, 135, 100 ) } }
SkinButtons( oSkinB ) // MUDEI EM: 24/08/2021 - COR: VERDE OLIVA.
FW_SetUnicode( .T. )
SetGetColorFocus( CLR_LGREEN )
tGet():lDisColors := .F.
tGet():nClrTextDis := CLR_HBLUE
tGet():nClrPaneDis := CLR_SOFTYELLOW
/*
IF .NOT. File( "my_reports" )
lMkDir( "my_reports" )
ENDIF
*/
RETURN NIL
FUNCTION CIERRA_METROWIN( oWnd )
// ? [ Salida aqui - Gracias Cesar.]
IF FILE( "ENCERRA.wav" )
SndPlaySound( "ENCERRA.wav", 0 )
ENDIF
DbCommitAll()
DbUnLockAll()
DbCloseAll()
FreeResources()
Release All
SysRefresh()
HB_GCALL( .T. )
CLEAR MEMORY
PostQuitMessage( 0 )
QUIT
RETURN NIL
FUNCTION Empresas()
? [AQUI, EMPRESA...]
RETURN NIL
FUNCTION Configurar()
? [AQUI, CONFIGURAR...]
RETURN NIL
FUNCTION Permisos()
? [AQUI, PERMISOS...]
RETURN NIL
FUNCTION Lineas()
? [AQUI, LINEAS...]
RETURN NIL
FUNCTION Clientes()
? [AQUI, CLIENTES...]
RETURN NIL
FUNCTION Artics()
? [AQUI, ARTIGOS...]
RETURN NIL
FUNCTION Contratos()
? [AQUI, CONTRATOS...]
RETURN NIL
FUNCTION Locales()
? [AQUI, LOCALES...]
RETURN NIL
// FIN / END - kapiabafwh@gmail.com
// C:\TMETRO - BY Cesar SysCtrl Software 2021 - Muchas Gracias.
// METROWIN.PRG - Version 2.0 by Joao Santos - kapiabafw@gmail.com - 10/09/2021
// Comenzar a aprender en la PANTALLA TACTIL: Me Encanta Fivewin.
/* // Original:
* SysCtrl Terminal Punto de Venta
* 01-Jun-2021
* BY Cesar SysCtrl Software 2021
* en este proyecto ya no usamos connect.ini
* la connexion la controlamos desde codigo
* Special thanks To: Cesar SysCtrl Software 2021
* Modificado em: 10/09/2021 - by Joao Santos - Covid 19 - Quarentine.
*/
#Include "Ambienty.ch"
#Include "xBrowse.ch"
#Include "Metropnl.ch"
// #Include ".\includes\scs.CH"
STATIC oWnd, oFontLarge, oFontMed, oFontUL, oFontSmall
STATIC oMetro, oTools, oWait
STATIC nClrBack := CLR_GREEN
REQUEST HB_LANG_PT
REQUEST HB_CODEPAGE_PT850
ANNOUNCE RDDSYS
REQUEST OrdKeyNo, OrdKeyCount, OrdCreate, OrdKeyGoto
REQUEST DBFCDX, DBFFPT
FUNCTION Main()
// LOCAL oWnd, oBar, oMetro, oBrush, cTitle, oServer, oQru, nRows
LOCAL oBar, oMetro, oBrush, cTitle, oServer, oQru, nRows
cTitle := "PLENOIND For Windows - Skype: joao@pleno.com.br"
DEFINE FONT oFontLarge NAME "Segoe UI Light" SIZE 0, -60 BOLD
DEFINE FONT oFontMed NAME "Segoe UI Light" SIZE 0, -40 BOLD
DEFINE FONT oFontUL NAME "Segoe UI Light" SIZE 0, -30 UNDERLINE
DEFINE FONT oFontSmall NAME "Segoe UI Light" SIZE 0, -20 BOLD
/* WINDOW FULL - JANELA CHEIA PARA DESKTOP NAO E BOM.
DEFINE WINDOW oWnd TITLE cTitle STYLE nOr( WS_POPUP, WS_MAXIMIZE ) ;
COLOR CLR_WHITE, CLR_GREEN ICON ".\TIMAO.ico"
*/
DEFINE WINDOW oWnd TITLE cTitle ;
COLOR CLR_WHITE, CLR_GREEN ICON ".\TIMAO.ico"
oWnd:Maximize()
oMetro := MakeMetroPanel( oWnd ) // MENU
DEFINE BRUSH oBrush FILE '.\BACKUP.jpg' RESIZE UPDATE
oMetro:SetBrush( oBrush )
oBrush:End()
oMetro:bRClicked := { |r,c,f,o| msginfo( 'HWND' + NUMTOHEX( oWnd:hWnd, 8 ) ) }
/*
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT( oWnd:nHeight := ScreenHeight(), oMetro:Show() )
*/
ACTIVATE WINDOW oWnd MAXIMIZED ON INIT( oMetro:Show() ) ;
VALID( CIERRA_METROWIN( oWnd ) )
RETURN NIL
// menu do sistema touch
STATIC FUNCTION MakeMetroPanel( oWnd ) // Professional Edition, yes sir!
LOCAL cTitle, oMetro, oBtn, oBtnEmp, oBtnSet, oBtnPerm, oBtnExit, oBtnLin
LOCAL oBtnRang, oBtnCli, oBtnArt, oBtnContr, oBtnStock, oBtnImp, oBtnMove
LOCAL oBtnLocal
cTitle := "SysCtrl PANEL - Via Touch Screen"
DEFINE METROPANEL oMetro OF oWnd TITLE cTitle COLOR CLR_HGREEN, CLR_WHITE ;
ON CLICK( CIERRA_METROWIN( oWnd ) )
oMetro:lDesignMode := .T.
oMetro:oFont:End()
oMetro:oFont := oFontLarge // Title
DEFINE METROBUTTON oBtnEmp OF oMetro ;
COLOR CLR_HBLUE, CLR_HGRAY ;
FONT oFontSmall ;
CAPTION "FiveTech" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\FiveTech.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 100, 100 ;
BODYTEXT "Datos; de la; Empresa" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION( Empresas() )
oBtnEmp:nClrCaption := CLR_HCYAN
oBtnEmp:cToolTip := "Datos de la Empresa FiveTech"
// EM RESTO.PRG INICIO - modelo inicial
DEFINE METROBUTTON oBtnSet OF oMetro ;
COLOR CLR_WHITE,RGB( 86, 177, 14 ) ;
FONT oFontSmall ;
CAPTION "Setup" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Image6.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 100, 100 ;
BODYTEXT "Configuración;de;SysCtrl POS" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION( Configurar() )
oBtnSet:nClrCaption := CLR_BLACK
DEFINE METROBUTTON oBtnPerm OF oMetro ;
COLOR RGB( 15, 15, 15 ),RGB( 213, 177, 1 ) ;
FONT oFontSmall ;
CAPTION "Users" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Image7.png" ;
SIZE 100, 100 ;
BMPALIGN "BOTTOMLEFT" ;
BODYTEXT "Control;de acceso;a los Usuarios" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION( Permisos() )
oBtnPerm:nClrCaption := CLR_HBLUE
oBtnPerm:cToolTip := "Control de acceso a los Usuarios"
DEFINE METROBUTTON oBtnLin OF oMetro ;
COLOR RGB( 15, 15, 15 ),RGB( 219, 239, 107 ) ;
FONT oFontSmall ;
CAPTION "Categories" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Pan_Setting.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 100, 100 ;
BODYTEXT "Cátalogo;Linea;Productos" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION( Lineas() )
oBtnLin:nClrCaption := RGB(255,0,255)
oBtnLin:cToolTip := "Cátalogo Linea Productos"
DEFINE METROBUTTON oBtnRang OF oMetro ;
COLOR RGB( 255, 255, 128 ),RGB( 202, 7, 218 ) ;
FONT oFontSmall ;
CAPTION "Re-Arrange" ;
ALIGN "TOPCENTER" ;
BODYTEXT "By Just;Drag && Drop" ;
TEXTALIGN "MIDDLECENTER"
oBtnRang:nClrCaption := CLR_WHITE
oBtnRang:cToolTip := "By Just Drag && Drop"
DEFINE METROBUTTON oBtnCli OF oMetro ;
COLOR CLR_WHITE,RGB( 2, 174, 224 ) ;
FONT oFontSmall ;
CAPTION "Customers" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Image3.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 100, 100 ;
BODYTEXT "Catálogo;de;Clientes" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION( Clientes() )
oBtnCli:nClrCaption := CLR_MAGENTA //RGB(255,0,255)
oBtnCli:cToolTip := "Catálogo de Clientes"
DEFINE METROBUTTON oBtnArt OF oMetro ;
COLOR RGB( 15,15,15 ),RGB( 255, 255, 255 ) ;
FONT oFontSmall ;
CAPTION "Artigos" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Image8.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 100, 100 ;
BODYTEXT "descripcion" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION( Artics() )
oBtnArt:nClrCaption := RGB( 255, 0, 255 )
oBtnArt:cToolTip := "Descripcion de Artics"
DEFINE METROBUTTON oBtnContr OF oMetro ;
COLOR RGB( 255,255,255 ),RGB( 220, 53, 69 ) ;
FONT oFontSmall ;
CAPTION "Contratos" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Image13.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 100, 100 ;
BODYTEXT "Cadastro; Contratos; Arrendamiento" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION( Contratos() )
oBtnContr:nClrCaption := RGB(0,0,0)
oBtnContr:cToolTip := "Cadastro de Contratos y Arrendamiento"
DEFINE METROBUTTON oBtnStock OF oMetro ;
COLOR CLR_WHITE,RGB( 2, 70, 133 ) ;
FONT oFontSmall ;
CAPTION "Stock" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Image2.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 100, 100 ;
BODYTEXT "Control;de;Inventarios" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE
oBtnStock:nClrCaption := RGB(255,255,255)
oBtnStock:cToolTip := "Control de Inventarios"
DEFINE METROBUTTON oBtnImp OF oMetro ;
COLOR CLR_BLACK,CLR_WHITE ;
FONT oFontSmall ;
CAPTION "SysCtrl Reports" ;
ALIGN "TOPRIGHT" ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Printer.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 100, 100 ;
BODYTEXT "Centro;de;Impresión" ;
TEXTALIGN "BOTTOMRIGHT" ;
LARGE ;
ACTION( msginfo("Reports") )
oBtnImp:nClrCaption := CLR_HRED
oBtnImp:cToolTip := "Centro;de;Impresión"
DEFINE METROBUTTON oBtnLocal OF oMetro ;
COLOR CLR_WHITE, RGB(255, 255, 255) ;
FONT oFontSmall ;
CAPTION "Commerce" +CRLF+ "Locales" ;
ALIGN "TOPRIGHT" ;
GROUP 2 ;
BITMAP "c:\fwh1905\bitmaps\PNGS\Image8.png" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 80, 80 ;
ACTION( Locales() )
oBtnLocal:nClrCaption := CLR_BLACK
oBtnLocal:cToolTip := "Commerce Locales"
// EM RESTO.PRG FIM
DEFINE METROBUTTON oBtnMove OF oMetro ;
COLOR CLR_WHITE,RGB( 86, 177, 14 ) ;
FONT oFontSmall ;
CAPTION "Salida" ;
ALIGN "TOPRIGHT" ;
GROUP 2 ;
BITMAP "c:\fwh1905\bitmaps\TOUCH.BMP" ;
BMPALIGN "BOTTOMLEFT" ;
SIZE 80, 80 ;
ACTION( CIERRA_METROWIN( oWnd ) )
oBtnMove:bOnMove := { |o,b| logfile( cFileSetExt( ExeName(), "log" ), { b:nTop, b:nLeft } ) }
@ 40,10 BTNBMP oBtnExit FILE "c:\fwh1905\bitmaps\metro\END.bmp" ;
SIZE 60, 60 PIXEL OF oMetro CENTER NOBORDER TRANSPARENT ;
ACTION( CIERRA_METROWIN( oWnd ) )
oBtnExit:cToolTip := "Salida - Exit - Cancelar"
RETURN( oMetro )
STATIC FUNCTION MetroFiles( oWnd )
LOCAL oMetro, n, oBtn
LOCAL aDir := Directory( "*.*" )
DEFINE METROPANEL oMetro OF oWnd TITLE "Files" ;
COLOR CLR_WHITE, nClrBack
for n := 1 to Min( Len( aDir ), 20 )
oMetro:AddButton( .t., nil, aDir[ n ][ 1 ],nil,nil,nil,"..\metro\files.bmp" )
next
oMetro:bRClicked := { || MsgInfo( "click" ), oMetro:SwitchTo( oMetro:oParent ) }
@ 40,10 BTNBMP oBtn FILE "c:\fwh\bitmaps\metro\metro-back-48.png","","",;
"c:\fwh\bitmaps\metro\back-black-48.png" ;
SIZE 60,60 PIXEL OF oMetro CENTER NOBORDER TRANSPARENT ;
ACTION oMetro:SwitchTo( oMetro:oParent )
RETURN( oMetro )
STATIC FUNCTION ImageFiles( oWnd )
LOCAL oMetro, aFiles, aFile, oBtn
aFiles := Directory( "..\bitmaps\AlphaBmp\*.bmp" )
DEFINE METROPANEL oMetro OF oWnd TITLE "Bitmaps" ;
COLOR CLR_WHITE, nClrBack
for each aFile in aFiles
DEFINE METROBUTTON OF oMetro ;
CAPTION aFile[ 1 ] ALIGN 'BOTTOMCENTER' ;
BITMAP "..\bitmaps\AlphaBmp\" + aFile[ 1 ] ;
BMPALIGN "TOPCENTER"
next
oMetro:bLClicked := { || msginfo( "click" ) }
@ 40,10 BTNBMP oBtn FILE "c:\fwh\bitmaps\metro\metro-back-48.png","","",;
"c:\fwh\bitmaps\metro\back-black-48.png" ;
SIZE 60,60 PIXEL OF oMetro CENTER NOBORDER TRANSPARENT ;
ACTION oMetro:SwitchTo( oMetro:oParent )
RETURN( oMetro )
FUNCTION UserConnection()
LOCAL cQry
LOCAL oDlg
LOCAL oGet[10]
LOCAL oBtn[ 10 ]
LOCAL oVar := array( 10 )
LOCAL oBrush
LOCAL oQry
LOCAL lVal := .f.
LOCAL oSay1
LOCAL oFont
LOCAL cClave1 := ""
LOCAL nCol := 75
LOCAL nSt := 55
LOCAL oImg
LOCAL cFile := ".\bmps\ScUser.jpg"
oVar[ 1 ] := space(15)
oVar[ 2 ] := space(40)
oVar[ 3 ] := space(15)
DEFINE BRUSH oBrush COLOR nRGB( 255, 255, 255 )
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-12 BOLD
DEFINE DIALOG oDlg SIZE 525, 250 brush oBrush FONT oFont
oDlg:lTransparent := .t.
oDlg:cTitle := "SysCtrl Connection:"
@ 0,1 XIMAGE oImg filename cFile SIZE 70,70 NOBORDER OF oDlg
@ 10, nCol SAY "Clave Usuario :" OF oDlg pixel
@ 10, nCol+nSt GET oGet[ 1] VAR oVar[ 1 ] of oDlg SIZE 60, 12 PICTURE "@!k" PIXEL ;
VALID ( ChkUser1( oVar, oGet, oSay1 ) )
@ 25, nCol SAY "Nombre :" OF oDlg pixel
@ 25, nCol+nSt GET oGet[ 2] VAR oVar[ 2 ] of oDlg SIZE 120, 12 PICTURE "@!k" PIXEL
@ 40, nCol SAY FWString("Password:") OF oDlg pixel
@ 40, nCol+nSt GET oGet[ 3] VAR oVar[ 3 ] of oDlg SIZE 60, 12 PICTURE "@!k" ;
PIXEL PASSWORD
@ 85, 80 BTNBMP oBtn[1] PROMPT "Connect" SIZE 50, 30 OF oDlg ;
ACTION ( lVal := .t. , oDlg:end() ) RESOURCE "ACEPTAR" PIXEL TOP FLAT
@ 85, 145 BTNBMP oBtn[2] PROMPT "Cancel" SIZE 50, 30 OF oDlg ;
ACTION ( lVal := .f. , oDlg:end() ) CANCEL RESOURCE "CANCELAR" PIXEL TOP FLAT
oDlg:lHelpIcon := .f.
ACTIVATE DIALOG oDlg CENTERED ON INIT oGet[1]:SetFocus()
IF lVal
lVal := .f.
oQry := hMain["server"]:Query( "SELECT * FROM users WHERE user=" + C_SIMPLE + alltrim( oVar[ 1 ] ) + C_SIMPLE )
cClave1 := decrypt( oQry:FieldGet('pasw1') )
nRows := oQry:RecCount()
IF nRows=0
lVal := .f.
ENDIF
/*
if cstr2(cClave1) == cstr2(oVar[3])
lVal := .t.
endif
*/
oQry:end()
ENDIF
RETURN ( lVal )
FUNCTION ChkUser1( oVar, oGet, oSay1 )
LOCAL nRows, oQry
IF Empty( oVar[ 1 ] )
RETURN .t.
ENDIF
oQry := hMain["server"]:Query( "SELECT * FROM users WHERE user=" + C_SIMPLE + alltrim( oVar[ 1 ] ) + C_SIMPLE )
nRows := oQry:RecCount()
IF nRows > 0 //ya existe
oVar[2] := oQry:FieldGet('username')
hMain["user"] := oVar[1]
hMain["username"] := oVar[2]
hMain["admin"] := oQry:FieldGet('admin')
oGet[2]:disable()
oGet[2]:Refresh()
ENDIF
oQry:END()
oQry := NIL
RETURN( .T. )
FUNCTION CATALOGOUSUARIOS()
RETURN (.T.)
STATIC FUNCTION ExitTo( cExe )
IF File( cExe )
WinExec( cExe )
WndMain():End()
ELSE
MsgInfo( cExe + " not found" )
ENDIF
RETURN NIL
INIT PROCEDURE ScSets()
HB_GCALL( .F. )
/*
// Para establecer código de página a Español (Ordenación, etc..)
REQUEST HB_CODEPAGE_ESWIN
REQUEST HB_LANG_ES
HB_LANGSELECT( 'ES' )
*/
HB_LANGSELECT( 'PT' ) // Default language is now Portuguese
HB_SETCODEPAGE( "PT850" )
RDDSETDEFAULT("DBFCDX")
SET CENTURY ON
SET DATE BRITISH
SET TIME FORMAT TO "HH:MM:SS"
SET EPOCH TO YEAR( DATE() ) - 30
SET SOFTSEEK OFF
SET WRAP ON
SETCANCEL( .F. )
SET CONFIRM OFF
SET DELETED ON
SET _3DLOOK ON
SET UNIQUE OFF
SET ESCAPE OFF
SET EXACT ON
SET EXCLUSIVE OFF
SET MULTIPLE OFF
SetBalloon( .T. ) // Balloon shape required for tooltips
oSkinB = TSkinButton():New()
oSkinB:nClrBorder0_N := RGB( 249, 194, 179 )
oSkinB:nClrBorder1_N := RGB( 181, 61, 29 )
// ESTA EM: TESTSK1.PRG - VIDE: COLORS.CH - aPubGrad
// Verde Oliva... Fica good RGB(109, 135, 100) // Bordas Vermelhas.
oSkinB:aClrNormal := { { 0.2, RGB( 000, 128, 000 ), RGB( 000, 128, 000 ) }, ;
{ 0.8, RGB( 109, 135, 100 ), RGB( 109, 135, 100 ) } }
SkinButtons( oSkinB ) // MUDEI EM: 24/08/2021 - COR: VERDE OLIVA.
FW_SetUnicode( .T. )
SetGetColorFocus( CLR_LGREEN )
tGet():lDisColors := .F.
tGet():nClrTextDis := CLR_HBLUE
tGet():nClrPaneDis := CLR_SOFTYELLOW
/*
IF .NOT. File( "my_reports" )
lMkDir( "my_reports" )
ENDIF
*/
RETURN NIL
FUNCTION CIERRA_METROWIN( oWnd )
// ? [ Salida aqui - Gracias Cesar.]
IF FILE( "ENCERRA.wav" )
SndPlaySound( "ENCERRA.wav", 0 )
ENDIF
RELEASE FONT oFontLarge, oFontMed, oFontUL, oFontSmall
DbCommitAll()
DbUnLockAll()
DbCloseAll()
FreeResources()
Release All
SysRefresh()
HB_GCALL( .T. )
CLEAR MEMORY
PostQuitMessage( 0 )
QUIT
RETURN NIL
FUNCTION Empresas()
? [AQUI, EMPRESA...]
RETURN NIL
FUNCTION Configurar()
? [AQUI, CONFIGURAR...]
RETURN NIL
FUNCTION Permisos()
? [AQUI, PERMISOS...]
RETURN NIL
FUNCTION Lineas()
? [AQUI, LINEAS...]
RETURN NIL
FUNCTION Clientes()
? [AQUI, CLIENTES...]
RETURN NIL
FUNCTION Artics()
? [AQUI, ARTIGOS...]
RETURN NIL
FUNCTION Contratos()
? [AQUI, CONTRATOS...]
RETURN NIL
FUNCTION Locales()
? [AQUI, LOCALES...]
RETURN NIL
// FIN / END - kapiabafwh@gmail.com
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT( oWnd:nHeight := ScreenHeight(), oMetro:Show() )
DEFINE WINDOW oWnd TITLE cTitle MDI
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 71 guests