自定义Class类注入测试对象

来源:互联网 发布:腹部减脂肪知乎 编辑:程序博客网 时间:2024/05/03 17:22

'***********************************************************'
'脚本名称:自定义Class类注入测试对象
'脚本功能:归类SwfTable对象常用基本方法
'编写日期:2014/01/10
'***********************************************************'
Class customSwfTable
 Private oSwfTable,rowNum,columnNum
 Public property set item(pObject)
  Set oSwfTable=pObject
 End Property
 
 Public property let item(pObject)
  Set item=oSwfTable
 End Property 
 '取Text属性
 Function GetText()
  GetText=oSwfTable.GetROProperty("text")
 End Function
 '取hwnd属性
 Function GetHWND()
  GetHWND=oSwfTable.GetROProperty("hwnd")
 End Function
 '取visible属性
 Function GetVisible()
  GetVisible=oSwfTable.GetROProperty("visible")
 End Function
 '取height属性
 Function GetHeight()
  GetHeight=oSwfTable.GetROProperty("height")
 End Function
 '取width属性
 Function GetWidth()
  GetWidth=oSwfTable.GetROProperty("width")
 End Function
 '取focused属性
 Function GetFocused()
  GetFocused=oSwfTable.GetROProperty("focused")
 End Function
 '取abs_y属性
 Function GetAbs_y()
  GetAbs_y=oSwfTable.GetROProperty("abs_y")
 End Function
 '取abs_x属性
 Function GetAbs_x()
  GetAbs_x=oSwfTable.GetROProperty("abs_x")
 End Function
 '取x属性
 Function GetX()
  GetX=oSwfTable.GetROProperty("x")
 End Function
 '取y属性
 Function GetY()
  GetY=oSwfTable.GetROProperty("y")
 End Function
 '取FocusedRow
 Function GetFocusedRow()
  GetFocusedRow=oSwfTable.Object.FocusedView.FocusedRowHandle
 End Function
 '取RowCount
 Function GetRowCount()
  GetRowCount=oSwfTable.RowCount
 End Function
 '表示Menu
 Function ShowMenu()
  oSwfTable.Click 1,1,micRightBtn
 End Function
 'SelectRow
 Function SelectRow(rowNum)
     oSwfTable.SetView ""
  oSwfTable.SelectCell rowNum,1
 End Function
 '表示指定Cell的Menu
 Function ShowCellMenu(rowNum,columnNum)
  oSwfTable.SetView ""
  oSwfTable.SelectCell rowNum,1
  WaitCursorDefault oSwfTable
  Dim x,y
  x=oSwfTable.GetCellProperty(rowNum,columnNum,"x")
  y=oSwfTable.GetCellProperty(rowNum,columnNum,"y")
  oSwfTable.Click x,y, micRightBtn
 End Function
End Class

Function cSwfTable(pObject)
   Set cSwfTable=nothing
   Set cSwfTable=new customSwfTable
   Set cSwfTable.item=pObject
End Function
RegisterUserFunc "SwfTable", "Extend", "cSwfTable", True

 

0 0