PropertyComboBox.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* Copyright (c) 2002-2012 Croteam Ltd.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of version 2 of the GNU General Public License as published by
  4. the Free Software Foundation
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License along
  10. with this program; if not, write to the Free Software Foundation, Inc.,
  11. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
  12. // PropertyComboBox.h : header file
  13. //
  14. #ifndef PROPERTYCOMBOBOX_H
  15. #define PROPERTYCOMBOBOX_H 1
  16. class CPropertyComboBar;
  17. class CWorldEditorDoc;
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CPropertyComboBox window
  20. /*
  21. * Class used for creating property intersection of selected entities
  22. */
  23. class CPropertyID
  24. {
  25. public:
  26. inline CPropertyID( CTString strName, CEntityProperty::PropertyType eptType,
  27. CEntityProperty *penpProperty, CAnimData *padAnimData)
  28. {
  29. pid_strName = strName;
  30. pid_eptType = eptType;
  31. pid_penpProperty = penpProperty;
  32. if( eptType == CEntityProperty::EPT_ANIMATION) pid_padAnimData = padAnimData;
  33. else pid_padAnimData = NULL;
  34. if( penpProperty != NULL)
  35. pid_chrShortcutKey = penpProperty->ep_chShortcut;
  36. else
  37. pid_chrShortcutKey = 0;
  38. };
  39. // node for linking
  40. CListNode pid_lnNode;
  41. // descriptive name of this property
  42. CTString pid_strName;
  43. // shortcut key for this property
  44. char pid_chrShortcutKey;
  45. // name of anim data object (if any)
  46. CAnimData *pid_padAnimData;
  47. // property type
  48. CEntityProperty::PropertyType pid_eptType;
  49. // property ptr
  50. CEntityProperty *pid_penpProperty;
  51. };
  52. class CPropertyComboBox : public CComboBox
  53. {
  54. // Construction
  55. public:
  56. CPropertyComboBox();
  57. BOOL OnIdle(LONG lCount);
  58. void DisableCombo();
  59. // Attributes
  60. public:
  61. // name of last edited property
  62. CTString m_strLastPropertyName;
  63. // ptr to parent dialog
  64. CPropertyComboBar *m_pDialog;
  65. // list head for holding intersected properties
  66. CListHead m_lhProperties;
  67. CUpdateableRT m_udComboEntries;
  68. INDEX m_iLastMode;
  69. CWorldEditorDoc *m_pLastDoc;
  70. // Operations
  71. public:
  72. // sets ptr to parent dialog
  73. void SetDialogPtr( CPropertyComboBar *pDialog);
  74. // adds intersecting properties of given entity into m_lhProperties list
  75. void JoinProperties( CEntity *penEntity, BOOL bIntersect);
  76. // Overrides
  77. // ClassWizard generated virtual function overrides
  78. //{{AFX_VIRTUAL(CPropertyComboBox)
  79. //}}AFX_VIRTUAL
  80. // Implementation
  81. public:
  82. virtual ~CPropertyComboBox();
  83. void SelectProperty(void);
  84. // Generated message map functions
  85. protected:
  86. //{{AFX_MSG(CPropertyComboBox)
  87. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  88. afx_msg void OnSelchange();
  89. afx_msg void OnDropdown();
  90. //}}AFX_MSG
  91. DECLARE_MESSAGE_MAP()
  92. };
  93. /////////////////////////////////////////////////////////////////////////////
  94. #endif // PROPERTYCOMBOBOX_H