SingletonAppliedAttribute Class Reference

Represents an applied attribute of which there is only one for the objects given by the iterator. More...

#include <attraggl.h>

Inheritance diagram for SingletonAppliedAttribute:

AppliedAttribute VisibleListItem UserInterface List of all members.

Public Member Functions

 SingletonAppliedAttribute (NodeAttribute &TheAttribute)
 This constructor tries to create a UserInterface in the form of a VisibleUserAttribute so the user can alter the attributes' contents.
 SingletonAppliedAttribute (VisibleAttribute &TheVisibleAttribute)
 This constructor is used for new VisibleAttributes (i.e., ones that haven't yet been applied).
 SingletonAppliedAttribute (const SingletonAppliedAttribute &Other)
virtual ~SingletonAppliedAttribute ()
 Destructor removes any internal heap muck.
virtual BOOL Display (DialogOp &Dialog)
 This SingletonAppliedAttribute appears in the Wizard Properties dialog as a "Used Property". When selected it displays its innards.
virtual void Hide ()
 This SingletonAppliedAttribute appears in the Wizard Properties dialog as a "Used Property". When de-selected it hides what it was displaying and makes any updates to the actual VisibleAttribute.
virtual StringBaseGetText (StringBase &Description) const
 Provides the text that goes in any UI.
virtual AttributeIdentifier GetAttrID () const
virtual BOOL ApplyAttribute (Operation &OpToApplyWith)
 This is called when the AppliedAttribute should apply itself to the selection.
virtual VisibleAttributeGetVisibleAttribute ()

Private Member Functions

 CC_DECLARE_MEMDUMP (SingletonAppliedAttribute)

Private Attributes

VisibleAttributem_pVisibleAttribute
String_128 m_AttrID
DialogOpm_pDialog

Detailed Description

Represents an applied attribute of which there is only one for the objects given by the iterator.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/07/97

Definition at line 339 of file attraggl.h.


Constructor & Destructor Documentation

SingletonAppliedAttribute::SingletonAppliedAttribute NodeAttribute TheAttribute  ) 
 

This constructor tries to create a UserInterface in the form of a VisibleUserAttribute so the user can alter the attributes' contents.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Notes: If this constructor fails there will be no user interface for the NodeAttribute.

Definition at line 836 of file attraggl.cpp.

00836                                                                                 :
00837     m_AttrID(TheAttribute.GetAttributeClassID())
00838 {
00839     
00840     m_pVisibleAttribute = TheAttribute.CreateVisibleAttribute();
00841     if (m_pVisibleAttribute != NULL)
00842     {
00843         m_pVisibleAttribute->MarkAsUsed();
00844     }
00845     m_pDialog = NULL;
00846 }

SingletonAppliedAttribute::SingletonAppliedAttribute VisibleAttribute TheVisibleAttribute  ) 
 

This constructor is used for new VisibleAttributes (i.e., ones that haven't yet been applied).

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Parameters:
The VisibleAttribute that is the one and only attribute with the associated [INPUTS] AttributeIdentifier (from GetAttributeClassID()) applied to the node (or will be)
Notes: If this constructor fails there will be no user interface for the VisibleAttribute.

Definition at line 867 of file attraggl.cpp.

00867                                                                                           :
00868     m_AttrID(NullString)
00869 {
00870     m_pVisibleAttribute = &TheVisibleAttribute;
00871 
00872     // Create us a quick NodeAttribute so we can get the ClassID thing
00873     NodeAttribute* pAttrib = m_pVisibleAttribute->CreateNewAttribute();
00874 
00875     if (pAttrib != NULL)
00876     {
00877         m_AttrID = pAttrib->GetAttributeClassID();
00878         delete pAttrib;
00879     }
00880     m_pDialog = NULL;
00881 }

SingletonAppliedAttribute::SingletonAppliedAttribute const SingletonAppliedAttribute Other  )  [inline]
 

Definition at line 347 of file attraggl.h.

00347                                                                       : m_AttrID(NonConstNullString)
00348         {   TRACE( wxT("SingletonAppliedAttribute copy constructor not implemented\n") );   }

SingletonAppliedAttribute::~SingletonAppliedAttribute  )  [virtual]
 

Destructor removes any internal heap muck.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97

Definition at line 894 of file attraggl.cpp.

00895 {
00896     delete m_pVisibleAttribute;
00897     m_pVisibleAttribute = NULL;
00898 }


Member Function Documentation

BOOL SingletonAppliedAttribute::ApplyAttribute Operation OpToApplyWith  )  [virtual]
 

This is called when the AppliedAttribute should apply itself to the selection.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Parameters:
OpToApplyWith,: This is quite useless 'cos we need to apply an op to an [INPUTS] object. Unfortunately there's no hierarchy in the OpParam class.
Notes: Always uses OpApplyAttribToSelected

Implements AppliedAttribute.

Definition at line 1038 of file attraggl.cpp.

01039 {
01040     BOOL Ok = TRUE;
01041 
01042     if (GetVisibleAttribute() != NULL)
01043     {
01044         NodeAttribute* pAttrib = GetVisibleAttribute()->CreateNewAttribute();
01045         Ok = (pAttrib != NULL);
01046 
01047         if (Ok)
01048         {
01049             // Obtain a pointer to the op descriptor for the attribute operation 
01050             OpDescriptor* const pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(OpApplyAttribToSelected));
01051             ENSURE_NOT_NULL(pOpDesc);
01052 
01053             // Invoke the operation, passing Attrib as a parameter
01054             OpParam     Param( pAttrib, TRUE );
01055             pOpDesc->Invoke( &Param );  // TRUE for undo
01056         }
01057 
01058         delete pAttrib;
01059         pAttrib = NULL;
01060     }
01061     else
01062     {
01063         TRACE( _T("SingletonAppliedAttribute::ApplyAttribute() : NULL Members") );
01064     }
01065 
01066     return Ok;
01067 }

SingletonAppliedAttribute::CC_DECLARE_MEMDUMP SingletonAppliedAttribute   )  [private]
 

BOOL SingletonAppliedAttribute::Display DialogOp Dialog  )  [virtual]
 

This SingletonAppliedAttribute appears in the Wizard Properties dialog as a "Used Property". When selected it displays its innards.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Parameters:
Dialog,: The dialog on which to display this SingletonAppliedAttribute [INPUTS]
Returns:
TRUE if it succeeded in doing what it wanted, FALSE if it didn't
Notes: The given DialogOp must be derived from TemplateDialog. SingletonAppliedAttribute delegates the work to the VisibleAttribute that is the singleton in the selection.

Reimplemented from VisibleListItem.

Definition at line 918 of file attraggl.cpp.

00919 {
00920 PORTNOTETRACE("dialog","SingletonAppliedAttribute::Display - do nothing");
00921 #ifndef EXCLUDE_FROM_XARALX
00922     BOOL Ok = TRUE;
00923 
00924     if (m_pVisibleAttribute != NULL)
00925     {
00926         m_pVisibleAttribute->Display(Dialog);
00927 
00928         // god, it's another bodge...it will get sorted, honest!
00929         // if the user changes the text then we'll enable the apply button 
00930         // but we need to make sure we don't interpret our own internal changes
00931         // We disable the message processing (in TemplateDialog) in Hide()
00932         m_pDialog = &Dialog;
00933 
00934         ENSURE_KIND((&Dialog), TemplateDialog);
00935 
00936         TemplateDialog& BetterBeThisDialog = (TemplateDialog&)Dialog;
00937         BetterBeThisDialog.SetUserCanModifyQuestion(TRUE);
00938 
00939         Ok = m_pVisibleAttribute->Interact(Dialog);
00940     }
00941     else
00942     {
00943         TRACE(_T("SingletonAppliedAttribute::Display() : NULL Members"));
00944         Ok = FALSE;
00945     }
00946 
00947     return Ok;
00948 #endif
00949     return FALSE;
00950 }

virtual AttributeIdentifier SingletonAppliedAttribute::GetAttrID  )  const [inline, virtual]
 

Implements AppliedAttribute.

Definition at line 362 of file attraggl.h.

00362 {   return m_AttrID;    }

StringBase & SingletonAppliedAttribute::GetText StringBase Description  )  const [virtual]
 

Provides the text that goes in any UI.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Notes: The Wizard Properties dialog uses this text in the "Used Property" list. SingletonAppliedAttribute gets the text from the actual VisibleAttribute that is the Singleton in the selection.

Implements VisibleListItem.

Definition at line 1008 of file attraggl.cpp.

01009 {
01010     if (m_pVisibleAttribute != NULL)
01011     {
01012         return m_pVisibleAttribute->GetText(Description);
01013     }
01014     else
01015     {
01016         return Description = String_256(_R(IDS_ERRORS_UNKNOWN));
01017     }
01018 }

virtual VisibleAttribute* SingletonAppliedAttribute::GetVisibleAttribute  )  [inline, virtual]
 

Implements AppliedAttribute.

Definition at line 364 of file attraggl.h.

00364 {   return m_pVisibleAttribute; }

void SingletonAppliedAttribute::Hide  )  [virtual]
 

This SingletonAppliedAttribute appears in the Wizard Properties dialog as a "Used Property". When de-selected it hides what it was displaying and makes any updates to the actual VisibleAttribute.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Notes: SingletonAppliedAttribute delegates the work to the VisibleAttribute that is the singleton in the selection.

Reimplemented from VisibleListItem.

Definition at line 968 of file attraggl.cpp.

00969 {
00970 PORTNOTETRACE("dialog","SingletonAppliedAttribute::Hide - do nothing");
00971 #ifndef EXCLUDE_FROM_XARALX
00972     if (m_pDialog != NULL && m_pVisibleAttribute != NULL)
00973     {
00974         ENSURE_KIND(m_pDialog, TemplateDialog);
00975 
00976         // Disable the processing of TEXT_CHANGED message (in TemplateDialog)
00977         // otherwise we end up processing our own changes
00978         TemplateDialog* pBetterBeThisDialog = (TemplateDialog*)m_pDialog;
00979         pBetterBeThisDialog->SetUserCanModifyQuestion(FALSE);
00980 
00981         m_pVisibleAttribute->Hide();
00982 
00983         // we'll say we're not on a dialog any more so we can ignore further requests
00984         m_pDialog = NULL;
00985     }
00986     else
00987     {
00988         TRACE(_T("SingletonAppliedAttribute::Hide() : NULL Members"));
00989     }
00990 #endif
00991 }


Member Data Documentation

String_128 SingletonAppliedAttribute::m_AttrID [private]
 

Definition at line 369 of file attraggl.h.

DialogOp* SingletonAppliedAttribute::m_pDialog [private]
 

Definition at line 370 of file attraggl.h.

VisibleAttribute* SingletonAppliedAttribute::m_pVisibleAttribute [private]
 

Definition at line 368 of file attraggl.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:01:16 2007 for Camelot by  doxygen 1.4.4