任何人都知道一个函数返回两个TShapes的交集TPath?特别是返回两个TPath的交集TPath的一个.
例如:
pthIntersection := PathIntersection(Path1,Path2);
Run Code Online (Sandbox Code Playgroud)

我能想到的有四种实现能够将SVG图形加载到Delphi应用程序中.
其中一个由Mattias Andersson(他是FMX.Canvas.VPR 的作者)与FireMonkey合作,但他还没有准备好发布代码.
第二个是由Martin Walter与VCL合作,但是开发人员退出Delphi并且没有计划转换为FireMonkey.
第三个是AGGPAS框架的一部分,与VCL一起工作,但没有FireMonkey.
Jason Southwell正在开发第四个,但尚未确定日期.
所以我的问题是:如果我今天想要一个SVG组件,而不是试图重新发明第五个(可能更多)的时间,那么我们要走哪条路?
我想知道是否已在任何目标之外释放拖动的控件.
有人会认为应该使用OnDragEnd,但该事件不起作用(他们忘记调用FMX.Types单元中的DragEnd过程).
作为替代方案,我尝试使用OnMouseUp进行拖动控制.不行.DragMode = dmAutomatic时不会触发.
作为最后的手段,我试图覆盖表单本身的MouseUp过程(因为所有鼠标事件在传递给相应的控件之前都会通过表单).惊喜:当控件的DragMode = dmAutomatic时,不会调用MouseUp过程.
令人惊讶的是,这非常简单,这是非常难以实现的,但我希望有人可能找到了一个有效的解决方案.
这个问题来自于使用方法链接时出现的问题(流畅的界面),我认为这是它可能成为问题的唯一原因之一.
为了说明,我将使用方法链接的示例:
在单元A中:
TParent = class
protected
function DoSomething: TParent;
end;
Run Code Online (Sandbox Code Playgroud)
在单元B中:
TChild = class(TParent)
public
procedure DoAnotherThing;
end;
implementation
procedure TChild.DoAnotherThing;
begin
DoSomething.DoSomething
end;
Run Code Online (Sandbox Code Playgroud)
我想保持DoSomething过程受保护,只对类后代可见.
这不会编译,抛出一个
无法访问受保护的符号TParent.DoSomething
因为DoSomething返回一个TParent,后续的DoSomething调用是从另一个单元中的TParent对象发出的(因此保护启动并且函数无法访问).(谢谢David Heffernan的解释)
为了减少它的本质,像TParent(Self).DoSomething在TChild类中是不可能的.
我的问题:
既然编译器确实知道从子类中访问Self参数的副本,那么是否存在访问祖先的受保护方法的能力破坏封装的实例?我只是谈论从后代的类方法中取消引用类型化的Self .我知道在这个类之外,该参数当然不应该访问祖先的受保护方法(在另一个单元中).
同样,简而言之:当一个与Self参数相同的变量在其自身的一个类方法中被取消引用时,编译器是否允许它访问其父级的受保护方法是不安全的(就像Self参数本身一样) )?
这是一个非常理论上的问题,但如果编译器允许这样做,我会对编译代码或封装会产生任何负面影响感兴趣.
谢谢.
这种特殊的亚马逊消息似乎抛出了Indy的MessagePart解析器.
消息是结构化的(当然是强烈删节版本):
Content-Type: multipart/mixed;
boundary="----=_Part_853547_18414509.1354745829993"
<some irrelevant header stuff>
------=_Part_853547_18414509.1354745829993
Content-Type: multipart/alternative;
boundary="----=_Part_853548_20128671.1354745829993"
------=_Part_853548_20128671.1354745829993
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<the message in plain text>
------=_Part_853548_20128671.1354745829993
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<the message in HTML>
------=_Part_853548_20128671.1354745829993--
------=_Part_853547_18414509.1354745829993--
Run Code Online (Sandbox Code Playgroud)
现在,当我表演时
imap.UIDRetrieve(UID,Msg)
Run Code Online (Sandbox Code Playgroud)
然后
Msg.ContentType = "multipart/mixed"
Run Code Online (Sandbox Code Playgroud)
并且个人Msg.MessageParts将此作为内容类型:
Msg.MessageParts[0].ContentType = "multipart/alternative; boundary="----=_Part_853548_20128671.1354745829993""
Msg.MessageParts[1].ContentType = "text/plain"
Run Code Online (Sandbox Code Playgroud)
没有任何痕迹text/html.
有人会知道这里发生了什么吗?
(我正在使用最新的Indy版本)
当我有一个TList(所以,一个"程序参考"列表),并且我清除它时,匿名方法中使用的所有捕获变量都会被释放,所以不会发生泄漏吗?
IE浏览器.是清除TList时有效的引用计数?
当我为TCircle的位置设置动画时,动画是平滑的并且似乎以子像素增量/减量发生.但是,当我为TCircle的宽度(或/和高度)设置动画时,动画以像素为单位递增,使其看起来不那么平滑.
当执行慢动画时,这尤其引人注目,其中位置(X和Y),宽度和高度同时被动画化,从而产生缩放效果.圆圈的左上部和上部平滑向外,而右侧和底部部分是生涩的.
无法弄清楚为什么会这样.所有建议都非常感谢.
(顺便说一句,这并不时Scale.X和Scale.Y的动画发生.光滑.但我不希望笔触粗细缩放,因此,使用宽度和高度)
(使用XE2)
一些TForm代码演示:
object Form6: TForm6
Left = 0
Top = 0
Caption = 'Form6'
ClientHeight = 821
ClientWidth = 1108
Visible = False
StyleLookup = 'backgroundstyle'
object cirPulse: TCircle
Position.Point = '(352,192)'
Width = 200.000000000000000000
Height = 200.000000000000000000
Fill.Kind = bkNone
StrokeThickness = 10.000000000000000000
object FloatAnimation1: TFloatAnimation
Enabled = True
Duration = 50.000000000000000000
StartFromCurrent = True
StopValue = 400.000000000000000000
PropertyName = 'Width'
end
object FloatAnimation2: TFloatAnimation
Enabled = True
Duration = 50.000000000000000000
StartFromCurrent = True
StopValue …Run Code Online (Sandbox Code Playgroud) 有没有人找到一种方法来检测Windows(并且仅限Windows)中Delphi FMX表单中的鼠标后退和前进按钮?
我知道这在 VCL 应用程序中工作得很好,使用
procedure WMAppCommand(var Msg: Winapi.Messages.TMessage); message WM_APPCOMMAND;
Run Code Online (Sandbox Code Playgroud)
但这在 FMX 应用程序中没有任何影响。
如果有人已经解决了这个问题,将非常感谢提示(或者他们使用的代码,当然)。
我知道,这是一个令人费解的问题,我相信有人可以将其简化为基础知识.
请考虑以下代码:
TTestClass = class
public
end;
TTestClassDescendant = class(TTestClass)
public
constructor Create;
end;
implementation
procedure TForm1.Button1Click(Sender: TObject);
var tc: TTestClass;
begin
tc := TTestClassDescendant.Create;
tc.Free;
end;
{ TTestClassDescendant }
constructor TTestClassDescendant.Create;
begin
ShowMessage('Create executed') // this gets executed
end;
Run Code Online (Sandbox Code Playgroud)
Create过程正确执行.
现在考虑以下代码:
TTestClass = class
public
end;
TTestClassDescendant = class(TTestClass)
public
constructor Create;
end;
TTestClassClass = class of TTestClass;
implementation
procedure TForm1.Button1Click(Sender: TObject);
var tc: TTestClass;
tcc: TTestClassClass;
begin
tcc := TTestClassDescendant;
tc := tcc.Create;
tc.Free
end;
{ TTestClassDescendant } …Run Code Online (Sandbox Code Playgroud) 我想知道TChromiumFMX浏览器组件是否包含用户选择的文本,如果是,则检索该文本,而无需用户首先将其复制到剪贴板(ctrl-c).
为了改进TLama的答案:如果你没有使用ShowMessage,那么在退出Button1Click之前匿名过程并不总是完成,因此通常不会产生任何结果(或者太晚).因此,可以检查Done:= true,因为可以检查过程的最后一行以查看是否已检索到该值:
procedure TForm1.Button1Click(Sender: TObject);
var Done: boolean;
begin
Done := false;
Chromium1.Browser.GetFocusedFrame.VisitDomProc(
procedure(const document: ICefDomDocument)
begin
SelectedText := document.SelectionAsText;
Done := true
end
);
while not Done do Application.ProcessMessages
end;
Run Code Online (Sandbox Code Playgroud) 我越来越
无法访问受保护的符号TParent.Test
用于以下代码:
在Unit1:
TParent = class
protected
function Test: TParent;
end;
implementation
function TParent.Test: TParent;
begin
Result := Self
end;
Run Code Online (Sandbox Code Playgroud)
在第2单元:
uses Unit1;
type
TChild = class(TParent)
end;
implementation
var c: TChild;
begin
c := TChild.Create;
c.Test.Test
end;
Run Code Online (Sandbox Code Playgroud)
TChild不应该可以访问返回值吗?
c.Test;
c.Test
Run Code Online (Sandbox Code Playgroud)
当然是有效的.
delphi ×11
firemonkey ×5
delphi-xe2 ×4
class ×2
protected ×2
chromium ×1
constructor ×1
drag ×1
indy ×1
indy10 ×1
mouseevent ×1
svg ×1
tchromium ×1
windows ×1