CmdControl Class Reference

A CmdControl is an abstract class from which all types of interface controls inherit. These controls include MenuItems, Keyboard Accelerators, Buttons etc. They all have one main thing in common and that is that they are built out of Operations. Unlike Tools Controls have only one operation behind them.Base class for Camelot menu items. Unfortunately neither Mario or Andy ever got round to documenting this stuff, ha ha ha. More...

#include <cmdctrl.h>

Inheritance diagram for CmdControl:

ListItem CCObject SimpleCCObject MenuItem List of all members.

Public Member Functions

 CmdControl ()
 CmdControl (OpDescriptor *Owner)
 Constructor for the CmdControl Class.
virtual BOOL IsEnabled ()
 Identifies if the current CmdControl is available. This function is used when updating the state of a CmdControl.
virtual void PerformAction ()
 Performs the action assoicated with a CmdControl.
virtual BOOL UpdateControlState ()
 Obtains the state of a CmdControl.
virtual String_256GetWhyDisabled ()
 Gets the reason why a CmdControl has been disabled.
virtual OpDescriptorGetOpDescriptor () const

Protected Attributes

UINT32 ControlId
String_256 WhyDisabled
OpState ControlState
OpDescriptorOwnerOperation

Private Member Functions

 CC_DECLARE_MEMDUMP (CmdControl)

Detailed Description

A CmdControl is an abstract class from which all types of interface controls inherit. These controls include MenuItems, Keyboard Accelerators, Buttons etc. They all have one main thing in common and that is that they are built out of Operations. Unlike Tools Controls have only one operation behind them.Base class for Camelot menu items. Unfortunately neither Mario or Andy ever got round to documenting this stuff, ha ha ha.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
sometime in 1993
See also:
-

Definition at line 136 of file cmdctrl.h.


Constructor & Destructor Documentation

CmdControl::CmdControl  )  [inline]
 

Definition at line 140 of file cmdctrl.h.

00140 { /* Empty */ }

CmdControl::CmdControl OpDescriptor Owner  ) 
 

Constructor for the CmdControl Class.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/93
Parameters:
Pointer to owner OpDescriptor [INPUTS]
None [OUTPUTS]
Returns:
None

Errors: None

Definition at line 128 of file cmdctrl.cpp.

00129 {
00130     ENSURE( Owner, "No owner for CmdControl" );
00131 
00132     ControlId       = 0;
00133     OwnerOperation  = Owner;
00134     ControlState    = OpState(FALSE, TRUE);
00135     
00136     WhyDisabled.Empty();
00137 }


Member Function Documentation

CmdControl::CC_DECLARE_MEMDUMP CmdControl   )  [private]
 

OpDescriptor * CmdControl::GetOpDescriptor  )  const [virtual]
 

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/5/95
Returns:
A pointer to the OpDescriptor associated with this object.

Definition at line 232 of file cmdctrl.cpp.

00233 {
00234     return OwnerOperation;
00235 }

String_256 * CmdControl::GetWhyDisabled  )  [virtual]
 

Gets the reason why a CmdControl has been disabled.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/93
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
If Succesful returns a string representing why the CmdControl is disabled otherwise NULL

Errors: None

Definition at line 176 of file cmdctrl.cpp.

00177 {
00178     return &WhyDisabled;
00179 }

BOOL CmdControl::IsEnabled  )  [virtual]
 

Identifies if the current CmdControl is available. This function is used when updating the state of a CmdControl.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/93
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
True if CmdControl is enabled False if CmdControl is disabled

Errors: None

Definition at line 156 of file cmdctrl.cpp.

00157 {
00158     return (!ControlState.Greyed);
00159 }

void CmdControl::PerformAction  )  [virtual]
 

Performs the action assoicated with a CmdControl.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/93
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
None

Errors: None

Reimplemented in MenuItem.

Definition at line 195 of file cmdctrl.cpp.

00196 {
00197     ENSURE(OwnerOperation, "Cannot Perform Action with NULL Owner");
00198 
00199     OwnerOperation->Invoke();
00200 }

BOOL CmdControl::UpdateControlState  )  [virtual]
 

Obtains the state of a CmdControl.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/10/93
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
TRUE if state is updated FALSE otherwise

Errors: None

Definition at line 217 of file cmdctrl.cpp.

00218 {
00219     return TRUE;                      
00220 }


Member Data Documentation

UINT32 CmdControl::ControlId [protected]
 

Definition at line 151 of file cmdctrl.h.

OpState CmdControl::ControlState [protected]
 

Definition at line 153 of file cmdctrl.h.

OpDescriptor* CmdControl::OwnerOperation [protected]
 

Definition at line 154 of file cmdctrl.h.

String_256 CmdControl::WhyDisabled [protected]
 

Definition at line 152 of file cmdctrl.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:52:35 2007 for Camelot by  doxygen 1.4.4