FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Extra spacing in GET on Window!
Posts: 207
Joined: Fri Oct 07, 2005 07:58 AM
Extra spacing in GET on Window!
Posted: Sat Mar 11, 2006 03:20 PM
Hello!

Bellow are two pictures - results of following two samples:
Sample "Dialog":
#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":
#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":

Result of "Window":


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!
Posts: 76
Joined: Fri Dec 30, 2005 10:25 AM
Re: Extra spacing in GET on Window!
Posted: Sun Mar 12, 2006 10:53 AM
that's my solution, see oGet:bGotFocus - > TRIM(oGet:Buffer)

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
Posts: 207
Joined: Fri Oct 07, 2005 07:58 AM
Extra spacing in GET on Window!
Posted: Sun Mar 12, 2006 02:52 PM

Hello!

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

Roman

© I'm not patented!
Posts: 207
Joined: Fri Oct 07, 2005 07:58 AM
Extra spacing in GET on Window!
Posted: Mon Mar 13, 2006 10:05 AM
BTW, here is how it looks in Delphi 7:



Best regards, Roman
© I'm not patented!
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Extra spacing in GET on Window!
Posted: 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
Posts: 207
Joined: Fri Oct 07, 2005 07:58 AM
Extra spacing in GET on Window!
Posted: 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:


Regards, Roman
© I'm not patented!
Posts: 207
Joined: Fri Oct 07, 2005 07:58 AM
Extra spacing in GET on Window!
Posted: Fri Mar 17, 2006 12:30 PM
Hello!

Found the solution :-) !

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!

Continue the discussion