Page 1 of 1

FWH 2102: GET Upper, Lower, Proper Cases

PostPosted: Sat Mar 06, 2021 11:52 am
by nageswaragunupudi
FWH 2102 introduces a new clause "CASE UPPER/LOWER/PROPER" to the GET command.

As we know, picture clause "@!" forces data entry to upper case. Instead, we can also use "CASE UPPER" clause. Or we can use CASE LOWER or CASE PROPER to force Lower or Proper case.

This clause applies to ANSI character gets created from source. If picture clause specified contains "!", the picture clause takes precedence and this clause is ignored.

The following sample demostrates use of CASE UPPER,LOWER and PROPER.
Code: Select all  Expand view

#include "fivewin.Ch"

//------------------------------------------------------------------//

function Main()

   local oDlg, oFont
   local aData := { space( 40 ), space( 40 ), space( 40 ) }
   local aGet[ 3 ]

   SetGetColorFocus()

   DEFINE FONT oFont NAME "Segoe UI Semibold" SIZE 0,-16
   DEFINE DIALOG oDlg SIZE 540,250 PIXEL TRUEPIXEL FONT oFont ;
      TITLE FWVERSION + " : GET Upper,Lower,Proper Cases"

   @  30,30 SAY " Upper Case :"  WIDTH 100 GET aGet[ 1 ] VAR aData[ 1 ] SIZE 450,32 PIXEL OF oDlg CASE UPPER
   @  65,30 SAY " Lower Case :"  WIDTH 100 GET aGet[ 2 ] VAR aData[ 2 ] SIZE 450,32 PIXEL OF oDlg CASE LOWER
   @ 100,30 SAY " Proper Case :" WIDTH 100 GET aGet[ 3 ] VAR aData[ 3 ] SIZE 450,32 PIXEL OF oDlg CASE PROPER

   @ 170,30 BTNBMP PROMPT "Show Vars" SIZE 200,40 PIXEL OF oDlg FLAT ACTION ( msginfo( FW_ArrayAsList( aData,,.t. ) ) )

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil

//------------------------------------------------------------------//
 


Image

Re: FWH 2102: GET Upper, Lower, Proper Cases

PostPosted: Sat Mar 06, 2021 1:02 pm
by jvtecheto
Hi Mr. Rao.

Very useful

also works with REDEFINEs ?

Thanks.

Jose.

Re: FWH 2102: GET Upper, Lower, Proper Cases

PostPosted: Sat Mar 06, 2021 1:34 pm
by nageswaragunupudi
In the case of REDEFINEs, the right place to define upper/lower case is the RC file. Please add the styles ES_UPPERCASE or ES_LOWERCASE in the rc file for the Gets you want.

The only thing we can provide for REDEFINEs is Proper case. That is not done till now. Probably we will incorporate it by the time we release the version.

Re: FWH 2102: GET Upper, Lower, Proper Cases

PostPosted: Sat Mar 06, 2021 3:42 pm
by nageswaragunupudi
For GETs created from RESOURCES:

1) Using Picture clause "@!" forces Upper Case.
2) Using styles ES_UPPERCASE or ES_LOWERCASE in the RC file forces Upper or Lower case as per the style.
3) If both ES_UPPERCAE and ES_LOWERCASE are specified in the RC file, ES_LOWERCASE takes precedence.
4) If ES_LOWERCASE is specified in the RC file, it overrides the picture clause "@!"
5) oGet:SetStyle( "UPPER" / "LOWER"/ "PROPER" ) can be used to force Upper,Lower or Proper cases.
6) oGet:SetStyle() over-rides the Style specified in the RC file, only if this method is called in the ON INIT clause of the dialog.