home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / brush / brush.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-06  |  11.8 KB  |  383 lines

  1. VERSION 2.00
  2. Begin Form frmBrush 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "PatternBrush-Demo"
  6.    ClientHeight    =   3735
  7.    ClientLeft      =   1050
  8.    ClientTop       =   1800
  9.    ClientWidth     =   7365
  10.    DrawStyle       =   5  'Transparent
  11.    FillStyle       =   0  'Solid
  12.    Height          =   4140
  13.    Left            =   990
  14.    LinkTopic       =   "Form1"
  15.    MaxButton       =   0   'False
  16.    ScaleHeight     =   3735
  17.    ScaleWidth      =   7365
  18.    Top             =   1455
  19.    Width           =   7485
  20.    Begin PictureBox cmdInfo 
  21.       Height          =   600
  22.       Left            =   270
  23.       Picture         =   BRUSH.FRX:0000
  24.       ScaleHeight     =   570
  25.       ScaleWidth      =   570
  26.       TabIndex        =   10
  27.       Top             =   2940
  28.       Width           =   600
  29.    End
  30.    Begin CommandButton cmdSave 
  31.       Caption         =   "&Save Bitmaps to disk"
  32.       Height          =   405
  33.       Left            =   3060
  34.       TabIndex        =   9
  35.       Top             =   3120
  36.       Width           =   2535
  37.    End
  38.    Begin CommandButton cmdForm 
  39.       Cancel          =   -1  'True
  40.       Caption         =   " &Ok"
  41.       Default         =   -1  'True
  42.       Height          =   405
  43.       Index           =   0
  44.       Left            =   5760
  45.       TabIndex        =   5
  46.       Top             =   3120
  47.       Width           =   1365
  48.    End
  49.    Begin PictureBox panel 
  50.       Align           =   1  'Align Top
  51.       BackColor       =   &H00C0C0C0&
  52.       ForeColor       =   &H00800000&
  53.       Height          =   675
  54.       Left            =   0
  55.       ScaleHeight     =   645
  56.       ScaleWidth      =   7335
  57.       TabIndex        =   1
  58.       Top             =   0
  59.       Width           =   7365
  60.       Begin PictureBox opt 
  61.          Height          =   195
  62.          Index           =   1
  63.          Left            =   5670
  64.          ScaleHeight     =   165
  65.          ScaleWidth      =   1335
  66.          TabIndex        =   7
  67.          TabStop         =   0   'False
  68.          Top             =   360
  69.          Width           =   1365
  70.       End
  71.       Begin PictureBox opt 
  72.          Height          =   195
  73.          Index           =   0
  74.          Left            =   5670
  75.          ScaleHeight     =   165
  76.          ScaleWidth      =   1335
  77.          TabIndex        =   6
  78.          Top             =   120
  79.          Width           =   1365
  80.       End
  81.       Begin PictureBox cmd 
  82.          BackColor       =   &H00C0C0C0&
  83.          Height          =   375
  84.          Index           =   11
  85.          Left            =   4230
  86.          ScaleHeight     =   345
  87.          ScaleWidth      =   345
  88.          TabIndex        =   11
  89.          Top             =   150
  90.          Width           =   375
  91.       End
  92.       Begin PictureBox cmd 
  93.          BackColor       =   &H00C0C0C0&
  94.          Height          =   375
  95.          Index           =   13
  96.          Left            =   4950
  97.          ScaleHeight     =   345
  98.          ScaleWidth      =   345
  99.          TabIndex        =   12
  100.          Top             =   150
  101.          Width           =   375
  102.       End
  103.       Begin PictureBox cmd 
  104.          BackColor       =   &H00C0C0C0&
  105.          Height          =   375
  106.          Index           =   12
  107.          Left            =   4590
  108.          ScaleHeight     =   345
  109.          ScaleWidth      =   345
  110.          TabIndex        =   13
  111.          Top             =   150
  112.          Width           =   375
  113.       End
  114.       Begin PictureBox cmd 
  115.          BackColor       =   &H00C0C0C0&
  116.          Height          =   375
  117.          Index           =   10
  118.          Left            =   3870
  119.          ScaleHeight     =   345
  120.          ScaleWidth      =   345
  121.          TabIndex        =   14
  122.          Top             =   150
  123.          Width           =   375
  124.       End
  125.       Begin PictureBox cmd 
  126.          BackColor       =   &H00C0C0C0&
  127.          Height          =   375
  128.          Index           =   3
  129.          Left            =   1260
  130.          ScaleHeight     =   345
  131.          ScaleWidth      =   345
  132.          TabIndex        =   15
  133.          Top             =   150
  134.          Width           =   375
  135.       End
  136.       Begin PictureBox cmd 
  137.          BackColor       =   &H00C0C0C0&
  138.          Height          =   375
  139.          Index           =   7
  140.          Left            =   2700
  141.          ScaleHeight     =   345
  142.          ScaleWidth      =   345
  143.          TabIndex        =   16
  144.          Top             =   150
  145.          Width           =   375
  146.       End
  147.       Begin PictureBox cmd 
  148.          BackColor       =   &H00C0C0C0&
  149.          Height          =   375
  150.          Index           =   4
  151.          Left            =   1620
  152.          ScaleHeight     =   345
  153.          ScaleWidth      =   345
  154.          TabIndex        =   17
  155.          Top             =   150
  156.          Width           =   375
  157.       End
  158.       Begin PictureBox cmd 
  159.          BackColor       =   &H00C0C0C0&
  160.          Height          =   375
  161.          Index           =   5
  162.          Left            =   1980
  163.          ScaleHeight     =   345
  164.          ScaleWidth      =   345
  165.          TabIndex        =   18
  166.          Top             =   150
  167.          Width           =   375
  168.       End
  169.       Begin PictureBox cmd 
  170.          BackColor       =   &H00C0C0C0&
  171.          Height          =   375
  172.          Index           =   2
  173.          Left            =   900
  174.          ScaleHeight     =   345
  175.          ScaleWidth      =   345
  176.          TabIndex        =   19
  177.          Top             =   150
  178.          Width           =   375
  179.       End
  180.       Begin PictureBox cmd 
  181.          BackColor       =   &H00C0C0C0&
  182.          Height          =   375
  183.          Index           =   6
  184.          Left            =   2340
  185.          ScaleHeight     =   345
  186.          ScaleWidth      =   345
  187.          TabIndex        =   20
  188.          Top             =   150
  189.          Width           =   375
  190.       End
  191.       Begin PictureBox cmd 
  192.          BackColor       =   &H00C0C0C0&
  193.          Height          =   375
  194.          Index           =   1
  195.          Left            =   540
  196.          ScaleHeight     =   345
  197.          ScaleWidth      =   345
  198.          TabIndex        =   21
  199.          Top             =   150
  200.          Width           =   375
  201.       End
  202.       Begin PictureBox cmd 
  203.          BackColor       =   &H00C0C0C0&
  204.          Height          =   375
  205.          Index           =   9
  206.          Left            =   3510
  207.          ScaleHeight     =   345
  208.          ScaleWidth      =   345
  209.          TabIndex        =   22
  210.          Top             =   150
  211.          Width           =   375
  212.       End
  213.       Begin PictureBox cmd 
  214.          BackColor       =   &H00C0C0C0&
  215.          Height          =   375
  216.          Index           =   8
  217.          Left            =   3150
  218.          ScaleHeight     =   345
  219.          ScaleWidth      =   345
  220.          TabIndex        =   23
  221.          Top             =   150
  222.          Width           =   375
  223.       End
  224.       Begin PictureBox cmd 
  225.          BackColor       =   &H00C0C0C0&
  226.          Height          =   375
  227.          Index           =   0
  228.          Left            =   180
  229.          ScaleHeight     =   345
  230.          ScaleWidth      =   345
  231.          TabIndex        =   24
  232.          Top             =   150
  233.          Width           =   375
  234.       End
  235.    End
  236.    Begin Label Label2 
  237.       AutoSize        =   -1  'True
  238.       BackStyle       =   0  'Transparent
  239.       Caption         =   "[ Control_Brush control, any.picture, borderwidth% ]"
  240.       FontBold        =   -1  'True
  241.       FontItalic      =   0   'False
  242.       FontName        =   "MS Sans Serif"
  243.       FontSize        =   12
  244.       FontStrikethru  =   0   'False
  245.       FontUnderline   =   0   'False
  246.       ForeColor       =   &H00808080&
  247.       Height          =   300
  248.       Index           =   3
  249.       Left            =   990
  250.       TabIndex        =   0
  251.       Top             =   1890
  252.       Width           =   6195
  253.    End
  254.    Begin Label Label1 
  255.       AutoSize        =   -1  'True
  256.       BackStyle       =   0  'Transparent
  257.       Caption         =   "This is all you need to do:"
  258.       FontBold        =   -1  'True
  259.       FontItalic      =   0   'False
  260.       FontName        =   "MS Sans Serif"
  261.       FontSize        =   12
  262.       FontStrikethru  =   0   'False
  263.       FontUnderline   =   -1  'True
  264.       Height          =   300
  265.       Left            =   180
  266.       TabIndex        =   2
  267.       Top             =   930
  268.       Width           =   3060
  269.    End
  270.    Begin Label Label2 
  271.       AutoSize        =   -1  'True
  272.       BackStyle       =   0  'Transparent
  273.       Caption         =   "Brush_Form Me, any.picture"
  274.       FontBold        =   -1  'True
  275.       FontItalic      =   0   'False
  276.       FontName        =   "MS Sans Serif"
  277.       FontSize        =   12
  278.       FontStrikethru  =   0   'False
  279.       FontUnderline   =   0   'False
  280.       ForeColor       =   &H00800000&
  281.       Height          =   300
  282.       Index           =   0
  283.       Left            =   990
  284.       TabIndex        =   3
  285.       Top             =   1590
  286.       Width           =   3390
  287.    End
  288.    Begin Label Label2 
  289.       AutoSize        =   -1  'True
  290.       BackStyle       =   0  'Transparent
  291.       Caption         =   "sub Form_Paint()"
  292.       FontBold        =   -1  'True
  293.       FontItalic      =   0   'False
  294.       FontName        =   "MS Sans Serif"
  295.       FontSize        =   12
  296.       FontStrikethru  =   0   'False
  297.       FontUnderline   =   0   'False
  298.       ForeColor       =   &H00800000&
  299.       Height          =   300
  300.       Index           =   1
  301.       Left            =   810
  302.       TabIndex        =   4
  303.       Top             =   1290
  304.       Width           =   2085
  305.    End
  306.    Begin Label Label2 
  307.       AutoSize        =   -1  'True
  308.       BackStyle       =   0  'Transparent
  309.       Caption         =   "End Sub"
  310.       FontBold        =   -1  'True
  311.       FontItalic      =   0   'False
  312.       FontName        =   "MS Sans Serif"
  313.       FontSize        =   12
  314.       FontStrikethru  =   0   'False
  315.       FontUnderline   =   0   'False
  316.       ForeColor       =   &H00800000&
  317.       Height          =   300
  318.       Index           =   2
  319.       Left            =   810
  320.       TabIndex        =   8
  321.       Top             =   2220
  322.       Width           =   1050
  323.    End
  324. Dim curFormBMP%, curPanelBMP%
  325. Sub cmd_Click (Index As Integer, Value As Integer)
  326.     Dim bmp%
  327.     If Value Then bmp = cmd(Index).PictureUp
  328.     If opt(0) Then
  329.        curFormBMP = bmp
  330.     Else
  331.        curPanelBMP = bmp
  332.        If Value = False Then panel.Refresh
  333.     End If
  334.     Refresh     '-- Calls Form_Paint()
  335. End Sub
  336. Sub cmdForm_Click (Index As Integer)
  337.     Unload Me
  338. End Sub
  339. Sub cmdInfo_Click ()
  340.     frmInfo.Show 1
  341. End Sub
  342. Sub cmdSave_Click ()
  343.     Dim i%, n$
  344.     On Error Resume Next
  345.     screen.MousePointer = 11
  346.     For i = 0 To 13
  347.         n = app.Path & "\BRUSH_" & i & ".BMP"
  348.         If FileLen(n) Then
  349.            screen.MousePointer = 0
  350.            MsgBox "Bitmaps already saved!", 48, "Info"
  351.            Exit Sub
  352.         End If
  353.         SavePicture cmd(i).PictureUp, n
  354.         If Err Then
  355.            screen.MousePointer = 0
  356.            MsgBox "Err (#" & Err & ") - Could not save bitmaps!", 48, "Error"
  357.            i = 0
  358.            Exit Sub
  359.         End If
  360.     Next
  361.     screen.MousePointer = 0
  362.     MsgBox "Bitmaps successfully saved to " & app.Path & "\BRUSH_1.BMP - BRUSH13.BMP", 64, "Info"
  363. End Sub
  364. Sub Form_Load ()
  365.     frmInfo.Show 1
  366.     form_center Me
  367.   ' Load patterns ( normally not needed )
  368.   ' -------------------------------------
  369.     curFormBMP = cmd(1).PictureUp
  370.     curPanelBMP = cmd(3).PictureUp
  371. End Sub
  372. Sub Form_Paint ()
  373.     If opt(0) Then
  374.        brush_form Me, curFormBMP
  375.     Else
  376.        brush_control panel, curPanelBMP, panel.BorderWidth * 4
  377.     End If
  378. End Sub
  379. Sub opt_Click (Index As Integer, Value As Integer)
  380.     panel.Refresh
  381.     Refresh
  382. End Sub
  383.