home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / Delphi / PolarDraw / data1.cab / Samples / Visual_Basic / Street / Form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  2001-08-31  |  3.2 KB  |  102 lines

  1. VERSION 5.00
  2. Object = "{52DE3A21-0A3F-11D4-B9D2-008048FD54E6}#2.0#0"; "POLARDraw20.ocx"
  3. Begin VB.Form Form1 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Form1"
  6.    ClientHeight    =   8670
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   9360
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   8670
  14.    ScaleWidth      =   9360
  15.    StartUpPosition =   3  'Windows Default
  16.    Begin POLARDRAW20Lib.POLARDraw POLARDraw1 
  17.       Height          =   8595
  18.       Left            =   0
  19.       TabIndex        =   2
  20.       Top             =   30
  21.       Width           =   7995
  22.       _Version        =   131072
  23.       _ExtentX        =   14102
  24.       _ExtentY        =   15161
  25.       _StockProps     =   224
  26.       PaperShadowColor=   0
  27.       PaperOutlinecolor=   22875532
  28.       DrawPaperOutline=   -1  'True
  29.       DrawPaperShadow =   -1  'True
  30.       PaperShadowOffset=   0
  31.       ViewportOriginX =   22875532
  32.       ViewportOriginY =   22878684
  33.       PageOriginX     =   1
  34.       PageOriginY     =   124523749
  35.       HorizontalGrid  =   567
  36.       VerticalGrid    =   567
  37.       SelectionCount  =   22740992
  38.       ShapeCount      =   22742704
  39.       CanvasWidth     =   536873485
  40.       CanvasHeight    =   0
  41.    End
  42.    Begin VB.CommandButton btnTree 
  43.       Caption         =   "Tree"
  44.       Height          =   465
  45.       Left            =   8085
  46.       TabIndex        =   1
  47.       Top             =   645
  48.       Width           =   1200
  49.    End
  50.    Begin VB.CommandButton btnLight 
  51.       Caption         =   "Traffic Light"
  52.       Height          =   465
  53.       Left            =   8085
  54.       TabIndex        =   0
  55.       Top             =   105
  56.       Width           =   1200
  57.    End
  58. Attribute VB_Name = "Form1"
  59. Attribute VB_GlobalNameSpace = False
  60. Attribute VB_Creatable = False
  61. Attribute VB_PredeclaredId = True
  62. Attribute VB_Exposed = False
  63. Dim m_pdPage As POLARDRAW20Lib.Page
  64. Private Sub btnLight_Click()
  65.     AddObject "semaphore.emf"
  66. End Sub
  67. Private Sub btnTree_Click()
  68.     AddObject "tree.emf"
  69. End Sub
  70. Private Sub Form_Load()
  71.     Set m_pdPage = POLARDraw1.ActivePage
  72.     Dim pd_street As POLARDRAW20Lib.Shape
  73.     POLARDraw1.EnableRendering = False
  74.     Set pd_street = m_pdPage.Shapes.AddPicture(App.Path + "\street.emf", 0, 0, m_pdPage.Width, m_pdPage.Height)
  75.     With pd_street
  76.       .AddToSelection
  77.       .Lock.AgainstSelection = True
  78.     End With
  79.     m_pdPage.Selection.Clear
  80.     m_pdPage.ShowPaper = False
  81.     POLARDraw1.ActiveWindow.FitTo polFitToPage
  82.     POLARDraw1.EnableRendering = True
  83.     Set pd_street = Nothing
  84. End Sub
  85. Private Sub AddObject(FileName As String)
  86.     Dim pd_object As POLARDRAW20Lib.Shape
  87.     POLARDraw1.EnableRendering = False
  88.     Set pd_object = m_pdPage.Shapes.Add(polRectangle, 0, 0, 30, 45)
  89.    With pd_object
  90.       .IsFilled = True
  91.       .Fill.Type = polPicture
  92.       .Fill.SetPictureFromFile App.Path + "\" + FileName
  93.       .HasLine = False
  94.    End With
  95.     POLARDraw1.EnableRendering = True
  96.     POLARDraw1.Render
  97.     Set pd_object = Nothing
  98. End Sub
  99. Private Sub Form_Unload(Cancel As Integer)
  100.    Set m_pdPage = Nothing
  101. End Sub
  102.