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

CGroupDlg Class Reference

#include <GroupDlg.h>

Inheritance diagram for CGroupDlg:

Inheritance graph
[legend]
Collaboration diagram for CGroupDlg:

Collaboration graph
[legend]

Public Types

enum  { IDD = IDD_DLG_GROUP }

Public Member Functions

 CGroupDlg (CWnd *pParent=NULL)
void InitGroups ()
virtual void OnCancel ()
virtual BOOL OnChildNotify (UINT message, WPARAM wParam, LPARAM lParam, LRESULT *pLResult)
virtual void OnOK ()

Data Fields

HTREEITEM m_hWorld
CButton m_wndAdd
CButton m_wndDel
CButton m_wndEdit
CTreeCtrl m_wndTree

Protected Member Functions

virtual void DoDataExchange (CDataExchange *pDX)
afx_msg void OnBegindragTreeGroup (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void OnBtnAdd ()
afx_msg void OnBtnDel ()
afx_msg void OnBtnEdit ()
afx_msg void OnClickTreeGroup (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void OnEndlabeleditTreeGroup (NMHDR *pNMHDR, LRESULT *pResult)
virtual BOOL OnInitDialog ()
virtual BOOL OnNotify (WPARAM wParam, LPARAM lParam, LRESULT *pResult)
afx_msg void OnRclickTreeGroup (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void OnSetdispinfoTreeGroup (NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void OnSize (UINT nType, int cx, int cy)

Private Attributes

CImageList m_imgList

Member Enumeration Documentation

anonymous enum
 

Enumeration values:
IDD 

Definition at line 48 of file GroupDlg.h.

00048 { IDD = IDD_DLG_GROUP };


Constructor & Destructor Documentation

CGroupDlg CWnd pParent = NULL  ) 
 

Definition at line 468 of file GroupDlg.cpp.

00469     : CDialog(CGroupDlg::IDD, pParent)
00470 {
00471     //{{AFX_DATA_INIT(CGroupDlg)
00472         // NOTE: the ClassWizard will add member initialization here
00473     //}}AFX_DATA_INIT
00474 }


Member Function Documentation

void DoDataExchange CDataExchange *  pDX  )  [protected, virtual]
 

Definition at line 477 of file GroupDlg.cpp.

References IDC_BTN_ADD, IDC_BTN_DEL, IDC_BTN_EDIT, IDC_TREE_GROUP, m_wndAdd, m_wndDel, m_wndEdit, and m_wndTree.

00478 {
00479     CDialog::DoDataExchange(pDX);
00480     //{{AFX_DATA_MAP(CGroupDlg)
00481     DDX_Control(pDX, IDC_TREE_GROUP, m_wndTree);
00482     DDX_Control(pDX, IDC_BTN_EDIT, m_wndEdit);
00483     DDX_Control(pDX, IDC_BTN_DEL, m_wndDel);
00484     DDX_Control(pDX, IDC_BTN_ADD, m_wndAdd);
00485     //}}AFX_DATA_MAP
00486 }

void InitGroups  ) 
 

Definition at line 540 of file GroupDlg.cpp.

References Group_Init().

Referenced by OnInitDialog().

00541 {
00542     Group_Init();
00543 }

Here is the call graph for this function:

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

Definition at line 649 of file GroupDlg.cpp.

00650 {
00651     NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
00652     // TODO: Add your control notification handler code here
00653     
00654     *pResult = 0;
00655 }

void OnBtnAdd  )  [protected]
 

Definition at line 546 of file GroupDlg.cpp.

References g(), g_pGroups, Group_Alloc(), group_t, group_s::itemOwner, CNameDlg::m_strName, m_wndTree, memset(), group_s::next, and Select_AddToGroup().

00547 {
00548   CNameDlg dlg("New Group", this);
00549   if (dlg.DoModal() == IDOK)
00550   {
00551         // create a new group node
00552     HTREEITEM hItem = m_wndTree.GetSelectedItem();
00553     TVINSERTSTRUCT tvInsert;
00554     memset(&tvInsert, 0, sizeof(TVINSERTSTRUCT));
00555     tvInsert.item.iImage = IMG_GROUP;
00556     tvInsert.item.iSelectedImage = tvInsert.item.iImage;
00557         //++timo wasat?
00558     // tvInsert.hParent = (hItem) ? hItem : m_hWorld;
00559     tvInsert.hParent = m_hWorld;
00560     tvInsert.hInsertAfter = NULL;
00561     tvInsert.item.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
00562     tvInsert.item.pszText = _T(dlg.m_strName.GetBuffer(0));
00563         // create a new group
00564         group_t *g = Group_Alloc( dlg.m_strName.GetBuffer(0) );
00565         g->itemOwner = m_wndTree.InsertItem(&tvInsert);
00566         g->next = g_pGroups;
00567         g_pGroups = g;
00568         // now add the selected brushes
00569         // NOTE: it would be much faster to give the group_t for adding
00570         // but Select_AddToGroup is the standard way for all other cases
00571         Select_AddToGroup( dlg.m_strName.GetBuffer(0) );
00572   }
00573 }

Here is the call graph for this function:

void OnBtnDel  )  [protected]
 

Definition at line 575 of file GroupDlg.cpp.

00576 {
00577 }

void OnBtnEdit  )  [protected]
 

Definition at line 579 of file GroupDlg.cpp.

00580 {
00581 }

void OnCancel  )  [virtual]
 

Definition at line 639 of file GroupDlg.cpp.

References m_wndTree.

00640 {
00641   TreeView_EndEditLabelNow(m_wndTree.GetSafeHwnd(), TRUE);
00642 }

BOOL OnChildNotify UINT  message,
WPARAM  wParam,
LPARAM  lParam,
LRESULT *  pLResult
[virtual]
 

Definition at line 583 of file GroupDlg.cpp.

References BOOL, and wParam.

00584 {
00585     return CDialog::OnChildNotify(message, wParam, lParam, pLResult);
00586 }

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

Definition at line 624 of file GroupDlg.cpp.

00625 {
00626     // TODO: Add your control notification handler code here
00627     
00628     *pResult = 0;
00629 }

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

Definition at line 600 of file GroupDlg.cpp.

References m_wndTree, strlen(), and Sys_Printf().

00601 {
00602     TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
00603   const char *pText = pTVDispInfo->item.pszText;
00604   if (pText && strlen(pText) > 0)
00605   {
00606     HTREEITEM item = pTVDispInfo->item.hItem;
00607     if (m_wndTree.GetRootItem() != item)
00608     {
00609       m_wndTree.SetItemText(item, pText);
00610       if (pTVDispInfo->item.iImage != IMG_GROUP)
00611       {
00612         // if it is an entity
00613       }
00614     }
00615     else
00616     {
00617       Sys_Printf("Cannot rename the world\n");
00618     }
00619   }
00620   m_wndTree.RedrawWindow();
00621     *pResult = 0;
00622 }

Here is the call graph for this function:

BOOL OnInitDialog  )  [protected, virtual]
 

Definition at line 530 of file GroupDlg.cpp.

References BOOL, IDB_BITMAP_GROUPS, InitGroups(), m_imgList, and m_wndTree.

00531 {
00532     CDialog::OnInitDialog();
00533     m_imgList.Create(IDB_BITMAP_GROUPS, 16, 0, ILC_COLOR);
00534     m_wndTree.SetImageList(&m_imgList, TVSIL_NORMAL);
00535     InitGroups();
00536     return TRUE;  // return TRUE unless you set the focus to a control
00537     // EXCEPTION: OCX Property Pages should return FALSE
00538 }

Here is the call graph for this function:

BOOL OnNotify WPARAM  wParam,
LPARAM  lParam,
LRESULT *  pResult
[protected, virtual]
 

Definition at line 588 of file GroupDlg.cpp.

References BOOL, and wParam.

00589 {
00590   return CDialog::OnNotify(wParam, lParam, pResult);
00591 }

void OnOK  )  [virtual]
 

Definition at line 644 of file GroupDlg.cpp.

References m_wndTree.

00645 {
00646   TreeView_EndEditLabelNow(m_wndTree.GetSafeHwnd(), FALSE);
00647 }

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

Definition at line 593 of file GroupDlg.cpp.

00594 {
00595     // TODO: Add your control notification handler code here
00596     
00597     *pResult = 0;
00598 }

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

Definition at line 631 of file GroupDlg.cpp.

00632 {
00633     TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
00634     // TODO: Add your control notification handler code here
00635     
00636     *pResult = 0;
00637 }

afx_msg void OnSize UINT  nType,
int  cx,
int  cy
[protected]
 


Field Documentation

HTREEITEM m_hWorld
 

Definition at line 44 of file GroupDlg.h.

Referenced by Group_Add().

CImageList m_imgList [private]
 

Definition at line 36 of file GroupDlg.h.

Referenced by OnInitDialog().

CButton m_wndAdd
 

Definition at line 52 of file GroupDlg.h.

Referenced by DoDataExchange().

CButton m_wndDel
 

Definition at line 51 of file GroupDlg.h.

Referenced by DoDataExchange().

CButton m_wndEdit
 

Definition at line 50 of file GroupDlg.h.

Referenced by DoDataExchange().

CTreeCtrl m_wndTree
 

Definition at line 49 of file GroupDlg.h.

Referenced by DoDataExchange(), Group_Add(), Group_AddToItem(), Group_AddToProperGroup(), Group_AddToSelected(), Group_AddToWorld(), Group_Init(), Group_RemoveBrush(), OnBtnAdd(), OnCancel(), OnEndlabeleditTreeGroup(), OnInitDialog(), and OnOK().


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