1
0

view_com.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * view_com.h
  3. * ----------
  4. * Purpose: Song comments tab, lower panel.
  5. * Notes : (currently none)
  6. * Authors: Olivier Lapicque
  7. * OpenMPT Devs
  8. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  9. */
  10. #pragma once
  11. #include "openmpt/all/BuildSettings.hpp"
  12. #include "CListCtrl.h"
  13. OPENMPT_NAMESPACE_BEGIN
  14. class CViewComments: public CModScrollView
  15. {
  16. public:
  17. CViewComments() = default;
  18. DECLARE_SERIAL(CViewComments)
  19. protected:
  20. CModControlBar m_ToolBar;
  21. CListCtrlEx m_ItemList;
  22. int m_nCurrentListId = 0, m_nListId = 0;
  23. ModCommand::NOTE m_lastNote = NOTE_NONE;
  24. CHANNELINDEX m_noteChannel = CHANNELINDEX_INVALID;
  25. INSTRUMENTINDEX m_noteInstr = INSTRUMENTINDEX_INVALID;
  26. public:
  27. void RecalcLayout();
  28. void UpdateButtonState();
  29. public:
  30. //{{AFX_VIRTUAL(CViewComments)
  31. void OnInitialUpdate() override;
  32. BOOL PreTranslateMessage(MSG *pMsg) override;
  33. LRESULT OnModViewMsg(WPARAM wParam, LPARAM lParam) override;
  34. void UpdateView(UpdateHint hint, CObject *pObject = nullptr) override;
  35. //}}AFX_VIRTUAL
  36. protected:
  37. bool SwitchToList(int list);
  38. //{{AFX_MSG(CViewGlobals)
  39. afx_msg void OnDestroy();
  40. afx_msg void OnSize(UINT nType, int cx, int cy);
  41. afx_msg void OnShowSamples() { SwitchToList(IDC_LIST_SAMPLES); }
  42. afx_msg void OnShowInstruments() { SwitchToList(IDC_LIST_INSTRUMENTS); }
  43. afx_msg void OnShowPatterns() { SwitchToList(IDC_LIST_PATTERNS); }
  44. afx_msg void OnEndLabelEdit(LPNMHDR pnmhdr, LRESULT *pLResult);
  45. afx_msg void OnBeginLabelEdit(LPNMHDR pnmhdr, LRESULT *pLResult);
  46. afx_msg void OnDblClickListItem(NMHDR *, LRESULT *);
  47. afx_msg void OnRClickListItem(NMHDR *, LRESULT *);
  48. afx_msg void OnCopyNames();
  49. afx_msg LRESULT OnMidiMsg(WPARAM midiData, LPARAM);
  50. afx_msg LRESULT OnCustomKeyMsg(WPARAM, LPARAM);
  51. //}}AFX_MSG
  52. DECLARE_MESSAGE_MAP()
  53. };
  54. OPENMPT_NAMESPACE_END