home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Object = "{511C3C9E-3AF1-11D2-AD63-004005448951}#42.5#0"; "SWBBTNBAR.OCX"
- Begin VB.Form Form1
- AutoRedraw = -1 'True
- Caption = "SWBBtnBar Demo Application"
- ClientHeight = 4365
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 4950
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4365
- ScaleWidth = 4950
- StartUpPosition = 2 'CenterScreen
- Begin VB.CheckBox chkShowFocus
- Caption = "Show &Group Focus"
- Height = 240
- Left = 1935
- TabIndex = 12
- Top = 3690
- Value = 1 'Checked
- Width = 1995
- End
- Begin SWBBtnBar.BtnBar BtnBar
- Align = 3 'Align Left
- Height = 4020
- Left = 0
- TabIndex = 11
- Top = 0
- Width = 1770
- _ExtentX = 3122
- _ExtentY = 7091
- LastDesignGroup = 0
- BorderStyle = 2
- GroupBtnHeight = 340
- GroupBtnVGap = 0
- BorderVGap = 15
- BorderHGap = 15
- ScrollBtnSize = 195
- ScrollBtnVGap = 30
- ScrollBtnHGap = 60
- ShowFocusBorder = -1 'True
- End
- Begin VB.Frame Frame2
- Caption = "Button Images"
- Height = 915
- Left = 1935
- TabIndex = 8
- Top = 2340
- Width = 1905
- Begin VB.OptionButton optImageSize
- Caption = "Small Images"
- Height = 240
- Index = 1
- Left = 135
- TabIndex = 10
- Top = 585
- Width = 1365
- End
- Begin VB.OptionButton optImageSize
- Caption = "Large Images"
- Height = 240
- Index = 0
- Left = 135
- TabIndex = 9
- Top = 270
- Value = -1 'True
- Width = 1365
- End
- End
- Begin MSComctlLib.ImageList imgSmallList
- Left = 4275
- Top = 3330
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 11
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":0000
- Key = "CD-ROM"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":015C
- Key = "Inbox"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":02B8
- Key = "My Computer"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":0414
- Key = "Desktop"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":0570
- Key = "Internet"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":06CC
- Key = "Explorer"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":0828
- Key = "Audio CD"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":0984
- Key = "User Security"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":0AE0
- Key = "Notes"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":0C3C
- Key = "Graphs"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":0D98
- Key = "E-Mail"
- EndProperty
- EndProperty
- End
- Begin VB.ComboBox cboPropState
- Height = 315
- ItemData = "Form1.frx":0EF4
- Left = 1935
- List = "Form1.frx":0F01
- Style = 2 'Dropdown List
- TabIndex = 7
- Top = 1755
- Width = 1995
- End
- Begin VB.CheckBox chkShowCaptions
- Caption = "&Show Captions"
- Height = 240
- Left = 1935
- TabIndex = 5
- Top = 3420
- Width = 1410
- End
- Begin VB.Frame Frame1
- Height = 1365
- Left = 1935
- TabIndex = 1
- Top = 45
- Width = 2850
- Begin VB.Label Label3
- AutoSize = -1 'True
- Caption = "All rights reserved."
- Height = 195
- Left = 135
- TabIndex = 4
- Top = 990
- Width = 1290
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- Caption = "
- 1998 Software with Brains, Inc."
- Height = 195
- Left = 135
- TabIndex = 3
- Top = 720
- Width = 2340
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "Software with Brains, Inc."
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 240
- Left = 135
- TabIndex = 2
- Top = 225
- Width = 2565
- End
- End
- Begin MSComctlLib.StatusBar StatusBar1
- Align = 2 'Align Bottom
- Height = 345
- Left = 0
- TabIndex = 0
- Top = 4020
- Width = 4950
- _ExtentX = 8731
- _ExtentY = 609
- _Version = 393216
- BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
- NumPanels = 2
- BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- Object.Width = 4410
- MinWidth = 4410
- EndProperty
- BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- Object.Width = 4410
- MinWidth = 4410
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.ImageList imgLargeList
- Left = 4290
- Top = 2640
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 32
- ImageHeight = 32
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 11
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":0F23
- Key = "CD-ROM"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":1377
- Key = "Inbox"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":17CB
- Key = "My Computer"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":1C1F
- Key = "Desktop"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":2073
- Key = "Internet"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":24C7
- Key = "Explorer"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":291B
- Key = "Audio CD"
- EndProperty
- BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":2D6F
- Key = "User Security"
- EndProperty
- BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":31C3
- Key = "Notes"
- EndProperty
- BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":3617
- Key = "Graphs"
- EndProperty
- BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":3A6B
- Key = "E-Mail"
- EndProperty
- EndProperty
- End
- Begin VB.Label Label4
- AutoSize = -1 'True
- Caption = "Show ""My Computer"" Icon as:"
- Height = 195
- Left = 1935
- TabIndex = 6
- Top = 1530
- Width = 2145
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '**********************************************
- ' SWBBtnBar Sample Application
- '**********************************************
- Option Explicit
- Private Sub BtnBar_GroupClick(GroupKey As String)
- 'The GroupClick event notifies the application
- 'that the user has changed groups by clicking on
- 'a new group button. Use the GroupKey to identify
- 'the newly selected group.
- StatusBar1.Panels(1).Text = "Group: '" & GroupKey & "'"
- StatusBar1.Panels(2).Text = ""
- End Sub
- Private Sub BtnBar_ItemClick(ItemKey As String)
- 'The ItemClick event notifies the application
- 'that the user has selected an item by clicking
- 'on it. Use the ItemKey to identify the selected
- 'item.
- StatusBar1.Panels(2).Text = "Item: '" & ItemKey & "'"
- End Sub
- Private Sub cboPropState_Click()
- 'Change the button state of the "My Computer" button
- 'in the "Computer" group.
- Select Case cboPropState.ListIndex
- Case 0: BtnBar.Items("My Computer").State = isFlat
- Case 1: BtnBar.Items("My Computer").State = isDisabled
- Case 2: BtnBar.Items("My Computer").State = isInvisible
- End Select
- 'Show the new button state
- BtnBar.ChangeGroup "Computer"
- End Sub
- Private Sub chkShowCaptions_Click()
- 'Change the captions display status
- BtnBar.ShowCaptions = (chkShowCaptions = vbChecked)
- 'Redraw the button bar with or without captions
- BtnBar.Refresh
- End Sub
- Private Sub chkShowFocus_Click()
- BtnBar.ShowFocusBorder = (chkShowFocus.Value = vbChecked)
- End Sub
- Private Sub Form_Load()
- 'Set up the Button Bar:
- 'Set the image list name.
- 'Add groups, each with a unique key string.
- 'Add buttons to each existing group, each with a unique key string.
- 'Select a group for display upon startup.
- 'Notes:
- '[position] is optional and only supplied when inserting a
- 'new item or group into an existing set of items or groups.
- 'The position must be valid (1 .. Number of Items or Groups).
- '
- 'Keys for groups must be unique within the list of groups.
- 'Keys for items must be unique within the list of all items (regardless of group).
- BtnBar.BorderVGap = 15
- BtnBar.BorderHGap = 15
- BtnBar.GroupBtnVGap = 15
- BtnBar.ScrollBtnSize = 235
- BtnBar.GroupBtnHeight = 345
-
- SetLargeImages
- 'Create 3 groups
- 'Syntax: BtnBar.AddGroup caption, groupkey, [position]
- BtnBar.AddGroup "Computer", "Computer"
- BtnBar.AddGroup "Accessories", "Accessories"
- BtnBar.AddGroup "Other", "Other"
-
- 'Add buttons to Computer group
- 'Syntax: BtnBar.AddItem groupkey, caption, itemkey, imageindex, [position]
- BtnBar.AddItem "Computer", "CD-ROM", "CD-ROM", 1
- BtnBar.AddItem "Computer", "Inbox", "Inbox", 2
- BtnBar.AddItem "Computer", "My Computer", "My Computer", 3
- BtnBar.AddItem "Computer", "Desktop", "Desktop", 4
- BtnBar.AddItem "Computer", "Internet", "Internet", 5
- 'Add buttons to Accessories group
- BtnBar.AddItem "Accessories", "Explorer", "Explorer", 6
- BtnBar.AddItem "Accessories", "Audio CD", "Audio CD", 7
- BtnBar.AddItem "Accessories", "User Security", "User Security", 8
- 'Add buttons to Other group
- BtnBar.AddItem "Other", "Notes", "Notes", 9
- BtnBar.AddItem "Other", "Graphs", "Graphs", 10
- BtnBar.AddItem "Other", "E-Mail", "E-Mail", 11
- 'Display Computer group upon startup (specify groupkey).
- BtnBar.ChangeGroup "Computer"
- 'Force the current groupkey to appear in the status bar at startup.
- BtnBar_GroupClick ("Computer")
- 'Initialize the state combo & checkbox
- cboPropState.ListIndex = 0
- chkShowCaptions.Value = vbChecked
- End Sub
- Private Sub SetLargeImages()
- BtnBar.ItemHeight = 600
- BtnBar.ItemWidth = 600
- BtnBar.ImageList = "imgLargeList"
- BtnBar.ItemCaptionPos = icBottom
- BtnBar.ItemVertGap = 120
- BtnBar.Refresh
- End Sub
- Private Sub SetSmallImages()
- BtnBar.ItemHeight = 300
- BtnBar.ItemWidth = 300
- BtnBar.ImageList = "imgSmallList"
- BtnBar.ItemCaptionPos = icRight
- BtnBar.ItemVertGap = 60
- BtnBar.Refresh
- End Sub
- Private Sub Form_Resize()
- If (Me.Width < 5070) Then Me.Width = 5070
- If (Me.Height < 4700) Then Me.Height = 4700
- End Sub
- Private Sub optImageSize_Click(Index As Integer)
- If (Index = 0) Then
- SetLargeImages
- Else
- SetSmallImages
- End If
- End Sub
-