home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / Windows_Ex2220722262012.psc / Forms / frmExplorerBar.frm next >
Text File  |  2011-12-28  |  15KB  |  430 lines

  1. VERSION 5.00
  2. Begin VB.Form frmExplorerBar 
  3.    Caption         =   "ExplorerBar Sample - by Ben Vonk"
  4.    ClientHeight    =   6252
  5.    ClientLeft      =   60
  6.    ClientTop       =   456
  7.    ClientWidth     =   10656
  8.    BeginProperty Font 
  9.       Name            =   "Arial"
  10.       Size            =   10.8
  11.       Charset         =   0
  12.       Weight          =   400
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    Icon            =   "frmExplorerBar.frx":0000
  18.    LinkTopic       =   "Form1"
  19.    ScaleHeight     =   6252
  20.    ScaleWidth      =   10656
  21.    StartUpPosition =   2  'CenterScreen
  22.    Begin prjExplorerBar.ExplorerBar exbSideBarUser 
  23.       Align           =   4  'Align Right
  24.       Height          =   6252
  25.       Left            =   7644
  26.       TabIndex        =   14
  27.       Top             =   0
  28.       Width           =   3012
  29.       _ExtentX        =   5313
  30.       _ExtentY        =   11028
  31.       BorderColor     =   -2147483640
  32.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  33.          Name            =   "MS Sans Serif"
  34.          Size            =   7.8
  35.          Charset         =   0
  36.          Weight          =   400
  37.          Underline       =   0   'False
  38.          Italic          =   0   'False
  39.          Strikethrough   =   0   'False
  40.       EndProperty
  41.       GradientStyle   =   0
  42.       UseTheme        =   2
  43.       UseUserForeColors=   -1  'True
  44.    End
  45.    Begin VB.PictureBox picContainer 
  46.       BorderStyle     =   0  'None
  47.       Height          =   2652
  48.       Left            =   3120
  49.       ScaleHeight     =   2652
  50.       ScaleWidth      =   2412
  51.       TabIndex        =   3
  52.       Top             =   120
  53.       Visible         =   0   'False
  54.       Width           =   2412
  55.       Begin VB.CommandButton Command3 
  56.          Caption         =   "&Clear"
  57.          Height          =   372
  58.          Left            =   120
  59.          Style           =   1  'Graphical
  60.          TabIndex        =   9
  61.          Top             =   2160
  62.          Width           =   852
  63.       End
  64.       Begin VB.Frame Frame1 
  65.          Caption         =   "Demo:"
  66.          Height          =   972
  67.          Left            =   1080
  68.          TabIndex        =   10
  69.          Top             =   1560
  70.          Width           =   1212
  71.          Begin VB.CheckBox Check1 
  72.             Caption         =   "Demo"
  73.             Height          =   252
  74.             Left            =   120
  75.             TabIndex        =   13
  76.             Top             =   660
  77.             Width           =   972
  78.          End
  79.          Begin VB.OptionButton Option1 
  80.             Caption         =   "Demo"
  81.             Height          =   252
  82.             Left            =   120
  83.             TabIndex        =   12
  84.             Top             =   420
  85.             Width           =   972
  86.          End
  87.          Begin VB.Label Label1 
  88.             Alignment       =   2  'Center
  89.             Caption         =   "Demo"
  90.             Height          =   252
  91.             Left            =   120
  92.             TabIndex        =   11
  93.             Top             =   180
  94.             Width           =   972
  95.          End
  96.       End
  97.       Begin VB.TextBox txtSearch 
  98.          Appearance      =   0  'Flat
  99.          Height          =   288
  100.          Left            =   1080
  101.          TabIndex        =   5
  102.          Top             =   120
  103.          Width           =   1212
  104.       End
  105.       Begin VB.CommandButton cmdSearch 
  106.          Caption         =   "&Search"
  107.          Height          =   372
  108.          Left            =   120
  109.          Style           =   1  'Graphical
  110.          TabIndex        =   8
  111.          Top             =   1680
  112.          Width           =   852
  113.       End
  114.       Begin VB.ListBox lstResult 
  115.          Height          =   552
  116.          ItemData        =   "frmExplorerBar.frx":08CA
  117.          Left            =   120
  118.          List            =   "frmExplorerBar.frx":08CC
  119.          TabIndex        =   7
  120.          Top             =   720
  121.          Width           =   2160
  122.       End
  123.       Begin VB.Label lblInfo 
  124.          Caption         =   "Search:"
  125.          Height          =   252
  126.          Index           =   0
  127.          Left            =   120
  128.          TabIndex        =   4
  129.          Top             =   132
  130.          Width           =   852
  131.       End
  132.       Begin VB.Label lblInfo 
  133.          Caption         =   "Result:"
  134.          Height          =   252
  135.          Index           =   1
  136.          Left            =   120
  137.          TabIndex        =   6
  138.          Top             =   480
  139.          Width           =   852
  140.       End
  141.    End
  142.    Begin VB.PictureBox picEvents 
  143.       AutoRedraw      =   -1  'True
  144.       AutoSize        =   -1  'True
  145.       BorderStyle     =   0  'None
  146.       Height          =   372
  147.       Left            =   3120
  148.       ScaleHeight     =   372
  149.       ScaleWidth      =   372
  150.       TabIndex        =   1
  151.       TabStop         =   0   'False
  152.       Top             =   3360
  153.       Width           =   372
  154.    End
  155.    Begin VB.ListBox lstEvents 
  156.       BeginProperty Font 
  157.          Name            =   "Arial"
  158.          Size            =   7.8
  159.          Charset         =   0
  160.          Weight          =   400
  161.          Underline       =   0   'False
  162.          Italic          =   0   'False
  163.          Strikethrough   =   0   'False
  164.       EndProperty
  165.       Height          =   2160
  166.       ItemData        =   "frmExplorerBar.frx":08CE
  167.       Left            =   3120
  168.       List            =   "frmExplorerBar.frx":08D0
  169.       TabIndex        =   2
  170.       Top             =   3840
  171.       Width           =   4452
  172.    End
  173.    Begin prjExplorerBar.ExplorerBar exbSideBarThemed 
  174.       Align           =   3  'Align Left
  175.       Height          =   6252
  176.       Left            =   0
  177.       TabIndex        =   0
  178.       Top             =   0
  179.       Width           =   3012
  180.       _ExtentX        =   5313
  181.       _ExtentY        =   11028
  182.       DetailGroupButton=   -1  'True
  183.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  184.          Name            =   "Arial Unicode MS"
  185.          Size            =   7.8
  186.          Charset         =   0
  187.          Weight          =   400
  188.          Underline       =   0   'False
  189.          Italic          =   0   'False
  190.          Strikethrough   =   0   'False
  191.       EndProperty
  192.       SoundGroupClicked=   -1  'True
  193.       SoundItemClicked=   -1  'True
  194.       UseTheme        =   1
  195.    End
  196.    Begin VB.Image imgShare 
  197.       Height          =   192
  198.       Left            =   6720
  199.       Picture         =   "frmExplorerBar.frx":08D2
  200.       Top             =   5640
  201.       Visible         =   0   'False
  202.       Width           =   192
  203.    End
  204.    Begin VB.Image imgUpload 
  205.       Height          =   192
  206.       Left            =   7440
  207.       Picture         =   "frmExplorerBar.frx":0E5C
  208.       Top             =   5640
  209.       Visible         =   0   'False
  210.       Width           =   192
  211.    End
  212.    Begin VB.Image imgNew 
  213.       Height          =   192
  214.       Left            =   6720
  215.       Picture         =   "frmExplorerBar.frx":13E6
  216.       Top             =   5400
  217.       Visible         =   0   'False
  218.       Width           =   192
  219.    End
  220.    Begin VB.Image imgBurn 
  221.       Height          =   192
  222.       Left            =   7080
  223.       Picture         =   "frmExplorerBar.frx":1970
  224.       Top             =   5640
  225.       Visible         =   0   'False
  226.       Width           =   192
  227.    End
  228.    Begin VB.Image imgSlide 
  229.       Height          =   192
  230.       Left            =   7800
  231.       Picture         =   "frmExplorerBar.frx":1EFA
  232.       Top             =   5400
  233.       Visible         =   0   'False
  234.       Width           =   192
  235.    End
  236.    Begin VB.Image imgOrder 
  237.       Height          =   192
  238.       Left            =   7080
  239.       Picture         =   "frmExplorerBar.frx":2484
  240.       Top             =   5400
  241.       Visible         =   0   'False
  242.       Width           =   192
  243.    End
  244.    Begin VB.Image imgImages 
  245.       Height          =   384
  246.       Left            =   6600
  247.       Picture         =   "frmExplorerBar.frx":2A0E
  248.       Top             =   4920
  249.       Visible         =   0   'False
  250.       Width           =   384
  251.    End
  252.    Begin VB.Image imgCan 
  253.       Height          =   4800
  254.       Left            =   5040
  255.       Picture         =   "frmExplorerBar.frx":5ED8
  256.       Top             =   120
  257.       Visible         =   0   'False
  258.       Width           =   4800
  259.    End
  260.    Begin VB.Image imgBack 
  261.       Height          =   648
  262.       Left            =   5760
  263.       Picture         =   "frmExplorerBar.frx":A80D
  264.       Top             =   4920
  265.       Visible         =   0   'False
  266.       Width           =   684
  267.    End
  268.    Begin VB.Image imgPrint 
  269.       Height          =   192
  270.       Left            =   7440
  271.       Picture         =   "frmExplorerBar.frx":CC97
  272.       Top             =   5400
  273.       Visible         =   0   'False
  274.       Width           =   192
  275.    End
  276.    Begin VB.Image imgClick 
  277.       Height          =   384
  278.       Left            =   7080
  279.       Picture         =   "frmExplorerBar.frx":D221
  280.       Top             =   4920
  281.       Visible         =   0   'False
  282.       Width           =   384
  283.    End
  284. End
  285. Attribute VB_Name = "frmExplorerBar"
  286. Attribute VB_GlobalNameSpace = False
  287. Attribute VB_Creatable = False
  288. Attribute VB_PredeclaredId = True
  289. Attribute VB_Exposed = False
  290. Option Explicit
  291.  
  292. Private SelectedGroup As Integer
  293.  
  294. Private Function GetObject(ByVal Group As Integer, ByVal Item As Integer) As String
  295.  
  296. Dim strObject As String
  297.  
  298.    If Group = -1 Then
  299.       strObject = "ExplorerBar Control"
  300.       
  301.    ElseIf Group = -2 Then
  302.       strObject = "ScrollBar"
  303.       
  304.    Else
  305.       strObject = "Group: " & Group
  306.       
  307.       If Item > -1 Then strObject = strObject & " - Item: " & Item
  308.    End If
  309.    
  310.    GetObject = strObject
  311.  
  312. End Function
  313.  
  314. Private Sub SetEventInfo(ByVal EventInfo As String, Optional ByRef EventImage As StdPicture = Nothing)
  315.  
  316.    With lstEvents
  317.       If .ListCount = 50 Then .RemoveItem 0
  318.       
  319.       .AddItem EventInfo
  320.       .ListIndex = .ListCount - 1
  321.    End With
  322.    
  323.    picEvents.Picture = EventImage
  324.  
  325. End Sub
  326.  
  327. Private Sub exbSideBarThemed_GroupClick(Group As Integer, WindowState As WindowStates)
  328.  
  329. Dim strWindowState As String
  330.  
  331.    Select Case WindowState
  332.       Case Expanded
  333.          strWindowState = "Expanded]"
  334.          
  335.       Case Collapsed
  336.          strWindowState = "Collapsed]"
  337.          
  338.       Case Fixed
  339.          strWindowState = "Fixed]"
  340.    End Select
  341.    
  342.    Call SetEventInfo("GroupClick " & Group & " (" & exbSideBarThemed.GetGroupTitle(Group) & ") [State: " & strWindowState, exbSideBarThemed.GetGroupIcon(Group))
  343.    
  344.    SelectedGroup = Group
  345.  
  346. End Sub
  347.  
  348. Private Sub exbSideBarThemed_ItemClick(Group As Integer, Item As Integer)
  349.  
  350.    Call SetEventInfo("ItemClick: " & Item & " in Group: " & Group & " (" & exbSideBarThemed.GetItemCaption(Group, Item) & ")", exbSideBarThemed.GetItemIcon(Group, Item))
  351.  
  352. End Sub
  353.  
  354. Private Sub exbSideBarThemed_ItemOpenFile(Group As Integer, Item As Integer, File As String)
  355.  
  356.    Call SetEventInfo("OpenFile for Item: " & Item & " in Group: " & Group & " (" & File & ")", exbSideBarThemed.GetItemIcon(Group, Item))
  357.  
  358. End Sub
  359.  
  360. Private Sub exbSideBarThemed_MouseHover(Group As Integer, Item As Integer, FullTextShowed As Boolean)
  361.  
  362.    Call SetEventInfo("MouseHover: " & GetObject(Group, Item))
  363.  
  364. End Sub
  365.  
  366. Private Sub exbSideBarThemed_MouseOut(Group As Integer, Item As Integer)
  367.  
  368.    Call SetEventInfo("MouseOut: " & GetObject(Group, Item))
  369.  
  370. End Sub
  371.  
  372. Private Sub Form_Load()
  373.  
  374. Dim intGroup As Integer
  375.  
  376.    SelectedGroup = -1
  377.    
  378.    With exbSideBarThemed
  379.       .Locked = True
  380.       intGroup = .AddNormalGroup("Container", , Expanded, , , , , picContainer)
  381.       intGroup = .AddNormalGroup("Foldertasks", , Expanded)
  382.       .AddItem intGroup, "New folder", , imgNew.Picture
  383.       .AddItem intGroup, "Upload folder", , imgUpload.Picture
  384.       .AddItem intGroup, "Share folder", , imgShare.Picture
  385.       intGroup = .AddSpecialGroup("Imagetasks", , , imgImages.Picture, imgBack.Picture)
  386.       .AddItem intGroup, "Show only text", True, imgSlide.Picture, True
  387.       .AddItem intGroup, "Paint", , imgOrder.Picture, , "MSPaint.exe"
  388.       .AddItem intGroup, "Print", , imgPrint.Picture
  389.       .AddItem intGroup, "Planet Source Code", , imgBurn.Picture, , "http://www.planet-source-code.com/vb/default.asp?lngWId=1"
  390.       intGroup = .AddNormalGroup("Other foldertasks", True, Collapsed)
  391.       .AddItem intGroup, "New folder", , imgNew.Picture
  392.       .AddItem intGroup, "Upload folder", , imgUpload.Picture
  393.       .AddItem intGroup, "Share folder", , imgShare.Picture
  394.       intGroup = .AddDetailGroup("More details", , Fixed, , imgCan.Picture, "Bthundertaste.jpg", "JPG-image" & vbCrLf & "Dimensions: 400 x 400" & vbCrLf & "Size: 18,2 kB" & vbCrLf & "Last modified: jul-2-2005 11:13")
  395.       intGroup = .AddNormalGroup("Group with columns", , Collapsed)
  396.       .AddItem intGroup, "New" & vbTab & "folder", True
  397.       .AddItem intGroup, "Upload" & vbTab & "folder"
  398.       .AddItem intGroup, "Share" & vbTab & "folder", , imgShare.Picture
  399.       .AddItem intGroup, "Download folder", , imgUpload.Picture
  400.       .Locked = False
  401.    End With
  402.    
  403.    With exbSideBarUser
  404.       .Locked = True
  405.       .GradientStyle = RightLeft
  406.       intGroup = .AddSpecialGroup("Imagetasks", , , imgImages.Picture, imgBack.Picture)
  407.       .AddItem intGroup, "Make slideshow", , imgSlide.Picture
  408.       .AddItem intGroup, "Order print online", , imgOrder.Picture
  409.       .AddItem intGroup, "Print", , imgPrint.Picture
  410.       .AddItem intGroup, "Burn on cd", , imgBurn.Picture
  411.       intGroup = .AddNormalGroup("Foldertasks", , Collapsed)
  412.       .AddItem intGroup, "New folder", , imgNew.Picture
  413.       .AddItem intGroup, "Upload folder", , imgUpload.Picture
  414.       .AddItem intGroup, "Share folder", , imgShare.Picture
  415.       intGroup = .AddNormalGroup("Other foldertasks", , Collapsed)
  416.       .AddItem intGroup, "New folder", , imgNew.Picture
  417.       .AddItem intGroup, "Upload folder", , imgUpload.Picture
  418.       .AddItem intGroup, "Share folder", , imgShare.Picture
  419.       intGroup = .AddNormalGroup("Group with columns", , Collapsed)
  420.       .AddItem intGroup, "New" & vbTab & "folder", True
  421.       .AddItem intGroup, "Upload" & vbTab & "folder"
  422.       .AddItem intGroup, "Share" & vbTab & "folder", , imgShare.Picture
  423.       .AddItem intGroup, "Download folder", , imgUpload.Picture
  424.       intGroup = .AddDetailGroup("More details", , Fixed, , imgCan.Picture, "thundertaste.jpg", "JPG-image" & vbCrLf & "Dimensions: 400 x 400" & vbCrLf & "Size: 18,2 kB" & vbCrLf & "Last modified: jul-2-2005 11:13")
  425.       .Locked = False
  426.    End With
  427.  
  428. End Sub
  429.  
  430.