Problem with valid email refresh btnbmp- RESOLVED

User avatar
karinha
Posts: 7884
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: Problem with valid email refresh btnbmp

Post by karinha »

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 _, funciona perfectamente en Windows 7 32 bits con HARBOUR y XHARBOUR. Pruébelo en Windows 10/11

Code: Select all | Expand

// 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
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with valid email refresh btnbmp

Post by Silvio.Falconi »

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 _, funciona perfectamente en Windows 7 32 bits con HARBOUR y XHARBOUR. Pruébelo en Windows 10/11

Code: Select all | Expand

// 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)


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
karinha
Posts: 7884
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: Problem with valid email refresh btnbmp

Post by karinha »

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

Image

Intente con este nuevo modelo y comente:

Code: Select all | Expand

// 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
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Problem with valid email refresh btnbmp

Post by Antonio Linares »

nageswaragunupudi wrote:Try

Code: Select all | Expand

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 ) ) )
Image
working fine here
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Problem with valid email refresh btnbmp

Post by nageswaragunupudi »

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

G. N. Rao.
Hyderabad, India
User avatar
RAMESHBABU
Posts: 626
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Re: Problem with valid email refresh btnbmp

Post by RAMESHBABU »

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
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Problem with valid email refresh btnbmp

Post by nageswaragunupudi »

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
User avatar
richard-service
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan
Contact:

Re: Problem with valid email refresh btnbmp

Post by richard-service »

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
Last edited by richard-service on Fri Apr 12, 2024 8:07 am, edited 1 time in total.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
Silvio.Falconi
Posts: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with valid email refresh btnbmp

Post by Silvio.Falconi »

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)

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: 7104
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with valid email refresh btnbmp- RESOLVED

Post by Silvio.Falconi »

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.

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
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Problem with valid email refresh btnbmp- RESOLVED

Post by Antonio Linares »

Very good that it got solved :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply