Cafu Engine
CommandGroupSetPropT Class Reference

This class implements a command for setting the properties (other than the visibility) of a group. More...

#include "Group_SetProp.hpp"

Inheritance diagram for CommandGroupSetPropT:

Public Types

enum  PropT { PROP_NAME, PROP_COLOR, PROP_CANSELECT, PROP_SELECTASGROUP }
 

Public Member Functions

 CommandGroupSetPropT (MapDocumentT &MapDoc, GroupT *Group, const wxString &NewName)
 The constructor for setting a new name. More...
 
 CommandGroupSetPropT (MapDocumentT &MapDoc, GroupT *Group, const wxColor &NewColor)
 The constructor for setting a new color. More...
 
 CommandGroupSetPropT (MapDocumentT &MapDoc, GroupT *Group, PropT Prop, bool NewFlag)
 The constructor for setting a new value for CanSelect or SelectAsGroup. More...
 
const GroupTGetGroup () const
 Returns the group whose property is set. More...
 
PropT GetProp () const
 Returns which property is set. More...
 
bool Do ()
 This method executes the command. More...
 
void Undo ()
 This method un-does the command. More...
 
wxString GetName () const
 Returns the name (a description) of the command. More...
 
- Public Member Functions inherited from CommandT
 CommandT (bool ShowInHistory=true, bool SuggestsSave=true)
 The constructor. More...
 
virtual ~CommandT ()
 The virtual destructor. More...
 
bool ShowInHistory () const
 Whether the command should be shown in the undo/redo history. More...
 
bool SuggestsSave () const
 Whether the command suggests to save the document when its closed and hasn't been saved between the command execution and the closing (selection changes for example don't suggest to save the document since no important changes have been made). More...
 
bool IsDone () const
 Whether the command has been executed. More...
 
unsigned long GetID () const
 Returns the commands unique ID. More...
 

Additional Inherited Members

- Protected Attributes inherited from CommandT
bool m_Done
 Whether the command has been executed. More...
 
const bool m_ShowInHistory
 Whether the command should have an entry in the undo/redo history. More...
 
const bool m_SuggestsSave
 Whether the command suggests saving of the document on close. More...
 
const unsigned long m_ID
 The commands unique ID. More...
 

Detailed Description

This class implements a command for setting the properties (other than the visibility) of a group.

Constructor & Destructor Documentation

CommandGroupSetPropT::CommandGroupSetPropT ( MapDocumentT MapDoc,
GroupT Group,
const wxString &  NewName 
)

The constructor for setting a new name.

Parameters
MapDocThe map document the group is in.
GroupThe group whose property is set.
NewNameThe new name for the group.
CommandGroupSetPropT::CommandGroupSetPropT ( MapDocumentT MapDoc,
GroupT Group,
const wxColor &  NewColor 
)

The constructor for setting a new color.

Parameters
MapDocThe map document the group is in.
GroupThe group whose property is set.
NewColorThe new color for the group. If Group->IsVisible is already NewVis, Do() will fail.
CommandGroupSetPropT::CommandGroupSetPropT ( MapDocumentT MapDoc,
GroupT Group,
PropT  Prop,
bool  NewFlag 
)

The constructor for setting a new value for CanSelect or SelectAsGroup.

Parameters
MapDocThe map document the group is in.
GroupThe group whose property is set.
PropThe boolean property that is newly set. Must be either PROP_CANSELECT or PROP_SELECTASGROUP.
NewFlagThe new value for the above specified boolean properly.

Member Function Documentation

bool CommandGroupSetPropT::Do ( )
virtual

This method executes the command.

Returns
true if the command succeeded, false if it failed.

Implements CommandT.

const GroupT* CommandGroupSetPropT::GetGroup ( ) const
inline

Returns the group whose property is set.

wxString CommandGroupSetPropT::GetName ( ) const
virtual

Returns the name (a description) of the command.

Implements CommandT.

PropT CommandGroupSetPropT::GetProp ( ) const
inline

Returns which property is set.

void CommandGroupSetPropT::Undo ( )
virtual

This method un-does the command.

Implements CommandT.


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