home *** CD-ROM | disk | FTP | other *** search
/ BUG 11 / BUGCD1998_02.ISO / aplic / turbocad / tcw.z / tcwapi40.app < prev    next >
Text File  |  1997-05-08  |  9KB  |  304 lines

  1. '******************************************************************
  2. '*                                                                *
  3. '*                      TurboCAD for Windows                      *
  4. '*                   Copyright (c) 1993 - 1996                    *
  5. '*             International Microcomputer Software, Inc.         *
  6. '*                            (IMSI)                              *
  7. '*                      All rights reserved.                      *
  8. '*                                                                *
  9. '******************************************************************
  10. '  This file gets appended to scripts.  These routines are        '
  11. '  used to support getting and setting properties.  They          '
  12. '  were written to get around a missing feature in Enable         '
  13. '  Basic - Variants are not supported with dlls.                  '
  14. '                 DO NOT CHANGE THIS FILE                         '
  15.  
  16. Declare Function TCWGetIntResult lib "TCAPI40" ( _ 
  17. ) As Integer
  18.  
  19. Declare Function TCWGetLongResult lib "TCAPI40" ( _ 
  20. ) As Long
  21.  
  22. Declare Function TCWGetDoubleResult lib "TCAPI40" ( _ 
  23. ) As Double
  24.  
  25. Declare Function TCWGetStringResult lib "TCAPI40" ( _ 
  26.     ByRef tcwstr As String _ 
  27. )
  28.  
  29. Declare Function TCWLayerPropertySetInt lib "TCAPI40" ( _ 
  30.     ByVal tcwl As Long, _ 
  31.     ByRef tcwstr As String, _ 
  32.     ByVal tcwvalue As Integer _ 
  33. )As Long
  34.  
  35. Declare Function TCWLayerPropertySetLong lib "TCAPI40" ( _ 
  36.     ByVal tcwl As Long, _ 
  37.     ByRef tcwstr As String, _ 
  38.     ByVal tcwvalue As Long _ 
  39. )As Long
  40.  
  41. Declare Function TCWLayerPropertySetString lib "TCAPI40" ( _ 
  42.     ByVal tcwl As Long, _ 
  43.     ByRef tcwstr As String, _ 
  44.     ByRef tcwvalue As String _ 
  45. )As Long
  46.  
  47. Declare Function TCWAppPropertySetInt lib "TCAPI40" ( _ 
  48.     ByRef tcwstr As String, _ 
  49.     ByVal tcwvalue As Integer _ 
  50. )As Long
  51.  
  52. Declare Function TCWAppPropertySetLong lib "TCAPI40" ( _ 
  53.     ByRef tcwstr As String, _ 
  54.     ByVal tcwvalue As Long _ 
  55. )As Long
  56.  
  57. Declare Function TCWAppPropertySetDbl lib "TCAPI40" ( _ 
  58.     ByRef tcwstr As String, _ 
  59.     ByVal tcwvalue As Double _ 
  60. ) As Long
  61.  
  62. Declare Function TCWAppPropertySetString lib "TCAPI40" ( _ 
  63.     ByRef tcwstr As String, _ 
  64.     ByRef tcwvalue As String _ 
  65. )As Long
  66.  
  67. Declare Function TCWDrawingPropertySetInt lib "TCAPI40" ( _ 
  68.     ByRef tcwstr As String, _ 
  69.     ByVal tcwvalue As Integer _ 
  70. )As Long
  71.  
  72. Declare Function TCWDrawingPropertySetLong lib "TCAPI40" ( _ 
  73.     ByRef tcwstr As String, _ 
  74.     ByVal tcwvalue As Long _ 
  75. )As Long
  76.  
  77. Declare Function TCWDrawingPropertySetDbl lib "TCAPI40" ( _ 
  78.     ByRef tcwstr As String, _ 
  79.     ByVal tcwvalue As Double _ 
  80. )As Long
  81.  
  82. Declare Function TCWDrawingPropertySetString lib "TCAPI40" ( _ 
  83.     ByRef tcwstr As String, _ 
  84.     ByRef tcwvalue As String _ 
  85. )As Long
  86.  
  87. Declare Function TCWGraphicPropertySetInt lib "TCAPI40" ( _ 
  88.     ByVal tcwg As Long,  _ 
  89.     ByRef tcwstr As String, _ 
  90.     ByVal tcwvalue As Integer _ 
  91. )As Long
  92.  
  93. Declare Function TCWGraphicPropertySetLong lib "TCAPI40" ( _ 
  94.     ByVal tcwg As Long, _ 
  95.     ByRef tcwstr As String, _ 
  96.     ByVal tcwvalue As Long _ 
  97. )As Long
  98.  
  99. Declare Function TCWGraphicPropertySetDbl lib "TCAPI40" ( _ 
  100.     ByVal tcwg As Long, _ 
  101.     ByRef tcwstr As String, _ 
  102.     ByVal tcwvalue As Double _ 
  103. )As Long
  104.  
  105. Declare Function TCWGraphicPropertySetString lib "TCAPI40" ( _ 
  106.     ByVal tcwg As Long, _ 
  107.     ByRef tcwstr As String, _ 
  108.     ByRef tcwvalue As String _ 
  109. )As Long
  110.  
  111. Declare Function TCWLayerPropertyGetX lib "TCAPI40" ( _ 
  112.     ByVal tcwlayer As Long, _ 
  113.     ByRef tcwpropertyname As String _ 
  114. ) As Long
  115.  
  116. Declare Function TCWAppPropertyGetX lib "TCAPI40" ( _ 
  117.     ByRef tcwpropertyname As String _ 
  118. ) As Long
  119.  
  120. Declare Function TCWDrawingPropertyGetX lib "TCAPI40" ( _ 
  121.     ByRef tcwpropertyname As String _ 
  122. ) As Long
  123.  
  124. Declare Function TCWGraphicPropertyGetX lib "TCAPI40" ( _ 
  125.     ByVal tcwg As Long, _ 
  126.     ByRef tcwpropertyname As String _ 
  127. ) As Long
  128.  
  129. 'Functions begin
  130. Function TCWAppPropertyGet(ByVal tcwstr As String) As Variant
  131.   Dim tcwResult As Variant
  132.   Dim tcwRType As Long
  133.  
  134.   tcwRType = TCWAppPropertyGetX(tcwstr)
  135.   tcwResult = TCWGetResult(tcwRType)
  136.   TCWAppPropertyGet = tcwResult
  137.  
  138. End Function
  139.  
  140. Function TCWAppPropertySet(ByVal tcwstr As String, ByVal tcwvalue As Variant) As Long
  141.   Dim tcwResult As Long
  142.   Dim tcwRType As Long
  143.   Dim tcwIType As Integer
  144.   Dim tcwLType As Long
  145.   Dim tcwDType As Double
  146.   Dim tcwSType As String
  147.  
  148.   If (VarType(tcwvalue) = 2) Then
  149.     tcwIType = tcwvalue
  150.     tcwResult = TCWAppPropertySetInt(tcwstr, tcwIType)  
  151.   ElseIf (VarType(tcwvalue) = 3) Then
  152.     tcwLType = tcwvalue
  153.     tcwResult = TCWAppPropertySetLong(tcwstr, tcwLType)
  154.   ElseIf (VarType(tcwvalue) = 5) Then
  155.     tcwDType = tcwvalue
  156.     tcwResult = TCWAppPropertySetDbl(tcwstr, tcwDType)
  157.   ElseIf (VarType(tcwvalue) = 8) Then
  158.     tcwSType = tcwvalue
  159.     tcwResult = TCWAppPropertySetString(tcwstr, tcwSType)
  160.   ElseIf (VarType(tcwvalue) = 11) Then
  161.     tcwIType = tcwvalue
  162.     tcwResult = TCWAppPropertySetInt(tcwstr, tcwIType)
  163.   End If
  164.  
  165.   TCWAppPropertySet = tcwResult
  166.  
  167. End Function
  168.  
  169.  
  170. Function TCWDrawingPropertyGet(ByVal tcwstr As String) As Variant
  171.   Dim tcwResult As Variant
  172.   Dim tcwRType As Long
  173.  
  174.   tcwRType = TCWDrawingPropertyGetX(tcwstr)
  175.   tcwResult = TCWGetResult(tcwRType)
  176.   TCWDrawingPropertyGet = tcwResult
  177.  
  178. End Function
  179.  
  180. Function TCWDrawingPropertySet(ByVal tcwstr As String, ByVal tcwvalue As Variant) As Long
  181.   Dim tcwResult As Long
  182.   Dim tcwRType As Long
  183.   Dim tcwIType As Integer
  184.   Dim tcwLType As Long
  185.   Dim tcwSType As String
  186.  
  187.   If (VarType(tcwvalue) = 2) Then
  188.     tcwIType = tcwvalue
  189.     tcwResult = TCWDrawingPropertySetInt(tcwstr, tcwIType)  
  190.   ElseIf (VarType(tcwvalue) = 3) Then
  191.     tcwLType = tcwvalue
  192.     tcwResult = TCWDrawingPropertySetLong(tcwstr, tcwLType)
  193.   ElseIf (VarType(tcwvalue) = 8) Then
  194.     tcwSType = tcwvalue
  195.     tcwResult = TCWDrawingPropertySetSTring(tcwstr, tcwSType)
  196.   ElseIf (VarType(tcwvalue) = 11) Then
  197.     tcwIType = tcwvalue
  198.     tcwResult = TCWDrawingPropertySetInt(tcwstr, tcwIType)
  199.   End If
  200.  
  201.   TCWDrawingPropertySet = tcwResult
  202.  
  203. End Function
  204.  
  205. Function TCWGraphicPropertyGet(ByVal tcwg As Long, ByVal tcwstr As String) As Variant
  206.   Dim tcwResult As Variant
  207.   Dim tcwRType As Long
  208.  
  209.   tcwRType = TCWGraphicPropertyGetX(tcwg, tcwstr)
  210.   tcwResult = TCWGetResult(tcwRType)
  211.   TCWGraphicPropertyGet = tcwResult
  212.  
  213. End Function
  214.  
  215. Function TCWGraphicPropertySet(ByVal tcwg As Long, ByVal tcwstr As String, ByVal tcwvalue As Variant) As Long
  216.   Dim tcwResult As Long
  217.   Dim tcwRType As Long
  218.   Dim tcwIType As Integer
  219.   Dim tcwLType As Long
  220.   Dim tcwSType As String
  221.  
  222.   If (VarType(tcwvalue) = 2) Then
  223.     tcwIType = tcwvalue
  224.     tcwResult = TCWGraphicPropertySetInt(tcwg, tcwstr, tcwIType)  
  225.   ElseIf (VarType(tcwvalue) = 3) Then
  226.     tcwLType = tcwvalue
  227.     tcwResult = TCWGraphicPropertySetLong(tcwg, tcwstr, tcwLType)
  228.   ElseIf (VarType(tcwvalue) = 8) Then
  229.     tcwSType = tcwvalue
  230.     tcwResult = TCWGraphicPropertySetSTring(tcwg, tcwstr, tcwSType)
  231.   ElseIf (VarType(tcwvalue) = 11) Then
  232.     tcwIType = tcwvalue
  233.     tcwResult = TCWGraphicPropertySetInt(tcwg, tcwstr, tcwIType)
  234.   End If
  235.  
  236.   TCWGraphicPropertySet = tcwResult
  237.  
  238. End Function
  239.  
  240. Function TCWLayerPropertyGet(ByVal tcwl As Long, ByVal tcwstr As String) As Variant
  241.   Dim tcwResult As Variant
  242.   Dim tcwRType As Long
  243.  
  244.   tcwRType = TCWLayerPropertyGetX(tcwl, tcwstr)
  245.   tcwResult = TCWGetResult(tcwRType)
  246.  
  247.   TCWLayerPropertyGet = tcwResult
  248.  
  249. End Function
  250.  
  251. Function TCWLayerPropertySet(ByVal tcwl As Long, ByVal tcwstr As String, ByVal tcwvalue As Variant) As Long
  252.   Dim tcwResult As Long
  253.   Dim tcwRType As Long
  254.   Dim tcwIType As Integer
  255.   Dim tcwLType As Long
  256.   Dim tcwSType As String
  257.  
  258.   If (VarType(tcwvalue) = 2) Then
  259.     tcwIType = tcwvalue
  260.     tcwResult = TCWLayerPropertySetInt(tcwl, tcwstr, tcwIType)  
  261.   ElseIf (VarType(tcwvalue) = 3) Then
  262.     tcwLType = tcwvalue
  263.     tcwResult = TCWLayerPropertySetLong(tcwl, tcwstr, tcwLType)
  264.   ElseIf (VarType(tcwvalue) = 8) Then
  265.     tcwSType = tcwvalue
  266.     tcwResult = TCWLayerPropertySetSTring(tcwl, tcwstr, tcwSType)
  267.   ElseIf (VarType(tcwvalue) = 11) Then
  268.     tcwIType = tcwvalue
  269.     tcwResult = TCWLayerPropertySetInt(tcwl, tcwstr, tcwIType)
  270.   End If
  271.  
  272.   TCWLayerPropertySet = tcwResult
  273.  
  274. End Function
  275.  
  276. Function TCWGetResult(ByVal tcwret As Long) As Variant
  277. Dim tcwResult As Variant
  278. Dim tcwIType As Integer
  279. Dim tcwDType As Double
  280. Dim tcwLType As Long
  281. Dim tcwSType As String
  282.  
  283.   If (tcwret = 0) Then
  284.     tcwResult = 0
  285.   ElseIf (tcwret = 2) Then
  286.     tcwIType = TCWGetIntResult()  
  287.     tcwResult = tcwIType
  288.   ElseIf (tcwret = 3) Then
  289.     tcwLType = TCWGetLongResult()
  290.     tcwResult = tcwLType
  291.   ElseIf (tcwret = 5) Then
  292.     tcwDType = TCWGetDoubleResult()
  293.     tcwResult = tcwDType
  294.   ElseIf (tcwret = 8) Then
  295.     TCWGetStringResult tcwSType
  296.     tcwResult = tcwSType
  297.   ElseIf (tcwret = 11) Then
  298.     tcwIType = TCWGetIntResult()
  299.     tcwResult = tcwIType
  300.   End If
  301.  
  302.   TCWGetResult = tcwResult
  303. End Function
  304.