FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Get right to leff
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Get right to leff
Posted: Fri May 11, 2018 02:34 PM

Hi,

How I can set get to show right to left? Like this:

01 Left RIGHT
02 (Default)
03
04 ., ___.___,
05 1
.___, ___.__1,
06 12_.,_ _.12,__
07 123.
, ___.123,
08 123.4__, __1.234,
09 1.234, __1.234,5_
10 __1.234,5_ __1.234,56
11 __1.234,56 __1.234,56

Thanks in advance!

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Get right to leff
Posted: Sun May 13, 2018 01:49 AM
Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local oDlg, oGet, oFont
   local nVar, cVar, cPic, nCent

   SetGetColorFocus()

   nVar        := 0
   cPic        := "999,999,999,999" // Can have any number of decimals
   nCent       := 10 ^ LEN( AFTERATNUM( ".", cPic ) )
   cPic        += " "
   cVar        := TRANSFORM( nVar, cPic )

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-16
   DEFINE DIALOG oDlg SIZE 400,300 PIXEL TRUEPIXEL FONT oFont

   @ 20,20 GET oGet VAR cVar SIZE 200,24 PIXEL OF oDlg RIGHT

   WITH OBJECT oGet
      :bGotFocus  := { || oGet:SetPos( Len( oGet:oGet:buffer ) ) }
      :bKeyChar   := <|nKey,nFlags|
         if nKey >= 0x30 .and. nKey <= 0x39
            nVar        := nVar * 10 + ( nKey - 0x30 ) / nCent
            oGet:cText  := Transform( nVar, cPic )
            oGet:SetPos( Len( oGet:oGet:buffer ) )
         endif
         if nKey == VK_TAB .or. nKey == VK_RETURN
            return nil
         endif
         return 0
         >
      :bKeyDown   := <|nKey,nFlags|
         if nKey == VK_DELETE .or. nKey == VK_BACK
            nVar        := Int( nVar * nCent / 10 ) / nCent
            oGet:cText  := Transform( nVar, cPic )
            oGet:SetPos( Len( oGet:oGet:buffer ) )
            return 0
         endif
         return nil
         >
   END

   @ 60,20 BUTTON "OK" SIZE 100,30 PIXEL OF oDlg ACTION MsgInfo( nVar )

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil
Regards



G. N. Rao.

Hyderabad, India
Posts: 253
Joined: Wed May 25, 2016 01:04 AM
Re: Get right to leff
Posted: Mon May 14, 2018 12:00 PM
nageswaragunupudi wrote:
Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local oDlg, oGet, oFont
   local nVar, cVar, cPic, nCent

   SetGetColorFocus()

   nVar        := 0
   cPic        := "999,999,999,999" // Can have any number of decimals
   nCent       := 10 ^ LEN( AFTERATNUM( ".", cPic ) )
   cPic        += " "
   cVar        := TRANSFORM( nVar, cPic )

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-16
   DEFINE DIALOG oDlg SIZE 400,300 PIXEL TRUEPIXEL FONT oFont

   @ 20,20 GET oGet VAR cVar SIZE 200,24 PIXEL OF oDlg RIGHT

   WITH OBJECT oGet
      :bGotFocus  := { || oGet:SetPos( Len( oGet:oGet:buffer ) ) }
      :bKeyChar   := <|nKey,nFlags|
         if nKey >= 0x30 .and. nKey <= 0x39
            nVar        := nVar * 10 + ( nKey - 0x30 ) / nCent
            oGet:cText  := Transform( nVar, cPic )
            oGet:SetPos( Len( oGet:oGet:buffer ) )
         endif
         if nKey == VK_TAB .or. nKey == VK_RETURN
            return nil
         endif
         return 0
         >
      :bKeyDown   := <|nKey,nFlags|
         if nKey == VK_DELETE .or. nKey == VK_BACK
            nVar        := Int( nVar * nCent / 10 ) / nCent
            oGet:cText  := Transform( nVar, cPic )
            oGet:SetPos( Len( oGet:oGet:buffer ) )
            return 0
         endif
         return nil
         >
   END

   @ 60,20 BUTTON "OK" SIZE 100,30 PIXEL OF oDlg ACTION MsgInfo( nVar )

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil


Thank you so much Mr. Nages, but this is the easiest way? So many gets to change.
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Get right to leff
Posted: Mon May 14, 2018 02:07 PM
Rao

What are the < > markers .. should they be { codeblock .... }

Also ... If I need to trap arrow down and oRs:EOF with latest version on Fwh I can do something like :
Code (fw): Select all Collapse
:bKeyChar   := {|nKey,nFlags|, if(nKey = VK_DOWN, If(oLbxB:bPastEof, _AddNewRow( ... ), ) )}


Something like the above ?

Thanks
Rick Lipkin
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Get right to leff
Posted: Wed May 16, 2018 04:46 AM
but this is the easiest way? So many gets to change.

The easiest way is to use FWH 18.04.
Regards



G. N. Rao.

Hyderabad, India
Posts: 253
Joined: Wed May 25, 2016 01:04 AM
Re: Get right to leff
Posted: Wed May 16, 2018 12:36 PM
nageswaragunupudi wrote:
but this is the easiest way? So many gets to change.

The easiest way is to use FWH 18.04.


Hi Nages,

What kind of changes in fwh18.04 to make easy this implementation?
Thank you!
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Get right to leff
Posted: Wed May 16, 2018 12:38 PM

@ <r>, <c> GET <normal clauses> RIGHTTOLEFT <anymoreclauses>

Regards



G. N. Rao.

Hyderabad, India
Posts: 253
Joined: Wed May 25, 2016 01:04 AM
Re: Get right to leff
Posted: Wed May 16, 2018 02:27 PM
nageswaragunupudi wrote:@ <r>, <c> GET <normal clauses> RIGHTTOLEFT <anymoreclauses>


Great news! Thanks.

Continue the discussion