VisibleUserAttribute Class Reference

Provides a user editable user attribute. More...

#include <visiattr.h>

Inheritance diagram for VisibleUserAttribute:

VisibleAttribute UserInterface VisibleTemplateAttribute List of all members.

Public Member Functions

 VisibleUserAttribute (const StringBase &Key, const StringBase &Value)
 Represents an AttrUser that the user can edit (this is all horribly wrong).
virtual BOOL Display (DialogOp &Dialog)
 This allows the user to change this VisibleUserAttribute.
virtual BOOL Interact (DialogOp &Dialog)
 This allows the user to change this VisibleUserAttribute.
virtual void Hide ()
 Hides this VisibleUserAttribute from the user.
virtual StringBaseGetText (StringBase &Description) const
void SetLongKey (const StringBase &NewKey)
void SetValue (const StringBase &NewValue)
const StringBaseGetKey ()
const StringBaseGetLongKey ()
const StringBaseGetValue ()
virtual NodeAttributeCreateNewAttribute ()
 Creates a new NodeAttribute from what the user entered. (this is all horribly wrong).

Private Attributes

String_64 m_Key
EditableText m_LongKey
EditableText m_Value

Detailed Description

Provides a user editable user attribute.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/10/96

Definition at line 142 of file visiattr.h.


Constructor & Destructor Documentation

VisibleUserAttribute::VisibleUserAttribute const StringBase Key,
const StringBase Value
 

Represents an AttrUser that the user can edit (this is all horribly wrong).

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

Definition at line 995 of file userattr.cpp.

00995                                                                                          :
00996     m_LongKey(Key),
00997     m_Value(Value)
00998 {
00999 }


Member Function Documentation

NodeAttribute * VisibleUserAttribute::CreateNewAttribute  )  [virtual]
 

Creates a new NodeAttribute from what the user entered. (this is all horribly wrong).

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

Implements VisibleAttribute.

Reimplemented in VisibleTemplateAttribute.

Definition at line 1056 of file userattr.cpp.

01057 {
01058     return new AttrUser(GetLongKey(), GetValue());
01059 }

BOOL VisibleUserAttribute::Display DialogOp Dialog  )  [virtual]
 

This allows the user to change this VisibleUserAttribute.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Notes: This function takes a DialopOp as its argument to determine where to put this object. Since this requires an internal knowledge of the DialogOp at the moment it is cast to a TemplateDialog which has the fields all ready. This is likely to change in the future.

Implements UserInterface.

Reimplemented in VisibleTemplateAttribute.

Definition at line 1100 of file userattr.cpp.

01101 {
01102     PORTNOTETRACE("other","VisibleUserAttribute::Display - do nothing");
01103 #ifndef EXCLUDE_FROM_XARALX
01104     ERROR3IF(!((&Dialog)->IS_KIND_OF(TemplateDialog)), "Dialog isn't kind of TemplateDialog");
01105 
01106     TemplateDialog& BetterBeThisDialog = (TemplateDialog&)Dialog;
01107     BOOL Success = TRUE;
01108 
01109     Success = m_LongKey.Display(BetterBeThisDialog.GetKeyControl());
01110     if (Success)
01111     {
01112         Success = m_Value.Display(BetterBeThisDialog.GetValueControl());
01113     }
01114 
01115     return Success;
01116 #else
01117     return FALSE;
01118 #endif
01119 }

const StringBase & VisibleUserAttribute::GetKey  ) 
 

Definition at line 1009 of file userattr.cpp.

01010 {
01011     const StringBase& SourceString = (const StringBase&)m_LongKey;
01012 
01013     // Find the first bit of the long key
01014     INT32 EndDelimiterPosition = SourceString.FindNextChar(s_KeyDelimiter);
01015 
01016     if (EndDelimiterPosition < 0)
01017     {
01018         // couldn't find the end so the delimiter is beyond the end of the string
01019         EndDelimiterPosition = SourceString.Length();
01020     }
01021 
01022     const UINT32 LengthToCopy = EndDelimiterPosition;
01023     if (LengthToCopy > 0)
01024     {
01025         SourceString.Left(&m_Key, LengthToCopy);
01026     }
01027     else
01028     {
01029         TRACE( _T("VisibleUserAttribute::GetKey - no key\n"));
01030     }
01031 
01032     return m_Key;
01033 }

const StringBase & VisibleUserAttribute::GetLongKey  ) 
 

Definition at line 1035 of file userattr.cpp.

01036 {
01037     return m_LongKey;
01038 }

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

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Returns:
Some user visible text describing this VisibleUserAttribute

Implements VisibleAttribute.

Reimplemented in VisibleTemplateAttribute.

Definition at line 1074 of file userattr.cpp.

01075 {
01076     PORTNOTETRACE("other","VisibleUserAttribute::GetText - do nothing");
01077 #ifndef EXCLUDE_FROM_XARALX
01078     String_32 TruncatedKey((const StringBase&)m_LongKey);
01079     Description.MakeMsg(_R(IDS_APPLIED_CUSTOM), TruncatedKey);
01080 #endif
01081     return Description; 
01082 }

const StringBase & VisibleUserAttribute::GetValue  ) 
 

Definition at line 1040 of file userattr.cpp.

01041 {
01042     return m_Value;
01043 }

void VisibleUserAttribute::Hide  )  [virtual]
 

Hides this VisibleUserAttribute from the user.

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

Implements UserInterface.

Reimplemented in VisibleTemplateAttribute.

Definition at line 1171 of file userattr.cpp.

01172 {
01173     m_LongKey.Hide();
01174     m_Value.Hide();
01175 }

BOOL VisibleUserAttribute::Interact DialogOp Dialog  )  [virtual]
 

This allows the user to change this VisibleUserAttribute.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Notes: This function takes a DialopOp as its argument to determine where to put this object. Since this requires an internal knowledge of the DialogOp at the moment it is cast to a TemplateDialog which has the fields all ready. This is likely to change in the future.

Reimplemented from VisibleAttribute.

Reimplemented in VisibleTemplateAttribute.

Definition at line 1137 of file userattr.cpp.

01138 {
01139     PORTNOTETRACE("other","VisibleUserAttribute::Interact - do nothing");
01140 #ifndef EXCLUDE_FROM_XARALX
01141     if (!((&Dialog)->IS_KIND_OF(TemplateDialog)))
01142     {
01143         ERROR3("Dialog isn't kind of TemplateDialog");
01144         return FALSE;
01145     }
01146 
01147     TemplateDialog& BetterBeThisDialog = (TemplateDialog&)Dialog;
01148     
01149     if (IsNew())
01150     {
01151         BetterBeThisDialog.GetKeyControl().Enable();
01152     }
01153     BetterBeThisDialog.GetValueControl().Enable();
01154 
01155     return TRUE;
01156 #else
01157     return FALSE;
01158 #endif
01159 }

void VisibleUserAttribute::SetLongKey const StringBase NewKey  ) 
 

Definition at line 1003 of file userattr.cpp.

01004 {
01005     m_LongKey = NewKey;
01006 }

void VisibleUserAttribute::SetValue const StringBase NewValue  )  [inline]
 

Definition at line 157 of file visiattr.h.

00157 {   m_Value = NewValue; }


Member Data Documentation

String_64 VisibleUserAttribute::m_Key [private]
 

Definition at line 166 of file visiattr.h.

EditableText VisibleUserAttribute::m_LongKey [private]
 

Definition at line 167 of file visiattr.h.

EditableText VisibleUserAttribute::m_Value [private]
 

Definition at line 168 of file visiattr.h.


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