#include "ProgressDlg.h"\r
#include "ShellUpdater.h"\r
#include "Commands/PushCommand.h"\r
+#include "PatchViewDlg.h"\r
\r
#ifdef _DEBUG\r
#define new DEBUG_NEW\r
ON_STN_CLICKED(IDC_BUGIDLABEL, &CCommitDlg::OnStnClickedBugidlabel)\r
ON_COMMAND(ID_FOCUS_MESSAGE,&CCommitDlg::OnFocusMessage)\r
ON_STN_CLICKED(IDC_VIEW_PATCH, &CCommitDlg::OnStnClickedViewPatch)\r
+ ON_WM_MOVE()\r
+ ON_WM_MOVING()\r
+ ON_WM_SIZING()\r
END_MESSAGE_MAP()\r
\r
BOOL CCommitDlg::OnInitDialog()\r
\r
//set range\r
SetSplitterRange();\r
+\r
}\r
\r
\r
void CCommitDlg::OnStnClickedViewPatch()\r
{\r
// TODO: Add your control notification handler code here\r
- this->m_ctrlShowPatch.SetWindowText(_T("Hide Patch<<"));\r
+ \r
+ m_patchViewdlg.m_pProjectProperties = &this->m_ProjectProperties;\r
+ m_patchViewdlg.m_ParentCommitDlg = this;\r
+ if(!IsWindow(this->m_patchViewdlg.m_hWnd))\r
+ {\r
+ m_patchViewdlg.Create(IDD_PATCH_VIEW,this);\r
+ CRect rect;\r
+ this->GetWindowRect(&rect);\r
+ rect.left=rect.right;\r
+ rect.right=rect.left+200;\r
+ m_patchViewdlg.MoveWindow(rect);\r
+ m_patchViewdlg.ShowWindow(SW_SHOW);\r
+ m_patchViewdlg.MoveWindow(rect);\r
+ ShowViewPatchText(false);\r
+ }\r
+ else\r
+ {\r
+ m_patchViewdlg.ShowWindow(SW_HIDE);\r
+ m_patchViewdlg.DestroyWindow();\r
+ ShowViewPatchText(true);\r
+ }\r
+}\r
+\r
+void CCommitDlg::OnMove(int x, int y)\r
+{\r
+ __super::OnMove(x, y);\r
+\r
+ // TODO: Add your message handler code here\r
+}\r
+\r
+void CCommitDlg::OnMoving(UINT fwSide, LPRECT pRect)\r
+{\r
+ __super::OnMoving(fwSide, pRect);\r
+\r
+ // TODO: Add your message handler code here\r
+ if (::IsWindow(m_patchViewdlg.m_hWnd))\r
+ {\r
+ RECT patchrect;\r
+ m_patchViewdlg.GetWindowRect(&patchrect);\r
+ if (::IsWindow(m_hWnd))\r
+ {\r
+ RECT thisrect;\r
+ GetWindowRect(&thisrect);\r
+ if (patchrect.left == thisrect.right)\r
+ {\r
+ m_patchViewdlg.SetWindowPos(NULL, patchrect.left - (thisrect.left - pRect->left), patchrect.top - (thisrect.top - pRect->top), \r
+ 0, 0, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);\r
+ }\r
+ }\r
+ }\r
+\r
+}\r
+\r
+void CCommitDlg::OnSizing(UINT fwSide, LPRECT pRect)\r
+{\r
+ __super::OnSizing(fwSide, pRect);\r
+\r
+ if(::IsWindow(this->m_patchViewdlg.m_hWnd))\r
+ {\r
+ CRect thisrect, patchrect;\r
+ this->GetWindowRect(thisrect);\r
+ this->m_patchViewdlg.GetWindowRect(patchrect);\r
+ if(thisrect.right==patchrect.left)\r
+ {\r
+ int width = patchrect.Width();\r
+ patchrect.left -= (thisrect.right - pRect->right);\r
+ patchrect.right-= (thisrect.right - pRect->right);\r
+\r
+ if( patchrect.bottom == thisrect.bottom)\r
+ {\r
+ patchrect.bottom -= (thisrect.bottom - pRect->bottom);\r
+ }\r
+ if( patchrect.top == thisrect.top)\r
+ {\r
+ patchrect.top -= thisrect.top-pRect->top;\r
+ }\r
+ m_patchViewdlg.MoveWindow(patchrect);\r
+ }\r
+ }\r
+ // TODO: Add your message handler code here\r
}\r
#include "..\IBugTraqProvider\IBugTraqProvider_h.h"\r
#include "Git.h"\r
#include "HyperLink.h"\r
+#include "PatchViewDlg.h"\r
\r
#include <regex>\r
using namespace std;\r
virtual void InsertMenuItems(CMenu& mPopup, int& nCmd);\r
virtual bool HandleMenuItemClick(int cmd, CSciEdit * pSciEdit);\r
\r
+ void ShowViewPatchText(bool b=true)\r
+ {\r
+ if(b)\r
+ this->m_ctrlShowPatch.SetWindowText(_T("View Patch>>"));\r
+ else\r
+ this->m_ctrlShowPatch.SetWindowText(_T("Hide Patch<<"));\r
+ }\r
private:\r
static UINT StatusThreadEntry(LPVOID pVoid);\r
UINT StatusThread();\r
CRect m_LogMsgOrigRect;\r
CPathWatcher m_pathwatcher;\r
CHyperLink m_ctrlShowPatch;\r
+ CPatchViewDlg m_patchViewdlg;\r
\r
CBugTraqAssociation m_bugtraq_association;\r
HACCEL m_hAccel;\r
afx_msg void OnStnClickedBugidlabel();\r
afx_msg void OnScnUpdateUI(NMHDR *pNMHDR, LRESULT *pResult);\r
afx_msg void OnStnClickedViewPatch();\r
+ afx_msg void OnMove(int x, int y);\r
+ afx_msg void OnMoving(UINT fwSide, LPRECT pRect);\r
+ afx_msg void OnSizing(UINT fwSide, LPRECT pRect);\r
};\r