Private m_cxLeftBorder As Long, m_cxRightBorder As Long
Private m_cyTopBorder As Long, m_cyBottomBorder As Long
Private m_cxDefaultGap As Long ' default gap value
Private m_nMRUWidth As Long ' for dynamic resizing
Private m_nCount As Long
Enum StateFlags
delayHide = 1
delayShow = 2
tempHide = 4
statusSet = 8
End Enum
Private m_nStateFlags As Long
Private m_pDockContext As CDockContext ' used during dragging
Private m_pDockSite As CFrame ' current dock site, if dockable
Private m_pDockBar As CDockBar ' current dock bar, if dockable
Private m_dwDockStyle As Long ' indicates how bar can be docked
Public arrBars As New CPtrArray ' each element is a CControlBar
Public Property Let pDockContext(ByVal RHS As CDockContext)
Set m_pDockContext = RHS
End Property
Public Property Get pDockContext() As CDockContext
Set pDockContext = m_pDockContext
End Property
Public Property Let bFloating(ByVal RHS As Boolean)
m_bFloating = RHS
End Property
Public Property Get bFloating() As Boolean
bFloating = m_bFloating
End Property
Public Property Let bLayoutQuery(ByVal RHS As Boolean)
m_bLayoutQuery = RHS
End Property
Public Property Get bLayoutQuery() As Boolean
bLayoutQuery = m_bLayoutQuery
End Property
Public Property Let cxLeftBorder(ByVal RHS As Long)
m_cxLeftBorder = RHS
End Property
Public Property Get cxLeftBorder() As Long
cxLeftBorder = m_cxLeftBorder
End Property
Public Property Let cxRightBorder(ByVal RHS As Long)
m_cxRightBorder = RHS
End Property
Public Property Get cxRightBorder() As Long
cxRightBorder = m_cxRightBorder
End Property
Public Property Let cyTopBorder(ByVal RHS As Long)
m_cyTopBorder = RHS
End Property
Public Property Get cyTopBorder() As Long
cyTopBorder = m_cyTopBorder
End Property
Public Property Let cyBottomBorder(ByVal RHS As Long)
m_cyBottomBorder = RHS
End Property
Public Property Get cyBottomBorder() As Long
cyBottomBorder = m_cyBottomBorder
End Property
Public Property Let cxDefaultGap(ByVal RHS As Long)
m_cxDefaultGap = RHS
End Property
Public Property Get cxDefaultGap() As Long
cxDefaultGap = m_cxDefaultGap
End Property
Public Property Let nMRUWidth(ByVal RHS As Long)
m_nMRUWidth = RHS
End Property
Public Property Get nMRUWidth() As Long
nMRUWidth = m_nMRUWidth
End Property
Public Property Let nCount(ByVal RHS As Long)
m_nCount = RHS
End Property
Public Property Get nCount() As Long
nCount = m_nCount
End Property
Public Property Let nStateFlags(ByVal RHS As Long)
m_nStateFlags = RHS
End Property
Public Property Get nStateFlags() As Long
nStateFlags = m_nStateFlags
End Property
Public Property Let dwStyle(ByVal RHS As Long)
Wnd.dwStyle = RHS
End Property
Public Property Get dwStyle() As Long
dwStyle = Wnd.dwStyle
End Property
Public Property Let pDockSite(ByVal RHS As CFrame)
Set m_pDockSite = RHS
End Property
Public Property Get pDockSite() As CFrame
Set pDockSite = m_pDockSite
End Property
Public Property Let pDockBar(ByVal RHS As CDockBar)
Set m_pDockBar = RHS
End Property
Public Property Get pDockBar() As CDockBar
Set pDockBar = m_pDockBar
End Property
Public Property Let dwDockStyle(ByVal RHS As Long)
m_dwDockStyle = RHS
End Property
Public Property Get dwDockStyle() As Long
dwDockStyle = m_dwDockStyle
End Property
Private Property Let CWnd_dwStyle(ByVal RHS As Long)
Wnd.dwStyle = RHS
End Property
Private Property Get CWnd_dwStyle() As Long
CWnd_dwStyle = Wnd.dwStyle
End Property
Private Property Let CWnd_hWnd(ByVal RHS As Long)
'
End Property
Private Property Get CWnd_hWnd() As Long
CWnd_hWnd = Wnd.hWnd
End Property
Public Property Get hWnd() As Long
hWnd = Wnd.hWnd
End Property
Friend Property Let hWnd(RHS As Long)
Wnd.hWnd = RHS
End Property
Private Sub Class_Initialize()
Call Initialize
End Sub
Private Function CWnd_CreateEx(dwExStyle As Long, lpszClassName As String, lpszWindowName As String, dwStyle As Long, x As Long, y As Long, nWidth As Long, nHeight As Long, hWndParent As Long, nIDorHMenu As Long, lpParam As Long, Optional obj As Object = Nothing) As Boolean
Public Function CreateEx(dwExStyle As Long, lpszClassName As String, lpszWindowName As String, dwStyle As Long, x As Long, y As Long, nWidth As Long, nHeight As Long, hWndParent As Long, nIDorHMenu As Long, lpParam As Long) As Boolean
Friend Function Create(lpszClassName As String, lpszWindowName As String, dwStyle As Long, recta As RECT, pParentWnd As Long, nID As Long, Optional pContext As Long = 0) As Boolean
Friend Function CalcFixedLayout(bStretch As Boolean, bHorz As Boolean) As Size
Dim sizea As Size
If (bStretch And bHorz) Then
sizea.cx = 32767
Else
sizea.cx = 0
End If
If (bStretch And (Not bHorz)) Then
sizea.cy = 32767
Else
sizea.cy = 0
End If
CalcFixedLayout = sizea
End Function
Public Function IsVisible() As Boolean
If (m_nStateFlags And delayHide) <> 0 Then
IsVisible = False
Exit Function
End If
If (((m_nStateFlags And delayShow) <> 0) Or ((GetStyle(m_hWnd) And WS_VISIBLE) <> 0)) Then
IsVisible = True
Exit Function
End If
IsVisible = False
End Function
Private Property Let m_dwStyle(ByVal RHS As Long)
dwStyle = RHS
End Property
Private Property Get m_dwStyle() As Long
m_dwStyle = dwStyle
End Property
Public Function SetBarStyle(dwStyle_param As Long)
If (m_dwStyle <> dwStyle_param) Then
Dim dwOldStyle As Long
dwOldStyle = m_dwStyle
m_dwStyle = dwStyle_param
Call OnBarStyleChange(dwOldStyle, dwStyle_param)
End If
End Function
Private Function OnBarStyleChange(dwOldStyle As Long, dwNewStyle As Long)
'
End Function
Private Function Initialize()
' no elements contained in the control bar yet
m_nCount = 0
'm_pData = NULL;
' set up some default border spacings
m_cxLeftBorder = 6
m_cxRightBorder = 6
m_cxDefaultGap = 2
m_cyTopBorder = 1
m_cyBottomBorder = 1
'm_bAutoDelete = FALSE;
'm_hWndOwner = NULL;
m_nStateFlags = 0
Set m_pDockSite = Nothing
Set m_pDockBar = Nothing
Set m_pDockContext = Nothing
m_dwStyle = 0
m_dwDockStyle = 0
m_nMRUWidth = 32767
End Function
Private Property Let CWnd_hWndOwner(ByVal RHS As Long)
Wnd.hWndOwner = RHS
End Property
Private Property Get CWnd_hWndOwner() As Long
CWnd_hWndOwner = Wnd.hWndOwner
End Property
Public Property Let hWndOwner(ByVal RHS As Long)
CWnd_hWndOwner = RHS
End Property
Public Property Get hWndOwner() As Long
hWndOwner = CWnd_hWndOwner
End Property
Friend Function OnSizeParent(wParam As Long, ByRef lParam As AFX_SIZEPARENTPARAMS, Optional pBar As Variant) As Long
Dim lpLayout As AFX_SIZEPARENTPARAMS
lpLayout = lParam
Dim dwStyle As Long
dwStyle = RecalcDelayShow(lpLayout, m_hWnd)
dwStyle = GetWindowLong(m_hWnd, GWL_STYLE)
If (((dwStyle And WS_VISIBLE) <> 0) And ((dwStyle And CBRS_ALIGN_ANY) <> 0)) <> 0 Then
' align the control bar
Dim recta As RECT
Call CopyRect(recta, lpLayout.recta)
Dim sizeAvail As Size
sizeAvail = CSize(recta) ' maximum size available
' get maximum requested size
Dim dwMode As Long
If (lpLayout.bStretch) <> 0 Then dwMode = LM_STRETCH Else dwMode = 0
If ((((GetWindowLong(m_hWnd, GWL_STYLE) And CBRS_ALL) And CBRS_SIZE_DYNAMIC) <> 0) And (((GetWindowLong(m_hWnd, GWL_STYLE) And CBRS_ALL) And CBRS_FLOATING) <> 0)) <> 0 Then