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

  1. // Options.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "tracker.h"
  6. #include "Optionsdlg.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. // COptionsDlg dialog
  16.  
  17.  
  18. COptionsDlg::COptionsDlg(CWnd* pParent /*=NULL*/)
  19.     : CDialog(COptionsDlg::IDD, pParent)
  20. {
  21.     //{{AFX_DATA_INIT(COptionsDlg)
  22.     m_PatPosAdd = 0;
  23.     m_Latency = 0;
  24.     //}}AFX_DATA_INIT
  25. }
  26.  
  27.  
  28. void COptionsDlg::DoDataExchange(CDataExchange* pDX)
  29. {
  30.     CDialog::DoDataExchange(pDX);
  31.     //{{AFX_DATA_MAP(COptionsDlg)
  32.     DDX_Control(pDX, IDC_ROUNDSLIDER_TEST, m_roundSlider);
  33.     DDX_Control(pDX, IDC_MAIN_COL, m_MainColView);
  34.     DDX_Text(pDX, IDC_EDIT_PATTERNPOSADD, m_PatPosAdd);
  35.     DDV_MinMaxInt(pDX, m_PatPosAdd, 1, 63);
  36.     DDX_Text(pDX, IDC_EDIT_LATENCY, m_Latency);
  37.     DDV_MinMaxInt(pDX, m_Latency, 1, 2048);
  38.     //}}AFX_DATA_MAP
  39. }
  40.  
  41.  
  42. BEGIN_MESSAGE_MAP(COptionsDlg, CDialog)
  43.     //{{AFX_MSG_MAP(COptionsDlg)
  44.     ON_BN_CLICKED(IDC_BUTTON_PICKCOLOR, OnButtonPickcolor)
  45.     ON_WM_DRAWITEM()
  46.     ON_WM_PAINT()
  47.     //}}AFX_MSG_MAP
  48. END_MESSAGE_MAP()
  49.  
  50. /////////////////////////////////////////////////////////////////////////////
  51. // COptionsDlg message handlers
  52.  
  53. void COptionsDlg::OnButtonPickcolor() 
  54. {
  55.     // TODO: Add your control notification handler code here
  56.     CColorDialog mColDlg;
  57.     if (mColDlg.DoModal ()==IDOK)
  58.     {
  59.         main_col_ref = mColDlg.GetColor ();        
  60. //        m_MainColor.Format ("%02x %02x %02x",GetRValue (cref),GetGValue (cref),GetBValue (cref));
  61. //        SetDlgItemText (IDC_EDIT_MAINCOLOR,m_MainColor);
  62.         CRect rect;
  63.         m_MainColView.GetClientRect (&rect);
  64.         CDC *pDC = m_MainColView.GetDC ();
  65.         pDC->FillSolidRect (&rect,main_col_ref);
  66.     }
  67. }
  68.  
  69. void COptionsDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct) 
  70. {
  71.     // TODO: Add your message handler code here and/or call default
  72.     CRect rect;
  73.  
  74.     if (nIDCtl == IDC_MAIN_COL)
  75.     {
  76.         m_MainColView.GetClientRect (&rect);
  77.         CDC *pDC = m_MainColView.GetDC ();
  78.         pDC->FillSolidRect (&rect,main_col_ref);
  79.         return;
  80.     }    
  81.     CDialog::OnDrawItem(nIDCtl, lpDrawItemStruct);
  82. }
  83.  
  84. void COptionsDlg::OnPaint() 
  85. {
  86.     CPaintDC dc(this); // device context for painting
  87.     
  88.     // TODO: Add your message handler code here
  89. /*
  90.     CRect rect;
  91.  
  92.     m_MainColView.GetClientRect (&rect);
  93.     CDC *pDC = m_MainColView.GetDC ();
  94.     pDC->FillSolidRect (&rect,main_col_ref);
  95. */
  96.     
  97.     // Do not call CDialog::OnPaint() for painting messages
  98. }
  99.