OSDN Git Service

Add WinMergePluginBase.h (2)
[winmerge-jp/winmerge-jp.git] / Src / DiffViewBar.cpp
index c8d0525..efda1e4 100644 (file)
@@ -1,24 +1,15 @@
-//////////////////////////////////////////////////////////////////////
 /** 
  * @file  DiffViewBar.cpp
  *
  * @brief Implementation file for CDiffViewBar
  *
  */
-// RCS ID line follows -- this is updated by CVS
-// $Id$
-//
-//////////////////////////////////////////////////////////////////////
 
 #include "stdafx.h"
-#include "Merge.h"
-
-#include "ChildFrm.h"
 #include "DiffViewBar.h"
+#include "SplitterWndEx.h"
 
 #ifdef _DEBUG
-#undef THIS_FILE
-static char THIS_FILE[]=__FILE__;
 #define new DEBUG_NEW
 #endif
 
@@ -29,8 +20,7 @@ IMPLEMENT_DYNAMIC(CDiffViewBar, TViewBarBase);
 //////////////////////////////////////////////////////////////////////
 
 CDiffViewBar::CDiffViewBar()
-: m_pwndDetailSplitter(0)
-, m_hwndFrame(NULL)
+: m_hwndFrame(nullptr)
 {
 }
 
@@ -43,7 +33,6 @@ CDiffViewBar::~CDiffViewBar()
 BEGIN_MESSAGE_MAP(CDiffViewBar, TViewBarBase)
        //{{AFX_MSG_MAP(CRegBar)
        ON_WM_CREATE()
-       ON_WM_SIZE()
        ON_WM_LBUTTONDOWN()
        ON_WM_WINDOWPOSCHANGED()
        //}}AFX_MSG_MAP
@@ -55,14 +44,14 @@ END_MESSAGE_MAP()
 /**
 * @brief Just create ourself
 *
-* @note The control are created in the parent frame CChildFrame
+* @note The control are created in the parent frame CMergeEditFrame
 *
 */
 BOOL CDiffViewBar::Create(
        CWnd* pParentWnd,
-       LPCTSTR lpszWindowName,
-       DWORD dwStyle,
-       UINT nID)
+       LPCTSTR lpszWindowName /*= nullptr*/,
+       DWORD dwStyle /*= WS_CHILD | WS_VISIBLE | CBRS_TOP*/,
+       UINT nID /*= AFX_IDW_PANE_FIRST*/)
 {
        return TViewBarBase::Create(
                lpszWindowName,
@@ -83,37 +72,6 @@ int CDiffViewBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
        return 0;
 }
 
-
-int CDiffViewBar::GetPanelHeight()
-{
-       if (IsWindowVisible() == FALSE)
-               return 0;
-
-       int hDetailLeft,hmin;
-       m_pwndDetailSplitter->GetRowInfo(0, hDetailLeft, hmin);
-       return hDetailLeft;
-}
-
-
-/// update height for both panels
-void CDiffViewBar::UpdateBarHeight(int DiffPanelHeight)
-{
-       if (m_pwndDetailSplitter == NULL || ::IsWindow(m_pwndDetailSplitter->m_hWnd) == FALSE)
-               return;
-
-       // first resize the splitter
-       CRect rc;
-       GetClientRect(rc);
-       m_pwndDetailSplitter->MoveWindow(rc);
-       m_pwndDetailSplitter->RecalcLayout();
-}
-
-void CDiffViewBar::OnSize(UINT nType, int cx, int cy) 
-{
-       TViewBarBase::OnSize(nType, cx, cy);
-       UpdateBarHeight(-1);
-}
-
 /**
 * @note The window must always be docked after movement
 * there are too much troubles if we get reparented to some minidockbar 
@@ -122,15 +80,15 @@ void CDiffViewBar::OnSize(UINT nType, int cx, int cy)
 void CDiffViewBar::OnLButtonDown(UINT nFlags, CPoint point)
 {
        TViewBarBase::OnLButtonDown(nFlags, point);
-       if (m_pDockBar != NULL)
+       if (m_pDockBar != nullptr)
        {
-               if (IsHorzDocked() == FALSE)
+               if (!IsHorzDocked())
                        m_pDockContext->ToggleDocking();
        }
 }
 
 /** 
- * @brief Informs parent frame (CChildFrame) when bar is closed.
+ * @brief Informs parent frame (CMergeEditFrame) when bar is closed.
  *
  * After bar is closed parent frame saves bar states.
  */
@@ -138,7 +96,7 @@ void CDiffViewBar::OnWindowPosChanged(WINDOWPOS* lpwndpos)
 {
        TViewBarBase::OnWindowPosChanged(lpwndpos);
 
-       if (m_hwndFrame != NULL)
+       if (m_hwndFrame != nullptr)
        {
                // If WINDOWPOS.flags has SWP_HIDEWINDOW flag set
                if ((lpwndpos->flags & SWP_HIDEWINDOW) != 0)
@@ -147,7 +105,7 @@ void CDiffViewBar::OnWindowPosChanged(WINDOWPOS* lpwndpos)
 }
 
 /** 
- * @brief Stores HWND of frame window (CChildFrame).
+ * @brief Stores HWND of frame window (CMergeEditFrame).
  */
 void CDiffViewBar::SetFrameHwnd(HWND hwndFrame)
 {