Page 1 of 2

Mark field as required

PostPosted: Wed Jul 05, 2023 2:56 pm
by INFORMAISVRB
it is possible to Mark field as mandatory

similar to one of the example image

Image
or

Image

Re: Mark field as required

PostPosted: Wed Jul 05, 2023 6:36 pm
by karinha
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.

Re: Mark field as required

PostPosted: Thu Jul 06, 2023 2:22 am
by cnavarro
Use "CUEBANNER" clause with GET object
CUEBANNER "REQUIRED"

For use clause CUEBANNER, in you RC file, include Manifest.

Re: Mark field as required

PostPosted: Thu Jul 06, 2023 7:26 am
by Marc Venken
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

Re: Mark field as required

PostPosted: Thu Jul 06, 2023 10:26 am
by INFORMAISVRB
Hello

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

Look
Image

or this way

Image

Re: Mark field as required

PostPosted: Thu Jul 06, 2023 10:28 am
by INFORMAISVRB
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.)

Re: Mark field as required

PostPosted: Thu Jul 06, 2023 11:18 am
by Antonio Linares
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

Re: Mark field as required

PostPosted: Thu Jul 06, 2023 11:31 am
by Marc Venken
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.

Re: Mark field as required

PostPosted: Thu Jul 06, 2023 1:29 pm
by Rick Lipkin
Why not use a valid clause at the end of the get statement .. like

Code: Select all  Expand view

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

Re: Mark field as required

PostPosted: Thu Jul 06, 2023 1:52 pm
by karinha
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.

Re: Mark field as required

PostPosted: Thu Jul 06, 2023 1:54 pm
by INFORMAISVRB
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

Re: Mark field as required

PostPosted: Thu Jul 06, 2023 2:25 pm
by karinha
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: Select all  Expand view

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

Re: Mark field as required

PostPosted: Thu Jul 06, 2023 3:36 pm
by Marc Venken
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.

Image

Re: Mark field as required

PostPosted: Thu Jul 06, 2023 4:09 pm
by INFORMAISVRB
exactly what I need

Re: Mark field as required

PostPosted: Fri Jul 07, 2023 2:27 pm
by karinha
Intenta ahora Márcio. Tente agora Márcio. Se não entender, pergunte.

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

abs.

Regards, saludos.