打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Device Manager
userphoto

2020.03.30

关注
Go Up toForm Designer Options
Tools > Options > User Interface > Form Designer > Device Manager
The Device Manager shows a grid with the device presets. The device presets are the list of available devices to use at design time for example in theMulti-Device Preview Window. These devices can be used asviews of your multi-device project if the view has been registered by installing the package of such view. By default, only generic devices have registered views. See how you cancreate your own views.
From this page you canadd,edit, anddelete a device preset. You cannot edit or delete built-in device presets, you can only edit or delete device presets that you add yourself to the .
The Device Manager manages the DevicePresets.xml file, when youadd,edit, ordelete a device preset from the Device Manager, the DevicePresets.xml file updates automatically to reflect such changes. You can also .
You can double-click a device in the list toedit it. You can use the or the to access other actions.
Contents
[]
Buttons and Context Menu
At the bottom of the page, you can find the buttons to manage the device presets. If you right-click anywhere in the page, a context menu pops up.
By using the buttons or the context menu, you can do one of the following actions:
ItemDescription
AddOpens theNew device settings editor tocreate a new device preset.
EditOpens theDevice Settings Window editor toedit the selected device preset.Note: This action is disabled when you select a built-in device preset. You cannot edit built-in device presets.
DeleteDeletes the selected device preset. SeeDeleting a Device Preset.Note: This action is disabled when you select a built-in device preset. You cannot delete built-in device presets.RAD Studio asks you for confirmation before it actually deletes the selected device preset.
DevicePresets.xml
The DevicePresets.xml file defines the device presets information, these devices can be used at design time.
Warning: We recommend to carefully check the modifications on the DevicePresets.xml file. Please revise the xml tags to ensure that they are properly cased. Otherwise the designer could not understand them and behave unexpectedly.
This file allows you to edit the following device information:
A friendly name for your view
Available orientations
Display size for each orientation
Status bar position and size
Image for the device frame
To add a new device preset to the DevicePresets.xml file:
Go to C:\Users\<username>\AppData\Roaming\Embarcadero\BDS\20.0.
Note: This is a hidden folder. If you are not able to see it, make active the Show hidden files, folders, and drivers on the Folder Options dialog box in the Windows Control Panel.
Open the file with a text editor.
Inside the <MobileDevices RepositoryVersion="3"> tag, add a new MobileDevice element as follows:
<MobileDevice> <Name>TestView</Name> <!-- Same unique ID used in the creation package if you are registering a new View --> <Displayname>My Android Phone</Displayname> <!-- Name to show in the Device Manager, View Selector and Multi-Device Preview --> <DevicePlatform>3</DevicePlatform> <FormFactor>2</FormFactor> <UserData>True</UserData> <Portrait Enabled="True" Width="360" Height="640" Top="61" Left="44" StatusbarHeight="25" StatusBarPos="0" Artwork="ARTWORK_PATH"/> <UpsideDown Enabled="True" Width="360" Height="640" Top="68" Left="47" StatusbarHeight="25" StatusBarPos="0" Artwork="ARTWORK_PATH"/> <LandscapeLeft Enabled="True" Width="640" Height="360" Top="44" Left="68" StatusbarHeight="25" StatusBarPos="0" Artwork="ARTWORK_PATH"/> <LandscapeRight Enabled="True" Width="640" Height="360" Top="47" Left="61" StatusbarHeight="25" StatusBarPos="0" Artwork="ARTWORK_PATH"/> </MobileDevice>
Note: You need to replace ARTWORK_PATH with the correct path to your artwork.
Warning: If you areadding a customized view to the view selector, you need to ensure that the name added between the <Name></Name> tags matches the ViewName of thepackage of that view.
Restart the IDE for the changes to take effect.
DevicePresets.xml Elements
Each MobileDevice element may use any combination of the following elements:
ElementDescriptionExample
NameIdentifier used tocreate the package to add a new view.Warning: The name must be unique, if you add a new device preset with the same name as an already existing device preset, the existing device preset is overwritten by the new one when the DevicePresets.xml file gets updated by the IDE.
<Name>TestView</Name>
DisplaynameFriendly name to display where necessary, like for example in theView Selector, the , and theMulti-Device Preview.<Displayname>My Android Phone</Displayname>
DevicePlatformPlatform of the device.NumberDefinition
0Windows
1OS X
2iOS
3Android
<DevicePlatform>3</DevicePlatform>
FormFactorForm factor of the device.NumberDefinition
0Desktop
2Phone
3Tablet
4Media Player
5Automotive
6Industrial
7Embedded
8Watch
9Glasses
Note: When selecting Desktop as form factor, there is no need to configure any of the orientation since these are not enabled for this particular form factor.
<FormFactor>2</FormFactor>
UserDataDetermines whether the device can be edited from the .<UserData>True</UserData>
Portrait
UpsideDown
LandscapeLeft
LandscapeRight
Orientation definition.
You may use any combination of these four elements. Use each element as a self-closed XML tag (<Tag />), and use any combination of the following attributes on each tag:
PropertyDefinition
EnabledSet this property to True if you want to use this orientation.
Width
Height
Measures (in pixels) of the form. Represents the available area.
Top
Left
Represents the most top left corner of the available area. It is the offset from the origin of the screen.
StatusbarHeightThe height of the status bar.
Default: 0.
StatusBarPosThe position of the status bar, 0 meaning on top.
Default: 0.
ValuePosition
0Top
1Bottom
2Left
3Right
ArtworkThe fully qualified path to the file. When the field is empty, a slim black frame appears by default.
MaskThe fully qualified path to the Mask file. It is an optional field that is used to apply a mask to the Artwork in order to define non-rectangular shapes in customized views. Therefore, the Mask defines the visible and non-visible parts of the Artwork on the form. When the field is empty, no mask is aplyied to the Artwork.
To apply a Mask to the Artwork take the following steps:
Make the Mask the same size as the form ( Width and Height).
Add transparency to the background and to the screen area of the device on the Artwork.
Make the visible part of the form transparent on the Mask.
Make the non-visible part of the form white (#FFFFFFF) on the Mask.
<Portrait Enabled="True" Width="360" Height="640" Top="61" Left="44" StatusbarHeight="25" StatusBarPos="0" Artwork="$(BDS)\ObjRepos\en\Devices\images\Android35.cpng" Mask="$(BDS)\ObjRepos\en\Devices\images\AndroidMask35.cpng" />
After saving new changes in the , the DevicePresets.xml file updates when the IDE closes to include the <Thumbnail></Thumbnail> tags. The <Thumbnail></Thumbnail> tags are automatically generated to include the location of the thumbnail images of the device presets used in the and theMulti-Device Preview. You should not edit or delete the <Thumbnail></Thumbnail> tags.
See Also
Form Designer
Adding a Customized View to the View Selector
Adding a Device Preset
Editing a Device Preset
Deleting a Device Preset
Device Settings Window
Multi-Device Preview
Multi-Device Application
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
TwinCAT更新XML文件
DAYU200_横竖屏切换的修改【坚果派】
第三方的ONVIF协议测试工具:ONVIF Device Manager
tomcat6安装版,性能调优 三个方面(其实两个方面)
JSP小秘诀:紧急:俺在配置tomcat时,无法进入管理界面!? |迷城学吧系统编程教程|...
动画预设
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服