FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with valid email refresh btnbmp- RESOLVED
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Problem with valid email refresh btnbmp
Posted: Mon Apr 08, 2024 11:16 AM
Silvio, Master Nages' model, with few changes, works perfectly on Windows 7 32 bits with HARBOUR and XHARBOUR. Test it on Windows 10/11.

Silvio, el modelo del Maestro Nages, con pocos cambios, funciona perfectamente en Windows 7 32 bits con HARBOUR y XHARBOUR. Pruébelo en Windows 10/11
Code (fw): Select all Collapse
// C:\FWH\SAMPLES\NAGESMAI.PRG

#include "FiveWin.ch"
#include "HbCompat.ch"

STATIC preCompiled

FUNCTION SilviBtnBmp()

   LOCAL oDlg, oGet, oBtn, oFont, oSalida, oSay, cSay, cTitle, oIco
   LOCAL cEmail := Space( 40 )

   SetGetColorFocus()

   cSay   := "INGRESE UN CORREO VÁLIDO:"
   cTitle := "FIVEWIN: VALIDAR EMAIL BY SILVIO FALCONI ->" + Version()

   DEFINE ICON oIco  FILE "..\icons\sendmail.ico"
   DEFINE FONT oFont NAME "Segoe UI" SIZE 0, - 24

   DEFINE DIALOG oDlg SIZE 600, 300 PIXEL TRUEPIXEL TITLE cTitle FONT oFont  ;
      TRANSPARENT ICON oIco

   oDlg:lHelpIcon := .F.

   // Silvio: Intente ahora con Windows 10/11 En Windows 7 funciona bien.
   @ 38, 40 GET oSay VAR cSay SIZE 400, 40 PIXEL PICTURE "@K!" OF oDlg       ;
      FONT oFont UPDATE COLOR CLR_WHITE, CLR_BLACK NOBORDER WHEN( .F. )

   oSay:lBtnTransparent := .T.       // transparent button get oSay
   oSay:lAdjustBtn      := .T.       // Button Get Adjust Witdh oSay
   oSay:lDisColors      := .F.       // Deactive disable color
   oSay:nClrTextDis     := CLR_WHITE // Color text disable status
   oSay:nClrPaneDis     := CLR_BLACK // Color Pane disable status

   @  80, 40 GET oGet VAR cEmail SIZE 400, 40 PIXEL OF oDlg ;
      ON CHANGE ( oDlg:AEvalWhen(), oDlg:Update() )

   @ 200, 40 BTNBMP oBtn PROMPT "Account Invio" LEFT ;
      FILE "..\bitmaps\alphabmp\gmail.bmp", "",      ;
      "..\bitmaps\alphabmp\question.bmp", ""         ;
      SIZE 220, 60 PIXEL OF oDlg FLAT                ;
      ACTION MsgInfo( LOWER( cEmail ) )              ;
      WHEN ValidaEmail( cEmail )

   @ 200, 350 BTNBMP oSalida PROMPT "Salida" LEFT FONT oFont                 ;
      FILE "..\bitmaps\Exit.bmp" SIZE 220, 60 PIXEL OF oDlg FLAT 2007 GDIP   ;
      COLOR CLR_WHITE, CLR_BLACK ACTION( oDlg:End() )

   oSalida:cToolTip := "Salida - Exit - Cancelar"

   oSalida:bClrGrad := { |lInvert| If( lInvert, 0x60FFA54A, nARGB( 64, 0, 192, 0 ) ) }

   WITH OBJECT oSalida
      :nClrBorder := { |lInvert| If( lInvert, 0x80FFA54A, nARGB( 54, 0, 192, 0 ) ) } // CLR_BLACK //  border color
      :bColorMap  := { || { { CLR_YELLOW, CLR_BLACK } } }  // image color
   END

   oSalida:lCancel := .T.

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont

RETURN NIL

FUNCTION ValidaEmail( cEmail )

   DEFAULT preCompiled := hb_regexComp( "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$" )

RETURN .NOT. EMPTY( hb_regex( preCompiled, AllTrim( cEmail ) ) )

// FIN / END
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with valid email refresh btnbmp
Posted: Tue Apr 09, 2024 09:41 AM
karinha wrote:Silvio, Master Nages' model, with few changes, works perfectly on Windows 7 32 bits with HARBOUR and XHARBOUR. Test it on Windows 10/11.

Silvio, el modelo del Maestro Nages, con pocos cambios, funciona perfectamente en Windows 7 32 bits con HARBOUR y XHARBOUR. Pruébelo en Windows 10/11
Code (fw): Select all Collapse
// C:\FWH\SAMPLES\NAGESMAI.PRG

#include "FiveWin.ch"
#include "HbCompat.ch"

STATIC preCompiled

FUNCTION SilviBtnBmp()

   LOCAL oDlg, oGet, oBtn, oFont, oSalida, oSay, cSay, cTitle, oIco
   LOCAL cEmail := Space( 40 )

   SetGetColorFocus()

   cSay   := "INGRESE UN CORREO VÁLIDO:"
   cTitle := "FIVEWIN: VALIDAR EMAIL BY SILVIO FALCONI ->" + Version()

   DEFINE ICON oIco  FILE "..\icons\sendmail.ico"
   DEFINE FONT oFont NAME "Segoe UI" SIZE 0, - 24

   DEFINE DIALOG oDlg SIZE 600, 300 PIXEL TRUEPIXEL TITLE cTitle FONT oFont  ;
      TRANSPARENT ICON oIco

   oDlg:lHelpIcon := .F.

   // Silvio: Intente ahora con Windows 10/11 En Windows 7 funciona bien.
   @ 38, 40 GET oSay VAR cSay SIZE 400, 40 PIXEL PICTURE "@K!" OF oDlg       ;
      FONT oFont UPDATE COLOR CLR_WHITE, CLR_BLACK NOBORDER WHEN( .F. )

   oSay:lBtnTransparent := .T.       // transparent button get oSay
   oSay:lAdjustBtn      := .T.       // Button Get Adjust Witdh oSay
   oSay:lDisColors      := .F.       // Deactive disable color
   oSay:nClrTextDis     := CLR_WHITE // Color text disable status
   oSay:nClrPaneDis     := CLR_BLACK // Color Pane disable status

   @  80, 40 GET oGet VAR cEmail SIZE 400, 40 PIXEL OF oDlg ;
      ON CHANGE ( oDlg:AEvalWhen(), oDlg:Update() )

   @ 200, 40 BTNBMP oBtn PROMPT "Account Invio" LEFT ;
      FILE "..\bitmaps\alphabmp\gmail.bmp", "",      ;
      "..\bitmaps\alphabmp\question.bmp", ""         ;
      SIZE 220, 60 PIXEL OF oDlg FLAT                ;
      ACTION MsgInfo( LOWER( cEmail ) )              ;
      WHEN ValidaEmail( cEmail )

   @ 200, 350 BTNBMP oSalida PROMPT "Salida" LEFT FONT oFont                 ;
      FILE "..\bitmaps\Exit.bmp" SIZE 220, 60 PIXEL OF oDlg FLAT 2007 GDIP   ;
      COLOR CLR_WHITE, CLR_BLACK ACTION( oDlg:End() )

   oSalida:cToolTip := "Salida - Exit - Cancelar"

   oSalida:bClrGrad := { |lInvert| If( lInvert, 0x60FFA54A, nARGB( 64, 0, 192, 0 ) ) }

   WITH OBJECT oSalida
      :nClrBorder := { |lInvert| If( lInvert, 0x80FFA54A, nARGB( 54, 0, 192, 0 ) ) } // CLR_BLACK //  border color
      :bColorMap  := { || { { CLR_YELLOW, CLR_BLACK } } }  // image color
   END

   oSalida:lCancel := .T.

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont

RETURN NIL

FUNCTION ValidaEmail( cEmail )

   DEFAULT preCompiled := hb_regexComp( "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$" )

RETURN .NOT. EMPTY( hb_regex( preCompiled, AllTrim( cEmail ) ) )

// FIN / END
Regards, saludos.

NOT RUN

harbour + LAST FWH + BCC7.70

Intel(R) Xeon(R) CPU E3-1225 V2 @ 3.20GHz 3.20 GHz
Windows 10 Pro 19045.4170
Windows Feature Experience Pack 1000.19054.1000.0
ram 4,00 GB (3,88 GB utilizzabile)


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: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Problem with valid email refresh btnbmp
Posted: Tue Apr 09, 2024 01:59 PM
Sílvio, there is something wrong with your HARBOUR or FIVEWIN, check with the FiveTech team or Enrico Maria Giordano. See image of what it should look like:

Sílvio, hay algún problema con tu HARBOUR o FIVEWIN, consulta con el equipo de FiveTech o con Enrico Maria Giordano. Vea imagen de cómo debería verse:

https://imgur.com/Q94QYG4



Intente con este nuevo modelo y comente:
Code (fw): Select all Collapse
// C:\FWH\SAMPLES\NAGESMAI.PRG

#include "FiveWin.ch"
#include "HbCompat.ch"

STATIC preCompiled
STATIC lIsValid := .F.

FUNCTION SilviBtnBmp()

   LOCAL oDlg, oGet, oBtn, oFont, oSalida, oSay, cSay, cTitle, oIco
   LOCAL cEmail := Space( 40 )

   SetGetColorFocus()

   cSay   := "INGRESE UN CORREO VÁLIDO:"
   cTitle := "FIVEWIN: VALIDAR EMAIL BY SILVIO FALCONI ->" + Version()

   DEFINE ICON oIco  FILE "..\icons\sendmail.ico"
   DEFINE FONT oFont NAME "Segoe UI" SIZE 0, - 24

   DEFINE DIALOG oDlg SIZE 600, 300 PIXEL TRUEPIXEL TITLE cTitle FONT oFont  ;
      TRANSPARENT ICON oIco

   oDlg:lHelpIcon := .F.

   // Silvio: Intente ahora con Windows 10/11 En Windows 7 funciona bien.
   @ 38, 40 GET oSay VAR cSay SIZE 400, 40 PIXEL PICTURE "@K!" OF oDlg       ;
      FONT oFont UPDATE COLOR CLR_WHITE, CLR_BLACK NOBORDER WHEN( .F. )

   oSay:lBtnTransparent := .T.       // transparent button get oSay
   oSay:lAdjustBtn      := .T.       // Button Get Adjust Witdh oSay
   oSay:lDisColors      := .F.       // Deactive disable color
   oSay:nClrTextDis     := CLR_WHITE // Color text disable status
   oSay:nClrPaneDis     := CLR_BLACK // Color Pane disable status

   @  80, 40 GET oGet VAR cEmail SIZE 400, 40 PIXEL OF oDlg ;
      ON CHANGE ( oDlg:AEvalWhen(), oDlg:Update() )

   @ 200, 40 BTNBMP oBtn PROMPT "Account Invio" LEFT ;
      FILE "..\bitmaps\alphabmp\gmail.bmp", "",      ;
      "..\bitmaps\alphabmp\question.bmp", ""         ;
      SIZE 220, 60 PIXEL OF oDlg FLAT                ;
      ACTION MsgInfo( LOWER( cEmail ) )              ;
      WHEN ValidaEmail( cEmail )

   oBtn:cToolTip := "Account Invio"

   @ 200, 350 BTNBMP oSalida PROMPT "Salida" LEFT FONT oFont                 ;
      FILE "..\bitmaps\Exit.bmp" SIZE 220, 60 PIXEL OF oDlg FLAT 2007 GDIP   ;
      COLOR CLR_WHITE, CLR_BLACK ACTION( oDlg:End() )

   oSalida:cToolTip := "Salida - Exit - Cancelar"

   oSalida:bClrGrad := { |lInvert| If( lInvert, 0x60FFA54A, nARGB( 64, 0, 192, 0 ) ) }

   WITH OBJECT oSalida
      :nClrBorder := { |lInvert| If( lInvert, 0x80FFA54A, nARGB( 54, 0, 192, 0 ) ) } // CLR_BLACK //  border color
      :bColorMap  := { || { { CLR_YELLOW, CLR_BLACK } } }  // image color
   END

   oSalida:lCancel := .T.

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont

RETURN NIL

FUNCTION ValidaEmail( cEmail )

   // DEFAULT preCompiled := hb_regexComp( "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$" )
   // LOCAL cRegEx := "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$"
   LOCAL cRegEx := "^[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$"
   // LOCAL cRegEx := hb_regexComp("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$")
   // LOCAL cRegEx := "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$"
   LOCAL cEmailSivio

   cEmailSivio := cEmail

   IF GETASYNCKEY( VK_UP )
      RETURN( .F. )
   ENDIF

   IF EMPTY( cEmailSivio )
      RETURN( .F. )
   ENDIF

   #IFDEF __XHARBOUR__

   // XHARBOUR
   IF ( ALLTRIM(LOWER( cEmailSivio ) ) LIKE cRegEx )

   #ELSE

   // HARBOUR:
   IF ( HB_REGEXLIKE( ( cRegEx ), ( ALLTRIM(LOWER( cEmailSivio ) ) ) ) )

   #ENDIF

      lIsValid := .T.

   ENDIF

   IF( lIsValid )

      RETURN .NOT. EMPTY( hb_regex( cRegEx, AllTrim( cEmail ) ) )

   ENDIF

RETURN( lIsValid )

// FIN / END
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problem with valid email refresh btnbmp
Posted: Fri Apr 12, 2024 06:03 AM
nageswaragunupudi wrote:Try
Code (fw): Select all Collapse
function SilviBtnBmp()

   local oDlg, oGet, oBtn, oFont
   local cEmail      := Space( 40 )

   SetGetColorFocus()

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-24
   DEFINE DIALOG oDlg SIZE 600,300 PIXEL TRUEPIXEL FONT oFont

   @  40,40 GET oGet VAR cEmail SIZE 400,40 PIXEL OF oDlg ;
      ON CHANGE ( oDlg:AEvalWhen(), oDlg:Update() )

   @ 120,40 BTNBMP oBtn PROMPT "Account Invio" LEFT ;
      FILE "..\bitmaps\alphabmp\gmail.bmp", "", ;
           "..\bitmaps\alphabmp\question.bmp", "" ;
      SIZE 220,60 PIXEL OF oDlg FLAT ;
      ACTION MsgInfo( cEmail ) ;
      WHEN ValidaEmail( cEmail )

//   oBtn:lDisColor := .f.

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil

function validaEmail(cEmail)

   static preCompiled

   DEFAULT preCompiled := hb_regexComp("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$")

return !Empty( hb_regex( preCompiled, alltrim( cEmail ) ) )
working fine here
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem with valid email refresh btnbmp
Posted: Fri Apr 12, 2024 06:19 AM

Can any other friends also test this program and let us know if it is working for them.

Regards



G. N. Rao.

Hyderabad, India
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
Re: Problem with valid email refresh btnbmp
Posted: Fri Apr 12, 2024 06:33 AM

Hi Friends,

I have tested the Antonio's above code with:

Win11,

FWH 2310,

xHarbour 1.3.1 Lastest Build,

BCC760

And it is working as intended.

-Ramesh Babu

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem with valid email refresh btnbmp
Posted: Fri Apr 12, 2024 06:55 AM

Just now, I requested Mr. Anser KK also to help testing.

He tested with FWH2307 and informed that the program is NOT working with FWH2307

So, Mr. Silvio

Let me test with FWH2307 and get back to you.

Also let me know the FWH version you are using.

Thanks

Regards



G. N. Rao.

Hyderabad, India
Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: Problem with valid email refresh btnbmp
Posted: Fri Apr 12, 2024 07:41 AM
nageswaragunupudi wrote:Can any other friends also test this program and let us know if it is working for them.
Dear Rao,

Test code from Antonio.
working fine for 32bit.
  • Win11 home/pro
    FWH2402
    Harbour 3.2
    Bcc77
Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with valid email refresh btnbmp
Posted: Fri Apr 12, 2024 08:04 AM
nageswaragunupudi wrote:Just now, I requested Mr. Anser KK also to help testing.
He tested with FWH2307 and informed that the program is NOT working with FWH2307

So, Mr. Silvio
Let me test with FWH2307 and get back to you.
Also let me know the FWH version you are using.
Thanks

Dear Rao,

I'using the last fwh release "FWH 24.02" (FW_VersionNo 24021)

Harbour Compiler version: Harbour 3.2.0dev (r2403071241)
C compiler version: Borland/Embarcadero C++ 7.7 (32-bit)
Windows 10 64 Bits, version: 6.2, Build 9200


I'allready tested with
#define FWVERSION "FWH 23.10"
#define FW_VersionNo 23101
Compiler version: Harbour 3.2.0dev (r2008190002)
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)

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: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with valid email refresh btnbmp- RESOLVED
Posted: Sun Apr 14, 2024 06:44 PM
After raising awareness of Antonio Linares and Nageswarao, after I went crazy thinking what it could be, i.e. why the Nageswarao test worked well for everyone and not on my computers, I remembered that many years ago I had the same problem but with the hb_regxxxxxxxx functions, I went to look for the test and I saw that a library was missing, I was hoping that this was the error and in fact it was for that library that was missing and I immediately notified Antonio Linares and I hope that Nageswarao reads this message.
The missing library was hb_pCre.lib as can be seen from the figure below.

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: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problem with valid email refresh btnbmp- RESOLVED
Posted: Sun Apr 14, 2024 07:49 PM
Very good that it got solved :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion