Page 1 of 1

TO Cristobal

Posted: Tue Jan 15, 2019 3:40 pm
by Silvio.Falconi
Dear Cristobal,
Can Know how create a single line toast easy ?
(because I not urdestood and there is not the sample on folder samples you showed me but only th eoldest sample toasttest.prg)

thanks

Re: TO Cristobal

Posted: Tue Jan 15, 2019 7:49 pm
by cnavarro
Silvio.Falconi wrote:Dear Cristobal,
Can Know how create a single line toast easy ?
(because I not urdestood and there is not the sample on folder samples you showed me but only th eoldest sample toasttest.prg)

thanks


Try with this

Code: Select all | Expand


   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, lAlert, lShadow,;
   //  

   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:lBtnClose  := .F.
   oTip:ActivaAlert()
 

Re: TO Cristobal

Posted: Wed Jan 16, 2019 8:57 am
by Silvio.Falconi
To simplify I created a simple function but I have problems because I can not find the command to draw the box to certain coordinates x, y


MessageToast( 1, "Message Success Action",;
"c:\work\fwh\bitmaps\16x16\alert.bmp",;
400, 40, oDlg, CLR_GREEN, CLR_WHITE, ;
CLR_WHITE, , , , , , , .t.)




Code: Select all | Expand


MessageToast( 1, "Message Success Action",;
                 "c:\work\fwh\bitmaps\16x16\alert.bmp",;
                 400, 40, oDlg, CLR_GREEN, CLR_WHITE, ;
                 CLR_WHITE, , , , , , , .t.)


 Function   MessageToast( nType, cText, cBmp, nWidth, nHeight, oWnd, nClrPane, nClrPane2, ;
                 nClrText, nLev, nTime, lUp, bRet, lLeftP, lAlert, lShadow)
                // nOffY, nOffX, nFont )

   local oTip
   local bInit

   DEFAULT lLeftP   := .T.
   DEFAULT lUp      := .T.
   DEFAULT nType    := 1
   DEFAULT lAlert   := .F.
   DEFAULT lShadow  := .T.
   DEFAULT nLev     := 255
   DEFAULT nTime    := 4000


      oTip := TToast():NewToast( nType, cText, cBmp,;
                                 nWidth, nHeight, oWnd,;
                                 nClrPane, nClrPane2, nClrText,;
                                 nLev, nTime, lUp, , lLeftP)

   oTip:nWRadio    := 6
   oTip:nHRadio    := 6
   oTip:lBtnClose  := .f.
   oTip:lBtnSetup  := .f.
   oTip:bValid     := { || TipTransHide( oTip ), .T. }

   oTip:ActivaAlert()

return nil
 


I saw that there are parameters

DEFAULT lLeftP: = .f.
DEFAULT lUp: = .T.

so I can draw at the corners of the window
but if I would like to draw the box at certain coordinates how should I do?

Re: TO Cristobal

Posted: Wed Jan 16, 2019 10:13 am
by cnavarro
Try with parameters nOffY and nOffX

MessageToast( nType, cText, cBmp, nWidth, nHeight, oWnd, nClrPane, nClrPane2, ;
nClrText, nLev, nTime, lUp, bRet, lLeftP, lAlert, lShadow, ;
nOffY, nOffX, nFont )

Re: TO Cristobal

Posted: Wed Jan 16, 2019 11:30 am
by Silvio.Falconi
I tried allready , not run ok
and then make error on ttoast class line 380
nTop -= ::nYOffSet


try this test

Code: Select all | Expand

#include "fivewin.ch"

Function TestInvoice()

Local oDlg,oFont

 DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
 DEFINE DIALOG oDlg SIZE 878, 570 PIXEL TRUEPIXEL RESIZABLE FONT oFont ;
   TITLE "Services"


 @ 10,10 button "test" SIZE 40,18 PIXEL;
 ACTION MessageToast( 1, "Message Success Action",;
                 "c:\work\fwh\bitmaps\16x16\alert.bmp",;
                 400, 40, oDlg, CLR_GREEN, CLR_WHITE, ;
                 CLR_WHITE, , , , , , , .t.,100,100) OF oDLG


 oDlg:aMinMaxInfo := { nil, nil, nil, nil, 878, 570, nil, nil } //878, 570

 ACTIVATE DIALOG oDlg CENTERED
         *  ON INIT
   RELEASE FONT oFont

return nil
//--------------------------------------------------------------------//




 Function   MessageToast( nType, cText, cBmp, nWidth, nHeight, oWnd, nClrPane, nClrPane2, ;
                 nClrText, nLev, nTime, lUp, bRet, lLeftP, lAlert, lShadow,;
                  nOffY, nOffX, nFont )

   local oTip
   local bInit

   DEFAULT lLeftP   := .f.
   DEFAULT lUp      := .T.
   DEFAULT nType    := 1
   DEFAULT lAlert   := .F.
   DEFAULT lShadow  := .T.
   DEFAULT nLev     := 255
   DEFAULT nTime    := 4000
   DEFAULT nOffY     := 0
   DEFAULT nOffX     := 0
   DEFAULT nFont     := -12

      oTip := TToast():NewToast( nType, cText, cBmp,;
                                 nWidth, nHeight, oWnd,;
                                 nClrPane, nClrPane2, nClrText,;
                                 nLev, nTime, lUp, , lLeftP,lAlert, lShadow,;
                                 nOffY, nOffX, nFont)

   oTip:nWRadio    := 6
   oTip:nHRadio    := 6
   oTip:lBtnClose  := .f.
   oTip:lBtnSetup  := .f.
   oTip:bValid     := { || TipTransHide( oTip ), .T. }

   oTip:ActivaAlert()

return nil

 




Image

Re: TO Cristobal

Posted: Wed Jan 16, 2019 9:00 pm
by cnavarro
This run for me

Code: Select all | Expand



   // oTip := TToast():NewToast( nToast, cText, cBmp, nWidth, nHeight, oWnd, nClrPane, ;
   //                  nClrPane2, nClrText, nLev, nTime, lUp, bRet, lLeft, lAlert, lShadow,;
   //                  nOffY, nOffX )

   cText   := "Message Success Action"
   oTip := TToast():NewToast( nType, cText, cBmp, 400, 40, oWnd, ;
               CLR_BLUE, , CLR_WHITE, 255, 4000, lUp, , lLeft, , , 250, -100 )

 


Try with values positive and negative and revise order parameters

Re: TO Cristobal

Posted: Thu Jan 17, 2019 12:43 am
by Silvio.Falconi
Not run here
Cris do you try my test please

Code: Select all | Expand

#include "fivewin.ch"

Function TestInvoice()

Local oDlg,oFont

 DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
 DEFINE DIALOG oDlg SIZE 878, 570 PIXEL TRUEPIXEL RESIZABLE FONT oFont ;
   TITLE "Services"


 @ 10,10 button "test" SIZE 40,18 PIXEL;
 ACTION MessageToast( 1, "Message Success Action",;
                 "c:\work\fwh\bitmaps\16x16\alert.bmp",;
                 400, 40, oDlg, CLR_GREEN, CLR_WHITE, ;
                 CLR_WHITE, , , , , , , .t.,250, -100) OF oDLG


 oDlg:aMinMaxInfo := { nil, nil, nil, nil, 878, 570, nil, nil } //878, 570

 ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil
//--------------------------------------------------------------------//




 Function   MessageToast( nType, cText, cBmp, nWidth, nHeight, oWnd, nClrPane, nClrPane2, ;
                 nClrText, nLev, nTime, lUp, bRet, lLeftP, lAlert, lShadow,;
                  nOffY, nOffX, nFont )

   local oTip
   local bInit

   DEFAULT lLeftP   := .f.
   DEFAULT lUp      := .T.
   DEFAULT nType    := 1
   DEFAULT lAlert   := .F.
   DEFAULT lShadow  := .T.
   DEFAULT nLev     := 255
   DEFAULT nTime    := 4000
   DEFAULT nOffY     := 0
   DEFAULT nOffX     := 0
   DEFAULT nFont     := -12

     oTip := TToast():NewToast( nType, cText, cBmp,;
                                 nWidth, nHeight, oWnd,;
                                 nClrPane, nClrPane2, nClrText,;
                                 nLev, nTime, lUp, , lLeftP,lAlert, lShadow,;
                                 nOffY, nOffX, nFont)

   oTip:nWRadio    := 6
   oTip:nHRadio    := 6
   oTip:lBtnClose  := .f.
   oTip:lBtnSetup  := .f.
   oTip:bValid     := { || TipTransHide( oTip ), .T. }

   oTip:ActivaAlert()

return nil

 

Re: TO Cristobal

Posted: Thu Jan 17, 2019 12:47 am
by Silvio.Falconi
run ok now
Sorry

Code: Select all | Expand

#include "fivewin.ch"

Function TestInvoice()

Local oDlg,oFont

 DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
 DEFINE DIALOG oDlg SIZE 878, 570 PIXEL TRUEPIXEL RESIZABLE FONT oFont ;
   TITLE "Services"


 @ 10,10 button "test" SIZE 40,18 PIXEL;
 ACTION MessageToast( 1, "Message Success Action",;
                 "c:\work\fwh\bitmaps\16x16\alert.bmp",;
                 400, 40, oDlg, CLR_GREEN, CLR_WHITE, ;
                 CLR_WHITE, , , , , , , .t.,-250, 100) OF oDLG


 oDlg:aMinMaxInfo := { nil, nil, nil, nil, 878, 570, nil, nil } //878, 570

 ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil
//--------------------------------------------------------------------//




 Function   MessageToast( nType, cText, cBmp, nWidth, nHeight, oWnd, nClrPane, nClrPane2, ;
                 nClrText, nLev, nTime, lUp, bRet, lLeftP, lAlert, lShadow,;
                  nOffY, nOffX, nFont )

   local oTip
   local bInit

   DEFAULT lLeftP   := .t.
   DEFAULT lUp      := .T.
   DEFAULT nType    := 1
   DEFAULT lAlert   := .F.
   DEFAULT lShadow  := .T.
   DEFAULT nLev     := 255
   DEFAULT nTime    := 4000
   DEFAULT nOffY     := 0
   DEFAULT nOffX     := 0
   DEFAULT nFont     := -12
       /*
     oTip := TToast():NewToast( nType, cText, cBmp,;
                                 nWidth, nHeight, oWnd,;
                                 nClrPane, nClrPane2, nClrText,;
                                 nLev, nTime, lUp, , lLeftP,lAlert, lShadow,;
                                 nOffY, nOffX, nFont)
                                  */


   oTip := TToast():NewToast( nType, cText, cBmp, 400, 40, oWnd, ;
               CLR_BLUE, , CLR_WHITE, nLev, nTime, lUp, , lLeftp, , , nOffY, nOffX )



   oTip:nWRadio    := 6
   oTip:nHRadio    := 6
   oTip:lBtnClose  := .f.
   oTip:lBtnSetup  := .f.
   oTip:bValid     := { || TipTransHide( oTip ), .T. }

   oTip:ActivaAlert()

return nil

 



However, if you move the window or the dialog the toast is another window in itself and not related to the dialog instead
what I had seen on a program was like a control object of the dialog

instead ttoast is an entity unrelated to the dialog and implies that if the dialog is enlarged the message created with the ttoast class will never be where you told him to stay