Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
VCL
8-Byte Alignment
Action Classes
Additional Controls
Core VCL Classes
DFM to TEXT
Dialog Controls
Docking
Drag/Drop
Emulation Classes
Exceptions
Gestures
Graphics
MAPI Support
MDI Support
Multi-Monitor Support
OnGesture event
Printing
Property/Type Editors
Registry / INI Objects
Ribbon Controls
Sample Controls
Services
Standard Controls
Styles
System Controls
Thread support
Touch Controls
Type Info
Win 3.1 Controls
Win 32 Controls
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/VCL/Graphics
[ Add a report in this area ]
Report #:
106211
Status:
Reported
add TCanvas....(TPoint) and ....(TSize) methods please.
Project:
Delphi
Build #:
any
Version:
16.4
Submitted By:
Dmitry Burov
Report Type:
Suggestion / Enhancement Request
Date Reported:
6/6/2012 1:43:23 AM
Severity:
Commonly encountered problem
Last Updated:
6/6/2012 7:03:45 PM
Platform:
All versions
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
Standard VCL.Graphics.TCanvas has two methods:
procedure LineTo(X, Y: Integer);
procedure MoveTo(X, Y: Integer);
But in my code it maybe more natural to use TPoint or TSize (those two types are almost the same)
I bind semantically-connected vars together into TPoint and work with it, using .Offset methods and such.
But then i have to interop with TCanvas.
I mademyself such a helper as below, but i am pretty sure that is to be part of core functionality
---------
type TCanvasPt = class helper for TCanvas
procedure LineTo(const XY: TPoint); overload; inline;
procedure MoveTo(const XY: TPoint); overload; inline;
end;
procedure TCanvasPt.LineTo(const XY: TPoint);
begin
Self.LineTo(XY.X, XY.Y);
end;
procedure TCanvasPt.MoveTo(const XY: TPoint);
begin
Self.MoveTo(XY.X, XY.Y);
end;
------------
Now i can call any of Canvas.MoveTo(1,1) and Canvas.MoveTo(Point(1,1)).
Compiler would figure out what to call;
Steps to Reproduce:
None
Workarounds
None
Attachment
None
Comments
None
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us