Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.6 KiB

  1. // SwingPage.cpp : Implementation of CSwingPage
  2. #include "stdafx.h"
  3. #include "ToolProps.h"
  4. #include "SwingPage.h"
  5. /////////////////////////////////////////////////////////////////////////////
  6. // CSwingPage
  7. CSwingPage::CSwingPage()
  8. {
  9. m_dwTitleID = IDS_TITLESwingPage;
  10. m_dwHelpFileID = IDS_HELPFILESwingPage;
  11. m_dwDocStringID = IDS_DOCSTRINGSwingPage;
  12. m_pSwing = NULL;
  13. }
  14. CSwingPage::~CSwingPage()
  15. {
  16. if (m_pSwing)
  17. {
  18. m_pSwing->Release();
  19. }
  20. }
  21. STDMETHODIMP CSwingPage::SetObjects(ULONG cObjects,IUnknown **ppUnk)
  22. {
  23. if (cObjects < 1 || cObjects > 1)
  24. return E_UNEXPECTED;
  25. return ppUnk[0]->QueryInterface(IID_IDirectMusicSwingTool,(void **) &m_pSwing);
  26. }
  27. STDMETHODIMP CSwingPage::Apply(void)
  28. {
  29. m_pSwing->SetStrength((DWORD)m_ctSwing.GetValue());
  30. m_bDirty = FALSE;
  31. return S_OK;
  32. }
  33. LRESULT CSwingPage::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  34. {
  35. if (m_pSwing)
  36. {
  37. m_ctSwing.Init(GetDlgItem(IDC_SWING),GetDlgItem(IDC_SWING_DISPLAY),0,100,true);
  38. DWORD dwSwing;
  39. m_pSwing->GetStrength(&dwSwing);
  40. m_ctSwing.SetValue((float)dwSwing);
  41. }
  42. return 1;
  43. }
  44. LRESULT CSwingPage::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  45. {
  46. LRESULT lr = m_ctSwing.MessageHandler(uMsg, wParam,lParam, bHandled);
  47. if (bHandled)
  48. SetDirty(true);
  49. return lr;
  50. }
  51. LRESULT CSwingPage::OnSlider(UINT uMsg, WPARAM wParam,LPARAM lParam, BOOL& bHandled)
  52. {
  53. LRESULT lr = m_ctSwing.MessageHandler(uMsg, wParam,lParam, bHandled);
  54. if (bHandled)
  55. SetDirty(true);
  56. return lr;
  57. }