Extra spacing in GET on Window!

Post Reply
User avatar
modicr
Posts: 207
Joined: Fri Oct 07, 2005 7:58 am
Location: ljubljana, barje, slovenia
Contact:

Extra spacing in GET on Window!

Post by modicr »

Hello!

Bellow are two pictures - results of following two samples:
Sample "Dialog":

Code: Select all

#include "FiveWin.ch"
static  fntErr, fntOK

function Main()
   LOCAL oUI, oGet
   LOCAL cErr := "F1- Arial "
   LOCAL cOK  := "F2 - Verdana "

   SET _3DLOOK OFF
   DEFINE FONT fntErr NAME "Arial" SIZE 0,32
   DEFINE FONT fntOK  NAME "Verdana" SIZE 0, 32

   DEFINE DIALOG oUI TITLE "Dialog: " + FWVERSION
   @ 1,    1 GET oGet VAR cErr OF oUI SIZE 120, 20 COLOR "W/G" PICTURE "@K"  NOBORDER FONT fntErr
   @ 3,    1 GET oGet VAR cOk OF oUI SIZE 120, 20 COLOR "W/G" PICTURE "@K"  NOBORDER FONT fntOK
   ACTIVATE DIALOG oUI
return nil  // Main
Sample "Window":

Code: Select all

#include "FiveWin.ch"
static  fntErr, fntOK

function Main()
   LOCAL oUI, oGet
   LOCAL cErr := "F1- Arial "
   LOCAL cOK  := "F2 - Verdana "

   SET _3DLOOK OFF
   DEFINE FONT fntErr NAME "Arial" SIZE 0,32
   DEFINE FONT fntOK  NAME "Verdana" SIZE 0, 32

   DEFINE WINDOW oUI TITLE "Window: " + FWVERSION
   @ 1,    1 GET oGet VAR cErr OF oUI SIZE 240, 40 COLOR "W/G" PICTURE "@K"  NOBORDER FONT fntErr
   @ 6,    1 GET oGet VAR cOk OF oUI SIZE 240, 40 COLOR "W/G" PICTURE "@K"  NOBORDER FONT fntOK
   ACTIVATE WINDOW oUI
return nil  // Main
Result of "Dialog":
Image
Result of "Window":
Image

As you can see, there is additional spacing in GET when
Arial font is used on window. What can be done to
remove this spacing???

Thanks, Roman
© I'm not patented!
User avatar
fp
Posts: 76
Joined: Fri Dec 30, 2005 10:25 am
Location: Germany

Re: Extra spacing in GET on Window!

Post by fp »

that's my solution, see oGet:bGotFocus - > TRIM(oGet:oGet:Buffer)

Code: Select all

oGet     := TGet():ReDefine(nId,bBlock,self,,xPicture,,,,,,cMessage,.F.,,,.F.,.F.,,,,)
oGet:bGotFocus  := {||oGet:SetSel(0,0),oGet:SetColor(RGB_RED,RGB_YELLOW),SetWindowText(oGet:hWnd,TRIM(oGet:oGet:Buffer),__KEYBOARD(CHR(VK_END)))}
oGet:bLostFocus := {||oGet:SetColor(RGB_BLACK,RGB_WHITE)}

Frank-Peter
User avatar
modicr
Posts: 207
Joined: Fri Oct 07, 2005 7:58 am
Location: ljubljana, barje, slovenia
Contact:

Post by modicr »

Hello!

Thanks for your reply - unfortunately this does not solve the problem!

Roman
© I'm not patented!
User avatar
modicr
Posts: 207
Joined: Fri Oct 07, 2005 7:58 am
Location: ljubljana, barje, slovenia
Contact:

Post by modicr »

BTW, here is how it looks in Delphi 7:

Image

Best regards, Roman
© I'm not patented!
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Roman,

Its a curious behavior, as such extra space is not writeable.

If you try to place the cursor there and type, you can't.

Lets see if we find where that left space comes from.

Thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
modicr
Posts: 207
Joined: Fri Oct 07, 2005 7:58 am
Location: ljubljana, barje, slovenia
Contact:

Post by modicr »

Hello!
Lets see if we find where that left space comes from.
:)

BTW, there is unnecessary margin at the right edge, too:
Image

Regards, Roman
© I'm not patented!
User avatar
modicr
Posts: 207
Joined: Fri Oct 07, 2005 7:58 am
Location: ljubljana, barje, slovenia
Contact:

Post by modicr »

Hello!

Found the solution :D !

By googling I encountered more the 10 years
old MS KB article:
http://support.microsoft.com/default.as ... -us;138419

Fortunately you have already written (October 2004 build)
TGet method SetMargins(nL, nR)
* Enhancement: Class TGet new Methods SetMargins() and GetMargins(). They allow the GETs to show the same margins on different Windows versions and 16 and 32 bits. Many thans to Walter Negro and Luis Krause.
which by default sets margins to 1,1. So I just called
o:SetMargins(0,0) after creating GETs.

Regards, Roman
© I'm not patented!
Post Reply