Mark field as required

Mark field as required

Postby INFORMAISVRB » Wed Jul 05, 2023 2:56 pm

it is possible to Mark field as mandatory

similar to one of the example image

Image
or

Image
INFORMAISVRB
 
Posts: 51
Joined: Tue Mar 23, 2010 12:53 pm

Re: Mark field as required

Postby karinha » Wed Jul 05, 2023 6: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
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Mark field as required

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

Re: Mark field as required

Postby Marc Venken » Thu Jul 06, 2023 7: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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Mark field as required

Postby INFORMAISVRB » 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
Image

or this way

Image
INFORMAISVRB
 
Posts: 51
Joined: Tue Mar 23, 2010 12:53 pm

Re: Mark field as required

Postby INFORMAISVRB » 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.)
INFORMAISVRB
 
Posts: 51
Joined: Tue Mar 23, 2010 12:53 pm

Re: Mark field as required

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

Re: Mark field as required

Postby Marc Venken » 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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Mark field as required

Postby Rick Lipkin » Thu Jul 06, 2023 1:29 pm

Why not use a valid clause at the end of the get statement .. like

Code: Select all  Expand view  RUN

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
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Mark field as required

Postby karinha » Thu Jul 06, 2023 1: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
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Mark field as required

Postby INFORMAISVRB » Thu Jul 06, 2023 1: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
INFORMAISVRB
 
Posts: 51
Joined: Tue Mar 23, 2010 12:53 pm

Re: Mark field as required

Postby karinha » Thu Jul 06, 2023 2: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: Select all  Expand view  RUN

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

Re: Mark field as required

Postby Marc Venken » Thu Jul 06, 2023 3: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.

Image
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1456
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Mark field as required

Postby INFORMAISVRB » Thu Jul 06, 2023 4:09 pm

exactly what I need
INFORMAISVRB
 
Posts: 51
Joined: Tue Mar 23, 2010 12:53 pm

Re: Mark field as required

Postby karinha » Fri Jul 07, 2023 2: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
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 83 guests