home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / tool / design / bmplst / blsample.frm next >
Text File  |  1995-02-27  |  9KB  |  313 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00FFFFFF&
  4.    Caption         =   "BmpLst Sample"
  5.    ClientHeight    =   4815
  6.    ClientLeft      =   1470
  7.    ClientTop       =   1785
  8.    ClientWidth     =   4695
  9.    ControlBox      =   0   'False
  10.    Height          =   5340
  11.    Left            =   1410
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   4815
  16.    ScaleWidth      =   4695
  17.    Top             =   1320
  18.    Width           =   4815
  19.    Begin TextBox Text1 
  20.       Enabled         =   0   'False
  21.       Height          =   285
  22.       Left            =   2880
  23.       TabIndex        =   11
  24.       Top             =   2280
  25.       Width           =   1575
  26.    End
  27.    Begin CommandButton Command3 
  28.       Caption         =   "Remove Item"
  29.       Enabled         =   0   'False
  30.       Height          =   375
  31.       Left            =   2880
  32.       TabIndex        =   10
  33.       Top             =   1200
  34.       Width           =   1575
  35.    End
  36.    Begin CommandButton Command2 
  37.       Caption         =   "Add Item"
  38.       Enabled         =   0   'False
  39.       Height          =   375
  40.       Left            =   2880
  41.       TabIndex        =   9
  42.       Top             =   720
  43.       Width           =   1575
  44.    End
  45.    Begin CommandButton Command1 
  46.       Caption         =   "Exit"
  47.       Height          =   375
  48.       Left            =   2880
  49.       TabIndex        =   8
  50.       Top             =   240
  51.       Width           =   1575
  52.    End
  53.    Begin Frame Frame1 
  54.       Caption         =   "Item Image"
  55.       Height          =   1815
  56.       Left            =   240
  57.       TabIndex        =   1
  58.       Top             =   2760
  59.       Width           =   2415
  60.       Begin PictureBox Picture1 
  61.          BorderStyle     =   0  'None
  62.          Height          =   495
  63.          Index           =   0
  64.          Left            =   240
  65.          Picture         =   BLSAMPLE.FRX:0000
  66.          ScaleHeight     =   495
  67.          ScaleWidth      =   495
  68.          TabIndex        =   7
  69.          Top             =   360
  70.          Width           =   495
  71.       End
  72.       Begin PictureBox Picture1 
  73.          BorderStyle     =   0  'None
  74.          Height          =   495
  75.          Index           =   1
  76.          Left            =   240
  77.          Picture         =   BLSAMPLE.FRX:0302
  78.          ScaleHeight     =   495
  79.          ScaleWidth      =   495
  80.          TabIndex        =   6
  81.          Top             =   1080
  82.          Width           =   495
  83.       End
  84.       Begin PictureBox Picture1 
  85.          BorderStyle     =   0  'None
  86.          Height          =   495
  87.          Index           =   2
  88.          Left            =   960
  89.          Picture         =   BLSAMPLE.FRX:0604
  90.          ScaleHeight     =   495
  91.          ScaleWidth      =   495
  92.          TabIndex        =   5
  93.          Top             =   360
  94.          Width           =   495
  95.       End
  96.       Begin PictureBox Picture1 
  97.          BorderStyle     =   0  'None
  98.          Height          =   495
  99.          Index           =   3
  100.          Left            =   960
  101.          Picture         =   BLSAMPLE.FRX:0906
  102.          ScaleHeight     =   495
  103.          ScaleWidth      =   495
  104.          TabIndex        =   4
  105.          Top             =   1080
  106.          Width           =   495
  107.       End
  108.       Begin PictureBox Picture1 
  109.          BorderStyle     =   0  'None
  110.          Height          =   495
  111.          Index           =   4
  112.          Left            =   1680
  113.          Picture         =   BLSAMPLE.FRX:0C08
  114.          ScaleHeight     =   495
  115.          ScaleWidth      =   495
  116.          TabIndex        =   3
  117.          Top             =   360
  118.          Width           =   495
  119.       End
  120.       Begin PictureBox Picture1 
  121.          BorderStyle     =   0  'None
  122.          Height          =   495
  123.          Index           =   5
  124.          Left            =   1680
  125.          Picture         =   BLSAMPLE.FRX:0F0A
  126.          ScaleHeight     =   495
  127.          ScaleWidth      =   495
  128.          TabIndex        =   2
  129.          Top             =   1080
  130.          Width           =   495
  131.       End
  132.       Begin Shape Shape1 
  133.          BorderStyle     =   0  'Transparent
  134.          FillColor       =   &H00FFFFFF&
  135.          FillStyle       =   0  'Solid
  136.          Height          =   735
  137.          Index           =   0
  138.          Left            =   120
  139.          Top             =   240
  140.          Width           =   735
  141.       End
  142.       Begin Shape Shape1 
  143.          BorderStyle     =   0  'Transparent
  144.          FillColor       =   &H00FFFFFF&
  145.          FillStyle       =   0  'Solid
  146.          Height          =   735
  147.          Index           =   1
  148.          Left            =   120
  149.          Top             =   960
  150.          Width           =   735
  151.       End
  152.       Begin Shape Shape1 
  153.          BorderStyle     =   0  'Transparent
  154.          FillColor       =   &H00FFFFFF&
  155.          FillStyle       =   0  'Solid
  156.          Height          =   735
  157.          Index           =   2
  158.          Left            =   840
  159.          Top             =   240
  160.          Width           =   735
  161.       End
  162.       Begin Shape Shape1 
  163.          BorderStyle     =   0  'Transparent
  164.          FillColor       =   &H00FFFFFF&
  165.          FillStyle       =   0  'Solid
  166.          Height          =   735
  167.          Index           =   3
  168.          Left            =   840
  169.          Top             =   960
  170.          Width           =   735
  171.       End
  172.       Begin Shape Shape1 
  173.          BorderStyle     =   0  'Transparent
  174.          FillColor       =   &H00FFFFFF&
  175.          FillStyle       =   0  'Solid
  176.          Height          =   735
  177.          Index           =   4
  178.          Left            =   1560
  179.          Top             =   240
  180.          Width           =   735
  181.       End
  182.       Begin Shape Shape1 
  183.          BorderStyle     =   0  'Transparent
  184.          FillColor       =   &H00FFFFFF&
  185.          FillStyle       =   0  'Solid
  186.          Height          =   735
  187.          Index           =   5
  188.          Left            =   1560
  189.          Top             =   960
  190.          Width           =   735
  191.       End
  192.    End
  193.    Begin BmpList BmpList1 
  194.       BorderEffect    =   0  'None
  195.       BorderStyle     =   1  'Fixed Single
  196.       BottomMargin    =   60
  197.       ColDelim        =   "    "
  198.       Height          =   2415
  199.       HScroll         =   -1  'True
  200.       ItemHeight      =   600
  201.       ItemPlacement   =   0  'Top
  202.       ItemWidth       =   1800
  203.       Left            =   240
  204.       LeftMargin      =   120
  205.       MultiColumn     =   0   'False
  206.       MultiSelect     =   0  'None
  207.       NumColumns      =   0
  208.       Sorted          =   0   'False
  209.       TabIndex        =   0
  210.       Top             =   240
  211.       TopMargin       =   30
  212.       VertGap         =   30
  213.       Width           =   2415
  214.    End
  215.    Begin Label Label1 
  216.       Caption         =   "Item Text:"
  217.       Enabled         =   0   'False
  218.       Height          =   255
  219.       Left            =   2880
  220.       TabIndex        =   12
  221.       Top             =   2040
  222.       Width           =   1215
  223.    End
  224. End
  225. Dim CurIndex As Integer
  226.  
  227. Sub BmpList1_Click ()
  228.     Dim I As Integer
  229.  
  230.     If BmpList1.ListCount = 0 Then
  231.         Command3.Enabled = False
  232.         Exit Sub
  233.     End If
  234.  
  235.     Command3.Enabled = True
  236.     If CurIndex <> -1 Then
  237.         Picture1(CurIndex).BackColor = &HFFFFFF
  238.         Shape1(CurIndex).FillColor = &HFFFFFF
  239.         CurIndex = -1
  240.     End If
  241.  
  242.     For I = 0 To 5
  243.         If Picture1(I).Picture = BmpList1.Picture(BmpList1.ListIndex) Then
  244.             CurIndex = I
  245.  
  246.             Picture1(CurIndex).BackColor = &HC0C0C0
  247.             Shape1(CurIndex).FillColor = &HC0C0C0
  248.             Exit For
  249.         End If
  250.     Next I
  251.  
  252.     Text1.Text = BmpList1.List(BmpList1.ListIndex)
  253. End Sub
  254.  
  255. Sub Command1_Click ()
  256.     End
  257. End Sub
  258.  
  259. Sub Command2_Click ()
  260.     ' BmpList1.ScreenUpdate = False
  261.     BmpList1.AddItem Text1
  262.     BmpList1.Picture(BmpList1.NewIndex) = Picture1(CurIndex).Picture
  263.     BmpList1.ScreenUpdate = True
  264. End Sub
  265.  
  266. Sub Command3_Click ()
  267.     BmpList1.RemoveItem BmpList1.ListIndex
  268.  
  269.     If BmpList1.ListCount = 0 Then
  270.         Command3.Enabled = False
  271.         BmpList1.ListIndex = 0
  272.     ElseIf BmpList1.ListIndex >= BmpList1.ListCount Then
  273.         BmpList1.ListIndex = BmpList1.ListCount - 1
  274.     End If
  275. End Sub
  276.  
  277. Sub Form_Load ()
  278.     CurIndex = -1
  279. End Sub
  280.  
  281. Sub Picture1_Click (Index As Integer)
  282.     If CurIndex <> -1 Then
  283.         Shape1(CurIndex).FillColor = &HFFFFFF
  284.         Picture1(CurIndex).BackColor = &HFFFFFF
  285.     End If
  286.  
  287.     If CurIndex = Index Then
  288.         CurIndex = -1
  289.         Command2.Enabled = False
  290.         Label1.Enabled = False
  291.         Text1.Enabled = False
  292.     Else
  293.         Command2.Enabled = True
  294.         Text1.Enabled = True
  295.         Label1.Enabled = True
  296.         CurIndex = Index
  297.  
  298.         Picture1(Index).BackColor = &HC0C0C0
  299.         Shape1(Index).FillColor = &HC0C0C0
  300.  
  301.         If BmpList1.ListCount > 0 Then
  302.             BmpList1.Picture(BmpList1.ListIndex) = Picture1(Index).Picture
  303.         End If
  304.     End If
  305. End Sub
  306.  
  307. Sub Text1_Change ()
  308.     If BmpList1.ListCount > 0 Then
  309.         BmpList1.List(BmpList1.ListIndex) = Text1.Text
  310.     End If
  311. End Sub
  312.  
  313.