/*! * Set the horizontal alignment with the given \a align. */ void Format::setHorizontalAlignment(HorizontalAlignment align) { if (hasProperty(FormatPrivate::P_Alignment_Indent) &&(align != AlignHGeneral && align != AlignLeft && align != AlignRight && align != AlignHDistributed)) { clearProperty(FormatPrivate::P_Alignment_Indent); } if (hasProperty(FormatPrivate::P_Alignment_ShinkToFit) && (align == AlignHFill || align == AlignHJustify || align == AlignHDistributed)) { clearProperty(FormatPrivate::P_Alignment_ShinkToFit); } setProperty(FormatPrivate::P_Alignment_AlignH, align, AlignHGeneral); }
/*! * Enable the text wrap if \a wrap is true. */ void Format::setTextWarp(bool wrap) { if (wrap && hasProperty(FormatPrivate::P_Alignment_ShinkToFit)) clearProperty(FormatPrivate::P_Alignment_ShinkToFit); setProperty(FormatPrivate::P_Alignment_Wrap, wrap, false); }
/*! * Set number \a format. * http://office.microsoft.com/en-001/excel-help/create-a-custom-number-format-HP010342372.aspx */ void Format::setNumberFormat(const QString &format) { if (format.isEmpty()) return; setProperty(FormatPrivate::P_NumFmt_FormatCode, format); clearProperty(FormatPrivate::P_NumFmt_Id); //numFmt id must be re-generated. }
void SettingsSector::setPropertyValueList(const MyGUI::UString& _propertyName, const VectorUString& _propertyValues) { clearProperty(_propertyName); for (size_t index = 0; index < _propertyValues.size(); ++ index) setPropertyValueImpl(MyGUI::utility::toString(_propertyName, '.', index), _propertyValues[index]); eventSettingsChanged(this, _propertyName); }
/*! * Turn on/off shrink to fit base on \a shink. */ void Format::setShrinkToFit(bool shink) { if (shink && hasProperty(FormatPrivate::P_Alignment_Wrap)) clearProperty(FormatPrivate::P_Alignment_Wrap); if (shink && hasProperty(FormatPrivate::P_Alignment_AlignH)) { HorizontalAlignment hl = horizontalAlignment(); if (hl == AlignHFill || hl == AlignHJustify || hl == AlignHDistributed) setHorizontalAlignment(AlignLeft); } setProperty(FormatPrivate::P_Alignment_ShinkToFit, shink, false); }
/*! * Set the number format identifier. The \a format * must be a valid built-in number format identifier * or the identifier of a custom number format. */ void Format::setNumberFormatIndex(int format) { setProperty(FormatPrivate::P_NumFmt_Id, format); clearProperty(FormatPrivate::P_NumFmt_FormatCode); }