Extra spacing in GET on Window!

Extra spacing in GET on Window!

Postby modicr » Sat Mar 11, 2006 3:20 pm

Hello!

Bellow are two pictures - results of following two samples:
Sample "Dialog":
Code: Select all  Expand view
#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  Expand view
#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
modicr
 
Posts: 207
Joined: Fri Oct 07, 2005 7:58 am
Location: ljubljana, barje, slovenia

Re: Extra spacing in GET on Window!

Postby fp » Sun Mar 12, 2006 10:53 am

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

Code: Select all  Expand view
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
fp
 
Posts: 76
Joined: Fri Dec 30, 2005 10:25 am
Location: Germany

Postby modicr » Sun Mar 12, 2006 2:52 pm

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

Postby modicr » Mon Mar 13, 2006 10:05 am

BTW, here is how it looks in Delphi 7:

Image

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

Postby Antonio Linares » Mon Mar 13, 2006 10:20 am

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
Antonio Linares
Site Admin
 
Posts: 41901
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby modicr » Tue Mar 14, 2006 10:12 am

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

Postby modicr » Fri Mar 17, 2006 12:30 pm

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!
User avatar
modicr
 
Posts: 207
Joined: Fri Oct 07, 2005 7:58 am
Location: ljubljana, barje, slovenia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 46 guests