1 /////////////////////////////////////////////////////////////////////////////
2 // WinMerge: an interactive diff/merge utility
3 // Copyright (C) 1997 Dean P. Grimm
4 // SPDX-License-Identifier: GPL-2.0-or-later
5 /////////////////////////////////////////////////////////////////////////////
7 * @file EditorFilePathBar.h
9 * @brief Interface of the CEditorFilePathBar class.
14 #include "FilepathEdit.h"
18 * Interface to update the header data.
23 virtual String GetText(int pane) const = 0;
24 virtual void SetText(int pane, const String& sString) = 0;
25 virtual void SetActive(int pane, bool bActive) = 0;
26 virtual void SetPaneCount(int nPanes) = 0;
27 virtual void Resize() = 0;
28 virtual void SetOnSetFocusCallback(const std::function<void(int)> callbackfunc) = 0;
33 * @brief A dialog bar with two controls for left/right path.
34 * This class is a dialog bar for the both files path in the editor.
35 * The bar looks like a statusBar (font, height). The control
36 * displays a tip for each path (as a tooltip).
38 class CEditorFilePathBar : public CDialogBar, public IHeaderBar
42 ~CEditorFilePathBar();
44 BOOL Create( CWnd* pParentWnd);
45 virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
48 enum { IDD = IDD_EDITOR_HEADERBAR };
50 void Resize() override;
51 void Resize(int widths[]);
52 void SetOnSetFocusCallback(const std::function<void(int)> callbackfunc) override;
54 // Implement IFilepathHeaders
55 void SetText(int pane, const String& sString) override;
56 String GetText(int pane) const override;
57 void SetActive(int pane, bool bActive) override;
58 void SetPaneCount(int nPanes) override;
61 //{{AFX_MSG(CEditorFilePathBar)
62 afx_msg BOOL OnToolTipNotify( UINT id, NMHDR * pTTTStruct, LRESULT * pResult );
63 afx_msg void OnSetFocusEdit(UINT id);
65 DECLARE_MESSAGE_MAP();
68 // this dialog uses custom edit boxes
69 CFilepathEdit m_Edit[3]; /**< Edit controls. */
70 CFont m_font; /**< Font for editcontrols */
72 std::function<void(int)> m_callbackfunc;
75 inline void CEditorFilePathBar::SetPaneCount(int nPanes)
81 * @brief Set callback function on EN_SETFOCUS notification
83 inline void CEditorFilePathBar::SetOnSetFocusCallback(const std::function<void(int)> callbackfunc)
85 m_callbackfunc = callbackfunc;