winexec("upg", 1)
quit
#INCLUDE "FiveWin.ch"
function Main
millisec(50)
winexec(MyApp, 1)
quit
return NIL
// C:\FWH..\SAMPLES\TUTOR09.PRG
// Modificado en: 07/10/2023
#Include "FiveWin.ch"
#Include "Directry.ch"
#Define aPubGrad {| lInvert | If( lInvert, ;
{ { 1 / 3, nRGB( 255, 253, 222 ), nRGB( 255, 231, 151 ) }, ;
{ 2 / 3, nRGB( 255, 215, 84 ), nRGB( 255, 233, 162 ) } ;
}, ;
{ { 1 / 2, nRGB( 219, 230, 244 ), nRGB( 207 - 50, 221 - 25, 255 ) }, ;
{ 1 / 2, nRGB( 201 - 50, 217 - 25, 255 ), nRGB( 231, 242, 255 ) } ;
} ) }
STATIC oWnd
STATIC lSalida := .F.
STATIC oFont, nHFont, cFont, nWFont, cFontH, oBrush, oFnt, oFont40
MEMVAR cDirPleno
FUNCTION Main()
LOCAL obar, oBmp, oIco
PRIVATE cDirPleno
HB_GCALL( .F. )
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
SET OPTIMIZE ON
SetBalloon( .T. )
SkinButtons()
cDirPleno := GETCURDIR()
IF SUBS( cDirPleno, LEN( ALLTRIM(cDirPleno ) ) , 1 ) = "\"
cDirPleno := SUBS( cDirPleno, 1 , LEN( ALLTRIM(cDirPleno ) ) - 1 )
ENDIF
LCHDIR( cDirPleno )
cFont := "Segoe UI Symbol" //"Calibri"
cFontH := -16 //-10 //-12 //-16 //-18 //-20
IF !IsWin8() .and. !IsWindows10()
cFont := "Calibri" //"Tahoma"
ENDIF
DEFINE FONT oFont NAME cFont SIZE 0, cFontH WEIGHT 300
DEFINE FONT oFont40 NAME 'Tahoma' SIZE 0, -40 BOLD
DEFINE ICON oIco FILE "..\icons\fax.ico"
DEFINE WINDOW oWnd FROM 1, 1 TO 22, 75 TITLE "Sistema Generico " ;
MENU BuildMenu() ICON oIco NOSYSMENU
DEFINE BUTTONBAR oBar _3D SIZE 40, 40 OF oWnd 2007
oBar:bClrGrad := aPubGrad
oBar:bRClicked := { || ( NIL ) } // Mouse Direito
oBar:bLClicked := { || ( NIL ) } // Mouse Esquerdo
oBar:nClrText := CLR_BLACK
oBar:Adjust()
oBar:SetFont( oFont )
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\new.bmp" FLAT ;
ACTION MsgInfo( "New" ) ;
TOOLTIP "Creates a new document" PROMPT "New" GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\open.bmp" FLAT ;
ACTION MsgInfo( cGetFile( "*.*", "Select a document to open" ) ) ;
TOOLTIP "Opens a document" WHEN .f. PROMPT "Open" GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\floppy.bmp" FLAT ;
ACTION MsgInfo( Time() ) TOOLTIP "Saves this document" PROMPT "Doc" GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\printer.bmp" FLAT ;
ACTION MsgInfo( "Prints this document" ) TOOLTIP "Print this document" ;
GROUP PROMPT "Print"
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\prop.bmp" FLAT ;
ACTION PrinterSetup() TOOLTIP "Setup the printer" PROMPT "Prop" GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\HelpInd.bmp" FLAT ;
ACTION MsgInfo( Version() ) TOOLTIP "A multiple lines" + ;
Chr( 13 ) + Chr( 10 ) + "tooltip!" GROUP PROMPT "Help"
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\Help.bmp" FLAT ;
ACTION ( lSalida := .T., DESLIGA_PROGRAM_SYS() ) ;
TOOLTIP "Shows program shutdown." ;
PROMPT "shutd" GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\Exit.bmp" FLAT ;
ACTION( oWnd:End(), CERRAR_TODO( lSalida := .T. ) ) ;
TOOLTIP "Exit this app" GROUP ;
PROMPT "Exit"
SET MESSAGE OF oWnd TO "© kapiabafwh@gmail.com - Skype: joao@pleno.com.br" ;
NOINSET CLOCK DATE KEYBOARD COLOR CLR_HBLUE, CLR_WHITE 2007 FONT oFont
DEFINE BITMAP oBmp FILENAME "..\bitmaps\sea.bmp"
oWnd:bPainted = { | hDC | BmpTiled( hDC, oWnd, oBmp ) }
ACTIVATE WINDOW oWnd MAXIMIZED ;
VALID( lSalida )
RETURN NIL
FUNCTION BuildMenu()
local oMenu
MENU oMenu
MENUITEM "Information"
MENU
MENUITEM "&About..." ;
ACTION MsgInfo( FWDESCRIPTION ) ;
FILENAME "..\bitmaps\16x16\info.bmp"
SEPARATOR
MENUITEM "&Shutdown" ;
ACTION ( lSalida := .T., DESLIGA_PROGRAM_SYS() ) ;
FILENAME "..\bitmaps\16x16\Help.bmp"
SEPARATOR
MENUITEM "&End..." ;
ACTION( oWnd:End(), CERRAR_TODO( lSalida := .T. ) ) ;
FILENAME "..\bitmaps\16x16\exit.bmp"
ENDMENU
MENUITEM "&Clients"
MENU
MENUITEM "&New..." ;
ACTION ( MsgStop( "New Clients" ),;
oWnd:Say( 5, 5, "New Clients...", "GR+/G" ) ) ;
FILENAME "..\bitmaps\16x16\faces.bmp"
MENUITEM "&Modify..." ACTION MsgInfo( "Modif. Clients" ) ;
FILENAME "..\bitmaps\edit.bmp"
MENUITEM "&Delete..." ACTION MsgAlert( "Del Clients" ) ;
FILENAME "..\bitmaps\16x16\delete.bmp"
SEPARATOR
MENUITEM "&Browse..." ACTION MsgInfo( "Browse Clients" ) ;
FILENAME "..\bitmaps\16x16\browse.bmp"
ENDMENU
MENUITEM "&Utilities"
MENU
MENUITEM "&Calculator..." ACTION WinExec( "Calc" ) ;
FILENAME "..\bitmaps\16x16\calc.bmp"
MENUITEM "&Internet..." ;
ACTION WinExec( "start iexplore www.fivetech.com", 0 ) ;
FILENAME "..\bitmaps\16x16\explorer.bmp"
ENDMENU
ENDMENU
RETURN( oMenu )
FUNCTION CERRAR_TODO()
IF FILE( "TUTOR09.LOG" )
DELETEFILE( "TUTOR09.LOG" )
ENDIF
lSalida := .F.
DbCommitAll()
DbUnLockAll()
DbCloseAll()
FreeResources()
Release All
SysRefresh()
HB_GCALL( .T. )
CLEAR MEMORY
PostQuitMessage( 0 )
QUIT
RETURN NIL
STATIC FUNCTION BmpTiled( hDC, oWnd, oBmp )
local nWidth := oWnd:nWidth(), nHeight := oWnd:nHeight()
local nRow := 0, nCol := 0, n
local nBmpWidth := oBmp:nWidth(), nBmpHeight := oBmp:nHeight()
if oBmp:hBitmap == 0
return nil
endif
while nRow < nHeight
nCol = 0
while nCol < nWidth
PalBmpDraw( hDC, nRow, nCol, oBmp:hBitmap )
nCol += nBmpWidth
end
nRow += nBmpHeight
end
RETURN NIL
// TURN OFF SYSTEM-PROGRAM
FUNCTION DESLIGA_PROGRAM_SYS() // 07/10/2023 - Joao
LOCAL Nome_Arq, nRegistro, oDlg, cMsg, cTexto
MsgRun( "Desligando o Programa... ", ;
"Por Favor, Espere! ", ;
{ | oDlg | ( DESLIGA_PROG_TUTOR09( oDlg ) ) } )
// AEVAL(DIRECTORY( "TUTOR09.BAT" ),{ |aFILE| FERASE(aFILE[F_NAME]) } )
IF .NOT. FILE( "TUTOR09.BAT" )
NOME_ARQ := FCREATE("TUTOR09.BAT")
NREGISTRO := "@ECHO OFF" ;
+ CRLF + ;
"CLS" + ;
+ CRLF + CRLF + ;
cDirPleno + "\TUTOR09 > NUL" + ;
+ CRLF + CRLF + ;
"CLS" + ;
+ CRLF + ;
"EXIT"
FWRITE( NOME_ARQ, NREGISTRO )
FCLOSE( NOME_ARQ )
ENDIF
lSalida := .F.
WinExec( "TUTOR09.BAT", 0 )
FreeResources()
SysRefresh()
DbCloseAll()
RELEASE ALL
HB_GCALL( .T. )
CLEAR MEMORY
PostQuitMessage( 0 )
__QUIT()
RETURN NIL
//-> Shows program shutdown.
FUNCTION DESLIGA_PROG_TUTOR09( oDlg )
LOCAL nFor, nStart
FOR nFor := 4 to 0 step -1
nStart = GetTickCount()
while ( GetTickCount() - nStart ) < 1000
end
oDlg:cMsg := "Aguarde, Desligando o Programa em: "+ ;
LTrim( Str( nFor ) ) + " Segundo" + ;
If( nFor > 1, "s", "" )
oDlg:Refresh()
SysRefresh()
NEXT
RETURN NIL
/*
// TUTOR09.BAT
@ECHO OFF
CLS
c:\FWH1905\samples\TUTOR09 > NUL
CLS
EXIT
*/
// FIN / END - kapiabafwh@gmail.com
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 41 guests