GME  13
CommitDialog.cpp
Go to the documentation of this file.
00001 // CommitDialog.cpp : implementation file
00002 //
00003 
00004 #include "stdafx.h"
00005 #include "resource.h"
00006 #include "CommitDialog.h"
00007 
00008 
00009 // CCommitDialog dialog
00010 
00011 IMPLEMENT_DYNAMIC(CCommitDialog, CDialog)
00012 
00013 CCommitDialog::CCommitDialog(CWnd* pParent /*=NULL*/)
00014         : CDialog(CCommitDialog::IDD, pParent)
00015 {
00016 
00017 }
00018 
00019 CCommitDialog::~CCommitDialog()
00020 {
00021 }
00022 
00023 void CCommitDialog::DoDataExchange(CDataExchange* pDX)
00024 {
00025         CDialog::DoDataExchange(pDX);
00026         DDX_Control(pDX, IDC_EDIT_COMMENT, m_commentEdit);
00027 }
00028 
00029 
00030 BEGIN_MESSAGE_MAP(CCommitDialog, CDialog)
00031 END_MESSAGE_MAP()
00032 
00033 
00034 // CCommitDialog message handlers
00035 void CCommitDialog::OnOK() 
00036 {
00037         CString commentLine;
00038         for (int i=0; i < m_commentEdit.GetLineCount(); i++) {
00039                 int len = m_commentEdit.LineLength(m_commentEdit.LineIndex(i));
00040                 len = max(len, sizeof(WORD)/sizeof(TCHAR)); // first WORD is used to store the max length internally...
00041                 m_commentEdit.GetLine(i, commentLine.GetBuffer(len), len);
00042                 commentLine.ReleaseBuffer(len);
00043                 m_comment += commentLine + _T("\n");
00044         }
00045    CDialog::OnOK();
00046 }