#include <ngsentry.h>
Inheritance diagram for NodeBarProperty:
Public Member Functions | |
NodeBarProperty () | |
See Node::GetDebugDetails See Node::ShowDebugTreeDetails Default constructor for a NodeBarProperty, which retains bar attributes in an undoable storage. | |
NodeBarProperty (Node *pContext, AttachNodeDirection eDir) | |
Constructor for a NodeBarProperty, which retains bar attributes in an undoable storage. | |
size_t | HowMany () const |
void | Clear () |
BarDataType & | Bar (INT32 n) |
Read the bars property. | |
const BarDataType & | Bar (INT32 n) const |
size_t | Add (const BarDataType &bdt) |
Appends the given property to the end of the array of bar properties. | |
BOOL | MakeChange (INT32 n, const BarDataType &bdt) |
Creates a duplicate of this node and then hides this node, writing the given changes into the duplicate. | |
virtual Node * | SimpleCopy () |
See Node::SimpleCopy. | |
virtual void | PolyCopyNodeContents (NodeRenderable *pNodeCopy) |
Polymorphically copies the contents of this node to another. | |
Protected Member Functions | |
virtual UINT32 | GetNodeSize () const |
See Node::GetNodeSize. | |
void | CopyNodeContents (NodeBarProperty *pCopy) |
See Node::SimpleCopy. | |
virtual BOOL | WritePreChildrenNative (BaseCamelotFilter *) |
Writes out a bar property record. | |
virtual BOOL | CanWriteChildrenWeb (BaseCamelotFilter *) |
Prevents children of the sentinel being written out in the web format. | |
virtual BOOL | WritePreChildrenWeb (BaseCamelotFilter *) |
Web files don't write out SetSentinel records. This code assumes the document will only contain one SetSentinel. | |
virtual BOOL | WriteBeginChildRecordsWeb (BaseCamelotFilter *) |
Begins the child record sequence for SetSentinel in the web format. Web export doesn't write out SetSentinel records or children of the sentinel, so this overrides the default behaviour in Node by ensuring the DOWN record does not get written. | |
virtual BOOL | WriteEndChildRecordsWeb (BaseCamelotFilter *) |
Ends the child record sequence for SetSentinel in the web format. Web export doesn't write out SetSentinel records or children of the sentinel, so this overrides the default behaviour in Node by ensuring the UP record does not get written. | |
Private Member Functions | |
CC_DECLARE_DYNAMIC (NodeBarProperty) | |
Private Attributes | |
std::vector< BarDataType > | m_vecBars |
size_t | m_nCount |
BarDataType | m_NoBar |
Definition at line 192 of file ngsentry.h.
|
See Node::GetDebugDetails See Node::ShowDebugTreeDetails Default constructor for a NodeBarProperty, which retains bar attributes in an undoable storage.
Definition at line 579 of file ngsentry.cpp. 00580 : m_nCount(0) 00581 { 00582 m_vecBars.reserve(MAX_BAR_PROPERTIES); 00583 00584 m_NoBar.IsLive = TRUE; 00585 }
|
|
Constructor for a NodeBarProperty, which retains bar attributes in an undoable storage.
Definition at line 600 of file ngsentry.cpp. 00601 : Node(pContext, eDir), 00602 m_nCount(0) 00603 { 00604 m_vecBars.reserve(MAX_BAR_PROPERTIES); 00605 }
|
|
Appends the given property to the end of the array of bar properties.
Definition at line 644 of file ngsentry.cpp. 00645 { 00646 // Test for overflow. 00647 if (HowMany() >= MAX_BAR_PROPERTIES) 00648 { 00649 ERROR3("NodeBarProperty::Add: array overflow"); 00650 return UINT_MAX; 00651 } 00652 00653 // Append to the end. 00654 m_vecBars[m_nCount] = bdt; 00655 return m_nCount++; 00656 }
|
|
Definition at line 623 of file ngsentry.cpp.
|
|
Read the bars property.
Definition at line 615 of file ngsentry.cpp.
|
|
Prevents children of the sentinel being written out in the web format.
Reimplemented from Node. Definition at line 839 of file ngsentry.cpp. 00840 { 00841 return FALSE; 00842 }
|
|
|
|
Definition at line 202 of file ngsentry.h. 00202 { m_nCount = 0; }
|
|
See Node::SimpleCopy.
Definition at line 742 of file ngsentry.cpp. 00743 { 00744 ERROR3IF(pCopy == 0, "NodeBarProperty::CopyNodeContents: null input"); 00745 Node::CopyNodeContents(pCopy); 00746 00747 // copy over the data of the first count bars 00748 for( size_t i = 0; i < m_nCount; i++ ) 00749 pCopy->m_vecBars[i] = m_vecBars[i]; 00750 00751 pCopy->m_nCount = m_nCount; 00752 }
|
|
See Node::GetNodeSize.
Reimplemented from Node. Definition at line 704 of file ngsentry.cpp.
|
|
Definition at line 201 of file ngsentry.h. 00201 { return m_nCount; }
|
|
Creates a duplicate of this node and then hides this node, writing the given changes into the duplicate.
Definition at line 673 of file ngsentry.cpp. 00674 { 00675 PORTNOTETRACE("dialog","NodeBarProperty::MakeChange - do nothing"); 00676 #ifndef EXCLUDE_FROM_XARALX 00677 // Package up the parameters into an OpParam. 00678 OpChangeBarPropParam prm; 00679 prm.m_nIndex = n; 00680 prm.m_pbdtInfo = &bdt; 00681 prm.m_Prop = this; 00682 00683 // Call the op to duplicate and hide this node. 00684 OpDescriptor* pDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_CHANGE_BAR_PROPERTY); 00685 ERROR3IF(pDesc == 0, "NodeBarProperty::MakeChange: can't find descriptor"); 00686 pDesc->Invoke(&prm); 00687 return TRUE; 00688 #else 00689 return FALSE; 00690 #endif 00691 }
|
|
Polymorphically copies the contents of this node to another.
Definition at line 768 of file ngsentry.cpp. 00769 { 00770 ENSURE(pNodeCopy, "Trying to copy a node's contents into a NULL node"); 00771 ENSURE(IS_A(pNodeCopy, NodeBarProperty), "PolyCopyNodeContents given wrong dest node type"); 00772 00773 if (IS_A(pNodeCopy, NodeBarProperty)) 00774 CopyNodeContents((NodeBarProperty*)pNodeCopy); 00775 }
|
|
See Node::SimpleCopy.
Reimplemented from Node. Definition at line 723 of file ngsentry.cpp. 00724 { 00725 NodeBarProperty* pCopy = new NodeBarProperty; 00726 ERRORIF(pCopy == 0, _R(IDE_NOMORE_MEMORY), 0); 00727 CopyNodeContents(pCopy); 00728 return pCopy; 00729 }
|
|
Begins the child record sequence for SetSentinel in the web format. Web export doesn't write out SetSentinel records or children of the sentinel, so this overrides the default behaviour in Node by ensuring the DOWN record does not get written.
Reimplemented from Node. Definition at line 877 of file ngsentry.cpp. 00878 { 00879 return TRUE; 00880 }
|
|
Ends the child record sequence for SetSentinel in the web format. Web export doesn't write out SetSentinel records or children of the sentinel, so this overrides the default behaviour in Node by ensuring the UP record does not get written.
Reimplemented from Node. Definition at line 897 of file ngsentry.cpp. 00898 { 00899 return TRUE; 00900 }
|
|
Writes out a bar property record.
Reimplemented from Node. Definition at line 789 of file ngsentry.cpp. 00790 { 00791 #ifdef DO_EXPORT 00792 // Write out the SetProperty record header. 00793 CXaraFileRecord rec(TAG_BARPROPERTY, TAG_BARPROPERTY_SIZE); 00794 if (!rec.Init() || !rec.WriteINT32(HowMany())) 00795 { 00796 pFilter->GotError(_R(IDE_FILE_WRITE_ERROR)); 00797 return FALSE; 00798 } 00799 00800 // Write out each property in ascending index order. 00801 for (UINT32 i = 0; i < HowMany(); i++) 00802 { 00803 const BarDataType& bdt = Bar(i); 00804 BYTE nCode = bdt.IsLive | 00805 (bdt.IsHorizontal << 1) | 00806 (bdt.RequiresShuffle << 2) | 00807 (bdt.ButtonsExtend << 3) | 00808 (bdt.ButtonsScale << 4) | 00809 (bdt.GroupsStretch << 5); 00810 00811 if (!rec.WriteINT32(bdt.Spacing) || !rec.WriteBYTE(nCode) || !rec.WriteBYTE(bdt.SameSize)) 00812 { 00813 pFilter->GotError(_R(IDE_FILE_WRITE_ERROR)); 00814 return FALSE; 00815 } 00816 } 00817 00818 // We've built up a record, now write it out. 00819 UINT32 r = pFilter->Write(&rec); 00820 if (r == 0) pFilter->GotError(_R(IDE_FILE_WRITE_ERROR)); 00821 return (BOOL) r; 00822 #else 00823 return FALSE; 00824 #endif 00825 }
|
|
Web files don't write out SetSentinel records. This code assumes the document will only contain one SetSentinel.
Reimplemented from Node. Definition at line 857 of file ngsentry.cpp. 00858 { 00859 return FALSE; 00860 }
|
|
Definition at line 235 of file ngsentry.h. |
|
Definition at line 236 of file ngsentry.h. |
|
Definition at line 234 of file ngsentry.h. |