TGet: RIGHT clause problem

TGet: RIGHT clause problem

Postby Enrico Maria Giordano » Sun Oct 25, 2020 3:34 pm

Please look at this sample, the edit string is not correctly right aligned using RIGHT clause. Any workaround?

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL cVar := SPACE( 30 )

    DEFINE DIALOG oDlg

    @ 1, 1 GET cVar RIGHT

    @ 3, 1 BUTTON "Close";
           ACTION oDlg:End()

    ACTIVATE DIALOG oDlg

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: TGet: RIGHT clause problem

Postby mauri.menabue » Sun Oct 25, 2020 9:00 pm

Hi Enrico
for me it's ok
try

Code: Select all  Expand view

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg
    LOCAL oFont1
    LOCAL oFont2

    LOCAL cVar := "FIVEWIN"
   
    DEFINE FONT oFont1 NAME "COURIER NEW" SIZE 0, -11 // NOT PROP.
    DEFINE FONT oFont2 NAME "TAHOMA"      SIZE 0, -10 // PROP

    DEFINE DIALOG oDlg

    @ 1, 1 GET cVar RIGHT FONT  oFont1
    @ 2, 1 GET cVar RIGHT FONT  oFont2

    @ 3, 1 BUTTON "Close";
           ACTION oDlg:End()

    ACTIVATE DIALOG oDlg
   
    RELEASE FONT oFont1
    RELEASE FONT oFont2

    RETURN NIL

 


Bye
User avatar
mauri.menabue
 
Posts: 155
Joined: Thu Apr 17, 2008 2:38 pm

Re: TGet: RIGHT clause problem

Postby Enrico Maria Giordano » Sun Oct 25, 2020 10:08 pm

Thank you, but your sample doesn't work right here (latest FWH version).

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: TGet: RIGHT clause problem

Postby Antonio Linares » Mon Oct 26, 2020 5:09 am

Dear Enrico,

We are checking it

many thanks for your feedback
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42077
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Re: TGet: RIGHT clause problem

Postby karinha » Mon Oct 26, 2020 12:03 pm

Code: Select all  Expand view

// \samples\enrico99.prg

#include "Fivewin.ch"

FUNCTION MAIN()

   LOCAL oDlg, aGet := ARRAY(5), oFont, oFnt
   LOCAL cVar  := "ENRICO MARIA Right..." // SPACE( 30 )
   LOCAL cVar2 := "GIORDANO DE ITALIA..."

   DEFINE FONT oFnt    NAME "Ms Sans Serif" SIZE 0,  14 BOLD
   DEFINE FONT oFont   NAME "Ms Sans Serif" SIZE 0, -14 BOLD

   DEFINE DIALOG oDlg

   oDlg:lHelpIcon := .F.

   @ 1, 1 GET aGet[1] VAR cVar  PICTURE "@K!" SIZE 090, 10 FONT oFnt RIGHT

   @ 2, 1 GET aGet[2] VAR cVar2 PICTURE "@K!" SIZE 090, 10 FONT oFnt // LEFT

   @ 3, 1 BUTTON "Close";
      ACTION oDlg:End()

   ACTIVATE DIALOG oDlg

   oFont:End()
   oFnt:End()

RETURN NIL
 


Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7804
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: TGet: RIGHT clause problem

Postby Enrico Maria Giordano » Mon Oct 26, 2020 1:34 pm

Please, try to write something in the RIGHT aligned GET and you'll see the problem.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: TGet: RIGHT clause problem

Postby nageswaragunupudi » Mon Oct 26, 2020 5:04 pm

Test Program:
Code: Select all  Expand view
#include "Fivewin.ch"

function main()

   local oDlg, oFont

   local cVar1 := PAD( "FiveTech Soft, Spain", 20 )
   local cVar2 := PAD( "Hello World",          20 )

   SetGetColorFocus()

   DEFINE FONT oFont NAME "Courier New" SIZE 0,-20

   DEFINE DIALOG oDlg SIZE 450,150 PIXEL TRUEPIXEL FONT oFont TITLE FWVERSION

   @ 20, 20 GET cVar1 SIZE 410,26 PIXEL OF oDlg RIGHT
   @ 50, 20 GET cVar2 SIZE 410,26 PIXEL OF oDlg RIGHT

   @ 90, 20 BUTTON "Close" SIZE 100,40 PIXEL OF oDlg ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE FONT oFont

return nil


Image

The text (including the spaces) is right-aligned in the Gets.
This is the behaviour in all previous versions of FWH.
Regards

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

Re: TGet: RIGHT clause problem

Postby karinha » Mon Oct 26, 2020 5:21 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7804
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: TGet: RIGHT clause problem

Postby Enrico Maria Giordano » Mon Oct 26, 2020 6:20 pm

Sorry, I thought that RIGHT worked like ES_RIGHT, but it's not.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: TGet: RIGHT clause problem

Postby nageswaragunupudi » Mon Oct 26, 2020 8:20 pm

Both these Gets have ES_RIGHT style and this is how Windows displays text with trailing spaces with this style. Does not "trim" the string and then right-align the trimmed string.

However, we can think of an enhancement by trimming the string and right-align when the Get does not have focus. Just thinking ...

Whether Windows does it or not, we can still do it if we like.
Regards

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

Re: TGet: RIGHT clause problem

Postby Enrico Maria Giordano » Mon Oct 26, 2020 9:26 pm

Ok, all is clear now. I missed the trailing spaces, sorry. :-)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: TGet: RIGHT clause problem

Postby nageswaragunupudi » Tue Oct 27, 2020 6:51 am

To get the effect what we like, ignoring the trailing spaces, please try EDIT control instead of GET control.

Please try this sample:
Code: Select all  Expand view
#include "Fivewin.ch"

function Main()

   local oDlg, oFont, oGet1, oGet2

   local cVar1 := PAD( "123",   10 )
   local cVar2 := PAD( "12345", 15 )

   DEFINE FONT oFont NAME "Courier New" SIZE 0,-20

   DEFINE DIALOG oDlg SIZE 450,150 PIXEL TRUEPIXEL FONT oFont TITLE FWVERSION

   @ 20, 20 EDIT oGet1 VAR cVar1 SIZE 410,26 PIXEL OF oDlg RIGHT LIMITTEXT
   oGet1:bGotFocus  := { || oGet1:SetColor( CLR_BLACK, RGB( 235, 235, 145 ) ) }
   oGet1:bLostFocus := { || oGet1:SetColor( CLR_BLACK, CLR_WHITE ) }

   @ 50, 20 EDIT oGet2 VAR cVar2 SIZE 410,26 PIXEL OF oDlg RIGHT LIMITTEXT
   oGet2:bGotFocus  := { || oGet2:SetColor( CLR_BLACK, RGB( 235, 235, 145 ) ) }
   oGet2:bLostFocus := { || oGet2:SetColor( CLR_BLACK, CLR_WHITE ) }

   @ 90, 20 BUTTON "Close" SIZE 100,40 PIXEL OF oDlg ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

   cVar1 := PAD( cVar1, 10 )
   cVar2 := PAD( cVar2, 15 )

return nil
 
Regards

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


Re: TGet: RIGHT clause problem

Postby mauri.menabue » Thu Oct 29, 2020 12:13 am

hi Mr. Rao
But with EDIT does not work up / down arrow to leave control only TAB or RETURN.
Bye
User avatar
mauri.menabue
 
Posts: 155
Joined: Thu Apr 17, 2008 2:38 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

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