home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Demo / conceptdraw / data1.cab / Samples__Basic / Solutions / Diagraming / JointGraph / JointGraph.cdb < prev    next >
Text File  |  2004-02-13  |  21KB  |  383 lines

  1. '╨í╨╕╨╝╨▓╨╛╨╗, ╤ü╨╗╤â╨╢╨░╤ë╨╕╨╣ ╤Ç╨░╨╖╨┤╨╡╨╗╨╕╤é╨╡╨╗╨╡╨╝ ╨╝╨╡╨╢╨┤╤â ╨┐╨╛╨╗╤Å╨╝╨╕
  2. Const constrCharSeparator As String = ";"
  3.  
  4. '╨£╨░╤ü╤ü╨╕╨▓, ╨▓ ╨║╨╛╤é╨╛╤Ç╨╛╨╝ ╨╖╨░╨┐╨╕╤ü╤ï╨▓╨░╤Ä╤é╤ü╤Å ╨╖╨░╨│╨╛╨╗╨╛╨▓╨║╨╕ ╤ü╤é╨╛╨╗╨▒╤å╨╛╨▓ ╤ä╨░╨╣╨╗╨░ ╨┤╨░╨╜╨╜╤ï╤à. ╨í╨╛╨╛╤é╨▓╨╡╤é╤ü╤é╨▓╤â╤Ä╤é ╨╛╨┐╨╕╤ü╨░╨╜╨╕╤Å╨╝ ╤ü╤é╨░╨╜╤å╨╕╨╣.
  5. Dim asNames() As String
  6. '╨¥╨░╨╕╨▒╨╛╨╗╤î╤ê╨╕╨╣ ╨╕╤ü╨┐╨╛╨╗╤î╨╖╤â╤Ä╤ë╨╕╨╣╤ü╤Å ╨╕╨╜╨┤╨╡╨║╤ü ╨╝╨░╤ü╤ü╨╕╨▓╨░ asNames.
  7. Dim iNamesUBound As Integer
  8. '╨ö╨▓╤â╨╝╨╡╤Ç╨╜╤ï╨╣ ╨╝╨░╤ü╤ü╨╕╨▓, ╨▓ ╨║╨╛╤é╨╛╤Ç╨╛╨╝ ╨╖╨░╨┐╨╕╤ü╤ï╨▓╨░╤Ä╤é╤ü╤Å ╤Ç╨╡╨╖╤â╨╗╤î╤é╨░╤é╤ï ╨╕╨╖╨╝╨╡╤Ç╨╡╨╜╨╕╨╣ ╤é╨╡╨╝╨┐╨╡╤Ç╨░╤é╤â╤Ç╤ï ╨╜╨░ ╨║╨░╨╢╨┤╨╛╨╣ ╨╕╨╖ ╤ü╤é╨░╨╜╤å╨╕╨╣ ╨┐╨╛ ╨┤╨╜╤Å╨╝.
  9. Dim adValues() As Double
  10. '╨¥╨░╨╕╨▒╨╛╨╗╤î╤ê╨╕╨╣ ╨╕╤ü╨┐╨╛╨╗╤î╨╖╤â╤Ä╤ë╨╕╨╣╤ü╤Å ╨╕╨╜╨┤╨╡╨║╤ü ╨▓╤é╨╛╤Ç╨╛╨╣ ╤Ç╨░╨╖╨╝╨╡╤Ç╨╜╨╛╤ü╤é╨╕ ╨╝╨░╤ü╤ü╨╕╨▓╨░ adValues.
  11. Dim iMaxUsedIndex As Integer
  12.  
  13. '╨£╨░╨║╤ü╨╕╨╝╨░╨╗╤î╨╜╨╛╨╡ ╨║╨╛╨╗╨╕╤ç╨╡╤ü╤é╨▓╨╛ ╤ü╤é╤Ç╨╛╨║ ╨┤╨░╨╜╨╜╤ï╤à, ╨║╨╛╤é╨╛╤Ç╨╛╨╡ ╨╛╨╢╨╕╨┤╨░╨╡╤é╤ü╤Å ╨▓ ╤ä╨░╨╣╨╗╨╡ ╨┤╨░╨╜╨╜╤ï╤à. ╨æ╨╡╨╖ ╤â╤ç╨╡╤é╨░
  14. '╨┐╨╡╤Ç╨▓╨╛╨╣ (╨╖╨░╨│╨╛╨╗╨╛╨▓╨╛╤ç╨╜╨╛╨╣ ╤ü╤é╤Ç╨╛╨║╨╕).
  15. Const conintMaxDataStrings As Integer = 31
  16.  
  17. '╨£╨░╤ü╤ê╤é╨░╨▒ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╤ï ╨┐╨╛ ╨╛╤ü╨╕ OX. ╨Ü╨╛╨╗╨╕╤ç╨╡╤ü╤é╨▓╨╛ ╤Ä╨╜╨╕╤é╨╛╨▓ ╨▓ ╨╡╨┤╨╕╨╜╨╕╤å╨╡ ╤ê╨║╨░╨╗╤ï. 
  18. Const condblXScale As Double = 50
  19. '╨£╨░╤ü╤ê╤é╨░╨▒ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╤ï ╨┐╨╛ ╨╛╤ü╨╕ OY. ╨Ü╨╛╨╗╨╕╤ç╨╡╤ü╤é╨▓╨╛ ╤Ä╨╜╨╕╤é╨╛╨▓ ╨▓ ╨╡╨┤╨╕╨╜╨╕╤å╨╡ ╤ê╨║╨░╨╗╤ï. 
  20. Const condblYScale As Double = 50
  21. '╨£╨╕╨╜╨╕╨╝╨░╨╗╤î╨╜╨╛╨╡ ╨╖╨╜╨░╤ç╨╡╨╜╨╕╨╡ ╨┐╨╛ ╨╛╤ü╨╕ OX, ╨║╨╛╤é╨╛╤Ç╨╛╨╡ ╨▒╤â╨┤╨╡╤é ╨╕╤ü╨┐╨╛╨╗╤î╨╖╨╛╨▓╨░╤é╤î╤ü╤Å ╨▓ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╨╡.
  22. Const condblMinX As Double = 1
  23. '╨£╨░╨║╤ü╨╕╨╝╨░╨╗╤î╨╜╨╛╨╡ ╨╖╨╜╨░╤ç╨╡╨╜╨╕╨╡ ╨┐╨╛ ╨╛╤ü╨╕ OX, ╨║╨╛╤é╨╛╤Ç╨╛╨╡ ╨▒╤â╨┤╨╡╤é ╨╕╤ü╨┐╨╛╨╗╤î╨╖╨╛╨▓╨░╤é╤î╤ü╤Å ╨▓ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╨╡.
  24. Const condblMaxX As Double = 31
  25. '╨£╨╕╨╜╨╕╨╝╨░╨╗╤î╨╜╨╛╨╡ ╨╖╨╜╨░╤ç╨╡╨╜╨╕╨╡ ╨┐╨╛ ╨╛╤ü╨╕ OY, ╨║╨╛╤é╨╛╤Ç╨╛╨╡ ╨▒╤â╨┤╨╡╤é ╨╕╤ü╨┐╨╛╨╗╤î╨╖╨╛╨▓╨░╤é╤î╤ü╤Å ╨▓ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╨╡.
  26. Const condblMinY As Double = 9
  27. '╨£╨░╨║╤ü╨╕╨╝╨░╨╗╤î╨╜╨╛╨╡ ╨╖╨╜╨░╤ç╨╡╨╜╨╕╨╡ ╨┐╨╛ ╨╛╤ü╨╕ OY, ╨║╨╛╤é╨╛╤Ç╨╛╨╡ ╨▒╤â╨┤╨╡╤é ╨╕╤ü╨┐╨╛╨╗╤î╨╖╨╛╨▓╨░╤é╤î╤ü╤Å ╨▓ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╨╡.
  28. Const condblMaxY As Double = 50
  29.  
  30. Declare Sub SelectFileAndRefreshDiagram()
  31. Declare Sub AutoRefresh()
  32. Declare Function RefreshDiagram(ByVal strTextFileName As String) As Boolean
  33. Declare Function LoadData(ByVal strFileName As String) As Boolean
  34. Declare Function DrawDiagram(ByVal strTextFileName As String) As Boolean
  35. Declare Function DrawTextBox(ByVal GroupShape As Shape, ByVal x1 As Double, ByVal y1 As Double, ByVal x2 As Double, ByVal y2 As Double, ByVal strText As String, ByVal lTextSize As Long, ByVal lTextStyle As Long) As Shape
  36.  
  37. '========================================================================================================================
  38. '========================================================================================================================
  39.  
  40. '╨í╨╛╨╖╨┤╨░╨╜╨╕╨╡ ╨┐╨╛╨╗╤î╨╖╨╛╨▓╨░╤é╨╡╨╗╤î╤ü╨║╨╛╨│╨╛ ╨╝╨╡╨╜╤Ä. ╨É╨▓╤é╨╛╨╝╨░╤é╨╕╤ç╨╡╤ü╨║╨╕ ╨▓╤ï╨╖╤ï╨▓╨░╨╡╤é╤ü╤Å ╨┐╤Ç╨╕ ╨╛╤é╨║╤Ç╤ï╤é╨╕╨╕ ╨┤╨╛╨║╤â╨╝╨╡╨╜╤é╨░ ╨╕╨╖
  41. '╨╝╨░╨║╤Ç╨╛╤ü╨░ ╤â╤Ç╨╛╨▓╨╜╤Å ╨┤╨╛╨║╤â╨╝╨╡╨╜╤é╨░.
  42. Sub CreateUserMenu()
  43.     Dim custMenu As Menu
  44.     Dim newMenuItem As MenuItem
  45.     
  46.     Set custMenu = thisDoc.CustomMenu
  47.     custMenu.Caption = "Fill Di&agram"
  48.     custMenu.RemoveAll()
  49.  
  50.     Set newMenuItem = custMenu.AddMenuItem(0)
  51.     newMenuItem.Caption = "&Select File And Refresh Diagram"
  52.     newMenuItem.SetCmdProcessing("SelectFileAndRefreshDiagram")
  53.  
  54.     Set newMenuItem = custMenu.AddMenuItem(0)
  55.     newMenuItem.Caption = "&Refresh Diagram"
  56.     newMenuItem.SetCmdProcessing("AutoRefresh")
  57. End Sub
  58.  
  59. '========================================================================================================================
  60. '========================================================================================================================
  61.  
  62. '╨É╨▓╤é╨╛╨╝╨░╤é╨╕╤ç╨╡╤ü╨║╨╛╨╡ ╨┐╨╛╤ü╤é╤Ç╨╛╨╡╨╜╨╕╨╡ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╤ï ╨┐╨╛ ╨╛╨▒╨╜╨╛╨▓╨╗╨╡╨╜╨╜╤ï╨╝ ╨┤╨░╨╜╨╜╤ï╨╝ ╨▓ ╤é╨╡╨║╤ü╤é╨╛╨▓╨╛╨╝ ╤ä╨░╨╣╨╗╨╡.
  63. '╨ò╤ü╨╗╨╕ ╨╕╨╝╤Å ╤ä╨░╨╣╨╗╨░ ╤ü╨╛╤à╤Ç╨░╨╜╨╡╨╜╨╛ ╨▓ Property ╨╛╨▒╤è╨╡╨║╤é╨░ ╨╕ ╤é╨░╨║╨╛╨╣ ╤ä╨░╨╣╨╗ ╤ü╤â╤ë╨╡╤ü╤é╨▓╤â╨╡╤é, ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╨░ ╨▒╤â╨┤╨╡╤é ╨┐╨╡╤Ç╨╡╤ü╤ç╨╕╤é╨░╨╜╨░ ╨▒╨╡╨╖
  64. '╨╖╨░╨┐╤Ç╨╛╤ü╨░ ╤â ╨┐╨╛╨╗╤î╨╖╨╛╨▓╨░╤é╨╡╨╗╤Å ╨╜╨╛╨▓╨╛╨│╨╛ ╨╕╨╝╨╡╨╜╨╕ ╤ä╨░╨╣╨╗╨░ ╨┤╨░╨╜╨╜╤ï╤à.
  65. Sub AutoRefresh()
  66. On Error GoTo ErrHandler
  67.     '╨ÿ╨╝╤Å ╤ä╨░╨╣╨╗╨░ ╨┤╨░╨╜╨╜╤ï╤à
  68.     Dim strTextFileName As String
  69.     '╨í╤ü╤ï╨╗╨║╨░ ╨╜╨░ Custom Property ╨╛╨▒╤è╨╡╨║╤é╨░ (╨▓ ╨╛╨┤╨╜╨╛╨╝ ╨╕╨╖ ╨╜╨╕╤à ╨╝╨╛╨╢╨╡╤é ╤à╤Ç╨░╨╜╨╕╤é╤î╤ü╤Å ╨┐╨╛╨╗╨╜╨╛╨╡ ╨╕╨╝╤Å ╤ä╨░╨╣╨╗╨░ ╨┤╨░╨╜╨╜╤ï╤à). 
  70.     Dim FileNameProp As CustomProp
  71.     Dim NextShape As Shape
  72.     Dim ActivePage As Page
  73.     Dim i As Integer
  74.     Dim j As Integer
  75.     
  76.     Set ActivePage = thisDoc.ActivePage()
  77.     
  78.     '╨ƒ╤Ç╨╛╨▓╨╡╤Ç╤Å╨╡╨╝ ╨▓╤ü╨╡ ╤ê╤ì╨╣╨┐╤ï ╨▓ ╨┤╨╛╨║╤â╨╝╨╡╨╜╤é╨╡. ╨¿╤ì╨╣╨┐, ╨▓╨╜╤â╤é╤Ç╨╕ ╨║╨╛╤é╨╛╤Ç╨╛╨│╨╛ ╨╛╨▒╨╜╨╛╨▓╨╗╤Å╨╡╤é╤ü╤Å ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╨░, 
  79.     '╤â╨╖╨╜╨░╨╡╤é╤ü╤Å ╨┐╨╛ Name.
  80.     For j=1 To ActivePage.ShapesNum()
  81.         Set NextShape = ActivePage.Shape(j)
  82.         If NextShape.Name = "Diagram" Then
  83.         '╨ò╤ü╨╗╨╕ ╨╜╨░╨╣╨┤╨╡╨╜ ╤ê╤ì╨╣╨┐ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╤ï, ╨┐╤Ç╨╛╨▓╨╡╤Ç╤Å╨╡╨╝, ╤ü╨╛╤à╤Ç╨░╨╜╨╡╨╜╨╛ ╨╗╨╕ ╨▓ ╨╜╨╡╨╝ Property ╤ü ╨╕╨╝╨╡╨╜╨╡╨╝ ╤ä╨░╨╣╨╗╨░-╨╕╤ü╤é╨╛╤ç╨╜╨╕╨║╨░ ╨┤╨░╨╜╨╜╤ï╤à.
  84.             i=1
  85.             Set FileNameProp = Nothing
  86.             Do While i<=NextShape.CustomPropsNum() And FileNameProp = Nothing
  87.                 If NextShape.CustomProp(i).Label = "LastSourceFileName" Then
  88.                     Set FileNameProp = NextShape.CustomProp(i) 
  89.                     strTextFileName = FileNameProp.Value
  90.                     '╨ò╤ü╨╗╨╕ Property ╤ü╤â╤ë╨╡╤ü╤é╨▓╤â╨╡╤é, ╨╕ ╤ü╤â╤ë╨╡╤ü╤é╨▓╤â╨╡╤é ╤ä╨░╨╣╨╗, ╤â╨║╨░╨╖╨░╨╜╨╜╤ï╨╣ ╨▓ ╨╜╨╡╨╝ ╨║╨░╨║ ╨╕╤ü╤é╨╛╤ç╨╜╨╕╨║ ╨┤╨░╨╜╨╜╤ï╤à,
  91.                     '╨░╨▓╤é╨╛╨╝╨░╤é╨╕╤ç╨╡╤ü╨║╨╕ ╨╛╨▒╨╜╨╛╨▓╨╗╤Å╨╡╨╝ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╤â.
  92.                     If Dir(strTextFileName) <> "" Then
  93.                          RefreshDiagram(strTextFileName)
  94.                     End If
  95.                 End If
  96.                 i = i + 1
  97.             Loop 
  98.         End If
  99.     Next
  100.     
  101.     Exit Sub
  102. ErrHandler:
  103.     MsgBox("In performing the macros, an error has occured.", cdbExclamation)
  104. End Sub
  105.  
  106. '========================================================================================================================
  107. '========================================================================================================================
  108.  
  109. '╨ù╨░╨┐╤Ç╨░╤ê╨╕╨▓╨░╨╡╨╝ ╨╕╨╝╤Å ╤ä╨░╨╣╨╗╨░-╨╕╤ü╤é╨╛╤ç╨╜╨╕╨║╨░ ╨┤╨░╨╜╨╜╤ï╤à ╨╕ ╤ü╤é╤Ç╨╛╨╕╨╝ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╤â ╨╜╨░ ╨╛╤ü╨╜╨╛╨▓╨░╨╜╨╕╨╕ ╤ì╤é╨╕╤à ╨┤╨░╨╜╨╜╤ï╤à.
  110. Sub SelectFileAndRefreshDiagram()
  111. On Error GoTo ErrHandler
  112.     Dim strTextFileName As String
  113.     
  114.     '╨ƒ╤Ç╨╡╨┤╨╗╨░╨│╨░╨╡╨╝ ╨┐╨╛╨╗╤î╨╖╨╛╨▓╨░╤é╨╡╨╗╤Ä ╨▓╤ï╨▒╤Ç╨░╤é╤î ╨╕╨╝╤Å ╤ä╨░╨╣╨╗╨░ ╨┤╨░╨╜╨╜╤ï╤à
  115.     strTextFileName = GetOpenFileName("txt","Text Files")
  116.     '╨ò╤ü╨╗╨╕ ╤ä╨░╨╗ ╨▓╤ï╨▒╤Ç╨░╨╜, ╤ü╤é╤Ç╨╛╨╕╨╝ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╤â.
  117.     If strTextFileName <> "" Then
  118.          RefreshDiagram(strTextFileName)
  119.     End If
  120.     Exit Sub
  121. ErrHandler:
  122.     MsgBox("In performing the macros, an error has occured.", cdbExclamation)
  123. End Sub
  124.  
  125. '========================================================================================================================
  126. '========================================================================================================================
  127.  
  128. '╨₧╨▒╨╜╨╛╨▓╨╗╤Å╨╡╨╝ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╤â ╨╜╨░ ╨╛╤ü╨╜╨╛╨▓╨░╨╜╨╕╨╕ ╨┤╨░╨╜╨╜╤ï╤à ╨▓ ╤ä╨░╨╣╨╗╨╡ strTextFileName 
  129. Function RefreshDiagram(ByVal strTextFileName As String) As Boolean
  130. On Error GoTo ErrHandler
  131.     RefreshDiagram = False
  132.  
  133.     '╨ù╨░╤ç╨╕╤é╤ï╨▓╨░╨╡╨╝ ╨┤╨░╨╜╨╜╤ï╨╡ ╨╕╨╖ ╤é╨╡╨║╤ü╤é╨╛╨▓╨╛╨│╨╛ ╤ä╨░╨╣╨╗╨░ ╨╕ ╨┐╨╛╨╝╨╡╤ë╨░╨╡╨╝ ╨╕╤à ╨▓ ╨╝╨░╤ü╤ü╨╕╨▓╤ï. ╨ò╤ü╨╗╨╕ ╨▓╨╛ ╨▓╤Ç╨╡╨╝╤Å 
  134.     '╨▓╤ï╨┐╨╛╨╗╨╜╨╡╨╜╨╕╤Å ╤ä╤â╨╜╨║╤å╨╕╨╕ LoadData ╨╜╨╡ ╨┐╤Ç╨╛╨╕╨╖╨╛╤ê╨╗╨╛ ╨╛╤ê╨╕╨▒╨╛╨║...
  135.     If LoadData(strTextFileName) Then
  136.         '... ╤é╨╛ ╤ü╤é╤Ç╨╛╨╕╨╝ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╤â. ╨ò╤ü╨╗╨╕ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╨░ ╨┐╨╛╤ü╤é╤Ç╨╛╨╡╨╜╨░ ╤â╤ü╨┐╨╡╤ê╨╜╨╛, ╤ü╨╛╨╛╨▒╤ë╨░╨╡╨╝ ╨╛╨▒ ╤ì╤é╨╛╨╝ ╨┐╨╛╨╗╤î╨╖╨╛╨▓╨░╤é╨╡╨╗╤Ä.
  137.         If DrawDiagram(strTextFileName) Then
  138.             RefreshDiagram = True
  139.             MsgBox("Diagramma bila uspeshno obnovlena na osnovanii dannih iz faila " & strTextFileName)
  140.         End If
  141.     End If
  142.  
  143.     Exit Function
  144. ErrHandler:
  145.     MsgBox("In performing the macros, an error has occured.", cdbExclamation)
  146. End Function
  147.  
  148. '========================================================================================================================
  149. '========================================================================================================================
  150.  
  151. '╨ù╨░╤ç╨╕╤é╤ï╨▓╨░╨╜╨╕╨╡ ╨┤╨░╨╜╨╜╤ï╤à ╨╕╨╖ ╤é╨╡╨║╤ü╤é╨╛╨▓╨╛╨│╨╛ ╤ä╨░╨╣╨╗╨░ strFileName ╨╕ ╤ü╨╛╤à╤Ç╨░╨╜╨╡╨╜╨╕╨╡ ╨╕╤à ╨▓ ╨╝╨░╤ü╤ü╨╕╨▓╨░╤à.
  152. Function LoadData(ByVal strFileName As String) As Boolean
  153. On Error GoTo ErrHandle
  154.  
  155.     Dim intFileNumber As Integer        '╨ÿ╨┤╨╡╨╜╤é╨╕╤ä╨╕╨║╨░╤é╨╛╤Ç ╨╛╨▒╤Ç╨░╨▒╨░╤é╤ï╨▓╨░╨╡╨╝╨╛╨│╨╛ ╤ä╨░╨╣╨╗╨░ ╨┤╨░╨╜╨╜╤ï╤à
  156.     Dim strLineData As String        '╨í╤é╤Ç╨╛╨║╨░, ╤ü╨╛╨┤╨╡╤Ç╨╢╨░╤ë╨░╤Å ╨╛╨┤╨╜╤â ╤ü╤é╤Ç╨╛╨║╤â ╨╕╨╖ ╤é╨╡╨║╤ü╤é╨╛╨▓╨╛╨│╨╛ ╤ä╨░╨╣╨╗╨░.
  157.     Dim intFieldsCounter As Integer    '╨¥╨╛╨╝╨╡╤Ç ╨╛╨▒╤Ç╨░╨▒╨░╤é╤ï╨▓╨░╤Ä╤ë╨╡╨│╨╛╤ü╤Å ╨┐╨╛╨╗╤Å ╤ü╤é╤Ç╨╛╨║╨╕
  158.     Dim intSeparatorPos As Integer    '╨ƒ╨╛╨╖╨╕╤å╨╕╤Å ╤Ç╨░╨╖╨┤╨╡╨╗╨╕╤é╨╡╨╗╤Å ╨┐╨╛╨╗╨╡╨╣ ╤ü╤é╤Ç╨╛╨║╨╕
  159.     Dim strFiels As String            '╨í╨╛╨┤╨╡╤Ç╨╢╨╕╨╝╨╛╨╡ ╨╛╨┤╨╜╨╛╨│╨╛ ╨┐╨╛╨╗╤Å ╤ü╤é╤Ç╨╛╨║╨╕
  160.     Dim fNoError As Boolean            '╨ñ╨╗╨░╨│, ╨┐╨╛╨║╨░╨╖╤ï╨▓╨░╤Ä╤ë╨╕╨╣, ╤ç╤é╨╛ ╨┐╤Ç╨╕ ╨╛╨▒╤Ç╨░╨▒╨╛╤é╨║╨╡ ╨┤╨░╨╜╨╜╤ï╤à ╤ä╨░╨╣╨╗╨░ ╨╜╨╡╤é ╨╛╤ê╨╕╨▒╨╛╨║
  161.     Dim strCharSeparator As String    '╨á╨░╨╖╨┤╨╡╨╗╨╕╤é╨╡╨╗╤î ╨┐╨╛╨╗╨╡╨╣ ╤ü╤é╤Ç╨╛╨║╨╕
  162.     Dim i As Integer
  163.     
  164.     strCharSeparator = constrCharSeparator
  165.     
  166.     fNoError = True
  167.     
  168.     '╨₧╤é╨║╤Ç╤ï╤é╨╕╨╡ ╤é╨╡╨║╤ü╤é╨╛╨▓╨╛╨│╨╛ ╤ä╨░╨╣╨╗╨░ ╨┤╨╗╤Å ╤ç╤é╨╡╨╜╨╕╤Å ╨┤╨░╨╜╨╜╤ï╤à
  169.     intFileNumber = FreeFile()
  170.     Open strFileName For Input As #intFileNumber
  171.     
  172.     
  173.     iMaxUsedIndex = -2
  174.     iNamesUBound = -1
  175.     
  176.     '╨ù╨░╤ç╨╕╤é╤ï╨▓╨░╨╡╨╝ ╨┐╨╛ ╨╛╨┤╨╜╨╛╨╣ ╤ü╤é╤Ç╨╛╨║╨╡ ╨╕╨╖ ╨┤╨╛ ╤é╨╡╤à ╨┐╨╛╤Ç, ╨┐╨╛╨║╨░ ╨╜╨╡ ╨┤╨╛╤ü╤é╨╕╨│╨╜╨╡╨╝ ╨║╨╛╨╜╤å╨░ ╤é╨╡╨║╤ü╤é╨╛╨▓╨╛╨│╨╛ ╤ä╨░╨╣╨╗╨░ ╨╕╨╗╨╕ ╨┐╨╛╨║╨░ ╨╜╨╡ ╨▓╨╛╨╖╨╜╨╕╨║╨╜╨╡╤é ╨╛╤ê╨╕╨▒╨║╨░    
  177.     Do While (Not EOF(intFileNumber)) And fNoError
  178.         '╨ù╨░╤ç╨╕╤é╨░╤é╤î ╤ü╤é╤Ç╨╛╨║╤â
  179.         Line Input #intFileNumber, strLineData
  180.         strLineData = Trim$(strLineData)
  181.         '╨ò╤ü╨╗╨╕ ╤ü╤é╤Ç╨╛╨║╨░ ╨╜╨╡ ╨┐╤â╤ü╤é╨░, ╨╛╨▒╤Ç╨░╨▒╨╛╤é╨░╨╡╨╝ ╨╡╨╡.
  182.         If strLineData <> "" Then
  183.             '╨ú╨▓╨╡╨╗╨╕╤ç╨╕╤é╤î ╨╜╨░ 1 ╨╖╨╜╨░╤ç╨╡╨╜╨╕╨╡ ╨╜╨░╨╕╨▒╨╛╨╗╤î╤ê╨╡╨│╨╛ ╨╕╤ü╨┐╨╛╨╗╤î╨╖╤â╤Ä╤ë╨╡╨│╨╛╤ü╤Å ╨╕╨╜╨┤╨╡╨║╤ü╨░ ╨▓╤é╨╛╤Ç╨╛╨╣ ╤Ç╨░╨╖╨╝╨╡╤Ç╨╜╨╛╤ü╤é╨╕ ╨▓ ╨╝╨░╤ü╤ü╨╕╨▓╨╡.
  184.             iMaxUsedIndex = iMaxUsedIndex + 1
  185.             '╨ƒ╤Ç╨╛╨▓╨╡╤Ç╨╕╤é╤î, ╨╜╨╡ ╤ü╨╗╨╕╤ê╨║╨╛╨╝ ╨╗╨╕ ╨╝╨╜╨╛╨│╨╛ ╤ü╤é╤Ç╨╛╨║ ╨▓ ╤ä╨░╨╣╨╗╨╡ ╨┤╨░╨╜╨╜╤ï╤à
  186.             If  iMaxUsedIndex > conintMaxDataStrings-1 Then
  187.                 MsgBox("V faile soderzhits'a bolee " & conintMaxDataStrings  & " stroki dannih, ne schitaja zagolovochnoj. Eto slishkom mnogo dlja odnomesjachnoj diagrammi.")
  188.                 fNoError = False
  189.             Else
  190.                 '╨ÿ╨╜╨╕╤å╨╕╨░╨╗╨╕╨╖╨░╤å╨╕╤Å ╨╜╨╛╨╝╨╡╤Ç╨░ ╤é╨╡╨║╤â╤ë╨╡╨│╨╛ ╨┐╨╛╨╗╤Å ╤é╨╡╨║╤â╤ë╨╡╨╣ ╤ü╤é╤Ç╨╛╨║╨╕
  191.                 intFieldsCounter = 1
  192.                 Do
  193.                     '╨₧╨▒╤Ç╨░╨▒╨░╤é╤ï╨▓╨░╨╡╨╝ ╨┐╨╛╨╗╤Å ╤ü╤é╤Ç╨╛╨║╨╕ ╨┤╨╛ ╤é╨╡╤à ╨┐╨╛╤Ç, ╨┐╨╛╨║╨░ ╨╜╨╡ ╨┤╨╛╤ü╤é╨╕╨│╨╜╨╡╨╝ ╨║╨╛╨╜╤å╨░ ╤ü╤é╤Ç╨╛╨║╨╕. 
  194.                     '╨ö╨░╨╜╨╜╤ï╨╡ ╨╕╨╖ ╨┐╨╛╨╗╨╡╨╣ ╨┐╨╛╨╝╨╡╤ë╨░╨╡╨╝ ╨▓ ╨╝╨░╤ü╤ü╨╕╨▓╤ï.
  195.                     intSeparatorPos = InStr(strLineData, strCharSeparator)
  196.                     If intSeparatorPos > 0 Then
  197.                         strFiels = Trim(Left(strLineData, intSeparatorPos - 1))
  198.                         strLineData = Right(strLineData, Len(strLineData) - intSeparatorPos)
  199.                     Else
  200.                         '╨¥╨╛╨▓╤ï╨╣ ╤ü╨╡╨┐╨░╤Ç╨░╤é╨╛╤Ç ╨╜╨╡ ╨╜╨░╨╣╨┤╨╡╨╜. ╨¡╤é╨╛ ╨┐╨╛╤ü╨╗╨╡╨┤╨╜╨╡╨╡ ╨┐╨╛╨╗╨╡ ╤ü╤é╤Ç╨╛╨║╨╕.
  201.                         strFiels = Trim(strLineData)
  202.                     End If
  203.                     If iMaxUsedIndex = -1 Then
  204.                         '╨ò╤ü╨╗╨╕ ╨░╨╜╨░╨╗╨╕╨╖╨╕╤Ç╤â╨╡╤é╤ü╤Å ╨┐╨╡╤Ç╨▓╨░╤Å (╨╖╨░╨│╨╛╨╗╨╛╨▓╨╛╤ç╨╜╨░╤Å) ╤ü╤é╤Ç╨╛╨║╨░, ╤â╨▓╨╡╨╗╨╕╤ç╨╕╨▓╨░╨╡╨╝ ╤Ç╨░╨╖╨╝╨╡╤Ç ╨╝╨░╤ü╤ü╨╕╨▓╨░ ╤ü ╨╜╨░╨╖╨▓╨░╨╜╨╕╤Å╨╝╨╕ ╤ü╤é╨░╨╜╤å╨╕╨╣
  205.                         iNamesUBound = intFieldsCounter - 1
  206.                         ReDim Preserve asNames(iNamesUBound) As String
  207.                         '╨ÿ ╨┐╨╛╨╝╨╡╤ë╨░╨╡╨╝ ╨▓ ╨╝╨░╤ü╤ü╨╕╨▓ ╨╜╨╛╨▓╨╛╨╡ ╨╖╨╜╨░╤ç╨╡╨╜╨╕╨╡.
  208.                         asNames(iNamesUBound) = strFiels 
  209.                     Else
  210.                         '╨ò╤ü╨╗╨╕ ╨░╨╜╨░╨╗╨╕╨╖╨╕╤Ç╤â╨╡╨╝ ╤ü╤é╤Ç╨╛╨║╤â ╨┤╨░╨╜╨╜╤ï╤à, ╨┐╨╛╨╝╨╡╤ë╨░╨╡╨╝ ╨▓ ╨╝╨░╤ü╤ü╨╕╨▓ ╨╖╨╜╨░╤ç╨╡╨╜╨╕╨╣ ╨╕╨╖╨╝╨╡╤Ç╨╡╨╜╨╕╨╣ ╨╜╨╛╨▓╨╛╨╡ ╤ç╨╕╤ü╨╗╨╛.
  211.                         adValues(intFieldsCounter - 1, iMaxUsedIndex) = CDbl(strFiels)
  212.                     End If
  213.                     intFieldsCounter = intFieldsCounter + 1
  214.                 Loop While intSeparatorPos > 0
  215.                 '╨ò╤ü╨╗╨╕ ╨╖╨░╨▓╨╡╤Ç╤ê╨╡╨╜ ╨░╨╜╨░╨╗╨╕╨╖ ╨╖╨░╨│╨╛╨╗╨╛╨▓╨╛╤ç╨╜╨╛╨╣ ╤ü╤é╤Ç╨╛╨║╨╕, ╨╕╨╖╨╝╨╡╨╜╤Å╨╡╨╝ ╤Ç╨░╨╖╨╝╨╡╤Ç ╨┤╨▓╤â╨╝╨╡╤Ç╨╜╨╛╨│╨╛ ╨╝╨░╤ü╤ü╨╕╨▓╨░ ╨╖╨╜╨░╤ç╨╡╨╜╨╕╨╣ ╤é╨░╨║, ╤ç╤é╨╛╨▒╤ï ╨▓ ╨╜╨╡╨╝ ╨╝╨╛╨│╨╗╨╕ ╨▒╤ï╤é╤î ╤Ç╨░╨╖╨╝╨╡╤ë╨╡╨╜╤ï ╨┤╨░╨╜╨╜╤ï╨╡ ╤ü╨╛ ╨▓╤ü╨╡╤à ╤ü╤é╨░╨╜╤å╨╕╨╣.
  216.                 If iMaxUsedIndex = -1 Then
  217.                     i = conintMaxDataStrings - 1
  218.                     ReDim adValues(iNamesUBound, i) As Double
  219.                 End If
  220.             End If
  221.         End If
  222.     Loop
  223.     
  224.     Close #intFileNumber
  225.     
  226.     '╨ƒ╤Ç╨╛╨▓╨╡╤Ç╨╕╤é╤î ╨▒╤ï╨╗╨╕ ╨╗╨╕ ╨▓ ╤ä╨░╨╣╨╗╨╡ ╨▓╨╛╨╛╨▒╤ë╨╡ ╨║╨░╨║╨╕╨╡-╤é╨╛ ╨┤╨░╨╜╨╜╤ï╨╡.
  227.     If iMaxUsedIndex = -1 Then
  228.         fNoError = False
  229.         MsgBox("V ukazannom faile ne obnaruzheni dannie.")
  230.     End If
  231.     
  232.     LoadData = fNoError
  233.     Exit Function
  234.     
  235. ErrHandle:
  236.     MsgBox ("Proizoshla oshibka pri zachitivanii textovogo faila.", cdbExclamation)
  237.     LoadData = False
  238.     Exit Function
  239. End Function 
  240.  
  241. '========================================================================================================================
  242. '========================================================================================================================
  243.  
  244. '╨ƒ╨╛╤ü╤é╤Ç╨╛╨╡╨╜╨╕╨╡ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╤ï ╨▓ ╨┤╨╛╨║╤â╨╝╨╡╨╜╤é╨╡ ConceptDraw
  245. Function DrawDiagram(ByVal strTextFileName As String) As Boolean
  246. On Error GoTo ErrHandle
  247.     Dim i As Long
  248.     Dim j As Long
  249.     Dim dblDiagHeight As Double        '╨Æ╤ï╤ü╨╛╤é╨░ ╨│╤Ç╤â╨┐╨┐╤ï, ╤ü╨╛╨┤╨╡╤Ç╨╢╨░╤ë╨╡╨╣ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╤â
  250.     Dim curPage As Page            '╨í╤ü╤ï╨╗╨║╨░ ╨╜╨░ ╤Ç╨░╨▒╨╛╤ç╤â╤Ä ╤ü╤é╤Ç╨░╨╜╨╕╤å╤â
  251.     Dim FileNameProp As CustomProp    '╨í╤ü╤ï╨╗╨║╨░ ╨╜╨░ Custom Property ╨╛╨▒╤è╨╡╨║╤é╨░ (╨▓ ╨╛╨┤╨╜╨╛╨╝ ╨╕╨╖ ╨╜╨╕╤à ╤à╤Ç╨░╨╜╨╕╤é╤ü╤Å ╨┐╨╛╨╗╨╜╨╛╨╡ ╨╕╨╝╤Å ╤ä╨░╨╣╨╗╨░ ╨┤╨░╨╜╨╜╤ï╤à). 
  252.     Dim DiagramShape As Shape        '╨í╤ü╤ï╨╗╨║╨░ ╨╜╨░ ╤ê╤ì╨╣╨┐, ╨┐╤Ç╨╡╨┤╤ü╤é╨░╨▓╨╗╤Å╤Ä╤ë╨╕╨╣ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╤â
  253.     Dim LineShape As Shape            '╨í╤ü╤ï╨╗╨║╨░ ╨╜╨░ ╤ê╤ì╨╣╨┐, ╨┐╤Ç╨╡╨┤╤ü╤é╨░╨▓╨╗╤Å╤Ä╤ë╨╕╨╣ ╨╗╨╕╨╜╨╕╤Ä ╨│╤Ç╨░╤ä╨╕╨║╨░
  254.     Dim LegendShape As Shape        '╨í╤ü╤ï╨╗╨║╨░ ╨╜╨░ ╤ê╤ì╨╣╨┐, ╨┐╤Ç╨╡╨┤╤ü╤é╨░╨▓╨╗╤Å╤Ä╤ë╨╕╨╣ ╨╗╨╡╨│╨╡╨╜╨┤╤â ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╤ï
  255.     Dim TextBox As Shape            '╨í╤ü╤ï╨╗╨║╨░ ╨╜╨░ ╤ê╤ì╨╣╨┐, ╨┐╤Ç╨╡╨┤╤ü╤é╨░╨▓╨╗╤Å╤Ä╤ë╨╕╨╣ ╤é╨╡╨║╤ü╤é╨╛╨▓╤â╤Ä ╨┐╨╛╨┤╨┐╨╕╤ü╤î
  256.     Dim strLostShapesName As String    '╨í╤é╤Ç╨╛╨║╨░, ╤ü╨╛╨┤╨╡╤Ç╨╢╨░╤ë╨╡╨╡ ╨╕╨╝╤Å ╤â╨┤╨░╨╗╨╡╨╜╨╜╨╛╨│╨╛ ╤ê╤ì╨╣╨┐╨░, ╨╜╨╡╨╛╨▒╤à╨╛╨┤╨╕╨╝╨╛╨│╨╛ ╨┤╨╗╤Å ╨║╨╛╤Ç╤Ç╨╡╨║╤é╨╜╨╛╨╣ ╤Ç╨░╨▒╨╛╤é╤ï ╨╝╨░╨║╤Ç╨╛╤ü╨░    
  257.     Dim intLineColor As Integer        '╨ª╨▓╨╡╤é ╨╗╨╕╨╜╨╕╨╕ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╤ï ╨▓ ╨╕╨╜╨┤╨╡╨║╤ü╨╜╨╛╨╝ ╨┐╤Ç╨╡╨┤╤ü╤é╨░╨▓╨╗╨╡╨╜╨╕╨╕
  258.     
  259.     
  260.     Set curPage = thisDoc.Page(1)
  261.  
  262.     i=1
  263.     Set DiagramShape = Nothing
  264.     Set LegendShape = Nothing
  265.     '╨ÿ╤ë╨╡╨╝ ╨▓ ╨┤╨╛╨║╤â╨╝╨╡╨╜╤é╨╡ ╨╜╨╡╨╛╨▒╤à╨╛╨┤╨╕╨╝╤ï╨╡ ╤ê╤ì╨╣╨┐╤ï, ╨▓ ╨║╨╛╤é╨╛╤Ç╤ï╤à ╨┤╨╛╨╗╨╢╨╜╤ï ╨▒╤ï╤é╤î ╤ü╨╛╨╖╨┤╨░╨╜╤ï ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╨░ ╨╕ ╨╡╨╡ ╨╗╨╡╨│╨╡╨╜╨┤╨░.
  266.     Do While i <= curPage.ShapesNum()
  267.         if curPage.Shape(i).Name = "Diagram" Then
  268.             Set DiagramShape = curPage.Shape(i)
  269.         End If
  270.         if curPage.Shape(i).Name = "Legend" Then
  271.             Set LegendShape = curPage.Shape(i)
  272.         End If
  273.         i=i+1
  274.     Loop    
  275.     strLostShapesName = ""
  276.     If DiagramShape = Nothing Then
  277.         strLostShapesName = "Diagram"
  278.     End If
  279.     If LegendShape = Nothing Then
  280.         strLostShapesName = "Legend"
  281.     End If
  282.     '╨ò╤ü╨╗╨╕ ╤ê╤ì╨╣╨┐ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╤ï ╨╜╨╡ ╨╜╨░╨╣╨┤╨╡╨╜, ╨▓╤ï╨┤╨░╨╡╤é╤ü╤Å ╤ü╨╛╨╛╨▒╤ë╨╡╨╜╨╕╨╡ ╨╛╨▒ ╨╛╤ê╨╕╨▒╨║╨╡ ╨╕ ╨▓╤ï╨┐╨╛╨╗╨╜╨╡╨╜╨╕╨╡ ╨╝╨░╨║╤Ç╨╛╤ü╨░ ╨┐╤Ç╨╡╨║╤Ç╨░╤ë╨░╨╡╤é╤ü╤Å. 
  283.     If strLostShapesName <> "" Then
  284.         MsgBox("Voznikla oshibka. Neobhodimij dlja postroenija diagrammi ob'ekt s name """ & strLostShapesName & """ v dokumente ne najden.")
  285.         DrawDiagram = False
  286.         Exit Function
  287.     End If
  288.     
  289.     '╨ô╤Ç╤â╨┐╨┐╨░, ╨▓ ╨║╨╛╤é╨╛╤Ç╨╛╨╣ ╨╕╨╖╨╛╨▒╤Ç╨░╨╢╨░╨╡╤é╤ü╤Å ╨╗╨╡╨│╨╡╨╜╨┤╨░ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╤ï, ╨╛╤ç╨╕╤ë╨░╨╡╤é╤ü╤Å ╨╛╤é ╨▓╤ü╨╡╤à child-╤ê╤ì╨╣╨┐╨╛╨▓.
  290.     LegendShape.RemoveAllShapes()
  291.     DrawTextBox(LegendShape, 0, 0, LegendShape.Width, 100, "Dannie izmereniy v 1:00 PM", 12, 7)
  292.  
  293.     
  294.     '╨ô╤Ç╤â╨┐╨┐╨░, ╨▓ ╨║╨╛╤é╨╛╤Ç╨╛╨╣ ╨╕╨╖╨╛╨▒╤Ç╨░╨╢╨░╨╡╤é╤ü╤Å ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╨░, ╨╛╤ç╨╕╤ë╨░╨╡╤é╤ü╤Å ╨╛╤é child-╤ê╤ì╨╣╨┐╨╛╨▓. ╨₧╤ü╤é╨░╤Ä╤é╤ü╤Å ╤é╨╛╨╗╤î╨║╨╛ ╨╛╤ü╨╕ ╨╕ ╨╕╤à ╨┐╨╛╨┤╨┐╨╕╤ü╨╕.
  295.     '╨ƒ╨╛╤ü╨║╨╛╨╗╤î╨║╤â ╨┐╨╛╤ü╨╗╨╡ ╤â╨┤╨░╨╗╨╡╨╜╨╕╤Å ╨╛╨┤╨╜╨╛╨│╨╛ ╤ê╤ì╨╣╨┐╨░ ╨╕╨╜╨┤╨╡╨║╤ü╤ï ╨╛╤ü╤é╨░╨╗╤î╨╜╤ï╤à ╨░╨▓╤é╨╛╨╝╨░╤é╨╕╤ç╨╡╤ü╨║╨╕ ╨┐╨╡╤Ç╨╡╤ü╤ç╨╕╤é╤ï╨▓╨░╤Ä╤é╤ü╤Å,
  296.     '╤ç╤é╨╛╨▒╤ï ╨╖╨░╨┐╨╛╨╗╨╜╨╕╤é╤î ╨▓╤ï╨┐╨░╨▓╤ê╨╕╨╣ ╨╕╨╜╨┤╨╡╨║╤ü, ╨┐╨╡╤Ç╨╡╨▒╨╛╤Ç ╤ì╨╗╨╡╨╝╨╡╨╜╤é╨╛╨▓ ╨╜╨░╤ç╨╕╨╜╨░╨╡╤é╤ü╤Å ╤ü ╨╜╨░╨╕╨▒╨╛╨╗╤î╤ê╨╡╨│╨╛ ╨╕╨╜╨┤╨╡╨║╤ü╨░.
  297.     For i=DiagramShape.ShapesNum() To 1 Step -1
  298.         If DiagramShape.Shape(i).Name <> "DescX" And DiagramShape.Shape(i).Name <> "DescY" And DiagramShape.Shape(i).Name <> "OX" And DiagramShape.Shape(i).Name <> "OY" Then
  299.             DiagramShape.RemoveShape(i)
  300.         End If
  301.     Next
  302.     
  303.     '╨¥╨░╨╜╨╛╤ü╨╕╨╝ ╤ê╨║╨░╨╗╤â ╨╜╨░ ╨╛╤ü╤î OY
  304.     dblDiagHeight = DiagramShape.Height
  305.     For i=condblMinY+1 To condblMaxY 
  306.         '╨¿╤é╤Ç╨╕╤à ╨╛╤ü╨╕ OY
  307.         DiagramShape.DrawLine(-10, dblDiagHeight - (i - condblMinY)*condblYScale, 10, dblDiagHeight - (i - condblMinY)*condblYScale)
  308.         '╨ƒ╨╛╨┤╨┐╨╕╤ü╤î ╨▓╨╛╨╖╨╗╨╡ ╤ê╤é╤Ç╨╕╤à╨░
  309.         DrawTextBox(DiagramShape, -70, dblDiagHeight - (i - condblMinY)*condblYScale - 25, -20, dblDiagHeight - (i - condblMinY)*condblYScale + 25, CStr(i), 10, 0)
  310.     Next
  311.     '╨¥╨░╨╜╨╛╤ü╨╕╨╝ ╤ê╨║╨░╨╗╤â ╨╜╨░ ╨╛╤ü╤î OX
  312.     For i=1 To iMaxUsedIndex 
  313.         '╨¿╤é╤Ç╨╕╤à ╨╛╤ü╨╕ OX
  314.         DiagramShape.DrawLine((adValues(0,i)-condblMinX)*condblXScale, dblDiagHeight + 10, (adValues(0,i)-condblMinX)*condblXScale, dblDiagHeight - 10)
  315.         '╨ƒ╨╛╨┤╨┐╨╕╤ü╤î ╨┐╨╛╨┤ ╤ê╤é╤Ç╨╕╤à╨╛╨╝
  316.         DrawTextBox(DiagramShape, (adValues(0,i)-condblMinX)*condblXScale-25, dblDiagHeight + 20, (adValues(0,i)-condblMinX)*condblXScale+25, dblDiagHeight+70, CStr(adValues(0,i)), 10, 0)
  317.     Next
  318.     
  319.     '╨ö╨╗╤Å ╨║╨░╨╢╨┤╨╛╨╣ ╤ü╤é╨░╨╜╤å╨╕╨╕ ╤Ç╨╕╤ü╤â╨╡╨╝ ╨│╤Ç╨░╤ä╨╕╨║ ╤é╨╡╨╝╨┐╨╡╤Ç╨░╤é╤â╤Ç ╨╖╨░ ╨╝╨╡╤ü╤Å╤å
  320.     For i = 1 To iNamesUBound
  321.         intLineColor = i
  322.         Set LineShape = DiagramShape.BeginShape()
  323.         LineShape.PenColor.Index = intLineColor 
  324.         LineShape.PenWeight = 6
  325.         LineShape.MoveTo((adValues(0,0)-condblMinX)*condblXScale, dblDiagHeight - (adValues(i,0)-condblMinY)*condblYScale)
  326.         For j=1 To iMaxUsedIndex 
  327.             DiagramShape.LineTo((adValues(0,j)-condblMinX)*condblXScale, dblDiagHeight - (adValues(i,j)-condblMinY)*condblYScale)
  328.         Next j
  329.         DiagramShape.EndShape()
  330.         '╨ƒ╨╛╨╝╨╡╤ë╨░╨╡╨╝ ╨▓ ╨¢╨╡╨│╨╡╨╜╨┤╤â ╨╛╨┐╨╕╤ü╨░╨╜╨╕╨╡ ╨╗╨╕╨╜╨╕╨╕ ╨│╤Ç╨░╤ä╨╕╨║╨░
  331.         Set LineShape = LegendShape.DrawLine(0, 50 + i*100, LegendShape.Width/4, 50 + i*100)
  332.         LineShape.PenColor.Index = intLineColor 
  333.         LineShape.PenWeight = 6
  334.         DrawTextBox(LegendShape, LegendShape.Width/4, 25 + i*100, LegendShape.Width, 75 + i*100, asNames(i), 10, 1)
  335.     Next i
  336.  
  337.     i=1
  338.     Set FileNameProp = Nothing
  339.     '╨ƒ╤Ç╨╛╨▓╨╡╤Ç╤Å╨╡╨╝, ╨╡╤ü╤é╤î ╨╗╨╕ ╨▓ ╨┤╨╕╨░╨│╤Ç╨░╨╝╨╝╨╡ CustomProperty ╤ü ╨╕╨╝╨╡╨╜╨╡╨╝ ╤ä╨░╨╣╨╗╨░-╨╕╤ü╤é╨╛╤ç╨╜╨╕╨║╨░ ╨┤╨░╨╜╨╜╤ï╤à.
  340.     '╨ò╤ü╨╗╨╕ ╨╡╤ü╤é╤î, ╨┐╨╛╨╝╨╡╤ë╨░╨╡╨╝ ╨▓ ╨╜╨╡╨│╨╛ ╨╕╨╝╤Å ╨┐╨╛╤ü╨╗╨╡╨┤╨╜╨╡╨│╨╛ ╨╕╤ü╨┐╨╛╨╗╤î╨╖╨╛╨▓╨░╨▓╤ê╨╡╨│╨╛╤ü╤Å ╤ä╨░╨╣╨╗╨░.
  341.     Do While i<=DiagramShape.CustomPropsNum() And FileNameProp = Nothing
  342.         If DiagramShape.CustomProp(i).Label = "LastSourceFileName" Then
  343.             Set FileNameProp = DiagramShape.CustomProp(i) 
  344.         End If
  345.         i = i + 1    
  346.     Loop 
  347.     '╨ò╤ü╨╗╨╕ ╤é╨░╨║╨╛╨│╨╛ CustomProperty ╨╜╨╡ ╨╜╨░╨╣╨┤╨╡╨╜╨╛, ╤ü╨╛╨╖╨┤╨░╨╡╨╝ ╨╡╨│╨╛ ╤ü╨░╨╝╨╕.
  348.     If FileNameProp = Nothing Then
  349.         Set FileNameProp = DiagramShape.AddCustomProp() 
  350.         FileNameProp.Label = "LastSourceFileName" 
  351.     End If
  352.     FileNameProp.Value = strTextFileName 
  353.     FileNameProp.Type = 0
  354.     FileNameProp.Prompt = "Imja Fajla, ispol'zovavshegosja v kachestve poslednego istochnika dannih"
  355.     
  356.     DrawDiagram = True
  357.     Exit Function
  358. ErrHandle:
  359.     MsgBox ("Proizoshla oshibka pri postroenii diagrammi.", cdbExclamation)
  360.     DrawDiagram = False
  361.     Exit Function
  362. End Function
  363.  
  364. '========================================================================================================================
  365. '========================================================================================================================
  366.  
  367. '╨í╨╛╨╖╨┤╨░╨╜╨╕╨╡ ╤ê╤ì╨╣╨┐╨░ TextBox ╤ü ╨╜╨╡╨║╨╛╤é╨╛╤Ç╤ï╨╝ ╤é╨╡╨║╤ü╤é╨╛╨╝.
  368. 'GroupShape - ╤ü╤ü╤ï╨╗╨║╨░ ╨╜╨░ ╤ê╤ì╨╣╨┐-╨│╤Ç╤â╨┐╨┐╤â, ╨▓╨╜╤â╤é╤Ç╨╕ ╨║╨╛╤é╨╛╤Ç╨╛╨╣ ╨┤╨╛╨╗╨╢╨╜╨░ ╨▒╤ï╤é╤î ╨┐╨╛╨╝╨╡╤ë╨╡╨╜╨░ ╨╜╨░╨┤╨┐╨╕╤ü╤î
  369. 'x1, y1 - ╨║╨╛╨╛╤Ç╨┤╨╕╨╜╨░╤é╤ï ╨▓╨╡╤Ç╤à╨╜╨╡╨│╨╛ ╨╗╨╡╨▓╨╛╨│╨╛ ╤â╨│╨╗╨░ ╨┐╤Ç╤Å╨╝╨╛╤â╨│╨╛╨╗╤î╨╜╨╕╨║╨░ ╤ü ╤é╨╡╨║╤ü╤é╨╛╨╝ ╨▓ ╤ü╨╕╤ü╤é╨╡╨╝╨╡ ╨║╨╛╨╛╤Ç╨┤╨╕╨╜╨░╤é ╤Ç╨╛╨┤╨╕╤é╨╡╨╗╤î╤ü╨║╨╛╨│╨╛ ╤ê╤ì╨╣╨┐╨░
  370. 'x2, y2 - ╨║╨╛╨╛╤Ç╨┤╨╕╨╜╨░╤é╤ï ╨┐╤Ç╨░╨▓╨╛╨│╨╛ ╨╜╨╕╨╢╨╜╨╡╨│╨╛ ╤â╨│╨╗╨░ ╨┐╤Ç╤Å╨╝╨╛╤â╨│╨╛╨╗╤î╨╜╨╕╨║╨░ ╤ü ╤é╨╡╨║╤ü╤é╨╛╨╝ ╨▓ ╤ü╨╕╤ü╤é╨╡╨╝╨╡ ╨║╨╛╨╛╤Ç╨┤╨╕╨╜╨░╤é ╤Ç╨╛╨┤╨╕╤é╨╡╨╗╤î╤ü╨║╨╛╨│╨╛ ╤ê╤ì╨╣╨┐╨░
  371. 'strText - ╤é╨╡╨║╤ü╤é ╨╜╨░╨┤╨┐╨╕╤ü╨╕
  372. 'lTextSize - ╤Ç╨░╨╖╨╝╨╡╤Ç ╤ê╤Ç╨╕╤ä╤é╨░
  373. 'lTextStyle - ╤ü╤é╨╕╨╗╤î ╤ê╤Ç╨╕╤ä╤é╨░
  374. Function DrawTextBox(ByVal GroupShape As Shape, ByVal x1 As Double, ByVal y1 As Double, ByVal x2 As Double, ByVal y2 As Double, ByVal strText As String, ByVal lTextSize As Long, ByVal lTextStyle As Long) As Shape
  375.     Set DrawTextBox= GroupShape.DrawRect(x1, y1, x2, y2)
  376.     DrawTextBox.FillPattern = 0
  377.     DrawTextBox.PenPattern = 0
  378.     DrawTextBox.Text = strText 
  379.     DrawTextBox.SetCharSize(1, Len(strText), lTextSize)
  380.     DrawTextBox.SetCharStyle(1, Len(strText), lTextStyle)
  381.     DrawTextBox.SetCharColor(1, Len(strText), 0, 0, 0)
  382. End Function 
  383.