home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmGrid
- BorderStyle = 1 'Fixed Single
- Caption = "Grid settings"
- ClientHeight = 2115
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 4740
- Icon = "frmGrid.frx":0000
- LinkTopic = "Form2"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2115
- ScaleWidth = 4740
- StartUpPosition = 1 'CenterOwner
- Begin VB.TextBox txtVGrid
- BeginProperty DataFormat
- Type = 1
- Format = "0"
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 1033
- SubFormatType = 1
- EndProperty
- Height = 285
- Left = 2535
- TabIndex = 3
- Text = "2"
- Top = 930
- Width = 540
- End
- Begin VB.TextBox txtHGrid
- BeginProperty DataFormat
- Type = 1
- Format = "0"
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 1033
- SubFormatType = 1
- EndProperty
- Height = 285
- Left = 2535
- TabIndex = 2
- Text = "2"
- Top = 540
- Width = 540
- End
- Begin VB.CheckBox chckSnapToGrid
- Caption = "Align shapes to grid"
- Height = 360
- Left = 1740
- TabIndex = 4
- Top = 1440
- Value = 1 'Checked
- Width = 1800
- End
- Begin VB.CommandButton btnCancel
- Cancel = -1 'True
- Caption = "Cancel"
- Height = 375
- Left = 3840
- TabIndex = 6
- Top = 585
- Width = 870
- End
- Begin VB.CommandButton btnOK
- Caption = "OK"
- Height = 375
- Left = 3825
- TabIndex = 5
- Top = 180
- Width = 870
- End
- Begin VB.CommandButton btnGridColor
- Caption = "Choose color..."
- Height = 360
- Left = 45
- TabIndex = 1
- Top = 795
- Width = 1320
- End
- Begin VB.CheckBox chckShowGrid
- Caption = "Show grid"
- Height = 360
- Left = 195
- TabIndex = 0
- Top = 195
- Value = 1 'Checked
- Width = 1245
- End
- Begin VB.Frame Frame1
- Caption = "Grid units: milimeters"
- Height = 1680
- Left = 1650
- TabIndex = 7
- Top = 195
- Width = 1935
- Begin VB.Label lblVGrid
- Caption = "&Height:"
- Height = 240
- Left = 105
- TabIndex = 9
- Top = 750
- Width = 705
- End
- Begin VB.Label lblHGrid
- Caption = "&Width:"
- Height = 240
- Left = 120
- TabIndex = 8
- Top = 375
- Width = 705
- End
- End
- Attribute VB_Name = "frmGrid"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim crGridColor As OLE_COLOR
- Dim lGridHeight, lGridWidth As Long
- Dim fSnapToGrid, fShowGrid As Boolean
- Private Sub btnCancel_Click()
- 'if user cancels, set back to initial values
- With pd_Environment
- .ShowGrid = fShowGrid
- .SnapToGrid = fSnapToGrid
- End With
- With pd_Page
- .VerticalGrid = lGridHeight
- .HorizontalGrid = lGridWidth
- .GridColor = crGridColor
- End With
- Unload Me
- End Sub
- Private Sub btnGridColor_Click()
- With pd_Page
- .GridColor = SetColor(.GridColor)
- End With
- End Sub
- Private Sub btnOK_Click()
- Unload Me
- End Sub
- Private Sub chckShowGrid_Click()
- pd_Environment.ShowGrid = CBool(chckShowGrid.Value)
- If (CBool(chckShowGrid.Value)) Then
- txtHGrid.Enabled = True
- txtVGrid.Enabled = True
- btnGridColor.Enabled = True
- chckSnapToGrid.Enabled = True
- Else
- txtHGrid.Enabled = False
- txtVGrid.Enabled = False
- btnGridColor.Enabled = False
- chckSnapToGrid.Enabled = False
- End If
- End Sub
- Private Sub chckSnapToGrid_Click()
- pd_Environment.SnapToGrid = CBool(chckSnapToGrid.Value)
- End Sub
- Private Sub Form_Load()
- 'saving initial values
- With pd_Environment
- fShowGrid = .ShowGrid
- fSnapToGrid = .SnapToGrid
- End With
- With pd_Page
- lGridHeight = .VerticalGrid
- lGridWidth = .HorizontalGrid
- crGridColor = .GridColor
- End With
-
- chckShowGrid.Value = Abs(fShowGrid)
- chckSnapToGrid.Value = Abs(fSnapToGrid)
- txtVGrid = lGridHeight
- txtHGrid = lGridWidth
- End Sub
- Private Sub txtHGrid_LostFocus()
- If NumberGreaterThanZero(txtHGrid) Then pd_Page.HorizontalGrid = txtHGrid
- End Sub
- Private Sub txtVGrid_LostFocus()
- If NumberGreaterThanZero(txtVGrid) Then pd_Page.VerticalGrid = txtVGrid
- End Sub
-