1 //////////////////////////////////////////////////////////////////////
3 * @file LocationBar.cpp
5 * @brief Implementation file for CLocationBar
8 // RCS ID line follows -- this is updated by CVS
11 //////////////////////////////////////////////////////////////////////
14 #include "LocationBar.h"
19 static char THIS_FILE[]=__FILE__;
23 IMPLEMENT_DYNAMIC(CLocationBar, TViewBarBase);
25 //////////////////////////////////////////////////////////////////////
26 // Construction/Destruction
27 //////////////////////////////////////////////////////////////////////
29 CLocationBar::CLocationBar()
35 CLocationBar::~CLocationBar()
40 BEGIN_MESSAGE_MAP(CLocationBar, TViewBarBase)
41 //{{AFX_MSG_MAP(CRegBar)
45 ON_WM_WINDOWPOSCHANGED()
49 /////////////////////////////////////////////////////////////////////////////
50 // CLocationBar message handlers
53 * @brief Just create ourself
55 * @note The control are created in the parent frame CChildFrame
58 BOOL CLocationBar::Create(
60 LPCTSTR lpszWindowName,
64 return TViewBarBase::Create(
72 /// Create the frame window associated with the view bar.
73 int CLocationBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
75 if (TViewBarBase::OnCreate(lpCreateStruct) == -1)
78 SetSCBStyle(SCBS_EDGELEFT | SCBS_EDGERIGHT | SCBS_SIZECHILD);
83 * @note The window must always be docked after movement
84 * there are too much troubles if we get reparented to some minidockbar
87 void CLocationBar::OnLButtonDown(UINT nFlags, CPoint point)
89 TViewBarBase::OnLButtonDown(nFlags, point);
90 if (m_pDockBar != NULL)
92 if (IsVertDocked() == FALSE)
93 m_pDockContext->ToggleDocking();
97 void CLocationBar::OnSize(UINT nType, int cx, int cy)
99 TViewBarBase::OnSize(nType, cx, cy);
103 * @brief Informs parent frame (CChildFrame) when bar is closed.
105 * After bar is closed parent frame saves bar states.
107 void CLocationBar::OnWindowPosChanged(WINDOWPOS* lpwndpos)
109 TViewBarBase::OnWindowPosChanged(lpwndpos);
111 if (m_hwndFrame != NULL)
113 // If WINDOWPOS.flags has SWP_HIDEWINDOW flag set
114 if ((lpwndpos->flags & SWP_HIDEWINDOW) != 0)
115 ::PostMessage(m_hwndFrame, MSG_STORE_PANESIZES, 0, 0);
120 * @brief Stores HWND of frame window (CChildFrame).
122 void CLocationBar::SetFrameHwnd(HWND hwndFrame)
124 m_hwndFrame = hwndFrame;
127 * @brief Update any resources necessary after a GUI language change
129 void CLocationBar::UpdateResources()
131 String sCaption = _("Location Pane");
132 SetWindowText(sCaption.c_str());