2

Intro:

I have a custom VCL component derived from the TCustomPanel class which purpose is to act as some kind of a custom form which has a parent (main form), but all default buttons such as maximize, minimize, close. That component was developed long before FMX and it's an important part of an existing application. The component is catching messages, overriding the Paint method etc.

The main feature of this component is to have similar functionality as a regular form (floating at runtime within it's parent, dragging ...) but with some customized graphics (smaller buttons etc...)

Demo application

Task at hand:

I am working on rewriting components for FireMonkey (Delphi XE2) including this floating window as well and if there is any point to do that.
(I don't want to mix VCL and FMX because at some point I would like to have whole application in FMX.)

Questions:

  1. Is there any existing FMX control with feature of floating / dragging / moving in runtime?

  2. What is the approach in Firemonkey to enable for an eg. TPanel move in run time or is there a control which offers that functionality by default? I guess the whole idea in FMX is to override existing methods.

  3. Is it possible in same application to have forms with different styles? I am thinking about creating my custom form with custom style. In that case I can have one main form (parent) and child forms which have different style.

Thanks!

4

1 回答 1

2

对于 1 和 2,您会发现 OnMouseXXXX 事件很容易自己使用(或者如果您正在开发自定义组件,则使用受保护的虚拟方法)。

对于 3,在每个表单上放置一个 TStyleBook 并将所需的样式加载到其中(记得设置表单的 StyleBook 属性)。您还可以将样书属性指向不在表单上的实例,例如在另一个表单上或指向全局对象。如果您这样做,请注意在释放表单之前将表单的 StyleBook 属性设为 nil,否则您将获得 AV。

于 2013-08-06T19:06:37.730 回答