FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FWH 2102: GET Upper, Lower, Proper Cases
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

FWH 2102: GET Upper, Lower, Proper Cases

Posted: Sat Mar 06, 2021 11:52 AM
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 (fw): Select all Collapse
#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

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


Regards



G. N. Rao.

Hyderabad, India
Posts: 607
Joined: Mon Mar 04, 2013 04:32 PM

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

Posted: Sat Mar 06, 2021 01:02 PM

Hi Mr. Rao.

Very useful

also works with REDEFINEs ?

Thanks.

Jose.

Fwh 24.07 64 bits + Harbour 64 bits 3.2dev(r2407221137) + MSVC64
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

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

Posted: Sat Mar 06, 2021 01:34 PM

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.

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

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

Posted: Sat Mar 06, 2021 03:42 PM

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.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion