vbAccelerator - Contents of code file: frmPick.frm

VERSION 5.00
Object = "*\AvbalPick.vbp"
Object = "{8245A918-4CF7-11D2-8E21-10B404C10000}#8.1#0"; "vbalIml.ocx"
Begin VB.Form frmPick 
   Caption         =   "vbAccelerator Picker Tester"
   ClientHeight    =   5490
   ClientLeft      =   3000
   ClientTop       =   2445
   ClientWidth     =   6255
   LinkTopic       =   "Form1"
   ScaleHeight     =   5490
   ScaleWidth      =   6255
   Begin VB.ListBox lstEvent 
      Height          =   3180
      Left            =   180
      TabIndex        =   0
      Top             =   2100
      Width           =   5835
   End
   Begin VB.CommandButton cmdTest 
      Caption         =   "Command1"
      Height          =   375
      Left            =   4680
      TabIndex        =   1
      Top             =   240
      Width           =   1335
   End
   Begin vbalIml.vbalImageList ilsIcons 
      Left            =   540
      Top             =   4800
      _ExtentX        =   953
      _ExtentY        =   953
      ColourDepth     =   8
      Size            =   63140
      Images          =   "frmPick.frx":0000
      Version         =   131072
      KeyCount        =   55
      Keys            =   ""
   End
   Begin vbalPick.vbalPicker pckColours 
      Height          =   4275
      Left            =   1260
      Top             =   660
      Visible         =   0   'False
      Width           =   2535
      _ExtentX        =   4471
      _ExtentY        =   7541
      ForeColor       =   -2147483630
      Picture         =   "frmPick.frx":F6C4
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BorderStyle     =   2
   End
   Begin vbalPick.vbalPicker pckMenu 
      Height          =   1695
      Left            =   240
      Top             =   180
      Width           =   3315
      _ExtentX        =   5847
      _ExtentY        =   2990
      ForeColor       =   -2147483630
      Picture         =   "frmPick.frx":F6E0
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BorderStyle     =   2
   End
   Begin vbalPick.vbalPicker pckMore 
      Height          =   4275
      Index           =   0
      Left            =   1680
      Top             =   1020
      Visible         =   0   'False
      Width           =   2535
      _ExtentX        =   4471
      _ExtentY        =   7541
      ForeColor       =   -2147483630
      Picture         =   "frmPick.frx":F6FC
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BorderStyle     =   2
   End
   Begin vbalPick.vbalPicker pckMore 
      Height          =   4275
      Index           =   1
      Left            =   2220
      Top             =   1440
      Visible         =   0   'False
      Width           =   2535
      _ExtentX        =   4471
      _ExtentY        =   7541
      ForeColor       =   -2147483630
      Picture         =   "frmPick.frx":F718
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BorderStyle     =   2
   End
   Begin vbalPick.vbalPicker pckMore 
      Height          =   4275
      Index           =   2
      Left            =   2640
      Top             =   1800
      Visible         =   0   'False
      Width           =   2535
      _ExtentX        =   4471
      _ExtentY        =   7541
      ForeColor       =   -2147483630
      Picture         =   "frmPick.frx":F734
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BorderStyle     =   2
   End
   Begin vbalPick.vbalPicker pckMore 
      Height          =   4275
      Index           =   3
      Left            =   3240
      Top             =   2100
      Visible         =   0   'False
      Width           =   2535
      _ExtentX        =   4471
      _ExtentY        =   7541
      ForeColor       =   -2147483630
      Picture         =   "frmPick.frx":F750
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BorderStyle     =   2
   End
End
Attribute VB_Name = "frmPick"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub LogEvent(ByVal sMsg As String)
   lstEvent.AddItem sMsg
   lstEvent.ListIndex = lstEvent.NewIndex
End Sub


Private Sub pSetUpMenu()
Dim itmX As cPickItem
   With pckMenu
      .Key = "MENU"
      .ImageList = ilsIcons.hIml
      .BackColor = SystemColorConstants.vbMenuBar
      With .Items
         Set itmX = .Add(, "FILE:TOP", evplIcon, "&File")
         itmX.DropDown = pckColours
         Set itmX = .Add(, "EDIT:TOP", evplIcon, "&Edit")
         itmX.DropDown = pckMore(3)
         .Add , "VIEW:TOP", evplIcon, "&View"
         .Add , "HELP:TOP", evplIcon, "&Help"
      End With
      .SetWidth .Width
   End With
End Sub

Private Sub pSetUpMore()
Dim i As Long
Dim j As Long
Dim itmX As cPickItem

   For j = 0 To 3
      With pckMore(j)
         .Key = "MORE:" & j
         .DisplayStyle = evplMenu
         .BackColor = vbMenuBar
         .ImageList = ilsIcons.hIml
         With .Items
            For i = 1 To 10
               Set itmX = .Add(, "MORE:" & i, evplIcon, "Test " & j & " " & i,
                Rnd * ilsIcons.ImageCount)
               If (j = 0) Then
                  If (i = 2) Then
                     itmX.DropDown = pckMore(1)
                  ElseIf (i = 3) Then
                     itmX.DropDown = pckMore(2)
                  End If
               End If
               If (i = 6) Then
                  .Add , , evplSeparator
               End If
            Next i
         End With
         .SetWidth .Width
      End With
   Next j
End Sub

Private Sub pSetUpColourPicker()
Dim itmX As cPickItem
   
   With pckColours
      .Key = "COLOURS"
      .DisplayStyle = evplMenu
      .BackColor = SystemColorConstants.vbMenuBar
      With .Items
         Set itmX = .Add(, "NONE", evplIcon, "&No Fill")
         itmX.Alignment = evplCentre
         itmX.DropDown = pckMore(0)
         .Add , , evplSeparator
         .AddOfficeColours "FILLCOL", True
         .Add , , evplSeparator
         Set itmX = .Add(, "FORECOLOR", evplColour)
         itmX.Color = &HFF&
         Set itmX = .Add(, "BACKCOLOR", evplColour)
         itmX.Color = &H663399
         .Add , , evplSeparator
         Set itmX = .Add(, "MORE", , "&More Fill Colours")
         itmX.Alignment = evplCentre
         Set itmX = .Add(, "EFFECTS", , "&Fill Effects...")
         itmX.Alignment = evplCentre
      End With
      .SetWidth ((14 + 6) * 8) * Screen.TwipsPerPixelX
   End With
   
End Sub

Private Sub Form_Load()
   
   pSetUpMore

   pSetUpColourPicker
   
   pSetUpMenu

   Dim i As Long
   For i = 1 To 20
      lstEvent.AddItem "Test" & i
   Next i

End Sub

Private Sub pckColours_ItemClick(Item As vbalPick.cPickItem)
Dim i As Long
   If InStr(Item.Key, "FILLCOL") > 0 Then
      With pckColours.Items
         For i = 1 To 40
            If .Item("FILLCOL" & i).Checked Then
               .Item("FILLCOL" & i).Checked = False
            End If
         Next i
      End With
      Item.Checked = True
   Else
      'MsgBox "Clicked Item " & Item.Caption & ", Key = " & Item.Key,
       vbExclamation
   End If
   LogEvent "pckColours:ItemClick: " & Item.Key & " (" & pckColours.Key & ")"
End Sub

Private Sub pckMenu_ItemClick(Item As vbalPick.cPickItem)
   LogEvent "pckMenu:ItemClick: " & Item.Key & " (" & pckMenu.Key & ")"
End Sub

Private Sub pckMore_ItemClick(Index As Integer, Item As vbalPick.cPickItem)
   LogEvent "pckMore(" & Index & "):ItemClick: " & Item.Key & " (" &
    pckMore(Index).Key & ")"
End Sub