int main(void) { Attributes attr; WORD result; printf("\f\t\tANSI Terminal Emulation Test\n"); printf( "\t\t============================\n\n\n"); setvbuf(stdin, NULL, _IONBF, 0); if ((result = GetAttributes(Heliosno(stdout), &attr)) < 0) { printf("Failed to get stdout attributes : %lx. Exiting.\n", result); exit((int)result); } printf("Window size : %d rows, %d columns.\n\n", attr.Min, attr.Time); rows = attr.Min; cols = attr.Time; AddAttribute(&attr, ConsoleRawOutput); RemoveAttribute(&attr, ConsolePause); RemoveAttribute(&attr, ConsoleEcho); if ((result = SetAttributes(Heliosno(stdout), &attr)) < 0) { printf("Failed to set stdout attributes : %lx. Exiting.\n", result); exit((int)result); } if ((result = GetAttributes(Heliosno(stdin), &attr)) < 0) { printf("Failed to get stdin attributes : %lx. Exiting.\n", result); exit((int)result); } AddAttribute(&attr, ConsoleRawInput); RemoveAttribute(&attr, ConsolePause); RemoveAttribute(&attr, ConsoleEcho); if ((result = SetAttributes(Heliosno(stdin), &attr)) < 0) { printf("Failed to set stdin attributes : %lx. Exiting.\n", result); exit((int) result); } wait_for_user(); main_menu(); printf("\r\n\n\n"); }
static bool EntityExists(const char* Path, u32 SubdirValue) { if (!Exists(Path)) return false; auto MaybeAttributes = GetAttributes(Path); if (!MaybeAttributes.has_value()) return false; return (MaybeAttributes.value().Attributes & Attributes::Subdir) == SubdirValue; }
BasicTool( N_BOOMERANG, fBasicSpeed, pfLocationRatio, fHeadingInDegrees, pfDimensions, pRasterGraphicName, deviceResources) { if (pRasterGraphicName != nullptr) // Raster graphics { m_pRenderable = new RasterGraphic(pRasterGraphicName, deviceResources); #ifdef SHOW_RAW_MASK_ZONES m_pRawMask = new VirtualMask(MaskTemplateRepository::GetInstance()->Get(pRasterGraphicName)); #endif // SHOW_RAW_MASK_ZONES m_pActualMask = new VirtualMask(MaskTemplateRepository::GetInstance()->Get(pRasterGraphicName)); } list<int> listAttributes; // A_LOCATION is part of Space. listAttributes.push_back(A_STRENGTH); listAttributes.push_back(A_BEING); listAttributes.push_back(A_ROTATION); m_pAttributes->AddAttributes(&listAttributes); int nStrength = 5; GetAttributes()->Modify(A_STRENGTH, A_STRENGTH_VALUE, &nStrength); bool bState = true; GetAttributes()->Modify(A_BEING, A_BEING_VALUE, &bState); float fRotation = 0.f; GetAttributes()->Modify(A_ROTATION, A_ROTATION_VALUE, &fRotation); m_nState = BOOMERANG_AWAY; m_fAngle_degrees = 0.0f; }
bool UGAAbilityBase::CheckAbilityAttributeCost() { for (int32 Idx = 0; Idx < AbilityAttributeCost.Num(); Idx++) { float ModValue = AbilityAttributeCost[Idx].GetSpecData()->AtributeModifier.Magnitude.GetFloatValue(DefaultContext); FGAAttribute Attribute = AbilityAttributeCost[Idx].GetSpecData()->AtributeModifier.Attribute; float AttributeVal = GetAttributes()->GetFloatValue(Attribute); if (ModValue > AttributeVal) return false; } return true; }
//--------------------------------------------------------------------------- // get the style attributes of the first character of the text // TFontStyles __fastcall TTaeTextAttributes::GetStyle(void) { TCharFormat Format; TFontStyles Result; GetAttributes(Format); if (Format.dwEffects & CFE_BOLD) Result = Result << fsBold; if (Format.dwEffects & CFE_ITALIC) Result = Result << fsItalic; if (Format.dwEffects & CFE_UNDERLINE) Result = Result << fsUnderline; if (Format.dwEffects & CFE_STRIKEOUT) Result = Result << fsStrikeOut; return Result; }
bool wxXmlNode::HasAttribute(const wxString& attrName) const { wxXmlAttribute *attr = GetAttributes(); while (attr) { if (attr->GetName() == attrName) return true; attr = attr->GetNext(); } return false; }
bool wxRichTextBackgroundPage::TransferDataToWindow() { wxRichTextAttr* attr = GetAttributes(); if (!attr->HasBackgroundColour()) { m_backgroundColourCheckBox->SetValue(false); m_backgroundColourSwatch->SetColour(*wxWHITE); } else { m_backgroundColourCheckBox->SetValue(true); m_backgroundColourSwatch->SetColour(attr->GetBackgroundColour()); } m_useShadow->SetValue(attr->GetTextBoxAttr().GetShadow().IsValid()); wxArrayInt units; units.Add(wxTEXT_ATTR_UNITS_PIXELS); units.Add(wxTEXT_ATTR_UNITS_TENTHS_MM); units.Add(wxTEXT_ATTR_UNITS_HUNDREDTHS_POINT); wxArrayInt percentUnits; percentUnits.Add(wxTEXT_ATTR_UNITS_PERCENTAGE); if (!attr->GetTextBoxAttr().GetShadow().GetOffsetX().IsValid()) attr->GetTextBoxAttr().GetShadow().GetOffsetX().SetValue(0, wxTEXT_ATTR_UNITS_PIXELS); if (!attr->GetTextBoxAttr().GetShadow().GetOffsetY().IsValid()) attr->GetTextBoxAttr().GetShadow().GetOffsetY().SetValue(0, wxTEXT_ATTR_UNITS_PIXELS); wxRichTextFormattingDialog::SetDimensionValue(attr->GetTextBoxAttr().GetShadow().GetOffsetX(), m_offsetX, m_unitsHorizontalOffset, NULL, & units); wxRichTextFormattingDialog::SetDimensionValue(attr->GetTextBoxAttr().GetShadow().GetOffsetY(), m_offsetY, m_unitsVerticalOffset, NULL, & units); wxRichTextFormattingDialog::SetDimensionValue(attr->GetTextBoxAttr().GetShadow().GetSpread(), m_spread, m_unitsShadowSpread, m_useShadowSpread, & units); wxRichTextFormattingDialog::SetDimensionValue(attr->GetTextBoxAttr().GetShadow().GetBlurDistance(), m_blurDistance, m_unitsBlurDistance, m_useBlurDistance, & units); wxRichTextFormattingDialog::SetDimensionValue(attr->GetTextBoxAttr().GetShadow().GetOpacity(), m_opacity, NULL, m_useShadowOpacity, & percentUnits); if (!attr->GetTextBoxAttr().GetShadow().HasColour() || !attr->GetTextBoxAttr().GetShadow().IsValid()) { m_shadowColourCheckBox->SetValue(false); m_shadowColourSwatch->SetColour(*wxWHITE); } else { m_shadowColourCheckBox->SetValue(true); m_shadowColourSwatch->SetColour(attr->GetTextBoxAttr().GetShadow().GetColour()); } return true; }
VError XWinFolder::IsHidden(bool &outIsHidden) { VError err; DWORD outAttrb; err=GetAttributes(&outAttrb); if(err==VE_OK) { outIsHidden= (outAttrb & FILE_ATTRIBUTE_HIDDEN) == FILE_ATTRIBUTE_HIDDEN; } return err; }
int VertexBuffer::GetVertexSize() { vector<VertexAttribute> attribs = GetAttributes(); int total_size = 0; for(unsigned int i = 0; i < attribs.size(); ++i) { VertexAttribute attrib = attribs[i]; if(attrib.type == Float) total_size += sizeof(float) * attrib.n_per_vertex; } return total_size; }
bool wxRichTextBackgroundPage::TransferDataFromWindow() { wxRichTextAttr* attr = GetAttributes(); if (m_backgroundColourCheckBox->GetValue()) { attr->SetBackgroundColour(m_backgroundColourSwatch->GetColour()); } else { attr->SetFlags(attr->GetFlags() & ~wxTEXT_ATTR_BACKGROUND_COLOUR); } return true; }
void Context::CopyBaseAttributes(StringHash baseType, StringHash derivedType) { const Vector<AttributeInfo>* baseAttributes = GetAttributes(baseType); if (baseAttributes) { for (unsigned i = 0; i < baseAttributes->Size(); ++i) { const AttributeInfo& attr = baseAttributes->At(i); attributes_[derivedType].Push(attr); if (attr.mode_ & AM_NET) networkAttributes_[derivedType].Push(attr); } } }
bool EC_DynamicComponent::ContainSameAttributes(const EC_DynamicComponent &comp) const { AttributeVector myAttributeVector = GetAttributes(); AttributeVector attributeVector = comp.GetAttributes(); if(attributeVector.size() != myAttributeVector.size()) return false; if(attributeVector.empty() && myAttributeVector.empty()) return true; std::sort(myAttributeVector.begin(), myAttributeVector.end(), &CmpAttributeByName); std::sort(attributeVector.begin(), attributeVector.end(), &CmpAttributeByName); AttributeVector::const_iterator iter1 = myAttributeVector.begin(); AttributeVector::const_iterator iter2 = attributeVector.begin(); while(iter1 != myAttributeVector.end() && iter2 != attributeVector.end()) { // Compare attribute names and type and if they mach continue iteration if not components aren't exactly the same. if((*iter1)->GetNameString() == (*iter2)->GetNameString() && (*iter1)->TypeName() == (*iter2)->TypeName()) { if(iter1 != myAttributeVector.end()) iter1++; if(iter2 != attributeVector.end()) iter2++; } else { return false; } } return true; /*// Get both attributes and check if they are holding exact number of attributes. AttributeVector myAttributeVector = GetAttributes(); AttributeVector attributeVector = comp.GetAttributes(); if(attributeVector.size() != myAttributeVector.size()) return false; // Compare that every attribute is same in both components. QSet<IAttribute*> myAttributeSet; QSet<IAttribute*> attributeSet; for(uint i = 0; i < myAttributeSet.size(); i++) { attributeSet.insert(myAttributeVector[i]); myAttributeSet.insert(attributeVector[i]); } if(attributeSet != myAttributeSet) return false; return true;*/ }
bool wxRichTextMarginsPage::TransferDataFromWindow() { // Margins wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMargins().GetLeft(), m_marginLeft, m_unitsMarginLeft, m_leftMarginCheckbox); wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMargins().GetTop(), m_marginTop, m_unitsMarginTop, m_topMarginCheckbox); wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMargins().GetRight(), m_marginRight, m_unitsMarginRight, m_rightMarginCheckbox); wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMargins().GetBottom(), m_marginBottom, m_unitsMarginBottom, m_bottomMarginCheckbox); // Padding wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetPadding().GetLeft(), m_paddingLeft, m_unitsPaddingLeft, m_leftPaddingCheckbox); wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetPadding().GetTop(), m_paddingTop, m_unitsPaddingTop, m_topPaddingCheckbox); wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetPadding().GetRight(), m_paddingRight, m_unitsPaddingRight, m_rightPaddingCheckbox); wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetPadding().GetBottom(), m_paddingBottom, m_unitsPaddingBottom, m_bottomPaddingCheckbox); return true; }
bool wxRichTextBackgroundPage::TransferDataFromWindow() { wxRichTextAttr* attr = GetAttributes(); if (m_backgroundColourCheckBox->GetValue()) { attr->SetBackgroundColour(m_backgroundColourSwatch->GetColour()); } else { attr->SetFlags(attr->GetFlags() & ~wxTEXT_ATTR_BACKGROUND_COLOUR); } if (!m_useShadow->GetValue()) attr->GetTextBoxAttr().GetShadow().Reset(); else { attr->GetTextBoxAttr().GetShadow().SetValid(true); wxArrayInt units; units.Add(wxTEXT_ATTR_UNITS_PIXELS); units.Add(wxTEXT_ATTR_UNITS_TENTHS_MM); units.Add(wxTEXT_ATTR_UNITS_HUNDREDTHS_POINT); wxArrayInt percentUnits; percentUnits.Add(wxTEXT_ATTR_UNITS_PERCENTAGE); wxRichTextFormattingDialog::GetDimensionValue(attr->GetTextBoxAttr().GetShadow().GetOffsetX(), m_offsetX, m_unitsHorizontalOffset, NULL, & units); wxRichTextFormattingDialog::GetDimensionValue(attr->GetTextBoxAttr().GetShadow().GetOffsetY(), m_offsetY, m_unitsVerticalOffset, NULL, & units); wxRichTextFormattingDialog::GetDimensionValue(attr->GetTextBoxAttr().GetShadow().GetSpread(), m_spread, m_unitsShadowSpread, m_useShadowSpread, & units); wxRichTextFormattingDialog::GetDimensionValue(attr->GetTextBoxAttr().GetShadow().GetBlurDistance(), m_blurDistance, m_unitsBlurDistance, m_useBlurDistance, & units); wxRichTextFormattingDialog::GetDimensionValue(attr->GetTextBoxAttr().GetShadow().GetOpacity(), m_opacity, NULL, m_useShadowOpacity, & percentUnits); if (m_shadowColourCheckBox->GetValue()) { attr->GetTextBoxAttr().GetShadow().SetColour(m_shadowColourSwatch->GetColour()); } else { attr->GetTextBoxAttr().GetShadow().SetFlags(attr->GetTextBoxAttr().GetShadow().GetFlags() & ~wxTEXT_BOX_ATTR_BORDER_COLOUR); } } return true; }
//--------------------------------------------------------------------------- // get the font pitch (default, fixed, or variable) for the first character // in the text // TFontPitch __fastcall TTaeTextAttributes::GetPitch(void) { TCharFormat Format; GetAttributes(Format); switch (Format.bPitchAndFamily & 0x03) { case DEFAULT_PITCH: return(fpDefault); case VARIABLE_PITCH: return fpVariable; case FIXED_PITCH: return fpFixed; } return fpDefault; }
/////////////////////////////////////////////////////////////////////////////// // finden eines Attributes einer Objektklasse HRESULT CArcViewAttributes::GetAttribute (INT_PTR lIdent, INT_PTR lMCode, os_string *pAttrName) { CArcViewLayerAttributes *pAttrMap = NULL; if (S_OK == GetAttributes (lIdent, &pAttrMap)) { CArcViewLayerAttributes::iterator it = pAttrMap -> find (lMCode); if (it != pAttrMap -> end()) { if (NULL != pAttrName) *pAttrName = (*it).second.GetName(); return S_OK; } } return S_FALSE; }
/* @method CreateSparse @discussion Create a SparseMatrix, based on the XML attributes. The object is returned by value. @throws KII_invalid_argument @param matElement pointer to Matrix XML element @result The SparseMatrix object. */ SparseMatrix MatrixFactory::CreateSparse(TiXmlElement* matElement) { string type; string init; int rows, columns; FLOAT multiplier; TiXmlHandle matHandle(matElement); GetAttributes(matElement, type, init, rows, columns, multiplier); #ifdef MDEBUG cerr << "Creating SparseMatrix with attributes: " << type << ", " << init << ", " << rows << "X" << columns << ", " << multiplier << endl; #endif if (type == "diag") { if (init == "none") { // a string of values is present & passed TiXmlText* valuesNode = matHandle.FirstChild().Text(); if (valuesNode == NULL) throw KII_invalid_argument("Contents not specified for Sparese Matrix with init='none'."); const char* values = valuesNode->Value(); #ifdef MDEBUG cerr << "\tData present for initialization: " << values << endl; #endif return SparseMatrix(rows, columns, multiplier, values); } else if (init == "const") { // No string of values or XML row data if (multiplier == 0.0) return SparseMatrix(rows, columns); else throw KII_invalid_argument("A sparse matrix can only be initialized to zero with const XML init"); } else throw KII_invalid_argument("Invalid init for sparse matrix"); } else if (type == "sparse") { if (init == "none") // a sequence of row data nodes is present & passed return SparseMatrix(rows, columns, multiplier, matElement); else if (init == "const") { // No row data if (multiplier == 0.0) return SparseMatrix(rows, columns); else throw KII_invalid_argument("A sparse matrix can only be initialized to zero with const XML init"); } else throw KII_invalid_argument("A sparse matrix can only be initialized to zero with const XML init"); } // If we get here, then something is really wrong throw KII_invalid_argument("Invalid type specified for sparse matrix."); }
bool wxRichTextBackgroundPage::TransferDataToWindow() { wxRichTextAttr* attr = GetAttributes(); if (!attr->HasBackgroundColour()) { m_backgroundColourCheckBox->SetValue(false); m_backgroundColourSwatch->SetColour(*wxWHITE); } else { m_backgroundColourCheckBox->SetValue(true); m_backgroundColourSwatch->SetColour(attr->GetBackgroundColour()); } return true; }
// Main int main () { char opentag[MAX_BUF]; Init(); // get the first tag name manually Match('<'); strncpy(opentag, tag(), MAX_BUF); GetAttributes(); if (Look == '/'){ Match('/'); Match('>'); } else { Match('>'); xml(opentag); } }
bool wxXmlNode::GetAttribute(const wxString& attrName, wxString *value) const { wxCHECK_MSG( value, false, "value argument must not be NULL" ); wxXmlAttribute *attr = GetAttributes(); while (attr) { if (attr->GetName() == attrName) { *value = attr->GetValue(); return true; } attr = attr->GetNext(); } return false; }
/// Transfer data from/to window bool wxRichTextTabsPage::TransferDataFromWindow() { wxPanel::TransferDataFromWindow(); wxRichTextAttr* attr = GetAttributes(); if (m_tabsPresent) { wxArrayInt tabs; size_t i; for (i = 0; i < m_tabListCtrl->GetCount(); i++) { tabs.Add(wxAtoi(m_tabListCtrl->GetString(i))); } attr->SetTabs(tabs); } return true; }
// This function creates a VectorMatrix from the given tinyxml Element // and its children. // // Input: // matElement: tinyxml DOM node containing a Matrix element // Postconditions" // If no problems, VectorMatrix object created and // initialized. // Returns: // VectorMatrix object (will be empty if some failure occurs). VectorMatrix MatrixFactory::CreateVector(TiXmlElement* matElement) { string type; string init; int rows, columns; FLOAT multiplier; string values; TiXmlHandle matHandle(matElement); GetAttributes(matElement, type, init, rows, columns, multiplier); #ifdef VDEBUG cerr << "Creating Vector with attributes: " << type << ", " << init << ", " << rows << "X" << columns << ", " << multiplier << endl; #endif // Get the Text node that contains the matrix values, if needed if (init == "none") { TiXmlText* valuesNode = matHandle.FirstChild().Text(); if (valuesNode == NULL) throw KII_invalid_argument("Contents not specified for Vector with init='none'."); values = valuesNode->Value(); #ifdef VDEBUG cerr << "\tData present for initialization: " << values << endl; #endif } else if (init == "implementation") throw KII_invalid_argument("MatrixFactory cannot create implementation-dependent Matrices; client program must perform creation"); if (type == "sparse") throw KII_invalid_argument("Sparse matrix requested in XML but CreateVector called"); if ((type == "complete") || (type == "diag")) { if ((rows > 1) && (columns > 1)) // Create a 2D Matrix throw KII_domain_error("Cannot create Vector with more than one dimension."); else // Create a 1D Matrix return VectorMatrix(type, init, rows, columns, multiplier, values); } else if (type == "sparse") throw KII_invalid_argument("No such thing as sparse Vectors"); else throw KII_invalid_argument("Illegal Vector type"); return VectorMatrix(); }
std::vector<int>* Observation::GetCollidingAttributes(Observation *t_observation) { std::vector<int>* returnedValue; int observationCount = GetAttributes().size(); if (observationCount != t_observation->GetAttributes().size()) return returnedValue; //sprawdzenie decyzji if ((this->GetAttributes())[observationCount - 1] == (t_observation->GetAttributes())[observationCount - 1]) return returnedValue; for (int i = 0; i < observationCount; i++) { if ((this->GetAttributes())[i] == (t_observation->GetAttributes())[i]) returnedValue->push_back(i); } return returnedValue; }
// --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // void CPosModulesSettings::CopyAttributesL( const CPosModulesSettings& aSource ) { CPosModuleIdList* list = aSource.GetInstalledListLC(); for (int i = 0; i < list->Count(); ++i) { TUid moduleId = (*list)[i]; TPosModuleAttributes attrSource, attrTarget; aSource.GetAttributes( moduleId, attrSource ); TInt err = GetAttributes( moduleId, attrTarget ); if ( !err ) { attrTarget.iAvailable = attrSource.iAvailable; attrTarget.iCost = attrSource.iCost; // visibility not copied SetAttributesL( moduleId, attrTarget ); } } CleanupStack::PopAndDestroy( list ); }
void CItem::UpdatePacket() { if (!m_pOwner || !m_pOwner->GetDesc()) return; TPacketGCItemUpdate pack; pack.header = HEADER_GC_ITEM_UPDATE; pack.Cell = TItemPos(GetWindow(), m_wCell); pack.count = m_dwCount; for (int i = 0; i < ITEM_SOCKET_MAX_NUM; ++i) pack.alSockets[i] = m_alSockets[i]; thecore_memcpy(pack.aAttr, GetAttributes(), sizeof(pack.aAttr)); sys_log(2, "UpdatePacket %s -> %s", GetName(), m_pOwner->GetName()); m_pOwner->GetDesc()->Packet(&pack, sizeof(pack)); }
void Context::CopyBaseAttributes(StringHash baseType, StringHash derivedType) { // Prevent endless loop if mistakenly copying attributes from same class as derived if (baseType == derivedType) { URHO3D_LOGWARNING("Attempt to copy base attributes to itself for class " + GetTypeName(baseType)); return; } const Vector<AttributeInfo>* baseAttributes = GetAttributes(baseType); if (baseAttributes) { for (unsigned i = 0; i < baseAttributes->Size(); ++i) { const AttributeInfo& attr = baseAttributes->At(i); attributes_[derivedType].Push(attr); if (attr.mode_ & AM_NET) networkAttributes_[derivedType].Push(attr); } } }
// --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // void CPosModulesSettings::SearchNewOldOrChangedL( const CPosModulesSettings& aOldSettings, RArray<TPosModulesEvent>& aEvents ) const { CPosModuleIdList* currentList = GetInstalledListLC(); CPosModuleIdList* oldList = aOldSettings.GetInstalledListLC(); // Search removed for ( TInt i = 0; i < oldList->Count(); i++ ) { TPositionModuleId id = (*oldList)[i]; if ( currentList->Find( id ) == KErrNotFound ) { AddEventL( id, EPosModulesEventModuleRemoved, aEvents ); } } // Search installed or changed for ( TInt i = 0; i < currentList->Count(); i++ ) { TPositionModuleId id = (*currentList)[i]; TPosModuleAttributes current; GetAttributes( id, current ); TPosModuleAttributes old; if ( aOldSettings.GetAttributes( id, old ) == KErrNotFound ) { AddEventL( id, EPosModulesEventModuleInstalled, aEvents ); } else { ComparePropertiesL( id, current, old, aEvents ); } } CleanupStack::PopAndDestroy( oldList ); CleanupStack::PopAndDestroy( currentList ); }
// <xml></xml> void xml (char * c) { char opentag[MAX_BUF]; // loop until we get the ending tag while (1){ if (Look!='<'){ // consume the stuff between the tags emptytag(); } else { // we found the start of a tag, consume it Match('<'); if (Look != '/') { // if we are an open tag strncpy(opentag, tag(), MAX_BUF); GetAttributes(); if (Look == '/'){ // self closing tag Match ('/'); Match ('>'); } else { // we just went in one more level // call yourself recursively // with the name of the closing tag to look for Match ('>'); xml (opentag); } } else { // else we are a closing tag Match('/'); // see if the close tag matches the open tag that was passed into the funtion. if (strcmp(c, tag())) { Expected("Matching Close Tag"); } Match('>'); return; } } } }
bool wxRichTextTabsPage::TransferDataToWindow() { wxPanel::TransferDataToWindow(); wxRichTextAttr* attr = GetAttributes(); m_tabListCtrl->Clear(); m_tabEditCtrl->SetValue(wxEmptyString); if (attr->HasTabs()) { m_tabsPresent = true; size_t i; for (i = 0; i < attr->GetTabs().GetCount(); i++) { wxString s(wxString::Format(wxT("%d"), attr->GetTabs()[i])); m_tabListCtrl->Append(s); } } return true; }
void XNODE::FormatContents( OUTPUTFORMATTER* out, int nestLevel ) { // output attributes first if they exist for( XATTR* attr = (XATTR*) GetAttributes(); attr; attr = (XATTR*) attr->GetNext() ) { out->Print( 0, " (%s %s)", TO_UTF8( attr->GetName() ), out->Quotew( attr->GetValue() ).c_str() ); } // we only expect to have used one of two types here: switch( GetType() ) { case wxXML_ELEMENT_NODE: // output children if they exist. for( XNODE* kid = (XNODE*) GetChildren(); kid; kid = (XNODE*) kid->GetNext() ) { if( kid->GetType() != wxXML_TEXT_NODE ) { if( kid == GetChildren() ) out->Print( 0, "\n" ); kid->Format( out, nestLevel+1 ); } else { kid->Format( out, 0 ); } } break; case wxXML_TEXT_NODE: out->Print( 0, " %s", out->Quotew( GetContent() ).c_str() ); break; default: ; // not supported } }