GME  13
InspectorList.h
Go to the documentation of this file.
00001 #if !defined(AFX_INSPECTORLIST_H__93C5CFDD_9E01_4E3C_B924_3188772DCA2C__INCLUDED_)
00002 #define AFX_INSPECTORLIST_H__93C5CFDD_9E01_4E3C_B924_3188772DCA2C__INCLUDED_
00003 
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 
00008 #include "InspectorDefs.h"
00009 #include "InPlaceManager.h"
00010 // InspectorList.h : header file
00011 //
00012 
00013 
00014 
00015 #include"ItemData.h"
00016 
00017 typedef CArray<CListItem,CListItem&> CListItemArray;
00018 
00019 
00020 class CInspectorListSettings
00021 {
00022 public:
00023         CInspectorListSettings():m_nDivider(INSP_DIVIDER_POSITION){};
00024 
00025         UINT m_nDivider;
00026 };
00028 // CInspectorList window
00029 class CInspectorList : public CListBox
00030 {
00031         friend CInPlaceManager;
00032 // Construction
00033 public:
00034         CInspectorList(bool bCategories=true);
00035         bool AddItem(CListItem ListItem);
00036         bool InsertItem(CListItem ListItem, int nIndex);
00037         bool RemoveItem(int nIndex);
00038         void RemoveAll();
00039 
00040         void UpdateItems(CArray<CListItem,CListItem&> &ListItemArray);
00041 
00042         void GetSelItems(CArray<int,int>&IndexArray,CArray<CListItem,CListItem&> &ListItemArray);
00043 
00044 // Attributes
00045 public:
00046 
00047 // Operations
00048 public:
00049 
00050 // Overrides
00051         // ClassWizard generated virtual function overrides
00052         //{{AFX_VIRTUAL(CInspectorList)
00053         public:
00054         virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
00055         virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
00056         protected:
00057         virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00058         virtual void PreSubclassWindow();
00059         //}}AFX_VIRTUAL
00060 
00061         afx_msg void OnArrowClicked();
00062         afx_msg void OnEditorClicked();
00063         afx_msg LRESULT OnEditEndOK(WPARAM lParam, LPARAM wParam);
00064 // Implementation
00065 public:
00066         void GetItem(int nIndex, CListItem &ListItem);
00067         void RefreshState();
00068         void NotifyParent(UINT nSelItem);
00069 
00070         void DeleteByKey(DWORD dwKey);
00071         void DeleteByKey(DWORD dwKey, DWORD dwUserData);
00072         bool FindByKey(DWORD,CListItem&);
00073         bool FindByKey(DWORD, DWORD, CListItem&);
00074 
00075         bool OnRightSideClick(CPoint point);
00076         bool OnPlusMinusClick(CPoint point);
00077         void DoCollapseExpand(int);
00078         void ResetContent();
00079         CInspectorListSettings m_Settings;
00080         virtual ~CInspectorList();
00081 
00082         bool m_bCategories;
00083 
00084         // Generated message map functions
00085 protected:
00086         CFont m_entryFont;
00087         CFont m_entryBoldFont;
00088         //{{AFX_MSG(CInspectorList)
00089         afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00090         afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00091         afx_msg void OnMouseMove(UINT nFlags, CPoint point);
00092         afx_msg void OnSelChange();
00093         afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
00094         afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00095         afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
00096         afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00097         afx_msg void OnSize(UINT nType, int cx, int cy);
00098         afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00099         afx_msg void OnListContextResetToDefault();
00100         //}}AFX_MSG
00101 
00102         DECLARE_MESSAGE_MAP()
00103 private:
00104         void UpdateItem(const CListItem& srcListItem, CListItem& dstListItem, int nIndex);
00105         void SetDefault();
00106         void SetHelp(int nIndex);
00107         bool SelectNextItem(BOOL reverse);      // JIRA GME-178
00108 
00109         CInPlaceManager m_InPlaceManager;
00110 
00111         CPoint m_ptOldTop;
00112         CPoint m_ptOldBottom;
00113         void InvertLine(CDC* pDC,CPoint ptSrc,CPoint ptDst);
00114         BOOL m_bIsDividerDrag;
00115         HCURSOR m_hCurSize;
00116         HCURSOR m_hCurArrow;
00117 
00118         CListItemArray m_ListItemArray;
00119 
00120         int m_ItemHeight;
00121         int m_ComboboxLineHeight;
00122 };
00123 
00125 
00126 //{{AFX_INSERT_LOCATION}}
00127 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00128 
00129 #endif // !defined(AFX_INSPECTORLIST_H__93C5CFDD_9E01_4E3C_B924_3188772DCA2C__INCLUDED_)