Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCLX/TWidgetControl    [ Add a report in this area ]  
Report #:  3112   Status: Reported
Size of input area is not the same of TWinControls VCL
Project:  Delphi Build #:  4453
Version:    7.0 Submitted By:   Cesar Romero
Report Type:  Minor failure / Design problem Date Reported:  12/12/2002 5:55:01 AM
Severity:    Commonly encountered problem Last Updated: 5/2/2003 12:58:35 PM
Platform:    All platforms Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
The input area have 4 pixels less than the TWinControl VCL.

I have a app that connect in a TCP server, the server process all rules and send to client the result, the client look like a Telnet Client, but with  input fields, that is TEdit, TMaskEdit, TComboBox, and so one.

In VCL I change the properts:
- BorderStyle = bsNone
- CTL3D:=  False
- Font.Name = Courier New
- Font.Size = 10

and I can use 1 Character in each 8 px, so if my component have Width = 80 I can see 10 characters

In CLX:
- BorderStyle = bsNone
- Font.Name = Courier New
- Font.Size = 10

CLX start the text draw, 2 pixels after left and stop the text draw before 2 pixels left + width.
In this case the component hide 1 or 2 characters if i use Width  = 80, to see all character i have to change the Width to 84.

I need to use font.size = 10, i cant reduce the size. and as the look is like telnet client i have to work with 25x80 window

I guess that the problem can be in "function TControl.GetBoundsRect: TRect;", and change it to:
function TControl.GetBoundsRect: TRect;
begin
  Result.Left:= Left -2; // My change -2
  Result.Top := Top;
  Result.Right:= Left + Width +4; // My change +4
  Result.Bottom:= Top + Height;
end;

After my changes the left is OK, but the width dont work.
Steps to Reproduce:
Apply to all CLX versions (Delphi 6-7 and Kylix 1-3)

File -> New -> CLX Application

Put in form a TEdit, and change the properties:
- BorderStyle = bsNone
- Font.Name = Courier New
- Font.Size = 10
- Text = 'ASDFGHJKLM'
  (anyone 10 characters)

and look that the 2 first characters is hidden.

in VCL:
File -> New -> Application

Put in form a TEdit, and change the properties:
- BorderStyle = bsNone
- CTL3D:=  False
- Font.Name = Courier New
- Font.Size = 10
- Text = 'ASDFGHJKLM'
  (anyone 10 characters)

You can see all characters...


Workarounds
None
Attachment
3112.zip
Comments

None

Server Response from: ETNACODE01