home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / Cell Control / DATA1.CAB / VCDEMO_Files / CopyDlg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-11  |  2.0 KB  |  85 lines

  1. // CopyDlg.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "VCDemo.h"
  6. #include "CopyDlg.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CCopyDlg dialog
  16.  
  17.  
  18. CCopyDlg::CCopyDlg(CWnd* pParent /*=NULL*/)
  19.     : CDialog(CCopyDlg::IDD, pParent)
  20. {
  21.     //{{AFX_DATA_INIT(CCopyDlg)
  22.         // NOTE: the ClassWizard will add member initialization here
  23.     //}}AFX_DATA_INIT
  24. }
  25.  
  26.  
  27. void CCopyDlg::DoDataExchange(CDataExchange* pDX)
  28. {
  29.     CDialog::DoDataExchange(pDX);
  30.     //{{AFX_DATA_MAP(CCopyDlg)
  31.     DDX_Control(pDX, IDC_SGCTRL1, m_ctrl);
  32.     //}}AFX_DATA_MAP
  33. }
  34.  
  35.  
  36. BEGIN_MESSAGE_MAP(CCopyDlg, CDialog)
  37.     //{{AFX_MSG_MAP(CCopyDlg)
  38.     ON_BN_CLICKED(IDC_BUTTON_COPY, OnButtonCopy)
  39.     ON_BN_CLICKED(IDC_BUTTON_CUT, OnButtonCut)
  40.     ON_BN_CLICKED(IDC_BUTTON_PASTE, OnButtonPaste)
  41.     ON_BN_CLICKED(IDC_BUTTON_PASTESAMESIZE, OnButtonPastesamesize)
  42.     //}}AFX_MSG_MAP
  43. END_MESSAGE_MAP()
  44.  
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CCopyDlg message handlers
  47.  
  48. void CCopyDlg::OnButtonCopy() 
  49. {
  50.     // TODO: Add your control notification handler code here
  51.     m_ctrl.DoCopySelected();
  52. }
  53.  
  54. void CCopyDlg::OnButtonCut() 
  55. {
  56.     // TODO: Add your control notification handler code here
  57.     m_ctrl.DoCutSelected();
  58. }
  59.  
  60. void CCopyDlg::OnButtonPaste() 
  61. {
  62.     // TODO: Add your control notification handler code here
  63.     m_ctrl.DoPaste( m_ctrl.DoGetCurrentCol(), m_ctrl.DoGetCurrentRow(), FALSE);
  64. }
  65.  
  66.  
  67. void CCopyDlg::OnButtonPastesamesize() 
  68. {
  69.     // TODO: Add your control notification handler code here
  70.     m_ctrl.DoPaste( m_ctrl.DoGetCurrentCol(), m_ctrl.DoGetCurrentRow(), TRUE );
  71. }
  72.  
  73. BOOL CCopyDlg::OnInitDialog() 
  74. {
  75.     CDialog::OnInitDialog();
  76.     
  77.     // TODO: Add extra initialization here
  78.     m_ctrl.SetPageLabelVisible( FALSE );
  79.     COleVariant var( "VCDEMO" );
  80.     m_ctrl.DoSetMessageTitle( var );
  81.  
  82.     return TRUE;  // return TRUE unless you set the focus to a control
  83.                   // EXCEPTION: OCX Property Pages should return FALSE
  84. }
  85.