//----------------------------------------------------------------------------//
Function HazAlert204( oWnd, nType )
local oTip
local cText
local cBmp := "..\bitmaps\16x16\alert.bmp"
local lLeft := .T.
local lUp := .T.
DEFAULT nType := 1
// oTip := TToast():NewToast( nToast, cText, cBmp, nWidth, nHeight, oWnd, nClrPane, ;
// nClrPane2, nClrText, nLev, nTime, lUp, bRet, lLeft )
cText := "Message Success Action"
oTip := TToast():NewToast( nType, cText, cBmp, 400, 40, oWnd, ;
CLR_BLUE, , CLR_WHITE, 255, 4000, !lUp, , lLeft )
oTip:nWRadio := 6
oTip:nHRadio := 6
oTip:ActivaAlert( oWnd )
// nTime = -1, no timer active, and user close alert with button X
Syswait( 1.0 )
cText := "Message Error Action"
oTip := TToast():NewToast( nType, cText, cBmp, 400, 40, oWnd, ;
CLR_RED, , CLR_WHITE, 255, -1, !lUp, , !lLeft )
oTip:nWRadio := 6
oTip:nHRadio := 6
oTip:ActivaAlert( oWnd )
Syswait( 1.0 )
cText := "Message Attention User"
oTip := TToast():NewToast( nType, cText, cBmp, 400, 40, oWnd, ;
CLR_HBLUE, , CLR_WHITE, 255, 4000, lUp, , !lLeft )
oTip:nWRadio := 6
oTip:nHRadio := 6
oTip:lBtnClose := .F.
oTip:lBtnSetup := .F.
oTip:ActivaAlert( oWnd )
Syswait( 1.0 )
cText := "Message Received"
oTip := TToast():NewToast( nType, cText, cBmp, 400, 40, oWnd, ;
CLR_GREEN, , CLR_WHITE, 255, 4000, lUp, , lLeft )
oTip:nWRadio := 6
oTip:nHRadio := 6
oTip:lBtnClose := .F.
oTip:lBtnSetup := .F.
oTip:ActivaAlert( oWnd )
Return oTip
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
Function HazAlert204( oWnd, nType )
local oTip
local bInit
local cText
local cBmp := "..\bitmaps\16x16\alert.bmp"
local lLeft := .T.
local lUp := .T.
DEFAULT nType := 1
// oTip := TToast():NewToast( nToast, cText, cBmp, nWidth, nHeight, oWnd, nClrPane, ;
// nClrPane2, nClrText, nLev, nTime, lUp, bRet, lLeft )
cText := "Message Success Action"
oTip := TToast():NewToast( nType, cText, cBmp, 400, 40, oWnd, ;
CLR_BLUE, , CLR_WHITE, 255, 4000, !lUp, , lLeft )
oTip:nWRadio := 6
oTip:nHRadio := 6
oTip:ActivaAlert( oWnd )
Syswait( 1.0 )
cText := "Message Error Action"
oTip := TToast():NewToast( nType, cText, cBmp, 400, 40, oWnd, ;
CLR_RED, , CLR_WHITE, 255, 4000, !lUp, , !lLeft )
oTip:nWRadio := 6
oTip:nHRadio := 6
oTip:ActivaAlert( oWnd )
Syswait( 1.0 )
cText := "Message Attention User"
oTip := TToast():NewToast( nType, cText, cBmp, 400, 40, oWnd, ;
CLR_HBLUE, , CLR_WHITE, 255, 4000, lUp, , !lLeft )
oTip:nWRadio := 6
oTip:nHRadio := 6
oTip:lBtnClose := .F.
oTip:lBtnSetup := .F.
oTip:ActivaAlert( oWnd )
Syswait( 1.0 )
cText := "Message Received"
oTip := TToast():NewToast( nType, cText, cBmp, 400, 40, oWnd, ;
CLR_GREEN, , CLR_WHITE, 255, 4000, lUp, , lLeft )
oTip:nWRadio := 6
oTip:nHRadio := 6
oTip:lBtnClose := .F.
oTip:lBtnSetup := .F.
//oTip:bValid := { || TipTransHide( oTip ), .T. } // Only Hide slowly
oTip:bValid := { || TipTransFlicker( oTip ), .T. } // Flicker slowly at end
oTip:ActivaAlert( oWnd )
Return oTip
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
#define LWA_ALPHA 2
//----------------------------------------------------------------------------//
static function TipTransFlicker( oObj )
TipTransHide( oObj )
TipTransShow( oObj )
TipTransHide( oObj )
return NIL
//----------------------------------------------------------------------------//
static function TipTransHide( oObj )
local x
for x = oObj:nLevel to 0 step -1
SetLayeredWindowAttributes( oObj:hWnd, , x, LWA_ALPHA )
SysWait( 0.0003 )
next x
return NIL
//----------------------------------------------------------------------------//
static function TipTransShow( oObj )
local x
for x = 1 to oObj:nLevel
SetLayeredWindowAttributes( oObj:hWnd, , x, LWA_ALPHA )
SysWait( 0.0003 )
next x
return NIL
//----------------------------------------------------------------------------//
#include "FiveWin.Ch"
#include "constant.ch"
#define LWA_ALPHA 2
Function ShowInvoice()
Local nBottom := 47.2
Local nRight := 147.4
Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 )
Local nHeight := nBottom * DLG_CHARPIX_H
DEFINE DIALOG oDlg SIZE nWidth, nHeight PIXEL ;
TITLE "Prenotazione n. "
ACTIVATE DIALOG oDlg CENTERED;
on init Message(oDlg)
//------------------------------------------------//
Function Message(oDlg)
Local cText := "Message Received"
Local nType := 1
Local cBmp := "c:\work\fwh\bitmaps\16x16\check.bmp"
local lUp := .T.
local lLeft := .T.
Local oTip
oTip := TToast():NewToast( nType, cText, cBmp, 400, 40, oDlg, ;
CLR_GREEN, , CLR_WHITE, 255, 4000, lUp, , lLeft )
oTip:nWRadio := 6
oTip:nHRadio := 6
oTip:lBtnClose := .F.
oTip:lBtnSetup := .F.
oTip:bValid := { || TipTransFlicker( oTip ), .T. }
oTip:ActivaAlert( oDlg )
return nil
static function TipTransFlicker( oObj )
TipTransHide( oObj )
TipTransShow( oObj )
TipTransHide( oObj )
return NIL
//----------------------------------------------------------------------------//
static function TipTransHide( oObj )
local x
for x = oObj:nLevel to 0 step -1
SetLayeredWindowAttributes( oObj:hWnd, , x, LWA_ALPHA )
SysWait( 0.0003 )
next x
return NIL
static function TipTransShow( oObj )
local x
for x = 1 to oObj:nLevel
SetLayeredWindowAttributes( oObj:hWnd, , x, LWA_ALPHA )
SysWait( 0.0003 )
next x
return NIL
.../...
nBottom := nTop + nHeight
nRight := nLeft + nWidth
if ::lAlert
// Add this
if !Empty( ::oWndEvent )
aPoint := ClientToScreen( ::oWndEvent:hWnd, { nTop, nLeft } )
aPoint := ScreenToClient( ::hWnd, aPoint )
nTop := aPoint[ 1 ]
nLeft := aPoint[ 2 ]
nBottom := aPoint[ 1 ] + nHeight
nRight := aPoint[ 2 ] + nWidth
endif
::Super:New( nTop, nLeft, nBottom, nRight,, nStyle,,,, ::oWndEvent,,, nClrText, nClrPane,,,,,,,.T., nStyleEx,,,)
//
endif
.../...
// and at end of method Add this
::bInit := { || Self:TToolWindow(), ;
IF( !HB_IsNIL( ::oWndEvent ), Self:oWndEvent:SetFocus(), ), ;
Self:nIT := Len( aTToast ), ;
if( Self:lHistory, Self:AddToast(), ) }
return Self
// in method ActivaAlert change this
.../...
ACTIVATE WINDOW Self // Remove clause ON INIT
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 61 guests