FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TO Cristobal
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
TO Cristobal
Posted: Tue Jan 15, 2019 03:40 PM

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

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: TO Cristobal
Posted: Tue Jan 15, 2019 07:49 PM
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 (fw): Select all Collapse
   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()
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: TO Cristobal
Posted: Wed Jan 16, 2019 08:57 AM
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 (fw): Select all Collapse
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?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: TO Cristobal
Posted: Wed Jan 16, 2019 10:13 AM
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 )
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: TO Cristobal
Posted: Wed Jan 16, 2019 11:30 AM
I tried allready , not run ok
and then make error on ttoast class line 380
nTop -= ::nYOffSet


try this test
Code (fw): Select all Collapse
#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




Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: TO Cristobal
Posted: Wed Jan 16, 2019 09:00 PM
This run for me

Code (fw): Select all Collapse
   // 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
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: TO Cristobal
Posted: Thu Jan 17, 2019 12:43 AM
Not run here
Cris do you try my test please

Code (fw): Select all Collapse
#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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: TO Cristobal
Posted: Thu Jan 17, 2019 12:47 AM
run ok now
Sorry
Code (fw): Select all Collapse
#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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion