// WinMerge: an interactive diff/merge utility
// Copyright (C) 1997-2000 Thingamahoochie Software
// Author: Dean Grimm
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-//
+// SPDX-License-Identifier: GPL-2.0-or-later
/////////////////////////////////////////////////////////////////////////////
/**
* @file EditorFilepathBar.cpp
BOOL CEditorFilePathBar::Create(CWnd* pParentWnd)
{
if (! CDialogBar::Create(pParentWnd, CEditorFilePathBar::IDD,
- CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY, CEditorFilePathBar::IDD))
+ CBRS_ALIGN_TOP | CBRS_TOOLTIPS | CBRS_FLYBY, CEditorFilePathBar::IDD))
return FALSE;
NONCLIENTMETRICS ncm = { sizeof NONCLIENTMETRICS };
m_font.CreateFontIndirect(&ncm.lfStatusFont);
// subclass the two custom edit boxes
- for (int pane = 0; pane < countof(m_Edit); pane++)
+ for (int pane = 0; pane < static_cast<int>(std::size(m_Edit)); pane++)
{
m_Edit[pane].SubClassEdit(IDC_STATIC_TITLE_PANE0 + pane, this);
m_Edit[pane].SetFont(&m_font);
return CSize(SHRT_MAX, tm.tmHeight + 6);
}
-void CEditorFilePathBar::SetPaneCount(int nPanes)
-{
- m_nPanes = nPanes;
-}
-
/**
* @brief Resize both controls to an equal size.
*/
if (m_hWnd == nullptr)
return;
- WINDOWPLACEMENT infoBar;
+ WINDOWPLACEMENT infoBar = {};
GetWindowPlacement(&infoBar);
- int widths[3];
+ int widths[3] = {};
for (int pane = 0; pane < m_nPanes; pane++)
widths[pane] = (infoBar.rcNormalPosition.right / m_nPanes);
Resize(widths);
}
/**
- * @brief Set callback function on EN_SETFOCUS notification
- */
-void CEditorFilePathBar::SetOnSetFocusCallback(const std::function<void(int)> callbackfunc)
-{
- m_callbackfunc = callbackfunc;
-}
-
-/**
* @brief Set widths.
* This function resizes both controls to given size. The width is usually
* same as the splitter view width.
pTTT->lpszText = const_cast<TCHAR *>(pItem->GetUpdatedTipText(&tempDC, maxWidth).c_str());
// set old font back
- if (hOldFont)
+ if (hOldFont != nullptr)
::SelectObject(tempDC.GetSafeHdc(),hOldFont);
// we must set TTM_SETMAXTIPWIDTH to use \n in tooltips
*/
String CEditorFilePathBar::GetText(int pane) const
{
- ASSERT (pane >= 0 && pane < countof(m_Edit));
+ ASSERT (pane >= 0 && pane < static_cast<int>(std::size(m_Edit)));
// Check for `nullptr` since window may be closing..
if (m_hWnd == nullptr)
*/
void CEditorFilePathBar::SetText(int pane, const String& sString)
{
- ASSERT (pane >= 0 && pane < countof(m_Edit));
+ ASSERT (pane >= 0 && pane < static_cast<int>(std::size(m_Edit)));
// Check for `nullptr` since window may be closing..
if (m_hWnd == nullptr)
*/
void CEditorFilePathBar::SetActive(int pane, bool bActive)
{
- ASSERT (pane >= 0 && pane < countof(m_Edit));
+ ASSERT (pane >= 0 && pane < static_cast<int>(std::size(m_Edit)));
// Check for `nullptr` since window may be closing..
if (m_hWnd == nullptr)