vbAccelerator - Contents of code file: mfrmMain.frm

VERSION 5.00
Object = "{54CCA7D7-6B11-45AC-89C1-8A8B07FFADFF}#6.0#0"; "vbalDkTb.ocx"
Object = "{54F463F3-0135-11D2-8D52-00C04FA4EE99}#7.8#0"; "vbalTbar.ocx"
Begin VB.MDIForm mfrmMain 
   AutoShowChildren=   0   'False
   BackColor       =   &H8000000C&
   Caption         =   "Office Bar Tester"
   ClientHeight    =   6315
   ClientLeft      =   3750
   ClientTop       =   2040
   ClientWidth     =   9015
   Icon            =   "mfrmMain.frx":0000
   Begin VB.PictureBox picGeneral 
      Align           =   1  'Align Top
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   0
      ScaleHeight     =   315
      ScaleWidth      =   8955
      TabIndex        =   9
      Top             =   0
      Visible         =   0   'False
      Width           =   9015
      Begin vbalTBar.cToolbar tbrMenu 
         Height          =   195
         Left            =   2040
         Top             =   60
         Width           =   1095
         _ExtentX        =   1931
         _ExtentY        =   344
      End
      Begin VB.ComboBox cboAddress 
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   315
         Left            =   900
         TabIndex        =   10
         Text            =   "Combo1"
         Top             =   0
         Width           =   1035
      End
      Begin vbalTBar.cToolbar tbrAddress 
         Height          =   195
         Left            =   3180
         Top             =   60
         Width           =   1095
         _ExtentX        =   1931
         _ExtentY        =   344
      End
      Begin vbalTBar.cToolbar tbrStandard 
         Height          =   195
         Left            =   4380
         Top             =   60
         Width           =   1095
         _ExtentX        =   1931
         _ExtentY        =   344
      End
   End
   Begin vbalDkTb.vbalDockContainer vbalDockContainer4 
      Align           =   4  'Align Right
      Height          =   5550
      Left            =   8985
      TabIndex        =   3
      Top             =   405
      Width           =   30
      _ExtentX        =   53
      _ExtentY        =   9790
   End
   Begin vbalDkTb.vbalDockContainer vbalDockContainer3 
      Align           =   3  'Align Left
      Height          =   5550
      Left            =   0
      TabIndex        =   2
      Top             =   405
      Width           =   30
      _ExtentX        =   53
      _ExtentY        =   9790
   End
   Begin vbalDkTb.vbalDockContainer vbalDockContainer2 
      Align           =   2  'Align Bottom
      Height          =   360
      Left            =   0
      TabIndex        =   1
      Top             =   5955
      Width           =   9015
      _ExtentX        =   15901
      _ExtentY        =   635
      NonDockingArea  =   -1  'True
      Begin VB.PictureBox picStatus 
         BorderStyle     =   0  'None
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   0
         ScaleHeight     =   375
         ScaleWidth      =   9015
         TabIndex        =   4
         Top             =   0
         Width           =   9015
         Begin VB.CommandButton cmdRestoreLayout 
            Caption         =   "Restore &Layout"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   5520
            TabIndex        =   8
            Top             =   30
            Width           =   1335
         End
         Begin VB.CommandButton cmdSaveLayout 
            Caption         =   "Save &Layout"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   4140
            TabIndex        =   7
            Top             =   30
            Width           =   1335
         End
         Begin VB.CommandButton cmdShowState 
            Caption         =   "Show &State"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   315
            Left            =   2760
            TabIndex        =   6
            Top             =   30
            Width           =   1335
         End
         Begin VB.CheckBox Check1 
            Caption         =   "&Lock Main Toolbar"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   1080
            TabIndex        =   5
            Top             =   60
            Width           =   1995
         End
      End
   End
   Begin vbalDkTb.vbalDockContainer vbalDockContainer1 
      Align           =   1  'Align Top
      Height          =   30
      Left            =   0
      TabIndex        =   0
      Top             =   375
      Width           =   9015
      _ExtentX        =   15901
      _ExtentY        =   53
   End
End
Attribute VB_Name = "mfrmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private WithEvents m_cMenu As cPopupMenu
Attribute m_cMenu.VB_VarHelpID = -1
Private m_cSBar As cNoStatusBar
Private m_cILNormal20 As cVBALImageList
Private m_cILHot20 As cVBALImageList

Private Sub showState()
Dim ctl As Control
Dim ctlDock As vbalDockContainer
Dim i As Long
   IndicateClear
   For Each ctl In Me.Controls
      If TypeName(ctl) = "vbalDockContainer" Then
         Set ctlDock = ctl
         Indicate ctlDock.Name
         Indicate "   Owns " & ctlDock.BarCount & " bars"
         Indicate "   Showing " & ctlDock.RowCount & " rows"
         For i = 1 To ctlDock.BarCount
            Indicate "      Bar " & i & " has key " & ctlDock.BarKey(i) & "; "
             & IIf(ctlDock.IsDocked(ctlDock.BarKey(i)), "Bar is docked", "Bar
             is undocked")
         Next i
      End If
   Next
End Sub

Private Sub IndicateClear()
Dim frm As Form
   For Each frm In Forms
      If TypeName(frm) = "frmChild" Then
         frm.IndicateClear
      End If
   Next
   
End Sub

Private Sub Indicate(ByVal sMsg As String)
Dim frm As Form
   For Each frm In Forms
      If TypeName(frm) = "frmChild" Then
         frm.Indicate sMsg
      End If
   Next
End Sub

Private Sub createMenu()
Dim iMain As Long
Dim iP As Long
Dim iP2 As Long
Dim iP3 As Long

   With m_cMenu
      ' Build bars for MENU & TOOLBAR:
      iMain = .AddItem("MENU", "Menu Bar", , , , , , "MENUBAR")
      
      iP = .AddItem("&File", , , iMain, , , , "mnuFileTOP")
      .AddItem "&New Instance" & vbTab & "Ctrl+N", , , iP, , , , "mnuFile(0)"
      .AddItem "Show &MDI!", , , iP, , , False, "mnuFile(1)"
      .AddItem "-", , , iP, , , , "mnuFile(2)"
      .AddItem "&Close", , , iP, , , , "mnuFile(3)"
      
      iP = .AddItem("&Button", , , iMain, , , , "mnuButtonTOP")
      .AddItem "Button 2 &Visible", , , iP, , True, , "mnuButton(0)"
      .AddItem "Button 2 &Enabled", , , iP, , False, , "mnuButton(1)"
      .AddItem "-", , , iP, , , , "mnuButton(2)"
      iP2 = .AddItem("Change Button 2 &Caption", , , iP, , , , "mnuButton(3)")
      .ItemInfrequentlyUsed(iP2) = True
      iP2 = .AddItem("Change Button 1 Captio&n", , , iP, , , , "mnuButton(4)")
      .ItemInfrequentlyUsed(iP2) = True
      .AddItem "-", , , iP, , , , "mnuButton(5)"
      iP2 = .AddItem("Change Button 2 &Image", , , iP, , , , "mnuButton(6)")
      .ItemInfrequentlyUsed(iP2) = True
      iP2 = .AddItem("Chec&k Last Button", , , iP, , , , "mnuButton(7)")
      .ItemInfrequentlyUsed(iP2) = True
      .AddItem "-", , , iP, , , , "mnuButton(8)"
      .AddItem "In&sert Button...", , , iP, , , , "mnuButton(9)"
      .AddItem "-", , , iP, , , , "mnuButton(10)"
      .AddItem "&Show Captions", , , iP, , True, , "mnuButton(11)"
      
      iP = .AddItem("&View", , , iMain, , , , "mnuViewTOP")
      .AddItem "&Large Toolbar", , , iP, , True, , "mnuView(0)"
      .AddItem "&Small Toolbar", , , iP, , True, , "mnuView(1)"
      .AddItem "Lin&ks Toolbar", , , iP, , True, , "mnuView(2)"
      .AddItem "St&yle Bar", , , iP, , True, , "mnuView(3)"
      .AddItem "-", , , iP, , , , "mnuView(4)"
      .AddItem "Background &Bitmap", , , iP, , True, , "mnuView(5)"
      
      iP = .AddItem("&Position", , , iMain, , , , "mnuPositionTOP")
      iP2 = .AddItem("&Top", , , iP, , , , "mnuPosition(0)")
      .RadioCheck(iP2) = True
      .AddItem "&Left", , , iP, , , , "mnuPosition(1)"
      .AddItem "&Right", , , iP, , , , "mnuPosition(2)"
      .AddItem "&Bottom", , , iP, , , , "mnuPosition(3)"
      
      iP = .AddItem("&Help", , , iMain, , , , "mnuHelpTOP")
      .AddItem "&Contents" & vbTab & "F1", , , iP, , , , "mnuHelp(0)"
      iP2 = .AddItem("&Index", , , iP, , , , "mnuHelp(1)")
      .ItemInfrequentlyUsed(iP2) = True
      iP2 = .AddItem("&Search", , , iP, , , , "mnuHelp(2)")
      .ItemInfrequentlyUsed(iP2) = True
      .AddItem "-", , , iP
      iP2 = .AddItem("&vbAccelerator on the Web", , , iP, , , , "mnuHelp(1)")
      iP3 = .AddItem("&Free Stuff", , , iP2)
      iP3 = .AddItem("&Product News", , , iP2)
      iP3 = .AddItem("Frequently Asked &Questions", , , iP2)
      iP3 = .AddItem("-", , , iP2)
      iP3 = .AddItem("For &Developers Only", , , iP2)
      .ItemInfrequentlyUsed(iP3) = True
      iP3 = .AddItem("Send Feed&back", , , iP2)
      .ItemInfrequentlyUsed(iP3) = True
      iP3 = .AddItem("&Best of the Web", , , iP2)
      .ItemInfrequentlyUsed(iP3) = True
      iP3 = .AddItem("Search the &Web", , , iP2)
      .ItemInfrequentlyUsed(iP3) = True
      iP3 = .AddItem("Web &Tutorial", , , iP2)
      .ItemInfrequentlyUsed(iP3) = True
      .AddItem "-", , , iP
      .AddItem "&About...", , , iP, , , , "mnuHelp(3)"
            
      
      ' Toolbar:
      iMain = .AddItem("TOOLBAR", "Standard Toolbar", , , , , , "STDTOOLBAR")
      
      iP = .AddItem("Back", "Back To ", , iMain, 0, , , "TOOLBAR:GO:BACK")
      iP2 = .AddItem("<empty>", , , iP, , , False, "TOOLBAR:BACK:1")
      iP = .AddItem("Forward", "Forward To ", , iMain, 1, , False,
       "TOOLBAR:GO:FORWARD")
      iP2 = .AddItem("<empty>", , , iP, , , False, "TOOLBAR:FORWARD:1")
      iP = .AddItem("Up", "Up", , iMain, 28, , , "TOOLBAR:GO:UP")
      iP = .AddItem("-", , , iMain)
      iP = .AddItem("Search", , , iMain, 17, , , "TOOLBAR:EXPLORER:SEARCH")
      iP = .AddItem("Folders", , , iMain, 43, True, ,
       "TOOLBAR:EXPLORER:FOLDERS")
      .RadioCheck(iP) = True
      iP = .AddItem("History", , , iMain, 17, , , "TOOLBAR:EXPLORER:HISTORY")
      iP = .AddItem("Favourites", , , iMain, 2, , ,
       "TOOLBAR:EXPLORER:FAVOURITES")
      .Visible(iP) = False
      iP = .AddItem("<None>", , , iMain, 17, , , "TOOLBAR:EXPLORER:NONE")
      .Visible(iP) = False
      iP = .AddItem("-", , , iMain)
      iP = .AddItem("Move To", "Move To", , iMain, 44, , False,
       "TOOLBAR:EDIT:MOVETO")
      iP = .AddItem("Copy To", "Copy To", , iMain, 45, , False,
       "TOOLBAR:EDIT:COPYTO")
      iP = .AddItem("Delete", "Delete", , iMain, 10, , , "TOOLBAR:FILE:DELETE")
      iP = .AddItem("Undo", "Undo", , iMain, 8, , , "TOOLBAR:EDIT:UNDO")
      iP = .AddItem("-", , , iMain)
      iP = .AddItem("Views", "Views", , iMain, 20, , , "TOOLBAR:TOP:VIEWS")
      iP2 = .AddItem("Lar&ge Icons", , , iP, 20, , , "TOOLBAR:VIEW:LARGE")
      .RadioCheck(iP2) = True
      iP2 = .AddItem("S&mall Icons", , , iP, 21, , , "TOOLBAR:VIEW:SMALL")
      iP2 = .AddItem("&List", , , iP, 22, , , "TOOLBAR:VIEW:LIST")
      iP2 = .AddItem("&Details", , , iP, 23, , , "TOOLBAR:VIEW:DETAILS")
      iP2 = .AddItem("T&humbnails", , , iP, , , , "TOOLBAR:VIEW:THUMBNAILS")
      
      
      ' Address/Go toolbar:
      iMain = .AddItem("ADDRESS", "Address Toolbar", , , , , , "ADRTOOLBAR")
      .AddItem "Address", , , iMain, , , , "TOOLBAR:ADDRESS:COMBO"
      .AddItem "&Go", , , iMain, 0, , , "TOOLBAR:ADDRESS:GO"
      
      
      .HideInfrequentlyUsed = True

   End With
   
End Sub
Private Sub buildImageLists()
   '
    ============================================================================
   =======
   ' 20 x 20 Hot & Standard Images:
   '
    ============================================================================
   =======
   Set m_cILNormal20 = New cVBALImageList
   With m_cILNormal20
      .IconSizeX = 20: .IconSizeY = 20: .ColourDepth = ILC_COLOR24
      .Create
      .AddFromFile App.Path & "\exp20n.bmp", IMAGE_BITMAP
   End With
   Set m_cILHot20 = New cVBALImageList
   With m_cILHot20
      .IconSizeX = 20: .IconSizeY = 20: .ColourDepth = ILC_COLOR24
      .Create
      .AddFromFile App.Path & "\exp20h.bmp", IMAGE_BITMAP
   End With

End Sub

Private Function chevronPress(ctl As vbalDockContainer, ByVal sKey As String,
 ByVal lX As Long, ByVal lY As Long)
   Debug.Print "ChevronPress Start", sKey
   Select Case sKey
   Case "MENU"
      tbrMenu.chevronPress lX, lY
      ctl.BandSizeChange "MENU", tbrMenu.ToolbarWidth, tbrMenu.ToolbarHeight,
       getVerticalHeight(tbrMenu), getVerticalWidth(tbrMenu)
   Case "UTILITY"
      tbrAddress.chevronPress lX, lY
      ctl.BandSizeChange "UTILITY", 256, tbrAddress.ToolbarHeight,
       getVerticalHeight(tbrAddress), getVerticalWidth(tbrAddress)
   Case "STANDARD"
      tbrStandard.chevronPress lX, lY
      ctl.BandSizeChange "STANDARD", tbrStandard.ToolbarWidth,
       tbrStandard.ToolbarHeight, getVerticalHeight(tbrStandard),
       getVerticalWidth(tbrStandard)
   End Select
   Debug.Print "ChevronPress End", sKey
End Function

Private Function getVerticalHeight(tbrThis As cToolbar) As Long
Dim l As Long
Dim lHeight As Long
Dim lMaxWidth As Long
Dim lRowHeight As Long
Dim lRowWidth As Long

   lMaxWidth = getVerticalWidth(tbrThis)
   
   For l = 0 To tbrThis.ButtonCount - 1
      If tbrThis.ButtonVisible(l) Then
         If tbrThis.ButtonControl(l) = 0 Then
            
            If tbrThis.ButtonStyle(l) = CTBSeparator Then
               ' we'll start a new row for the next one
               lHeight = lHeight + lRowHeight
               lRowHeight = 0
               lRowWidth = 0
            Else
               If (lRowWidth + tbrThis.ButtonWidth(l) > lMaxWidth) Then
                  ' This button needs to go on a new row:
                  lHeight = lHeight + lRowHeight
                  lRowHeight = 0
                  lRowWidth = lRowWidth + tbrThis.ButtonWidth(l)
                  If (tbrThis.ButtonHeight(l) > lRowHeight) Then
                     lRowHeight = tbrThis.ButtonHeight(l)
                  End If
               Else
                  ' This button goes on this row:
                  If (tbrThis.ButtonHeight(l) > lRowHeight) Then
                     lRowHeight = tbrThis.ButtonHeight(l)
                  End If
                  lRowWidth = lRowWidth + tbrThis.ButtonWidth(l)
               End If
            End If
         End If
      End If
   Next l
   lHeight = lHeight + lRowHeight
   getVerticalHeight = lHeight
End Function

Private Function getVerticalWidth(tbrThis As cToolbar) As Long
Dim l As Long
Dim lMaxWidth As Long
   For l = 0 To tbrThis.ButtonCount - 1
      If tbrThis.ButtonVisible(l) Then
         If tbrThis.ButtonControl(l) = 0 Then
            If (tbrThis.ButtonWidth(l) > lMaxWidth) Then
               lMaxWidth = tbrThis.ButtonWidth(l)
            End If
         End If
      End If
   Next l
   getVerticalWidth = lMaxWidth
   
End Function

Public Sub newChild()
   Dim f As New frmChild
   f.Show
End Sub

Private Sub cboAddress_Change()
   Debug.Print "cboAddress_Change"
End Sub

Private Sub cboAddress_Click()
   Debug.Print "cboAddress_Click"
End Sub

Private Sub Check1_Click()
   vbalDockContainer1.LockToolBars = (Check1.Value = Checked)
End Sub

Private Sub cmdRestoreLayout_Click()
   Dim sFile As String
   sFile = App.Path & "\layout.xml"
   
   Dim iFile As Integer
   iFile = FreeFile
   Open sFile For Binary Access Read As #iFile
   Dim sXml As String
   sXml = String(LOF(iFile), " ")
   Get #iFile, , sXml
   Close #iFile
   
   ReDim sKey(1 To 6) As String
   Dim hwnd(1 To 6) As Long
   sKey(1) = "MENU": hwnd(1) = tbrMenu.hwnd
   sKey(2) = "STANDARD": hwnd(2) = tbrStandard.hwnd
   sKey(3) = "UTILITY": hwnd(3) = tbrAddress.hwnd
   sKey(4) = "DRAWING": hwnd(4) = 0
   sKey(5) = "TABLES": hwnd(5) = 0
   sKey(6) = "HELP": hwnd(6) = 0
   
   Dim ctl As Control
   Dim ctlDock As vbalDockContainer
   For Each ctl In Me.Controls
      If TypeName(ctl) = "vbalDockContainer" Then
         Set ctlDock = ctl
         Debug.Print "Before Restore on "; ctlDock.Name; ": "; tbrStandard.hwnd
         ctlDock.RestoreLayout sXml, sKey(), hwnd()
         Debug.Print "After Restore on "; ctlDock.Name; ": "; tbrStandard.hwnd
      End If
   Next

End Sub

Private Sub cmdSaveLayout_Click()
Dim sMsg As String
Dim ctl As Control
Dim ctlDock As vbalDockContainer
   sMsg = "<Layout>"
   For Each ctl In Me.Controls
      If TypeName(ctl) = "vbalDockContainer" Then
         Set ctlDock = ctl
         sMsg = sMsg & vbCrLf & ctlDock.SaveLayout()
      End If
   Next
   sMsg = sMsg & vbCrLf & "</Layout>"
   IndicateClear
   Indicate sMsg
   
   Dim sFile As String
   sFile = App.Path & "\layout.xml"
   On Error Resume Next
   Kill sFile
   On Error GoTo errorHandler
   
   Dim iFile As Integer
   iFile = FreeFile
   Open sFile For Binary Access Write As #iFile
   Put #iFile, , sMsg
   Close #iFile
   Exit Sub
   
errorHandler:
   MsgBox "Failed to save layout: " & Err.Description, vbExclamation
   Close #iFile
   Exit Sub
End Sub

Private Sub cmdShowState_Click()
   showState
End Sub

Private Sub m_cMenu_Click(ItemNumber As Long)
   If (m_cMenu.ItemKey(ItemNumber) = "mnuFile(3)") Then
      Unload Me
   Else
      MsgBox "CLICKED:" & m_cMenu.ItemKey(ItemNumber)
   End If
End Sub

Private Sub MDIForm_Load()
   
   '
    ----------------------------------------------------------------------------
   --------
   ' Create status bar:
   Set m_cSBar = New cNoStatusBar
   m_cSBar.Create picStatus
   m_cSBar.SizeGrip = True
   m_cSBar.AddPanel estbrStandard, "Ready.", , , True
   '
    ----------------------------------------------------------------------------
   --------
   
   
   '
    ----------------------------------------------------------------------------
   --------
   ' Create the Menu for the form:
   Set m_cMenu = New cPopupMenu
   m_cMenu.hWndOwner = Me.hwnd
   m_cMenu.OfficeXpStyle = True

   createMenu
   With tbrMenu
      .DrawStyle = CTBDrawOfficeXPStyle
      .CreateFromMenu2 m_cMenu, CTBMenuStyle, "MENUBAR"
      .Wrappable = True
      .ChevronButton(CTBChevronAdditionalAddorRemove) = True
      .ChevronButton(CTBChevronAdditionalReset) = True
      .ChevronButton(CTBChevronAdditionalCustomise) = True
   End With
   '
    ----------------------------------------------------------------------------
   --------
   
   
   '
    ----------------------------------------------------------------------------
   --------
   ' Create an Address/Go toolbar
   With tbrAddress
      .ImageSource = CTBLoadFromFile
      .ImageFile = App.Path & "\1616.bmp"
      .DrawStyle = CTBDrawOfficeXPStyle
      
      ' Create the toolbar
      .CreateFromMenu2 m_cMenu, CTBToolbarStyle, "ADRTOOLBAR"
      
      ' Customise the toolbar so there is a combo box for the first button:
      .SetControl cboAddress.hwnd, "TOOLBAR:ADDRESS:COMBO"
      ' Set the combo box to stretch into the available area:
      .ControlStretch("TOOLBAR:ADDRESS:COMBO") = True
      
      ' Make the Go button text visible:
      .ButtonTextVisible("TOOLBAR:ADDRESS:GO") = True
      
      .Wrappable = True
      .ChevronButton(CTBChevronAdditionalAddorRemove) = True
      .ChevronButton(CTBChevronAdditionalReset) = True
   End With
   Dim i As Long
   For i = 1 To 20
      cboAddress.AddItem "Test Item " & i
   Next i
   cboAddress.ListIndex = 0
   '
    ----------------------------------------------------------------------------
   --------
   
   '
    ----------------------------------------------------------------------------
   --------
   ' Create an Explorer toolbar:
   buildImageLists
   With tbrStandard
      ' Set up the image source:
      .ImageSource = CTBExternalImageList
      .SetImageList m_cILHot20, CTBImageListNormal
      .DrawStyle = CTBDrawOfficeXPStyle
      
      ' Since our images are a different size to the menu,
      ' we should create the toolbar with the right button
      ' size before calling CreateFromMenu
      .CreateToolbar 20, True, True, True
      
      ' Now we create the toolbar:
      .CreateFromMenu2 m_cMenu, CTBToolbarStyle, "STDTOOLBAR"
      
      ' Customise the buttons for the desired appearance:
      .ButtonStyle("TOOLBAR:TOP:VIEWS") = CTBDropDownArrow
      .ButtonTextVisible("TOOLBAR:GO:BACK") = True
      .ButtonTextVisible("TOOLBAR:EXPLORER:FOLDERS") = True
      .ButtonTextVisible("TOOLBAR:EXPLORER:SEARCH") = True
      .ButtonTextVisible("TOOLBAR:EXPLORER:HISTORY") = True
      .ButtonTextVisible("TOOLBAR:EXPLORER:FAVOURITES") = True
      
      .ButtonVisible("TOOLBAR:EXPLORER:FAVOURITES") = False
      .ButtonVisible("TOOLBAR:EXPLORER:NONE") = False
      
      .ChevronButton(CTBChevronAdditionalAddorRemove) = True
      .ChevronButton(CTBChevronAdditionalCustomise) = True
      .ChevronButton(CTBChevronAdditionalReset) = True
   End With
   '
    ----------------------------------------------------------------------------
   --------
   
   
   
   '
    ----------------------------------------------------------------------------
   --------
   ' Set up the docking containers in their initial condition:
   With vbalDockContainer1
      .Add _
         "MENU", _
         tbrMenu.ToolbarWidth, tbrMenu.ToolbarHeight, _
         getVerticalHeight(tbrMenu), tbrMenu.MaxButtonWidth, _
         "Menu Bar", , , , _
         True, , , False
      .capture "MENU", tbrMenu.hwnd
      .Add _
         "STANDARD", _
         tbrStandard.ToolbarWidth, tbrStandard.ToolbarHeight, _
         getVerticalHeight(tbrStandard), getVerticalWidth(tbrStandard), _
         "Standard"
      .capture "STANDARD", tbrStandard.hwnd
      .Add _
         "UTILITY", _
         256, tbrAddress.ToolbarHeight, _
         getVerticalHeight(tbrAddress), getVerticalWidth(tbrAddress), _
         "Utility"
      .capture "UTILITY", tbrAddress.hwnd
   End With

   With vbalDockContainer2
      .NonDockingArea = True
   End With
   
   With vbalDockContainer3
      .Add "DRAWING", 128, 26, 128, 26, "Drawing"
      .Add "TABLES", 192, 26, 192, 26, "Tables", 1
      .Add "HELP", 64, 26, 64, 26, "Help"
   End With
   '
    ----------------------------------------------------------------------------
   --------
   
   
   '
    ----------------------------------------------------------------------------
   --------
   ' Load a new child form, and start
   newChild
   '
    ----------------------------------------------------------------------------
   --------
   

End Sub


Private Sub picStatus_Paint()
   m_cSBar.Draw
End Sub

Private Sub vbalDockContainer1_chevronPress(ByVal Key As String, ByVal x As
 Long, ByVal y As Long)
   '
   chevronPress vbalDockContainer1, Key, x, y
   '
End Sub

Private Sub vbalDockContainer1_Docked(ByVal Key As String)
   showState
End Sub

Private Sub vbalDockContainer1_Undocked(ByVal Key As String)
   showState
End Sub

Private Sub vbalDockContainer2_chevronPress(ByVal Key As String, ByVal x As
 Long, ByVal y As Long)
   '
   chevronPress vbalDockContainer2, Key, x, y
   '
End Sub

Private Sub vbalDockContainer2_Docked(ByVal Key As String)
   showState
End Sub

Private Sub vbalDockContainer2_SizeChanged()
   picStatus.Move 0, vbalDockContainer2.Height -
    vbalDockContainer2.NonDockingAreaSize * Screen.TwipsPerPixelY,
    vbalDockContainer2.Width, vbalDockContainer2.NonDockingAreaSize *
    Screen.TwipsPerPixelY
End Sub

Private Sub vbalDockContainer2_Undocked(ByVal Key As String)
showState
End Sub

Private Sub vbalDockContainer3_chevronPress(ByVal Key As String, ByVal x As
 Long, ByVal y As Long)
   '
   chevronPress vbalDockContainer3, Key, x, y
   '
End Sub

Private Sub vbalDockContainer3_Docked(ByVal Key As String)
   showState
End Sub

Private Sub vbalDockContainer3_Undocked(ByVal Key As String)
   showState
End Sub

Private Sub vbalDockContainer4_chevronPress(ByVal Key As String, ByVal x As
 Long, ByVal y As Long)
   '
   chevronPress vbalDockContainer4, Key, x, y
   '
End Sub

Private Sub vbalDockContainer4_Docked(ByVal Key As String)
   showState
End Sub

Private Sub vbalDockContainer4_Undocked(ByVal Key As String)
   showState
End Sub