home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code2 / scg_demo / samples.frm < prev    next >
Text File  |  1993-08-10  |  14KB  |  431 lines

  1. VERSION 2.00
  2. Begin Form frmSamples 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Samples"
  5.    ClientHeight    =   5790
  6.    ClientLeft      =   2445
  7.    ClientTop       =   1485
  8.    ClientWidth     =   7365
  9.    ControlBox      =   0   'False
  10.    Height          =   6195
  11.    Left            =   2385
  12.    LinkTopic       =   "Form3"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   5790
  16.    ScaleWidth      =   7365
  17.    Top             =   1140
  18.    Width           =   7485
  19.    Begin Frame Shadow 
  20.       BackColor       =   &H00C0C0C0&
  21.       Caption         =   "Shadow"
  22.       Height          =   1095
  23.       Left            =   4440
  24.       TabIndex        =   4
  25.       Top             =   4560
  26.       Width           =   2775
  27.       Begin OptionButton ShadowOff 
  28.          BackColor       =   &H00C0C0C0&
  29.          Caption         =   "Off"
  30.          Height          =   255
  31.          Left            =   240
  32.          TabIndex        =   6
  33.          Top             =   720
  34.          Value           =   -1  'True
  35.          Width           =   2175
  36.       End
  37.       Begin OptionButton ShadowOn 
  38.          BackColor       =   &H00C0C0C0&
  39.          Caption         =   "On"
  40.          Height          =   255
  41.          Left            =   240
  42.          TabIndex        =   5
  43.          Top             =   360
  44.          Width           =   2175
  45.       End
  46.    End
  47.    Begin Frame FrameFill 
  48.       BackColor       =   &H00C0C0C0&
  49.       Caption         =   "Fill Pattern"
  50.       Height          =   1815
  51.       Left            =   4440
  52.       TabIndex        =   0
  53.       Top             =   2640
  54.       Width           =   2775
  55.       Begin OptionButton GradDiag 
  56.          BackColor       =   &H00C0C0C0&
  57.          Caption         =   "Graduated Diagonal"
  58.          Height          =   255
  59.          Left            =   240
  60.          TabIndex        =   7
  61.          Top             =   1440
  62.          Width           =   2295
  63.       End
  64.       Begin OptionButton GradHorz 
  65.          BackColor       =   &H00C0C0C0&
  66.          Caption         =   "Graduated Horizontal"
  67.          Height          =   255
  68.          Left            =   240
  69.          TabIndex        =   3
  70.          Top             =   1080
  71.          Value           =   -1  'True
  72.          Width           =   2295
  73.       End
  74.       Begin OptionButton GradVert 
  75.          BackColor       =   &H00C0C0C0&
  76.          Caption         =   "Graduated Vertical"
  77.          Height          =   255
  78.          Left            =   240
  79.          TabIndex        =   2
  80.          Top             =   720
  81.          Width           =   2415
  82.       End
  83.       Begin OptionButton Solid 
  84.          BackColor       =   &H00C0C0C0&
  85.          Caption         =   "Solid"
  86.          Height          =   255
  87.          Left            =   240
  88.          TabIndex        =   1
  89.          Top             =   360
  90.          Width           =   2295
  91.       End
  92.    End
  93.    Begin SCGraphic SCGraphic1 
  94.       AngleEnd        =   45
  95.       AngleStart      =   -90
  96.       ArrowSize       =   2  'Small
  97.       ArrowType       =   0  'None
  98.       FillColor       =   &H00808080&
  99.       FillColor2      =   &H00000000&
  100.       FillPattern     =   0  'Solid
  101.       Height          =   975
  102.       Index           =   5
  103.       Left            =   2400
  104.       LineColor       =   &H00FF0000&
  105.       LinePattern     =   0  'Solid
  106.       LineWidth       =   15
  107.       MouseEvents     =   -1  'True
  108.       NumPoints       =   6
  109.       PaletteSteps    =   20
  110.       RoundRadius     =   0
  111.       SelectByInk     =   0   'False
  112.       ShadowColor     =   &H00000000&
  113.       ShadowDepthX    =   0
  114.       ShadowDepthY    =   0
  115.       Shape           =   6  'Ngon
  116.       ShowOutlineOnly =   0   'False
  117.       Top             =   3000
  118.       Use256Palette   =   -1  'True
  119.       Width           =   1455
  120.    End
  121.    Begin SCGraphic SCGraphic1 
  122.       AngleEnd        =   45
  123.       AngleStart      =   -180
  124.       ArrowSize       =   2  'Small
  125.       ArrowType       =   0  'None
  126.       FillColor       =   &H00808080&
  127.       FillColor2      =   &H00000000&
  128.       FillPattern     =   0  'Solid
  129.       Height          =   975
  130.       Index           =   7
  131.       Left            =   2400
  132.       LineColor       =   &H00FF0000&
  133.       LinePattern     =   0  'Solid
  134.       LineWidth       =   25
  135.       MouseEvents     =   -1  'True
  136.       NumPoints       =   0
  137.       PaletteSteps    =   20
  138.       RoundRadius     =   0
  139.       SelectByInk     =   0   'False
  140.       ShadowColor     =   &H00000000&
  141.       ShadowDepthX    =   0
  142.       ShadowDepthY    =   0
  143.       Shape           =   4  'Arc
  144.       ShowOutlineOnly =   0   'False
  145.       Top             =   4320
  146.       Use256Palette   =   -1  'True
  147.       Width           =   1455
  148.    End
  149.    Begin SCGraphic SCGraphic1 
  150.       AngleEnd        =   45
  151.       AngleStart      =   -90
  152.       ArrowSize       =   2  'Small
  153.       ArrowType       =   0  'None
  154.       FillColor       =   &H00808080&
  155.       FillColor2      =   &H00000000&
  156.       FillPattern     =   0  'Solid
  157.       Height          =   975
  158.       Index           =   3
  159.       Left            =   2400
  160.       LineColor       =   &H00FF0000&
  161.       LinePattern     =   0  'Solid
  162.       LineWidth       =   15
  163.       MouseEvents     =   -1  'True
  164.       NumPoints       =   4
  165.       PaletteSteps    =   20
  166.       RoundRadius     =   0
  167.       SelectByInk     =   0   'False
  168.       ShadowColor     =   &H00000000&
  169.       ShadowDepthX    =   0
  170.       ShadowDepthY    =   0
  171.       Shape           =   3  'Polygon
  172.       ShowOutlineOnly =   0   'False
  173.       Top             =   1680
  174.       Use256Palette   =   -1  'True
  175.       Width           =   1455
  176.    End
  177.    Begin SCGraphic SCGraphic1 
  178.       AngleEnd        =   45
  179.       AngleStart      =   -90
  180.       ArrowSize       =   2  'Small
  181.       ArrowType       =   0  'None
  182.       FillColor       =   &H00808080&
  183.       FillColor2      =   &H00000000&
  184.       FillPattern     =   0  'Solid
  185.       Height          =   975
  186.       Index           =   1
  187.       Left            =   2400
  188.       LineColor       =   &H00FF0000&
  189.       LinePattern     =   0  'Solid
  190.       LineWidth       =   15
  191.       MouseEvents     =   -1  'True
  192.       NumPoints       =   0
  193.       PaletteSteps    =   20
  194.       RoundRadius     =   0
  195.       SelectByInk     =   0   'False
  196.       ShadowColor     =   &H00000000&
  197.       ShadowDepthX    =   0
  198.       ShadowDepthY    =   0
  199.       Shape           =   1  'Ellipse
  200.       ShowOutlineOnly =   0   'False
  201.       Top             =   240
  202.       Use256Palette   =   -1  'True
  203.       Width           =   1455
  204.    End
  205.    Begin SCGraphic SCGraphic1 
  206.       AngleEnd        =   45
  207.       AngleStart      =   -180
  208.       ArrowSize       =   2  'Small
  209.       ArrowType       =   0  'None
  210.       FillColor       =   &H00808080&
  211.       FillColor2      =   &H00000000&
  212.       FillPattern     =   0  'Solid
  213.       Height          =   975
  214.       Index           =   6
  215.       Left            =   360
  216.       LineColor       =   &H00FF0000&
  217.       LinePattern     =   0  'Solid
  218.       LineWidth       =   15
  219.       MouseEvents     =   -1  'True
  220.       NumPoints       =   0
  221.       PaletteSteps    =   20
  222.       RoundRadius     =   0
  223.       SelectByInk     =   0   'False
  224.       ShadowColor     =   &H00000000&
  225.       ShadowDepthX    =   0
  226.       ShadowDepthY    =   0
  227.       Shape           =   5  'Pie
  228.       ShowOutlineOnly =   0   'False
  229.       Top             =   4320
  230.       Use256Palette   =   -1  'True
  231.       Width           =   1455
  232.    End
  233.    Begin SCGraphic SCGraphic1 
  234.       AngleEnd        =   45
  235.       AngleStart      =   -90
  236.       ArrowSize       =   2  'Small
  237.       ArrowType       =   0  'None
  238.       FillColor       =   &H00808080&
  239.       FillColor2      =   &H00000000&
  240.       FillPattern     =   0  'Solid
  241.       Height          =   975
  242.       Index           =   4
  243.       Left            =   360
  244.       LineColor       =   &H00FF0000&
  245.       LinePattern     =   0  'Solid
  246.       LineWidth       =   15
  247.       MouseEvents     =   -1  'True
  248.       NumPoints       =   4
  249.       PaletteSteps    =   20
  250.       RoundRadius     =   0
  251.       SelectByInk     =   0   'False
  252.       ShadowColor     =   &H00000000&
  253.       ShadowDepthX    =   0
  254.       ShadowDepthY    =   0
  255.       Shape           =   3  'Polygon
  256.       ShowOutlineOnly =   0   'False
  257.       Top             =   3000
  258.       Use256Palette   =   -1  'True
  259.       Width           =   1455
  260.    End
  261.    Begin SCGraphic SCGraphic1 
  262.       AngleEnd        =   45
  263.       AngleStart      =   -90
  264.       ArrowSize       =   3  'Normal
  265.       ArrowType       =   3  'Both
  266.       FillColor       =   &H00808080&
  267.       FillColor2      =   &H00000000&
  268.       FillPattern     =   0  'Solid
  269.       Height          =   975
  270.       Index           =   2
  271.       Left            =   360
  272.       LineColor       =   &H00FF0000&
  273.       LinePattern     =   0  'Solid
  274.       LineWidth       =   15
  275.       MouseEvents     =   -1  'True
  276.       NumPoints       =   4
  277.       PaletteSteps    =   20
  278.       RoundRadius     =   0
  279.       SelectByInk     =   0   'False
  280.       ShadowColor     =   &H00000000&
  281.       ShadowDepthX    =   0
  282.       ShadowDepthY    =   0
  283.       Shape           =   2  'Polyline
  284.       ShowOutlineOnly =   0   'False
  285.       Top             =   1680
  286.       Use256Palette   =   -1  'True
  287.       Width           =   1455
  288.    End
  289.    Begin SCGraphic SCGraphic1 
  290.       AngleEnd        =   45
  291.       AngleStart      =   -90
  292.       ArrowSize       =   2  'Small
  293.       ArrowType       =   0  'None
  294.       FillColor       =   &H00808080&
  295.       FillColor2      =   &H00000000&
  296.       FillPattern     =   0  'Solid
  297.       Height          =   975
  298.       Index           =   0
  299.       Left            =   360
  300.       LineColor       =   &H00FF0000&
  301.       LinePattern     =   0  'Solid
  302.       LineWidth       =   15
  303.       MouseEvents     =   -1  'True
  304.       NumPoints       =   0
  305.       PaletteSteps    =   20
  306.       RoundRadius     =   0
  307.       SelectByInk     =   0   'False
  308.       ShadowColor     =   &H00000000&
  309.       ShadowDepthX    =   0
  310.       ShadowDepthY    =   0
  311.       Shape           =   0  'Rectangle
  312.       ShowOutlineOnly =   0   'False
  313.       Top             =   240
  314.       Use256Palette   =   -1  'True
  315.       Width           =   1455
  316.    End
  317.    Begin SCGraphic SCGraphic2 
  318.       AngleEnd        =   45
  319.       AngleStart      =   -90
  320.       ArrowSize       =   2  'Small
  321.       ArrowType       =   0  'None
  322.       FillColor       =   &H00FFFFC0&
  323.       FillColor2      =   &H00800080&
  324.       FillPattern     =   17  'Graduated Horizontal
  325.       Height          =   5775
  326.       Left            =   0
  327.       LineColor       =   &H00FF0000&
  328.       LinePattern     =   5  'Transparent
  329.       LineWidth       =   15
  330.       MouseEvents     =   -1  'True
  331.       NumPoints       =   0
  332.       PaletteSteps    =   50
  333.       RoundRadius     =   0
  334.       SelectByInk     =   0   'False
  335.       ShadowColor     =   &H00000000&
  336.       ShadowDepthX    =   0
  337.       ShadowDepthY    =   0
  338.       Shape           =   0  'Rectangle
  339.       ShowOutlineOnly =   0   'False
  340.       Top             =   0
  341.       Use256Palette   =   -1  'True
  342.       Width           =   4335
  343.    End
  344. End
  345. Option Explicit
  346. Const MAXSAMPLE = 7
  347.  
  348. Sub Form_Load ()
  349.     Dim i, j As Single
  350.     ' set the initial fill colors for the samples (this could
  351.     ' have been done at design time instead)
  352.     For i = 0 To MAXSAMPLE
  353.         SCGraphic1(i).FillPattern = 17 ' graduated horizontal
  354.         SCGraphic1(i).FillColor = MAGENTA
  355.         SCGraphic1(i).FillColor2 = CYAN
  356.     Next i
  357.  
  358.     ' set different shadow colors for the open shapes for interest
  359.     SCGraphic1(2).ShadowColor = YELLOW
  360.     SCGraphic1(7).ShadowColor = YELLOW
  361.  
  362.     ' controls 2 through 4 are poly's; set some sample points
  363.     ' just so we see something interesting
  364.     For i = 2 To 4
  365.         SCGraphic1(i).NumPoints = 5
  366.         SCGraphic1(i).PointX(0) = 100
  367.         SCGraphic1(i).PointY(0) = 900
  368.         SCGraphic1(i).PointX(1) = 100
  369.         SCGraphic1(i).PointY(1) = 100
  370.         SCGraphic1(i).PointX(2) = 500
  371.         SCGraphic1(i).PointY(2) = 700
  372.         SCGraphic1(i).PointX(3) = 900
  373.         SCGraphic1(i).PointY(3) = 100
  374.         SCGraphic1(i).PointX(4) = 900
  375.         SCGraphic1(i).PointY(4) = 900
  376.     Next i
  377.  
  378.     ' make polyline 4 have some auto curvature points (only the X component needs to be set if it's auto)
  379.     SCGraphic1(4).PointXOffsetIn(1) = BEZAUTO
  380.     SCGraphic1(4).PointXOffsetIn(2) = BEZAUTO
  381.     SCGraphic1(4).PointXOffsetIn(3) = BEZAUTO
  382.     SCGraphic1(4).PointXOffsetOut(1) = BEZAUTO
  383.     SCGraphic1(4).PointXOffsetOut(2) = BEZAUTO
  384.     SCGraphic1(4).PointXOffsetOut(3) = BEZAUTO
  385. End Sub
  386.  
  387. Sub GradDiag_Click ()
  388.     Dim i, j As Single
  389.     For i = 0 To MAXSAMPLE
  390.         SCGraphic1(i).FillPattern = 19 'graduated down right
  391.     Next i
  392. End Sub
  393.  
  394. Sub GradHorz_Click ()
  395.     Dim i, j As Single
  396.     For i = 0 To MAXSAMPLE
  397.         SCGraphic1(i).FillPattern = 17 'graduated horizontal
  398.     Next i
  399. End Sub
  400.  
  401. Sub GradVert_Click ()
  402.     Dim i, j As Single
  403.     For i = 0 To MAXSAMPLE
  404.         SCGraphic1(i).FillPattern = 16 'graduated vertical
  405.     Next i
  406. End Sub
  407.  
  408. Sub ShadowOff_Click ()
  409.     Dim i, j As Single
  410.     For i = 0 To MAXSAMPLE
  411.         SCGraphic1(i).ShadowDepthX = 0
  412.         SCGraphic1(i).ShadowDepthY = 0
  413.     Next i
  414. End Sub
  415.  
  416. Sub ShadowOn_Click ()
  417.     Dim i, j As Single
  418.     For i = 0 To MAXSAMPLE
  419.         SCGraphic1(i).ShadowDepthX = 50  ' assuming units are still twips
  420.         SCGraphic1(i).ShadowDepthY = 50
  421.     Next i
  422. End Sub
  423.  
  424. Sub Solid_Click ()
  425.     Dim i, j As Single
  426.     For i = 0 To MAXSAMPLE
  427.         SCGraphic1(i).FillPattern = 0 'solid
  428.     Next i
  429. End Sub
  430.  
  431.