home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{52DE3A21-0A3F-11D4-B9D2-008048FD54E6}#2.0#0"; "POLARDRAW20.OCX"
- Begin VB.Form frmSimpleDrawing
- Caption = "Simple Drawing"
- ClientHeight = 5025
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 8835
- LinkTopic = "Form1"
- ScaleHeight = 5025
- ScaleWidth = 8835
- StartUpPosition = 3 'Windows Default
- Begin POLARDRAW20Lib.POLARDraw POLARDraw1
- Height = 4815
- Left = 120
- TabIndex = 6
- Top = 120
- Width = 6375
- _Version = 131072
- _ExtentX = 11245
- _ExtentY = 8493
- _StockProps = 224
- PaperShadowColor= 0
- DrawPaperOutline= -1 'True
- DrawPaperShadow = -1 'True
- PaperShadowOffset= 24444616
- ViewportOriginX = 8384568
- ViewportOriginY = 48183456
- PageOriginX = 24379392
- PageOriginY = 5813682
- HorizontalGrid = 567
- VerticalGrid = 567
- ShowVerticalScrollBar= 0 'False
- ShowHorizontalScrollBar= 0 'False
- ShowVerticalRuler= 0 'False
- ShowHorizontalRuler= 0 'False
- SelectionCount = -1
- ShapeCount = 1598273252
- CanvasWidth = 0
- CanvasHeight = 1598275446
- End
- Begin VB.ComboBox cmbEditMode
- Height = 315
- Left = 6660
- Style = 2 'Dropdown List
- TabIndex = 2
- Top = 3390
- Width = 1575
- End
- Begin VB.ComboBox cmbShape
- Height = 315
- Left = 6660
- Style = 2 'Dropdown List
- TabIndex = 0
- Top = 2580
- Width = 1575
- End
- Begin VB.Label Label5
- Caption = "Ctrl+R for resizing and Ctrl + C for drawing (Create new)"
- Height = 570
- Left = 6675
- TabIndex = 5
- Top = 1650
- Width = 1875
- End
- Begin VB.Label Label4
- Caption = "Use combo boxes to switch between edit modes or use shortcuts:"
- Height = 645
- Left = 6690
- TabIndex = 4
- Top = 990
- Width = 2085
- End
- Begin VB.Label Label2
- Caption = "Current Edit Mode:"
- Height = 225
- Left = 6675
- TabIndex = 3
- Top = 3150
- Width = 1575
- End
- Begin VB.Label Label1
- Caption = "Current Shape Type:"
- Height = 315
- Left = 6660
- TabIndex = 1
- Top = 2385
- Width = 1575
- End
- Attribute VB_Name = "frmSimpleDrawing"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim pd_environment As POLARDRAW20Lib.Environment
- Public arr_ShapeTypeConstants As Variant
- Public arr_ShapeTypeNames As Variant
- Public arr_EditModeConstants As Variant
- Public arr_EditModeNames As Variant
- Private Sub cmbEditMode_Click()
- pd_environment.EditMode = cmbEditMode.ItemData(cmbEditMode.ListIndex)
- If pd_environment.EditMode = polEditPoints Then
- POLARDraw1.ShowConnectors = True
- Else
- POLARDraw1.ShowConnectors = False
- End If
- End Sub
- Private Sub cmbShape_Click()
- pd_environment.CurrentShapeType = cmbShape.ItemData(cmbShape.ListIndex)
-
- If pd_environment.CurrentShapeType = polLink Then
- POLARDraw1.ShowConnectors = True
- Else
- POLARDraw1.ShowConnectors = False
- End If
- End Sub
- Private Sub Form_Load()
- arr_ShapeTypeConstants = Array(polArc, polDiamond, polDimensionBar, polEllipse, polFreeform, polHexagon, polIsoscelesTriangle, polLeftArrow, polLine, polLink, polOctagon, polParallelogram, polPentagon, polPlainText, polPlusSign, polRectangle, polRightTriangle, polRoundRectangle, polStar, polTextBox, polTrapezoid)
- arr_ShapeTypeNames = Array("Arc", "Diamond", "Dimension Bar", "Ellipse", "Freeform", "Hexagon", "Isosceles Triangle", "Left Arrow", "Line", "Link", "Octagon", "Parallelogram", "Pentagon", "Plain Text", "Plus Sign", "Rectangle", "Right Triangle", "Round Rectangle", "Star", "Text Box", "Trapezoid")
- arr_EditModeConstants = Array(polCreateNew, polEditPoints, polResize, polRotate, polView)
- arr_EditModeNames = Array("Draw", "Edit Polygon Points", "Resize", "Rotate", "Just View")
- Set pd_environment = POLARDraw1.ActiveWindow.Environment
- pd_environment.CurrentShapeType = polFreeform
- pd_environment.EditMode = polCreateNew
- 'setting values for combo-box that enables switching between shape types
- For i = 0 To UBound(arr_ShapeTypeConstants)
- cmbShape.AddItem arr_ShapeTypeNames(i), i
- cmbShape.ItemData(i) = arr_ShapeTypeConstants(i)
- Next i
- 'setting values for combo-box that enables switching between edit modes
- For i = 0 To UBound(arr_EditModeConstants)
- cmbEditMode.AddItem arr_EditModeNames(i), i
- cmbEditMode.ItemData(i) = arr_EditModeConstants(i)
- Next i
- cmbEditMode.ListIndex = IndexOf(cmbEditMode, pd_environment.EditMode)
- cmbShape.ListIndex = IndexOf(cmbShape, pd_environment.CurrentShapeType)
-
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Set pd_environment = Nothing
- End Sub
- Private Sub POLARDraw1_KeyDown(KeyCode As Integer, Shift As Integer)
- If Shift = vbCtrlMask Then
- Select Case KeyCode
- Case vbKeyR
- pd_environment.EditMode = polResize
- cmbEditMode.ListIndex = IndexOf(cmbEditMode, pd_environment.EditMode)
- Case vbKeyC
- pd_environment.EditMode = polCreateNew
- cmbEditMode.ListIndex = IndexOf(cmbEditMode, pd_environment.EditMode)
- End Select
- End If
- End Sub
- Private Function IndexOf(Combo As ComboBox, DataValue As Long) As Long
- With Combo
- For i = 0 To .ListCount - 1
- If .ItemData(i) = DataValue Then IndexOf = i
- Next
- End With
- End Function
-