|
// MemoDlg.cpp : implementation file
//
#include "stdafx.h"
#include "dbfviewapp.h"
#include "MemoDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMemoDlg dialog
CMemoDlg::CMemoDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMemoDlg::IDD, pParent)
{
m_pSet = NULL;
m_iFld = 0;
m_iRec = 0;
m_pctrlButton = NULL;
//{{AFX_DATA_INIT(CMemoDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CMemoDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMemoDlg)
DDX_Control(pDX, IDOK, m_ctrlButtonOK);
DDX_Control(pDX, IDC_EDIT_MEMO, m_ctrlMemoEdit);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMemoDlg, CDialog)
//{{AFX_MSG_MAP(CMemoDlg)
ON_BN_CLICKED(IDOK, OnSave)
ON_EN_CHANGE(IDC_EDIT_MEMO, OnChangeEditMemo)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMemoDlg message handlers
BOOL CMemoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_pSet->SetAbsolutePosition(m_iRec);
COleVariant varValue;
m_pSet->GetFieldValue(m_iFld,varValue);
if(varValue.vt == VT_BSTR)
{
CString m_strText = varValue.bstrVal;
m_ctrlMemoEdit.SetWindowText(m_strText);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CMemoDlg::OnSave()
{
CString m_strText;
m_ctrlMemoEdit.GetWindowText(m_strText);
m_pSet->SetAbsolutePosition(m_iRec);
COleVariant varValue(m_strText);
m_pSet->Edit();
m_pSet->SetFieldValue(m_iFld,varValue);
m_pSet->Update();
if(m_pctrlButton != NULL)
{
CELL_DATA CellData;
CellData.m_dwTag = 0;
CellData.m_strText = m_strText;
m_pctrlButton->SetData(CellData);
m_pctrlButton->Invalidate();
}
CDialog::OnOK();
}
void CMemoDlg::OnChangeEditMemo()
{
m_ctrlButtonOK.EnableWindow(TRUE);
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
Year of birth - 1974.
Eeducation - was ended by Kaliningrad State University in 1997.
Now I work as the engineer-programmer in Kaliningrad (RUSSIA).