deks
Advanced Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору ## Making Your Components Available at Design Time and Run Time Following are the two ways the IDE decides whether or not a component is available for Win32/Win64/OSX32. (Here "available" means appearing on the palette, and checked by the IDE. The IDE does not do any compile-time checking other than the component unit's existence.) Both methods rely on data embedded in the Win32 run-time (or design+run-time) package that implements the components. The IDE cannot load Win64 and OSX32 packages in the IDE, so the IDE must defer to the Win32 package for information. The RAD Studio build system automatically embeds an RC_DATA resource in the Win32 package binary named PLATFORMTARGETS, which is a bitmask of the pidXXX constants in System.Classes.pas and reflects the package project's targeted platforms. The IDE reads this when the package is loaded and uses it to decide, for example, whether or not to disable the component(s) in the palette when an unsupported platform is active. To target multiple platforms with a component package implies a contract between the component developer and the IDE. The IDE assumes that if a component package project targets multiple platforms and the developer distributes the Win32 run-time package to customers (and all the associated compilable and linkable files), the developer will also distribute all the necessary compilable, linkable, and run-time bits for the other targeted platforms as well. Individual components can use the ComponentPlatformsAttribute class attribute to override the data in PLATFORMTARGETS, using a bitmask of the same constants in Classes. For example: Код: type [ComponentPlatformsAttribute(pidWin32 or pidWin64)] // not supported on OSX TMyComponent = class(TComponent) private ... end; | Use of this attribute implies the same contract as described in the first bulleted item. | Всего записей: 857 | Зарегистр. 09-10-2003 | Отправлено: 13:01 12-11-2012 | Исправлено: deks, 13:02 12-11-2012 |
|