home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / beaversweeper_v101.zip / src / ArpEditor.cpp < prev    next >
C/C++ Source or Header  |  2003-01-06  |  2KB  |  101 lines

  1. // ArpEditor.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "tracker.h"
  6. #include "isInstrument.h"
  7. #include "ArpEditor.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15.  
  16.  
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CArpEditor dialog
  19.  
  20.  
  21. CArpEditor::CArpEditor(CWnd* pParent /*=NULL*/)
  22.     : CDialog(CArpEditor::IDD, pParent)
  23. {
  24.     //{{AFX_DATA_INIT(CArpEditor)
  25.     m_ticksperrow = 0;
  26.     //}}AFX_DATA_INIT
  27.     m_aewindow = 0;
  28. }
  29.  
  30.  
  31. void CArpEditor::DoDataExchange(CDataExchange* pDX)
  32. {
  33.     CDialog::DoDataExchange(pDX);
  34.     //{{AFX_DATA_MAP(CArpEditor)
  35.     DDX_Control(pDX, IDC_EDIT1, m_edit_ctrl);
  36.     DDX_Control(pDX, IDC_SPIN1, m_buddy);
  37.     DDX_Text(pDX, IDC_EDIT1, m_ticksperrow);
  38.     //}}AFX_DATA_MAP
  39. }
  40.  
  41.  
  42. BEGIN_MESSAGE_MAP(CArpEditor, CDialog)
  43.     //{{AFX_MSG_MAP(CArpEditor)
  44.     ON_EN_CHANGE(IDC_EDIT1, OnChangeEdit1)
  45.     //}}AFX_MSG_MAP
  46. END_MESSAGE_MAP()
  47.  
  48. /////////////////////////////////////////////////////////////////////////////
  49. // CArpEditor message handlers
  50.  
  51. BOOL CArpEditor::OnInitDialog() 
  52. {
  53.     CDialog::OnInitDialog();    
  54.     // TODO: Add extra initiablization here
  55.     m_aewindow = new CAEWindow();
  56.     RECT r;
  57.     GetClientRect( &r );
  58.     r.top += 64; // G÷r utrymmer f÷r knappf
  59.  
  60.     m_aewindow->m_instrument = m_instrument;
  61.     m_aewindow->Create( NULL, _T("AEWIND"), WS_VISIBLE | WS_TABSTOP, r, this, 0, 0 );
  62.  
  63.  
  64.     m_buddy.SetRange( 1, 255 );    
  65.     m_buddy.SetBuddy( GetDlgItem( IDC_EDIT1 ) );    
  66.     m_ticksperrow = m_instrument->arpeggiator.ticksPerRow;
  67.     
  68.     UpdateData(FALSE);
  69.  
  70.     GotoDlgCtrl( m_aewindow );
  71.         
  72.     return FALSE;  // return TRUE unless you set the focus to a control
  73.                   // EXCEPTION: OCX Property Pages should return FALSE
  74. }
  75.  
  76. BOOL CArpEditor::DestroyWindow() 
  77. {
  78.     // TODO: Add your specialized code here and/or call the base class
  79.     if (m_aewindow) {
  80.         delete m_aewindow;
  81.         m_aewindow = 0;
  82.     }
  83.     
  84.     return CDialog::DestroyWindow();
  85. }
  86.  
  87. void CArpEditor::OnChangeEdit1() 
  88. {
  89.     // TODO: If this is a RICHEDIT control, the control will not
  90.     // send this notification unless you override the CDialog::OnInitDialog()
  91.     // function and call CRichEditCtrl().SetEventMask()
  92.     // with the ENM_CHANGE flag ORed into the mask.
  93.  
  94.     UpdateData(TRUE);
  95.     m_instrument->arpeggiator.ticksPerRow = m_ticksperrow;
  96.  
  97.     
  98.     // TODO: Add your control notification handler code here
  99.     
  100. }
  101.