Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Grid/MFCGrid
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20182/MFCGrid
Modified Files:
GridCellCheck.cpp GridCellCombo.cpp GridCellDateTime.cpp
GridCellDateTime.h GridCtrl.cpp Makefile StdAfx.cpp StdAfx.h
Log Message:
Merge Grid into core distribution
Index: GridCellCheck.cpp
===================================================================
RCS file:
/cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Grid/MFCGrid/GridCellCheck.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** GridCellCheck.cpp 1 Nov 2005 12:34:46 -0000 1.1
--- GridCellCheck.cpp 11 Jun 2006 16:42:11 -0000 1.2
***************
*** 28,31 ****
--- 28,33 ----
// History:
// 23 Jul 2001 - Complete rewrite
+ // 13 Mar 2004 - GetCellExtent and GetCheckPlacement fixed by Yogurt
+ // - Read-only now honoured - Yogurt
//
/////////////////////////////////////////////////////////////////////////////
***************
*** 55,59 ****
{
// Using SM_CXHSCROLL as a guide to the size of the checkbox
! int nWidth = GetSystemMetrics(SM_CXHSCROLL) + 2*GetMargin(); // Yogurt
$$LR$$
CSize cellSize = CGridCell::GetCellExtent(pDC);
cellSize.cx += nWidth;
--- 57,61 ----
{
// Using SM_CXHSCROLL as a guide to the size of the checkbox
! int nWidth = GetSystemMetrics(SM_CXHSCROLL) + 2*GetMargin();
CSize cellSize = CGridCell::GetCellExtent(pDC);
cellSize.cx += nWidth;
***************
*** 105,108 ****
--- 107,111 ----
PointCellRelative += m_Rect.TopLeft();
+ // Bail if cell is read-only
CCellID cell = GetGrid()->GetCellFromPt (PointCellRelative);
if (!GetGrid()->IsCellEditable (cell))
***************
*** 163,168 ****
}
*/
! // Yogurt $$LR$$
! if (m_Rect.Height() < nWidth + 2 * (int)GetMargin() )
{
place.top = m_Rect.top + (m_Rect.Height() - nWidth) / 2;
--- 166,171 ----
}
*/
!
! if (m_Rect.Height() < nWidth + 2 * static_cast<int> (GetMargin()))
{
place.top = m_Rect.top + (m_Rect.Height() - nWidth) / 2;
***************
*** 171,173 ****
return place;
! }
--- 174,176 ----
return place;
! }
\ No newline at end of file
Index: GridCellDateTime.cpp
===================================================================
RCS file:
/cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Grid/MFCGrid/GridCellDateTime.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** GridCellDateTime.cpp 1 Nov 2005 12:34:46 -0000 1.1
--- GridCellDateTime.cpp 11 Jun 2006 16:42:11 -0000 1.2
***************
*** 51,54 ****
--- 51,63 ----
}
+ CSize CGridCellDateTime::GetCellExtent(CDC* pDC)
+ {
+ CSize sizeScroll (GetSystemMetrics(SM_CXVSCROLL),
GetSystemMetrics(SM_CYHSCROLL));
+ CSize sizeCell (CGridCell::GetCellExtent(pDC));
+ sizeCell.cx += sizeScroll.cx;
+ sizeCell.cy = max(sizeCell.cy,sizeScroll.cy);
+ return sizeCell;
+ }
+
BOOL CGridCellDateTime::Edit(int nRow, int nCol, CRect rect, CPoint /* point
*/,
UINT nID, UINT nChar)
***************
*** 99,103 ****
SetText(strTemp);
#else
! SetText(m_cTime.Format(_T("%X"))); // Yogurt $$LR$$ (_T("%H:%M:%S")));
#endif
}
--- 108,114 ----
SetText(strTemp);
#else
!
! // SetText(m_cTime.Format(_T("%H:%M:%S")));
! SetText(m_cTime.Format(_T("%X")));
#endif
}
***************
*** 110,128 ****
SetText(strTemp);
#else
! SetText(m_cTime.Format(_T("%x"))); // Yogurt $$LR$$ (("%d/%m/%Y")));
#endif
}
}
- // Yogurt $$LR$$
- CSize CGridCellDateTime::GetCellExtent(CDC* pDC)
- {
- CSize sizeScroll (GetSystemMetrics(SM_CXVSCROLL),
GetSystemMetrics(SM_CYHSCROLL));
- CSize sizeCell (CGridCell::GetCellExtent(pDC));
- sizeCell.cx += sizeScroll.cx;
- sizeCell.cy = max(sizeCell.cy,sizeScroll.cy);
- return sizeCell;
- }
-
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
--- 121,130 ----
SetText(strTemp);
#else
! // SetText(m_cTime.Format(("%d/%m/%Y")));
! SetText(m_cTime.Format(("%x")));
#endif
}
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
***************
*** 261,266 ****
CDateTimeCtrl::OnKillFocus(pNewWnd);
! if (GetSafeHwnd() == pNewWnd->GetSafeHwnd())
return;
EndEdit();
}
--- 263,269 ----
CDateTimeCtrl::OnKillFocus(pNewWnd);
! if (GetSafeHwnd() == pNewWnd->GetSafeHwnd()) {
return;
+ }
EndEdit();
}
Index: Makefile
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Grid/MFCGrid/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Makefile 1 Nov 2005 12:34:46 -0000 1.1
--- Makefile 11 Jun 2006 16:42:11 -0000 1.2
***************
*** 69,98 ****
<<
! .c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
! .cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
! .cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
! .c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
! .cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
! .cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
--- 69,98 ----
<<
! .c{$(INTDIR)}.obj:
$(CPP) @<<
$(CPP_PROJ) $<
<<
! .cpp{$(INTDIR)}.obj:
$(CPP) @<<
$(CPP_PROJ) $<
<<
! .cxx{$(INTDIR)}.obj:
$(CPP) @<<
$(CPP_PROJ) $<
<<
! .c{$(INTDIR)}.sbr:
$(CPP) @<<
$(CPP_PROJ) $<
<<
! .cpp{$(INTDIR)}.sbr:
$(CPP) @<<
$(CPP_PROJ) $<
<<
! .cxx{$(INTDIR)}.sbr:
$(CPP) @<<
$(CPP_PROJ) $<
Index: GridCellDateTime.h
===================================================================
RCS file:
/cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Grid/MFCGrid/GridCellDateTime.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** GridCellDateTime.h 1 Nov 2005 12:34:46 -0000 1.1
--- GridCellDateTime.h 11 Jun 2006 16:42:11 -0000 1.2
***************
*** 30,33 ****
--- 30,34 ----
CGridCellDateTime(DWORD dwStyle);
virtual ~CGridCellDateTime();
+ virtual CSize GetCellExtent(CDC* pDC);
// editing cells
***************
*** 37,41 ****
virtual CWnd* GetEditWnd() const;
virtual void EndEdit();
! virtual CSize GetCellExtent(CDC* pDC);
CTime* GetTime() {return &m_cTime;};
--- 38,42 ----
virtual CWnd* GetEditWnd() const;
virtual void EndEdit();
!
CTime* GetTime() {return &m_cTime;};
Index: StdAfx.h
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Grid/MFCGrid/StdAfx.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** StdAfx.h 1 Nov 2005 12:34:46 -0000 1.1
--- StdAfx.h 11 Jun 2006 16:42:12 -0000 1.2
***************
*** 4,9 ****
//
! #if !defined(AFX_STDAFX_H__19E18FB7_DFF6_11D1_8CE7_000000000000__INCLUDED_)
! #define AFX_STDAFX_H__19E18FB7_DFF6_11D1_8CE7_000000000000__INCLUDED_
#if _MSC_VER >= 1000
--- 4,9 ----
//
! #if !defined(AFX_STDAFX_H__34B6D7A8_9CDC_11D1_9C11_00A0243D1382__INCLUDED_)
! #define AFX_STDAFX_H__34B6D7A8_9CDC_11D1_9C11_00A0243D1382__INCLUDED_
#if _MSC_VER >= 1000
***************
*** 21,26 ****
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately
before the previous line.
! #endif //
!defined(AFX_STDAFX_H__19E18FB7_DFF6_11D1_8CE7_000000000000__INCLUDED_)
--- 21,29 ----
+ // #define for if(0);else for
+
+
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately
before the previous line.
! #endif //
!defined(AFX_STDAFX_H__34B6D7A8_9CDC_11D1_9C11_00A0243D1382__INCLUDED_)
Index: StdAfx.cpp
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Grid/MFCGrid/StdAfx.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** StdAfx.cpp 1 Nov 2005 12:34:46 -0000 1.1
--- StdAfx.cpp 11 Jun 2006 16:42:12 -0000 1.2
***************
*** 1,4 ****
// stdafx.cpp : source file that includes just the standard includes
! // GridViewDemo.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
--- 1,4 ----
// stdafx.cpp : source file that includes just the standard includes
! // GridCtrlDemo.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
Index: GridCtrl.cpp
===================================================================
RCS file:
/cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Grid/MFCGrid/GridCtrl.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** GridCtrl.cpp 1 Nov 2005 12:34:46 -0000 1.1
--- GridCtrl.cpp 11 Jun 2006 16:42:11 -0000 1.2
***************
*** 2333,2336 ****
--- 2333,2337 ----
str += _T("\t");
}
+
if (row != Selection.GetMaxRow())
str += _T("\r\n");
***************
*** 3692,3696 ****
else
{
! m_arColWidths.InsertAt(nColumn, (int)0);
if (!GetVirtualMode())
{
--- 3693,3697 ----
else
{
! m_arColWidths.InsertAt(nColumn, (UINT)0);
if (!GetVirtualMode())
{
***************
*** 3767,3771 ****
else
{
! m_arRowHeights.InsertAt(nRow, (int)0);
if (!GetVirtualMode())
m_RowData.InsertAt(nRow, new GRID_ROW);
--- 3768,3772 ----
else
{
! m_arRowHeights.InsertAt(nRow, (UINT)0);
if (!GetVirtualMode())
m_RowData.InsertAt(nRow, new GRID_ROW);
Index: GridCellCombo.cpp
===================================================================
RCS file:
/cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-Grid/MFCGrid/GridCellCombo.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** GridCellCombo.cpp 1 Nov 2005 12:34:46 -0000 1.1
--- GridCellCombo.cpp 11 Jun 2006 16:42:11 -0000 1.2
***************
*** 31,34 ****
--- 31,35 ----
// the constructor param list.
// 29 Nov 1998 - bug fix in onkeydown (Markus Irtenkauf)
+ // 13 Mar 2004 - GetCellExtent fixed by Yogurt
//
/////////////////////////////////////////////////////////////////////////////
***************
*** 449,455 ****
}
CSize CGridCellCombo::GetCellExtent(CDC* pDC)
{
! CSize sizeScroll(GetSystemMetrics(SM_CXVSCROLL),
GetSystemMetrics(SM_CYHSCROLL)); //Yogurt $$LR$$
CSize sizeCell (CGridCell::GetCellExtent(pDC));
sizeCell.cx += sizeScroll.cx;
--- 450,457 ----
}
+
CSize CGridCellCombo::GetCellExtent(CDC* pDC)
{
! CSize sizeScroll (GetSystemMetrics(SM_CXVSCROLL),
GetSystemMetrics(SM_CYHSCROLL));
CSize sizeCell (CGridCell::GetCellExtent(pDC));
sizeCell.cx += sizeScroll.cx;