2 * @file LocationBar.cpp
4 * @brief Implementation file for CLocationBar
9 #include "LocationBar.h"
15 IMPLEMENT_DYNAMIC(CLocationBar, TViewBarBase);
17 //////////////////////////////////////////////////////////////////////
18 // Construction/Destruction
19 //////////////////////////////////////////////////////////////////////
21 CLocationBar::CLocationBar()
22 : m_hwndFrame(nullptr)
27 CLocationBar::~CLocationBar()
32 BEGIN_MESSAGE_MAP(CLocationBar, TViewBarBase)
33 //{{AFX_MSG_MAP(CRegBar)
37 ON_WM_WINDOWPOSCHANGED()
41 /////////////////////////////////////////////////////////////////////////////
42 // CLocationBar message handlers
45 * @brief Just create ourself
47 * @note The control are created in the parent frame CMergeEditFrame
50 BOOL CLocationBar::Create(
52 LPCTSTR lpszWindowName,
56 return TViewBarBase::Create(
64 /// Create the frame window associated with the view bar.
65 int CLocationBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
67 if (TViewBarBase::OnCreate(lpCreateStruct) == -1)
70 SetSCBStyle(SCBS_EDGELEFT | SCBS_EDGERIGHT | SCBS_SIZECHILD);
75 * @note The window must always be docked after movement
76 * there are too much troubles if we get reparented to some minidockbar
79 void CLocationBar::OnLButtonDown(UINT nFlags, CPoint point)
81 TViewBarBase::OnLButtonDown(nFlags, point);
82 if (m_pDockBar != nullptr)
85 m_pDockContext->ToggleDocking();
89 void CLocationBar::OnSize(UINT nType, int cx, int cy)
91 TViewBarBase::OnSize(nType, cx, cy);
95 * @brief Informs parent frame (CMergeEditFrame) when bar is closed.
97 * After bar is closed parent frame saves bar states.
99 void CLocationBar::OnWindowPosChanged(WINDOWPOS* lpwndpos)
101 TViewBarBase::OnWindowPosChanged(lpwndpos);
103 if (m_hwndFrame != nullptr)
105 // If WINDOWPOS.flags has SWP_HIDEWINDOW flag set
106 if ((lpwndpos->flags & SWP_HIDEWINDOW) != 0)
107 ::PostMessage(m_hwndFrame, MSG_STORE_PANESIZES, 0, 0);
112 * @brief Stores HWND of frame window (CMergeEditFrame).
114 void CLocationBar::SetFrameHwnd(HWND hwndFrame)
116 m_hwndFrame = hwndFrame;
119 * @brief Update any resources necessary after a GUI language change
121 void CLocationBar::UpdateResources()
123 String sCaption = _("Location Pane");
124 SetWindowText(sCaption.c_str());