Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
HierarchyView Class Reference

#include <HierarchyView.h>

Classes

struct  hashConstGameWindowPtr
 

Public Member Functions

 HierarchyView (void)
 
 ~HierarchyView (void)
 
void init (void)
 
void reset (void)
 
void shutdown (void)
 
char * getWindowTreeName (GameWindow *window)
 
void addWindow (GameWindow *window, HierarchyOption option)
 add a window to the view
 
void removeWindow (GameWindow *window)
 remove window from tree
 
void bringWindowToTop (GameWindow *window)
 bring window to top of parent list
 
void updateWindowName (GameWindow *window)
 update tree entry based on name
 
void selectWindow (GameWindow *window)
 select window
 
HWND getTreeHandle (void)
 get the tree control handle
 
HWND getHierarchyHandle (void)
 get window handle for the whole dialog
 
void setDialogPos (ICoord2D *pos)
 
void getDialogPos (ICoord2D *pos)
 
void setDialogSize (ICoord2D *size)
 
void getDialogSize (ICoord2D *size)
 
void setDragWindow (GameWindow *window)
 
void setDragTarget (GameWindow *window)
 
GameWindowgetDragWindow (void)
 
GameWindowgetDragTarget (void)
 
void moveWindowAheadOf (GameWindow *window, GameWindow *aheadOf)
 move hierarchy representation
 
void moveWindowChildOf (GameWindow *window, GameWindow *parent)
 move hierarchy representation
 
Bool validateDragDropOperation (GameWindow *source, GameWindow *target)
 
void setPopupTarget (GameWindow *window)
 set target for popup menu
 
GameWindowgetPopupTarget (void)
 get the popup target window
 
HTREEITEM treePointToItem (Int x, Int y)
 translate mouse pos to item location
 
GameWindowgetWindowFromItem (HTREEITEM treeItem)
 get game window from user data in the tree item
 

Protected Types

typedef const GameWindowConstGameWindowPtr
 
typedef std::hash_map< ConstGameWindowPtr, HTREEITEM, hashConstGameWindowPtr, std::equal_to< ConstGameWindowPtr > > TreeHash
 

Protected Member Functions

void addWindowToTree (GameWindow *window, HTREEITEM treeParent, HierarchyOption option, Bool addChildren, Bool addSiblings)
 workhorse for addWindow()
 
HTREEITEM findItemEntry (HTREEITEM node, GameWindow *window)
 workhorse for findTreeEntry
 
HTREEITEM findTreeEntry (GameWindow *window)
 return entry if in tree
 

Static Protected Member Functions

static LRESULT CALLBACK dialogProc (HWND hWndDialog, UINT message, WPARAM wParam, LPARAM lParam)
 

Protected Attributes

HWND m_dialog
 window handle for our control dialog
 
HWND m_tree
 window handle for the tree control
 
GameWindowm_dragWindow
 for drag drop operations
 
GameWindowm_dragTarget
 target for drag and drop operations while mouse is moving
 
GameWindowm_popupTarget
 the target for right mouse popup menus
 
TreeHash m_treeHash
 Speed up the search with a nice hash.
 

Detailed Description

This view allows users to manipulate the windows hierarchy using a tree view control

Definition at line 83 of file HierarchyView.h.

Member Typedef Documentation

◆ ConstGameWindowPtr

Definition at line 144 of file HierarchyView.h.

◆ TreeHash

typedef std::hash_map< ConstGameWindowPtr, HTREEITEM, hashConstGameWindowPtr, std::equal_to<ConstGameWindowPtr> > HierarchyView::TreeHash
protected

Definition at line 155 of file HierarchyView.h.

Constructor & Destructor Documentation

◆ HierarchyView()

HierarchyView::HierarchyView ( void )

Definition at line 747 of file HierarchyView.cpp.

◆ ~HierarchyView()

HierarchyView::~HierarchyView ( void )

Definition at line 763 of file HierarchyView.cpp.

Member Function Documentation

◆ addWindow()

void HierarchyView::addWindow ( GameWindow * window,
HierarchyOption option )

add a window to the view

Add a window to the hierarchy view AND any of it's children

Definition at line 906 of file HierarchyView.cpp.

◆ addWindowToTree()

void HierarchyView::addWindowToTree ( GameWindow * window,
HTREEITEM treeParent,
HierarchyOption option,
Bool addChildren,
Bool addSiblings )
protected

workhorse for addWindow()

Add a single window to the hierarchy tree

Definition at line 668 of file HierarchyView.cpp.

◆ bringWindowToTop()

void HierarchyView::bringWindowToTop ( GameWindow * window)

bring window to top of parent list

Bring the window to the top of its parent list in the hierarchy view, if no parent is present to the top of the hierarchy then

Definition at line 977 of file HierarchyView.cpp.

◆ dialogProc()

LRESULT CALLBACK HierarchyView::dialogProc ( HWND hWndDialog,
UINT message,
WPARAM wParam,
LPARAM lParam )
staticprotected

Windows dialog procedure for the control palette

Definition at line 85 of file HierarchyView.cpp.

◆ findItemEntry()

HTREEITEM HierarchyView::findItemEntry ( HTREEITEM node,
GameWindow * window )
protected

workhorse for findTreeEntry

Workhorse to find the tree item anywhere in the tree with the matching data pointer of this game window

Definition at line 607 of file HierarchyView.cpp.

◆ findTreeEntry()

HTREEITEM HierarchyView::findTreeEntry ( GameWindow * window)
protected

return entry if in tree

Find the game window entry in the hierarchy tree, if found the item in the tree will be returned containing the window

Definition at line 653 of file HierarchyView.cpp.

◆ getDialogPos()

void HierarchyView::getDialogPos ( ICoord2D * pos)

Get the dialog position as recorded from the static

Definition at line 1042 of file HierarchyView.cpp.

◆ getDialogSize()

void HierarchyView::getDialogSize ( ICoord2D * size)

Get the dialog size as recorded from the static

Definition at line 1056 of file HierarchyView.cpp.

◆ getDragTarget()

GameWindow * HierarchyView::getDragTarget ( void )
inline

Definition at line 171 of file HierarchyView.h.

◆ getDragWindow()

GameWindow * HierarchyView::getDragWindow ( void )
inline

Definition at line 170 of file HierarchyView.h.

◆ getHierarchyHandle()

HWND HierarchyView::getHierarchyHandle ( void )
inline

get window handle for the whole dialog

Definition at line 167 of file HierarchyView.h.

◆ getPopupTarget()

GameWindow * HierarchyView::getPopupTarget ( void )
inline

get the popup target window

Definition at line 173 of file HierarchyView.h.

◆ getTreeHandle()

HWND HierarchyView::getTreeHandle ( void )
inline

get the tree control handle

Definition at line 166 of file HierarchyView.h.

◆ getWindowFromItem()

GameWindow * HierarchyView::getWindowFromItem ( HTREEITEM treeItem)

get game window from user data in the tree item

Get the game window we stored as the user data lParam in the tree item

Definition at line 1243 of file HierarchyView.cpp.

◆ getWindowTreeName()

char * HierarchyView::getWindowTreeName ( GameWindow * window)

Given a window, return a string representation for that window in the hierarchy view

Definition at line 847 of file HierarchyView.cpp.

◆ init()

void HierarchyView::init ( void )

Create the control palette

Definition at line 774 of file HierarchyView.cpp.

◆ moveWindowAheadOf()

void HierarchyView::moveWindowAheadOf ( GameWindow * window,
GameWindow * aheadOf )

move hierarchy representation

Move the window hierarchy representation to be just ahead of the hierarchy entry of 'aheadOf'

Definition at line 1101 of file HierarchyView.cpp.

◆ moveWindowChildOf()

void HierarchyView::moveWindowChildOf ( GameWindow * window,
GameWindow * parent )

move hierarchy representation

Move the hierarchy entry for window so that it is now the first child in the list under parent

Definition at line 1186 of file HierarchyView.cpp.

◆ removeWindow()

void HierarchyView::removeWindow ( GameWindow * window)

remove window from tree

Remove the window from the hierarchy tree view

Definition at line 935 of file HierarchyView.cpp.

◆ reset()

void HierarchyView::reset ( void )

Reset everything about our hierarchy view

Definition at line 817 of file HierarchyView.cpp.

◆ selectWindow()

void HierarchyView::selectWindow ( GameWindow * window)

select window

Select the tree item

Definition at line 1268 of file HierarchyView.cpp.

◆ setDialogPos()

void HierarchyView::setDialogPos ( ICoord2D * pos)

Definition at line 1070 of file HierarchyView.cpp.

◆ setDialogSize()

void HierarchyView::setDialogSize ( ICoord2D * size)

Definition at line 1085 of file HierarchyView.cpp.

◆ setDragTarget()

void HierarchyView::setDragTarget ( GameWindow * window)
inline

Definition at line 169 of file HierarchyView.h.

◆ setDragWindow()

void HierarchyView::setDragWindow ( GameWindow * window)
inline

Definition at line 168 of file HierarchyView.h.

◆ setPopupTarget()

void HierarchyView::setPopupTarget ( GameWindow * window)
inline

set target for popup menu

Definition at line 172 of file HierarchyView.h.

◆ shutdown()

void HierarchyView::shutdown ( void )

Destroy the control palette and all data associated with it

Definition at line 833 of file HierarchyView.cpp.

◆ treePointToItem()

HTREEITEM HierarchyView::treePointToItem ( Int x,
Int y )

translate mouse pos to item location

Given the location (x,y) in TREE COORDINATES, correlate that to a tree item, if any

Definition at line 1226 of file HierarchyView.cpp.

◆ updateWindowName()

void HierarchyView::updateWindowName ( GameWindow * window)

update tree entry based on name

A window name may have been updated, reconstruct its hierarchy tree entry cause we like to show names when we have them

Definition at line 1010 of file HierarchyView.cpp.

◆ validateDragDropOperation()

Bool HierarchyView::validateDragDropOperation ( GameWindow * source,
GameWindow * target )

Return TRUE if the drag drop operation of source onto target is logically OK. It's not OK if target is a child of source because you cannot move a parent window into it's own child list.

Definition at line 1287 of file HierarchyView.cpp.

Member Data Documentation

◆ m_dialog

HWND HierarchyView::m_dialog
protected

window handle for our control dialog

Definition at line 136 of file HierarchyView.h.

◆ m_dragTarget

GameWindow* HierarchyView::m_dragTarget
protected

target for drag and drop operations while mouse is moving

Definition at line 140 of file HierarchyView.h.

◆ m_dragWindow

GameWindow* HierarchyView::m_dragWindow
protected

for drag drop operations

Definition at line 139 of file HierarchyView.h.

◆ m_popupTarget

GameWindow* HierarchyView::m_popupTarget
protected

the target for right mouse popup menus

Definition at line 141 of file HierarchyView.h.

◆ m_tree

HWND HierarchyView::m_tree
protected

window handle for the tree control

Definition at line 137 of file HierarchyView.h.

◆ m_treeHash

TreeHash HierarchyView::m_treeHash
protected

Speed up the search with a nice hash.

Definition at line 157 of file HierarchyView.h.


The documentation for this class was generated from the following files: