FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Mark field as required
Posts: 56
Joined: Tue Mar 23, 2010 12:53 PM
Mark field as required
Posted: Wed Jul 05, 2023 02:56 PM
it is possible to Mark field as mandatory

similar to one of the example image


or

Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Mark field as required
Posted: Wed Jul 05, 2023 06:36 PM

Márcio, não entendi nada. Explique melhor, ou poste a sua dúvida no fivewin Brasil com mais detalhes, não sei porquê você posta dúvidas no forum em inglês? No forum em espanhol, mesmo que você poste a dúvida em Português, muitos vão entender.

Abs.

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Mark field as required
Posted: Thu Jul 06, 2023 02:22 AM
Use "CUEBANNER" clause with GET object
CUEBANNER "REQUIRED"
For use clause CUEBANNER, in you RC file, include Manifest.
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: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Mark field as required
Posted: Thu Jul 06, 2023 07:26 AM

Where do you put the "REQUIRED" ? I get a syntax error at compiling

This is from the sample Subscript0.prg

@ nRow, nCol GET aGets[ 1 ] VAR aData[ 1, 2 ] ;

  PICTURE aData[ 1, 3 ] SIZE nWidth - nCol * 2, 15 PIXEL OF oDlg ;

  COLOR nClrTxt, CLR_WHITE CUEBANNER aData[ 1, 1 ] BOTTOMBORDER ;

  INFIELD INFONT oFontI INCLRTXT CLR_GRAY ;

  INCLRBORDER { | o | if( o:lFocused, o:nInClrLineB, nClrBox ) } ;

  INSEPH 1 INSEPV 1 ; //INWHPEN 2 ;

  INCLRLINEDIS CLR_BLUE DYNAMIC ; //GROUP

  INERROR "EMPTY VALUE NOT VALID" ;

  INCLRERROR CLR_BLUE, CLR_HGRAY
Marc Venken

Using: FWH 23.08 with Harbour
Posts: 56
Joined: Tue Mar 23, 2010 12:53 PM
Re: Mark field as required
Posted: Thu Jul 06, 2023 10:26 AM
Hello

I would like something similar, indicating that the field has to be filled in, as Indicated in red with (*)

Look


or this way

Posts: 56
Joined: Tue Mar 23, 2010 12:53 PM
Re: Mark field as required
Posted: Thu Jul 06, 2023 10:28 AM
karinha wrote:Márcio, não entendi nada. Explique melhor, ou poste a sua dúvida no fivewin Brasil com mais detalhes, não sei porquê você posta dúvidas no forum em inglês? No forum em espanhol, mesmo que você poste a dúvida em Português, muitos vão entender.

Abs.

Regards, saludos.

I already posted on the brazil forum, but I had to modify the entire GET class, I didn't think it would be feasible.
The brazil forum is slow, almost stopping.


(Já postei no forum brasil, mas tinha que modificar classe GET toda, não achei que seria viavel.
O forum do brasil tá devagar, quase parando.)
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Mark field as required
Posted: Thu Jul 06, 2023 11:18 AM

Dear Marc,

I think Cristobal means this way:

@ nRow, nCol GET aGets[ 1 ] VAR aData[ 1, 2 ] ;

PICTURE aData[ 1, 3 ] SIZE nWidth - nCol * 2, 15 PIXEL OF oDlg ;

COLOR nClrTxt, CLR_WHITE CUEBANNER "REQUIRED" BOTTOMBORDER ;

INFIELD INFONT oFontI INCLRTXT CLR_GRAY ;

INCLRBORDER { | o | if( o:lFocused, o:nInClrLineB, nClrBox ) } ;

INSEPH 1 INSEPV 1 ; //INWHPEN 2 ;

INCLRLINEDIS CLR_BLUE DYNAMIC ; //GROUP

INERROR "EMPTY VALUE NOT VALID" ;

INCLRERROR CLR_BLUE, CLR_HGRAY

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Mark field as required
Posted: Thu Jul 06, 2023 11:31 AM
Antonio Linares wrote:Dear Marc,

I think Cristobal means this way:

@ nRow, nCol GET aGets[ 1 ] VAR aData[ 1, 2 ] ;
PICTURE aData[ 1, 3 ] SIZE nWidth - nCol * 2, 15 PIXEL OF oDlg ;
COLOR nClrTxt, CLR_WHITE CUEBANNER "REQUIRED" BOTTOMBORDER ;
INFIELD INFONT oFontI INCLRTXT CLR_GRAY ;
INCLRBORDER { | o | if( o:lFocused, o:nInClrLineB, nClrBox ) } ;
INSEPH 1 INSEPV 1 ; //INWHPEN 2 ;
INCLRLINEDIS CLR_BLUE DYNAMIC ; //GROUP
INERROR "EMPTY VALUE NOT VALID" ;
INCLRERROR CLR_BLUE, CLR_HGRAY
Ok, Ik thougth that it was a Method/Data that would put a item like (*) insite the get so show it is a required field.
Marc Venken

Using: FWH 23.08 with Harbour
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Mark field as required
Posted: Thu Jul 06, 2023 01:29 PM
Why not use a valid clause at the end of the get statement .. like
Code (fw): Select all Collapse
REDEFINE GET oActive     var cActive     ID 143 Font oFontB of oGrps Valid  _ChkField( cActive,oActive) PICTURE "@!" UPDATE

//-------------------
Static Func  _CHkField( cActive,oActive )

Local Saying

If cActive = "  "
   Saying :=   "Sorry .. the Field ACTIVE is a Required field"+CRLF
   Saying += "and Can Not be left BLANK"

   MsgInfo( Saying )
    oActive:SetFocus()
    Return(.f.)
Else
    Return(.t.)
Endif

// end

Rick Lipkin
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Mark field as required
Posted: Thu Jul 06, 2023 01:52 PM
cnavarro wrote:Use "CUEBANNER" clause with GET object
CUEBANNER "REQUIRED"
For use clause CUEBANNER, in you RC file, include Manifest.
Master Navarro, I never managed to make this CUEBANNER command work properly.

Maestro Navarro, nunca logré hacer funcionar correctamente este comando CUEBANNER.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 56
Joined: Tue Mar 23, 2010 12:53 PM
Re: Mark field as required
Posted: Thu Jul 06, 2023 01:54 PM
hello

Thanks for the answer, but I wanted it to be something Visual


when looking at the dialog, already identify which fields are mandatory

Sample
http://fivewin.com.br/applications/core/interface/file/attachment.php?id=67

Link Forum Brazil
http://fivewin.com.br/index.php?/topic/21763-identificar-campo-obrigatorio-no-get/&tab=comments#comment-263637
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Mark field as required
Posted: Thu Jul 06, 2023 02:25 PM
Aunque hasta ahora no he entendido exactamente qué quiere hacer Márcio, me gustó mucho esta idea de Mister Rick Lipkin.

Although until now I haven't understood exactly what Márcio wants to do, I really liked this idea from Mister Rick Lipkin.
Code (fw): Select all Collapse
// C:\FWH..\SAMPLES\RICKBAN.PRG -> By Rick Lipkin

#include "FiveWin.ch"

FUNCTION Main()

   LOCAL oDlg, oBtn, oActive, cActive, oFont

   cActive := SPACE(40) // "TESTE DE CUEBANNER     "

   SetDlgGradient( { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } )

   DEFINE FONT oFont  NAME "Ms Sans Serif"  SIZE 00, -14 BOLD

   DEFINE DIALOG oDlg FROM 5, 5 TO 25, 40 TITLE "Testing CUEBANNER" FONT oFont

   @ 2, 2 GET oActive VAR cActive PICTURE "@!" OF oDlg SIZE 100, 12 UPDATE   ;
      VALID( ChkField( cActive, oActive ) )

   @ 06, 08 BUTTON "&Quit" OF oDlg SIZE 40,12 ACTION( oDlg:End() ) CANCEL

   ACTIVATE DIALOG oDlg CENTERED

   oFont:End()

RETURN NIL

FUNCTION CHkField( cActive, oActive )

   LOCAL Saying

   IF cActive = "  "

      Saying := "Sorry... the Field ACTIVE is a Required field" + CRLF
      Saying += "and Can Not be left BLANK"

      MsgInfo( Saying )

      // oActive:VARPUT( "Field ACTIVE is a Required" )
      // oActive:Refresh()

      oActive:SetFocus()

      RETURN( .F. )

   ELSE

      RETURN( .T. )

   ENDIF

RETURN( .T. )

// FIN / END
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Mark field as required
Posted: Thu Jul 06, 2023 03:36 PM
What he want is quit good and should be a thing inside FWH. It simple give a visual look (red stars) that these fields are needed.

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 56
Joined: Tue Mar 23, 2010 12:53 PM
Re: Mark field as required
Posted: Thu Jul 06, 2023 04:09 PM

exactly what I need

Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Mark field as required
Posted: Fri Jul 07, 2023 02:27 PM
Intenta ahora Márcio. Tente agora Márcio. Se não entender, pergunte.

https://mega.nz/file/IB8BjAgD#rUUqVQY6q-u3SPKPapsQts58BW627TYEDOuxylKQabw

abs.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341