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
#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