home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / t2win-32 / _object.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-08-24  |  16.0 KB  |  346 lines

  1. VERSION 4.00
  2. Begin VB.Form frmObject 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Object"
  5.    ClientHeight    =   4845
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   7485
  9.    Height          =   5250
  10.    Left            =   1830
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   4845
  14.    ScaleWidth      =   7485
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2925
  17.    Width           =   7605
  18.    Begin VB.TextBox txt_Result 
  19.       BackColor       =   &H00C0C0C0&
  20.       BorderStyle     =   0  'None
  21.       Height          =   3270
  22.       Left            =   105
  23.       Locked          =   -1  'True
  24.       MultiLine       =   -1  'True
  25.       ScrollBars      =   2  'Vertical
  26.       TabIndex        =   0
  27.       Top             =   630
  28.       Width           =   7260
  29.    End
  30.    Begin Threed.SSFrame SSFrame1 
  31.       Height          =   750
  32.       Index           =   1
  33.       Left            =   105
  34.       TabIndex        =   1
  35.       Tag             =   "Tag for SSFrame1"
  36.       Top             =   3990
  37.       Width           =   7260
  38.       _Version        =   65536
  39.       _ExtentX        =   12806
  40.       _ExtentY        =   1323
  41.       _StockProps     =   14
  42.       Caption         =   "Test Frame"
  43.       MousePointer    =   13
  44.       Begin VB.Label Label1 
  45.          Alignment       =   2  'Center
  46.          Caption         =   "Test Label"
  47.          DataField       =   "DataField for Label1"
  48.          ForeColor       =   &H00FF0000&
  49.          Height          =   330
  50.          Left            =   105
  51.          MousePointer    =   14  'Arrow and Question
  52.          TabIndex        =   2
  53.          Tag             =   "Tag for Label1"
  54.          Top             =   315
  55.          Width           =   7050
  56.       End
  57.    End
  58.    Begin Threed.SSPanel SSPanel1 
  59.       Align           =   1  'Align Top
  60.       Height          =   480
  61.       Left            =   0
  62.       TabIndex        =   3
  63.       Top             =   0
  64.       Width           =   7485
  65.       _Version        =   65536
  66.       _ExtentX        =   13203
  67.       _ExtentY        =   847
  68.       _StockProps     =   15
  69.       ForeColor       =   -2147483640
  70.       BackColor       =   12632256
  71.       Begin VB.ComboBox cmb_Function 
  72.          Height          =   315
  73.          Left            =   1365
  74.          TabIndex        =   4
  75.          Top             =   90
  76.          Width           =   4785
  77.       End
  78.       Begin Threed.SSCommand cmdNP 
  79.          Height          =   300
  80.          Index           =   1
  81.          Left            =   7140
  82.          TabIndex        =   8
  83.          Top             =   90
  84.          Width           =   255
  85.          _Version        =   65536
  86.          _ExtentX        =   450
  87.          _ExtentY        =   529
  88.          _StockProps     =   78
  89.          Caption         =   ">"
  90.          BevelWidth      =   1
  91.          Font3D          =   3
  92.          RoundedCorners  =   0   'False
  93.          Outline         =   0   'False
  94.       End
  95.       Begin Threed.SSCommand cmdNP 
  96.          Height          =   300
  97.          Index           =   0
  98.          Left            =   6300
  99.          TabIndex        =   7
  100.          Top             =   90
  101.          Width           =   255
  102.          _Version        =   65536
  103.          _ExtentX        =   450
  104.          _ExtentY        =   529
  105.          _StockProps     =   78
  106.          Caption         =   "<"
  107.          BevelWidth      =   1
  108.          Font3D          =   3
  109.          RoundedCorners  =   0   'False
  110.          Outline         =   0   'False
  111.       End
  112.       Begin VB.Label Label2 
  113.          Caption         =   "&Select a function"
  114.          Height          =   255
  115.          Left            =   90
  116.          TabIndex        =   6
  117.          Top             =   120
  118.          Width           =   1275
  119.       End
  120.       Begin Threed.SSCommand SSCommand1 
  121.          Default         =   -1  'True
  122.          Height          =   300
  123.          Left            =   6615
  124.          TabIndex        =   5
  125.          Top             =   90
  126.          Width           =   465
  127.          _Version        =   65536
  128.          _ExtentX        =   820
  129.          _ExtentY        =   529
  130.          _StockProps     =   78
  131.          Caption         =   "&Go"
  132.          BevelWidth      =   1
  133.          RoundedCorners  =   0   'False
  134.          Outline         =   0   'False
  135.       End
  136.    End
  137. Attribute VB_Name = "frmObject"
  138. Attribute VB_Creatable = False
  139. Attribute VB_Exposed = False
  140. Option Explicit
  141. Option Base 1
  142. Private Const Iteration = 250
  143. Dim IsLoaded         As Integer
  144. Dim TimerStartOk     As Integer
  145. Dim TimerCloseOk     As Integer
  146. Dim TimerHandle      As Integer
  147. Dim TimerValue       As Long
  148. Private Sub cmdNP_Click(Index As Integer)
  149.    Call sub_NextPrev(cmb_Function, Index)
  150. End Sub
  151. Private Sub cmb_Function_Click()
  152.    If (IsLoaded = False) Then Exit Sub
  153.    Call cDisableFI(mdiT2W.Picture1)
  154.    txt_Result = ""
  155.    DoEvents
  156.    Select Case cmb_Function.ListIndex
  157.       Case 0
  158.          Call TestObjectGetX
  159.       Case 1
  160.          Call TestGetObjX
  161.       Case 2
  162.          Call TestObjectPutX
  163.       Case 3
  164.          Call TestPutObjX
  165.    End Select
  166.    DoEvents
  167.    Call cEnableFI(mdiT2W.Picture1)
  168. End Sub
  169. Private Sub Form_Activate()
  170.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  171. End Sub
  172. Private Sub Form_Load()
  173.    IsLoaded = False
  174.    Show
  175.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_object.t2w")
  176.    IsLoaded = True
  177. End Sub
  178. Private Sub SSCommand1_Click()
  179.    Call cmb_Function_Click
  180. End Sub
  181. Private Sub TestObjectGetX()
  182.    Dim intResult        As Integer
  183.    Dim strResult        As String
  184.    Dim strDisplay       As String
  185.    Dim i                As Integer
  186.    strResult = ""
  187.    strDisplay = ""
  188.    strDisplay = strDisplay & "ObjectGetX for SSFrame1(1)" & vbCrLf & vbCrLf
  189.    strDisplay = strDisplay & "Boolean (property 'enabled') is '" & cObjectGetBoolean(SSFrame1(1), "enabled") & "'" & vbCrLf
  190.    strDisplay = strDisplay & "Byte (property 'alignment') is '" & cObjectGetByte(SSFrame1(1), "alignment") & "'" & vbCrLf
  191.    strDisplay = strDisplay & "Integer (property 'mousepointer') is '" & cObjectGetInteger(SSFrame1(1), "mousepointer") & "'" & vbCrLf
  192.    strDisplay = strDisplay & "Long (property 'forecolor') is '" & cObjectGetLong(SSFrame1(1), "forecolor") & "'" & vbCrLf
  193.    strDisplay = strDisplay & "String (property 'caption') is '" & cObjectGetString(SSFrame1(1), "caption") & "'" & vbCrLf
  194.    strDisplay = strDisplay & "Variant (property 'tabindex') is '" & cObjectGetVariant(SSFrame1(1), "tabindex") & "'" & vbCrLf
  195.    strDisplay = strDisplay & "Variant (property 'caption') is '" & cObjectGetVariant(SSFrame1(1), "caption") & "'" & vbCrLf
  196.    strDisplay = strDisplay & "Variant (property 'visible') is '" & cObjectGetVariant(SSFrame1(1), "visible") & "'" & vbCrLf
  197.    strDisplay = strDisplay & "Index (property 'index') is '" & cObjectGetIndex(SSFrame1(1)) & "'" & vbCrLf
  198.    strDisplay = strDisplay & vbCrLf
  199.    strDisplay = strDisplay & "ObjectGetX for Label1" & vbCrLf & vbCrLf
  200.    strDisplay = strDisplay & "Boolean (property 'enabled') is '" & cObjectGetBoolean(Label1, "enabled") & "'" & vbCrLf
  201.    strDisplay = strDisplay & "Byte (property 'alignment') is '" & cObjectGetByte(Label1, "alignment") & "'" & vbCrLf
  202.    strDisplay = strDisplay & "Integer (property 'mousepointer') is '" & cObjectGetInteger(Label1, "mousepointer") & "'" & vbCrLf
  203.    strDisplay = strDisplay & "Long (property 'forecolor') is '" & cObjectGetLong(Label1, "forecolor") & "'" & vbCrLf
  204.    strDisplay = strDisplay & "String (property 'caption') is '" & cObjectGetString(Label1, "caption") & "'" & vbCrLf
  205.    strDisplay = strDisplay & "Variant (property 'tabindex') is '" & cObjectGetVariant(Label1, "tabindex") & "'" & vbCrLf
  206.    strDisplay = strDisplay & "Variant (property 'caption') is '" & cObjectGetVariant(Label1, "caption") & "'" & vbCrLf
  207.    strDisplay = strDisplay & "Variant (property 'visible') is '" & cObjectGetVariant(Label1, "visible") & "'" & vbCrLf
  208.    strDisplay = strDisplay & "Index (property 'index') is '" & cObjectGetIndex(Label1) & "'"
  209.    txt_Result = strDisplay
  210.    'time the function
  211.    TimerHandle = cTimerOpen()
  212.    TimerStartOk = cTimerStart(TimerHandle)
  213.    For i = 1 To Iteration
  214.       strResult = cObjectGetString(cmb_Function, "text")
  215.    Next i
  216.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  217.    TimerCloseOk = cTimerClose(TimerHandle)
  218. End Sub
  219. Private Sub TestGetObjX()
  220.    Dim intResult        As Integer
  221.    Dim strResult        As String
  222.    Dim strDisplay       As String
  223.    Dim i                As Integer
  224.    strResult = ""
  225.    strDisplay = ""
  226.    strDisplay = strDisplay & "GetObjX for SSFrame1(1)" & vbCrLf & vbCrLf
  227.    strDisplay = strDisplay & "Caption is '" & cGetObjCaption(SSFrame1(1)) & "'" & vbCrLf
  228.    strDisplay = strDisplay & "Container is '" & cGetObjContainer(SSFrame1(1)) & "'" & vbCrLf
  229.    strDisplay = strDisplay & "Parent is '" & cGetObjParent(SSFrame1(1)) & "'" & vbCrLf
  230.    strDisplay = strDisplay & "Tag is '" & cGetObjTag(SSFrame1(1)) & "'" & vbCrLf
  231.    strDisplay = strDisplay & "Text is '" & cGetObjText(SSFrame1(1)) & "'" & vbCrLf
  232.    strDisplay = strDisplay & "DataField is '" & cGetObjDataField(SSFrame1(1)) & "'" & vbCrLf
  233.    strDisplay = strDisplay & "DataSource is '" & cGetObjDataSource(SSFrame1(1)) & "'" & vbCrLf
  234.    strDisplay = strDisplay & "Name is '" & cGetObjName(SSFrame1(1)) & "'" & vbCrLf
  235.    strDisplay = strDisplay & "Index is '" & cGetObjIndex(SSFrame1(1)) & "'" & vbCrLf
  236.    strDisplay = strDisplay & "NameIndex is '" & cGetObjNameIndex(SSFrame1(1)) & "'" & vbCrLf
  237.    strDisplay = strDisplay & "ClassName is '" & cGetObjClassName(SSFrame1(1)) & "'" & vbCrLf
  238.    strDisplay = strDisplay & vbCrLf
  239.    strDisplay = strDisplay & "GetObjX for Label1" & vbCrLf & vbCrLf
  240.    strDisplay = strDisplay & "Caption is '" & cGetObjCaption(Label1) & "'" & vbCrLf
  241.    strDisplay = strDisplay & "Container is '" & cGetObjContainer(Label1) & "'" & vbCrLf
  242.    strDisplay = strDisplay & "Parent is '" & cGetObjParent(Label1) & "'" & vbCrLf
  243.    strDisplay = strDisplay & "Tag is '" & cGetObjTag(Label1) & "'" & vbCrLf
  244.    strDisplay = strDisplay & "Text is '" & cGetObjText(Label1) & "'" & vbCrLf
  245.    strDisplay = strDisplay & "DataField is '" & cGetObjDataField(Label1) & "'" & vbCrLf
  246.    strDisplay = strDisplay & "DataSource is '" & cGetObjDataSource(Label1) & "'" & vbCrLf
  247.    strDisplay = strDisplay & "Name is '" & cGetObjName(Label1) & "'" & vbCrLf
  248.    strDisplay = strDisplay & "Index is '" & cGetObjIndex(Label1) & "'" & vbCrLf
  249.    strDisplay = strDisplay & "NameIndex is '" & cGetObjNameIndex(Label1) & "'" & vbCrLf
  250.    strDisplay = strDisplay & "ClassName is '" & cGetObjClassName(Label1) & "'" & vbCrLf
  251.    txt_Result = strDisplay
  252.    'time the function
  253.    TimerHandle = cTimerOpen()
  254.    TimerStartOk = cTimerStart(TimerHandle)
  255.    For i = 1 To Iteration
  256.       strResult = cGetObjContainer(cmb_Function)
  257.    Next i
  258.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  259.    TimerCloseOk = cTimerClose(TimerHandle)
  260. End Sub
  261. Private Sub TestObjectPutX()
  262.    Dim intResult        As Integer
  263.    Dim strResult        As String
  264.    Dim strDisplay       As String
  265.    Dim i                As Integer
  266.    strResult = ""
  267.    strDisplay = ""
  268.    strDisplay = strDisplay & "ObjectPutX for SSFrame1(1)" & vbCrLf & vbCrLf
  269.    Call cObjectPutBoolean(SSFrame1(1), "enabled", False)
  270.    strDisplay = strDisplay & "Boolean (property 'enabled') is '" & cObjectGetBoolean(SSFrame1(1), "enabled") & "'" & vbCrLf
  271.    Call cObjectPutByte(SSFrame1(1), "alignment", 1)
  272.    strDisplay = strDisplay & "Byte (property 'alignment') is '" & cObjectGetByte(SSFrame1(1), "alignment") & "'" & vbCrLf
  273.    Call cObjectPutInteger(SSFrame1(1), "mousepointer", 7)
  274.    strDisplay = strDisplay & "Integer (property 'mousepointer') is '" & cObjectGetInteger(SSFrame1(1), "mousepointer") & "'" & vbCrLf
  275.    Call cObjectPutLong(SSFrame1(1), "forecolor", &HC0C0C0)
  276.    strDisplay = strDisplay & "Long (property 'forecolor') is '" & cObjectGetLong(SSFrame1(1), "forecolor") & "'" & vbCrLf
  277.    Call cObjectPutString(SSFrame1(1), "caption", "SSFrame1(1).Caption is now this")
  278.    strDisplay = strDisplay & "String (property 'caption') is '" & cObjectGetString(SSFrame1(1), "caption") & "'" & vbCrLf
  279.    strDisplay = strDisplay & vbCrLf
  280.    strDisplay = strDisplay & "ObjectPutX for Label1" & vbCrLf & vbCrLf
  281.    Call cObjectPutBoolean(Label1, "enabled", False)
  282.    strDisplay = strDisplay & "Boolean (property 'enabled') is '" & cObjectGetBoolean(Label1, "enabled") & "'" & vbCrLf
  283.    Call cObjectPutByte(Label1, "alignment", 1)
  284.    strDisplay = strDisplay & "Byte (property 'alignment') is '" & cObjectGetByte(Label1, "alignment") & "'" & vbCrLf
  285.    Call cObjectPutInteger(Label1, "mousepointer", 7)
  286.    strDisplay = strDisplay & "Integer (property 'mousepointer') is '" & cObjectGetInteger(Label1, "mousepointer") & "'" & vbCrLf
  287.    Call cObjectPutLong(Label1, "forecolor", &HC0C0C0)
  288.    strDisplay = strDisplay & "Long (property 'forecolor') is '" & cObjectGetLong(Label1, "forecolor") & "'" & vbCrLf
  289.    Call cObjectPutString(Label1, "caption", "Label1.Caption is now this")
  290.    strDisplay = strDisplay & "String (property 'caption') is '" & cObjectGetString(Label1, "caption") & "'" & vbCrLf
  291.    txt_Result = strDisplay
  292.    'time the function
  293.    TimerHandle = cTimerOpen()
  294.    TimerStartOk = cTimerStart(TimerHandle)
  295.    For i = 1 To Iteration
  296.       If ((i Mod 2) = 0) Then
  297.          Call cObjectPutByte(Label1, "borderstyle", 0)
  298.       Else
  299.          Call cObjectPutByte(Label1, "borderstyle", 1)
  300.       End If
  301.       DoEvents
  302.    Next i
  303.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  304.    TimerCloseOk = cTimerClose(TimerHandle)
  305. End Sub
  306. Private Sub TestPutObjX()
  307.    Dim intResult        As Integer
  308.    Dim strResult        As String
  309.    Dim strDisplay       As String
  310.    Dim i                As Integer
  311.    strResult = ""
  312.    strDisplay = ""
  313.    strDisplay = strDisplay & "PutObjX for SSFrame1(1)" & vbCrLf & vbCrLf
  314.    Call cPutObjCaption(SSFrame1(1), "SSFrame1(1).Caption set by PutObjCaption")
  315.    strDisplay = strDisplay & "Caption is '" & cGetObjCaption(SSFrame1(1)) & "'" & vbCrLf
  316.    Call cPutObjDataField(SSFrame1(1), "DataField set by PutObjDataField")
  317.    strDisplay = strDisplay & "DataField is '" & cGetObjDataField(SSFrame1(1)) & "'" & vbCrLf
  318.    Call cPutObjDataSource(SSFrame1(1), "DataSource set by PutObjSource")
  319.    strDisplay = strDisplay & "DataSource is '" & cGetObjDataSource(SSFrame1(1)) & "'" & vbCrLf
  320.    Call cPutObjTag(SSFrame1(1), "Tag set by PutObjTag")
  321.    strDisplay = strDisplay & "Tag is '" & cGetObjTag(SSFrame1(1)) & "'" & vbCrLf
  322.    Call cPutObjText(SSFrame1(1), "Text set by PutObjText")
  323.    strDisplay = strDisplay & "Text is '" & cGetObjText(SSFrame1(1)) & "'" & vbCrLf
  324.    strDisplay = strDisplay & vbCrLf
  325.    strDisplay = strDisplay & "PutObjX for Label1" & vbCrLf & vbCrLf
  326.    Call cPutObjCaption(Label1, "Label1.Caption set by PutObjCaption")
  327.    strDisplay = strDisplay & "Caption is '" & cGetObjCaption(Label1) & "'" & vbCrLf
  328.    Call cPutObjDataField(Label1, "DataField set by PutObjDataField")
  329.    strDisplay = strDisplay & "DataField is '" & cGetObjDataField(Label1) & "'" & vbCrLf
  330.    Call cPutObjDataSource(Label1, "DataSource set by PutObjSource")
  331.    strDisplay = strDisplay & "DataSource is '" & cGetObjDataSource(Label1) & "'" & vbCrLf
  332.    Call cPutObjTag(Label1, "Tag set by PutObjTag")
  333.    strDisplay = strDisplay & "Tag is '" & cGetObjTag(Label1) & "'" & vbCrLf
  334.    Call cPutObjText(Label1, "Text set by PutObjText")
  335.    strDisplay = strDisplay & "Text is '" & cGetObjText(Label1) & "'" & vbCrLf
  336.    txt_Result = strDisplay
  337.    'time the function
  338.    TimerHandle = cTimerOpen()
  339.    TimerStartOk = cTimerStart(TimerHandle)
  340.    For i = 1 To Iteration
  341.       Call cPutObjTag(cmb_Function, "Tag set by PutObjTag")
  342.    Next i
  343.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  344.    TimerCloseOk = cTimerClose(TimerHandle)
  345. End Sub
  346.