|
6#
楼主 |
发表于 2007-9-5 16:46:14
|
只看该作者
回复 #5 yabest 的帖子
非常感谢你的回答。不过我有点不明白。
刚才我在TEAFlex.xml这个文件里增添了点配置。
<ClassInfo Name="FlexButton" GenericTypeID="button" Extends="FlexObject" SupportsTabularData="false">
<IconInfo IconFile="TEAPluginQTP.dll" IconIndex="2"/>
<Description>FlexButton</Description>
<Implementation Class="mx.controls::Button"/>
<TypeInfo>
<Operation ExposureLevel="CommonUsed" Name="ChangeFocus" PropertyType="Method">
<Implementation Class="flash.events::FocusEvent" Type="keyFocusChange"/>
<Argument Name="shiftKey" IsMandatory="false" DefaultValue="false">
<Type VariantType="Boolean"/>
<Description>True if the user held the Shift key down when changing focus. Otherwise false.</Description>
</Argument>
<Argument Name="keyCode" IsMandatory="false" DefaultValue="TAB">
<Type VariantType="String" Codec="keyCode"/>
<Description>The key code value of the key pressed to trigger a ChangeFocus event.</Description>
</Argument>
<Description>Dispatched when the focus changes from object to another.</Description>
</Operation>
<Operation Name="Click" PropertyType="Method" ExposureLevel="CommonUsed">
<Implementation Class="flash.events::MouseEvent" Type="click"/>
<Argument Name="keyModifier" IsMandatory="false" DefaultValue="0">
<Type VariantType="Enumeration" ListOfValuesName="FlexKeyModifierValues" Codec="keyModifier"/>
<Description>A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt.</Description>
</Argument>
<Description>Dispatched when the mouse is clicked while over this object.</Description>
</Operation>
<Operation Name="GetAutomationChildAt" PropertyType="Method" ExposureLevel="CommonUsed">
<Implementation Type="getAutomationChildAt"/>
<Argument Name="childIndex" IsMandatory="true">
<Type VariantType="Integer"/>
<Description>The index of the child.</Description>
</Argument>
<ReturnValueType>
<Type VariantType="TEAObject"/>
</ReturnValueType>
<Description>Returns the child component at given index.</Description>
</Operation>
<Operation Name="MouseMove" PropertyType="Method" ExposureLevel="CommonUsed">
<Implementation Class="flash.events::MouseEvent" Type="mouseMove"/>
<Argument Name="localX" IsMandatory="false" DefaultValue="0">
<Type VariantType="Integer"/>
<Description>The x position to move the mouse relative to this object.</Description>
</Argument>
<Argument Name="localY" IsMandatory="false" DefaultValue="0">
<Type VariantType="Integer"/>
<Description>The y position to move the mouse relative to this object.</Description>
</Argument>
<Argument Name="keyModifier" IsMandatory="false" DefaultValue="0">
<Type VariantType="Enumeration" ListOfValuesName="FlexKeyModifierValues" Codec="keyModifier"/>
<Description>A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt.</Description>
</Argument>
<Description>Dispatched when the mouse moves while over this object.</Description>
</Operation>
<Operation Name="SetFocus" PropertyType="Method" ExposureLevel="CommonUsed">
<Implementation Type="setFocus"/>
<Description>Sets focus to the component.</Description>
</Operation>
<Operation Name="Type" PropertyType="Method" ExposureLevel="CommonUsed">
<Implementation Class="flash.events::KeyboardEvent" Type="keyPress"/>
<Argument Name="keyCode" IsMandatory="true">
<Type VariantType="String" Codec="keyCode" DefaultValue="SPACE"/>
<Description>The key code value of the key pressed.</Description>
</Argument>
<Argument Name="keyModifier" IsMandatory="false" DefaultValue="0">
<Type VariantType="Enumeration" ListOfValuesName="FlexKeyModifierValues" Codec="keyModifier"/>
<Description>A constant that indicates which key or key combination, if any, was pressed while this operation took place. One of: flexAlt, flexControl, flexControlAlt, flexControlShift, flexControlShiftAlt, flexShift, or flexShiftAlt. For example, if the Shift and Alt keys were pressed, then the value would be flexShiftAlt.</Description>
</Argument>
<Description>Dispatched when the user presses a key.</Description>
</Operation>
</TypeInfo>
<Properties>
<Property Name="shortcutKey" ForVerification="true">
<Type VariantType="VT_R8"/>
<Description>Specifies the object's vertical position, in pixels, within its parent container.</Description>
</Property>
<Property Name="altKey" ForVerification="true">
<Type VariantType="Boolean"/>
<Description>Indicates whether the object is visible.</Description>
</Property>
<Property Name="ctrlKey" ForVerification="true">
<Type VariantType="Boolean"/>
<Description>Indicates whether the object is visible.</Description>
</Property>
<Property Name="shiftKey" ForVerification="true">
<Type VariantType="Boolean"/>
<Description>Indicates whether the object is visible.</Description>
</Property>
<Property Name="groupName" ForVerification="true">
<Type VariantType="String"/>
<Description>Text to display in the ToolTip.</Description>
</Property>
<Property Name="labelHAlign" ForVerification="true">
<Type VariantType="String"/>
<Description>Text to display in the ToolTip.</Description>
</Property>
<Property Name="labelVAlign" ForVerification="true">
<Type VariantType="String"/>
<Description>Text to display in the ToolTip.</Description>
</Property>
<Property Name="labelHMargin " ForVerification="true">
<Type VariantType="VT_R8"/>
<Description>Specifies the object's vertical position, in pixels, within its parent container.</Description>
</Property>
<Property Name="labelVMargin " ForVerification="true">
<Type VariantType="VT_R8"/>
<Description>Specifies the object's vertical position, in pixels, within its parent container.</Description>
</Property>
<Property Name="buttonStype" ForVerification="true">
<Type VariantType="String"/>
<Description>Text to display in the ToolTip.</Description>
</Property>
<Property Name="focusStyle" ForVerification="true">
<Type VariantType="String"/>
<Description>Text to display in the ToolTip.</Description>
</Property>
<Property Name="focusColor" ForVerification="true">
<Type VariantType="String"/>
<Description>Text to display in the ToolTip.</Description>
</Property>
</Properties>
</ClassInfo>
是我添加的。这样的话Extend Button也能被QTP识别了。
不过现在又有了这样一个问题,如果我再写个控件,这个控件纯继承UIComponent,那样的话如何配置,好像必须要添加一个Delegate类,这个类继承UIComponentAutomationImpl。具体配置和方法怎么弄。 |
|