TO Cristobal

TO Cristobal

Postby Silvio.Falconi » Tue Jan 15, 2019 3: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: TO Cristobal

Postby cnavarro » Tue Jan 15, 2019 7: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: Select all  Expand view

   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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: TO Cristobal

Postby Silvio.Falconi » Wed Jan 16, 2019 8: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: Select all  Expand view

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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: TO Cristobal

Postby cnavarro » 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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: TO Cristobal

Postby Silvio.Falconi » 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: Select all  Expand view
#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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: TO Cristobal

Postby cnavarro » Wed Jan 16, 2019 9:00 pm

This run for me

Code: Select all  Expand view


   // 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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: TO Cristobal

Postby Silvio.Falconi » Thu Jan 17, 2019 12:43 am

Not run here
Cris do you try my test please

Code: Select all  Expand view
#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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: TO Cristobal

Postby Silvio.Falconi » Thu Jan 17, 2019 12:47 am

run ok now
Sorry
Code: Select all  Expand view
#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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Antonio Linares, Google [Bot] and 79 guests