Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

CEntityListDlg Class Reference

#include <EntityListDlg.h>

Inheritance diagram for CEntityListDlg:

Inheritance graph
[legend]
Collaboration diagram for CEntityListDlg:

Collaboration graph
[legend]

Public Types

enum  { IDD = IDD_DLG_ENTITYLIST }

Public Member Functions

 CEntityListDlg (CWnd *pParent=NULL)

Data Fields

CListCtrl m_lstEntity
CTreeCtrl m_treeEntity

Protected Member Functions

virtual void DoDataExchange (CDataExchange *pDX)
afx_msg void OnDblclkListInfo ()
afx_msg void OnDblclkTreeEntity (NMHDR *pNMHDR, LRESULT *pResult)
virtual BOOL OnInitDialog ()
afx_msg void OnSelchangedTreeEntity (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void OnSelect ()

Member Enumeration Documentation

anonymous enum
 

Enumeration values:
IDD 

Definition at line 42 of file EntityListDlg.h.

00042 { IDD = IDD_DLG_ENTITYLIST };


Constructor & Destructor Documentation

CEntityListDlg CWnd pParent = NULL  ) 
 

Definition at line 39 of file EntityListDlg.cpp.

00040     : CDialog(CEntityListDlg::IDD, pParent)
00041 {
00042     //{{AFX_DATA_INIT(CEntityListDlg)
00043     //}}AFX_DATA_INIT
00044 }


Member Function Documentation

void DoDataExchange CDataExchange *  pDX  )  [protected, virtual]
 

Definition at line 47 of file EntityListDlg.cpp.

References IDC_LIST_ENTITY, IDC_TREE_ENTITY, m_lstEntity, and m_treeEntity.

00048 {
00049     CDialog::DoDataExchange(pDX);
00050     //{{AFX_DATA_MAP(CEntityListDlg)
00051     DDX_Control(pDX, IDC_LIST_ENTITY, m_lstEntity);
00052     DDX_Control(pDX, IDC_TREE_ENTITY, m_treeEntity);
00053     //}}AFX_DATA_MAP
00054 }

void OnDblclkListInfo  )  [protected]
 

Definition at line 142 of file EntityListDlg.cpp.

00143 {
00144     // TODO: Add your control notification handler code here
00145     
00146 }

void OnDblclkTreeEntity NMHDR *  pNMHDR,
LRESULT *  pResult
[protected]
 

Definition at line 148 of file EntityListDlg.cpp.

References OnSelect().

00149 {
00150   OnSelect();
00151     *pResult = 0;
00152 }

Here is the call graph for this function:

BOOL OnInitDialog  )  [protected, virtual]
 

Definition at line 83 of file EntityListDlg.cpp.

References BOOL, entities, FALSE, m_lstEntity, m_treeEntity, and world_entity.

00084 {
00085     CDialog::OnInitDialog();
00086     
00087   CMapStringToPtr mapEntity;
00088 
00089   HTREEITEM hParent = m_treeEntity.InsertItem(world_entity->eclass->name);
00090   HTREEITEM hChild = m_treeEntity.InsertItem(world_entity->eclass->name, hParent);
00091   m_treeEntity.SetItemData(hChild, reinterpret_cast<DWORD>(world_entity));
00092 
00093     for (entity_t* pEntity=entities.next ; pEntity != &entities ; pEntity=pEntity->next)
00094     {
00095     hParent = NULL;
00096     if (mapEntity.Lookup(pEntity->eclass->name, reinterpret_cast<void*&>(hParent)) == FALSE)
00097     {
00098       hParent = m_treeEntity.InsertItem(pEntity->eclass->name);
00099       mapEntity.SetAt(pEntity->eclass->name, reinterpret_cast<void*>(hParent));
00100     }
00101     hChild = m_treeEntity.InsertItem(pEntity->eclass->name, hParent);
00102     m_treeEntity.SetItemData(hChild, reinterpret_cast<DWORD>(pEntity));
00103   }
00104 
00105   CRect rct;
00106   m_lstEntity.GetClientRect(rct);
00107   m_lstEntity.InsertColumn(0, "Key", LVCFMT_LEFT, rct.Width() / 2);
00108   m_lstEntity.InsertColumn(1, "Value", LVCFMT_LEFT, rct.Width() / 2);
00109   m_lstEntity.DeleteColumn(2);
00110   UpdateData(FALSE);
00111     
00112     return TRUE;  // return TRUE unless you set the focus to a control
00113                   // EXCEPTION: OCX Property Pages should return FALSE
00114 }

void OnSelchangedTreeEntity NMHDR *  pNMHDR,
LRESULT *  pResult
[protected]
 

Definition at line 116 of file EntityListDlg.cpp.

References epair_t, entity_t::epairs, epair_s::key, m_lstEntity, m_treeEntity, epair_s::next, strlen(), and epair_s::value.

00117 {
00118     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00119   HTREEITEM hItem = m_treeEntity.GetSelectedItem();
00120   m_lstEntity.DeleteAllItems();
00121   if (hItem)
00122   {
00123     CString strList;
00124     entity_t* pEntity = reinterpret_cast<entity_t*>(m_treeEntity.GetItemData(hItem));
00125     if (pEntity)
00126     {
00127         for (epair_t* pEpair = pEntity->epairs ; pEpair ; pEpair = pEpair->next)
00128       {
00129             if (strlen(pEpair->key) > 8)
00130           strList.Format("%s\t%s", pEpair->key, pEpair->value);
00131         else
00132           strList.Format("%s\t\t%s", pEpair->key, pEpair->value);
00133         int nParent = m_lstEntity.InsertItem(0, pEpair->key);
00134         m_lstEntity.SetItem(nParent, 1, LVIF_TEXT, pEpair->value, 0, 0, 0, reinterpret_cast<DWORD>(pEntity));
00135 
00136       }
00137     }
00138     }
00139     *pResult = 0;
00140 }

Here is the call graph for this function:

afx_msg void OnSelect  )  [protected]
 

Referenced by OnDblclkTreeEntity().


Field Documentation

CListCtrl m_lstEntity
 

Definition at line 43 of file EntityListDlg.h.

Referenced by DoDataExchange(), OnInitDialog(), and OnSelchangedTreeEntity().

CTreeCtrl m_treeEntity
 

Definition at line 44 of file EntityListDlg.h.

Referenced by DoDataExchange(), OnInitDialog(), and OnSelchangedTreeEntity().


The documentation for this class was generated from the following files:
Generated on Thu Aug 25 18:57:56 2005 for Quake III Arena by  doxygen 1.3.9.1