Get right to leff

Get right to leff

Postby Wanderson » Fri May 11, 2018 2: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!
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: Get right to leff

Postby nageswaragunupudi » Sun May 13, 2018 1:49 am

Code: Select all  Expand view
#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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Get right to leff

Postby wartiaga » Mon May 14, 2018 12:00 pm

nageswaragunupudi wrote:
Code: Select all  Expand view
#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.
wartiaga
 
Posts: 210
Joined: Wed May 25, 2016 1:04 am

Re: Get right to leff

Postby Rick Lipkin » Mon May 14, 2018 2: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: Select all  Expand view

:bKeyChar   := {|nKey,nFlags|, if(nKey = VK_DOWN, If(oLbxB:bPastEof, _AddNewRow( ... ), ) )}
 


Something like the above ?

Thanks
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2663
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Get right to leff

Postby nageswaragunupudi » Wed May 16, 2018 4: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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Get right to leff

Postby wartiaga » 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!
wartiaga
 
Posts: 210
Joined: Wed May 25, 2016 1:04 am

Re: Get right to leff

Postby nageswaragunupudi » Wed May 16, 2018 12:38 pm

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Get right to leff

Postby wartiaga » Wed May 16, 2018 2:27 pm

nageswaragunupudi wrote:@ <r>, <c> GET <normal clauses> RIGHTTOLEFT <anymoreclauses>


Great news! Thanks.
wartiaga
 
Posts: 210
Joined: Wed May 25, 2016 1:04 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 52 guests