void UITextView::ConvertStaticMappings(NIBWriter *writer, XIBObject *obj) { if ( _shadowOffset.width != 0.0 || _shadowOffset.height != 0.0 ) obj->AddSize(writer, "UIShadowOffset", _shadowOffset); if ( _text ) obj->AddString(writer, "UIText", _text); if ( !_editable ) AddBool(writer, "UIEditable", _editable); if ( _dataDetectorTypes ) AddInt(writer, "UIDataDetectorTypes", _dataDetectorTypes); if ( _autoCorrectionType ) AddInt(writer, "UIAutocorrectionType", _autoCorrectionType); if ( _returnKeyType ) AddInt(writer, "UIReturnKeyType", _returnKeyType); if ( _textColor && !_textColor->isNil() ) { obj->AddOutputMember(writer, "UITextColor", _textColor); } else { UIColor *color = new UIColor(4, 4, 0.0f, 0.0f, 0.0f, 1.0f, "whiteColor"); obj->AddOutputMember(writer, "UITextColor", color->CreateObject(writer)); } if ( _font ) obj->AddOutputMember(writer, "UIFont", _font); AddOutputMember(writer, "UIMinimumScaleFactor", new XIBObjectFloat(1.0f)); CGSize size; size.width = getFrame().width; size.height = getFrame().height; AddSize(writer, "UIContentSize", size); AddInt(writer, "UITextAlignment", _textAlignment); if ( !_subviews ) { _subviews = new XIBArray(); _subviews->_className = "NSMutableArray"; } Map(writer, obj, propertyMappings, numPropertyMappings); UIScrollView::ConvertStaticMappings(writer, obj); }
void UILabel::ConvertStaticMappings(NIBWriter *writer, XIBObject *obj) { if ( _shadowOffset.width != 0.0 || _shadowOffset.height != 0.0 ) obj->AddSize(writer, "UIShadowOffset", _shadowOffset); if ( _text ) obj->AddString(writer, "UIText", _text); if ( _textColor ) { obj->AddOutputMember(writer, "UITextColor", _textColor); } else { UIColor *color = new UIColor(4, 4, 0.0f, 0.0f, 0.0f, 1.0f, "whiteColor"); obj->AddOutputMember(writer, "UITextColor", color->CreateObject(writer)); } if ( _highlightedColor ) { obj->AddOutputMember(writer, "UIHighlightedColor", _textColor); } AddOutputMember(writer, "UIMinimumScaleFactor", new XIBObjectFloat(1.0f)); if ( _textAlignment != 0 ) AddInt(writer, "UITextAlignment", _textAlignment); if ( _numberOfLines != 1 ) AddInt(writer, "UINumberOfLines", _numberOfLines); if ( _baselineAdjustment != 0 ) AddInt(writer, "UIBaselineAdjustment", _baselineAdjustment); if ( _numberOfLines == 1 ) { if ( _adjustsFontSizeToFit ) AddBool(writer, "UIAdjustsFontSizeToFit", _adjustsFontSizeToFit); if ( _minimumFontSize != -1.0f ) AddOutputMember(writer, "UIMinimumFontSize", new XIBObjectFloat(_minimumFontSize)); } if ( _font ) AddOutputMember(writer, "UIFont", _font); Map(writer, obj, propertyMappings, numPropertyMappings); UIView::ConvertStaticMappings(writer, obj); }
XIBObject *GetButtonContent(NIBWriter *writer, XIBObject *obj, char *mode) { XIBObject *buttonContent = new XIBObject(); buttonContent->_className = "UIButtonContent"; buttonContent->_outputClassName = "UIButtonContent"; buttonContent->_needsConversion = false; char szName[255]; XIBObject *findObj; sprintf(szName, "IBUI%sTitle", mode); findObj = obj->FindMember(szName); if ( findObj ) { buttonContent->AddOutputMember(writer, "UITitle", findObj); } sprintf(szName, "IBUI%sImage", mode); findObj = obj->FindMember(szName); if ( findObj ) { buttonContent->AddOutputMember(writer, "UIImage", findObj); } sprintf(szName, "IBUI%sBackgroundImage", mode); findObj = obj->FindMember(szName); if ( findObj ) { buttonContent->AddOutputMember(writer, "UIBackgroundImage", findObj); } sprintf(szName, "IBUI%sTitleShadowColor", mode); findObj = obj->FindMember(szName); if ( findObj ) { buttonContent->AddOutputMember(writer, "UIShadowColor", findObj); } sprintf(szName, "IBUI%sTitleColor", mode); findObj = obj->FindMember(szName); if ( findObj ) { buttonContent->AddOutputMember(writer, "UITitleColor", findObj); } else { if ( strcmp(mode, "Normal") != 0 && buttonContent->_outputMembers.size() > 0 ) { //findObj = obj->FindMember("IBUINormalTitleColor"); //buttonContent->AddOutputMember(writer, "UITitleColor", findObj); } else if ( strcmp(mode, "Normal") == 0 ) { UIColor *color = new UIColor(4, 4, 0.0f, 0.0f, 0.0f, 0.0f, "whiteColor"); buttonContent->AddOutputMember(writer, "UITitleColor", color->CreateObject(writer)); } } return buttonContent; }
void UITextField::ConvertStaticMappings(NIBWriter* writer, XIBObject* obj) { if (_shadowOffset.width != 0.0 || _shadowOffset.height != 0.0) { obj->AddSize(writer, "UIShadowOffset", _shadowOffset); } if (_text) { obj->AddString(writer, "UIText", _text); } if (_placeholder) { obj->AddString(writer, "UIPlaceholder", _placeholder); } if (_borderStyle != 0) { obj->AddInt(writer, "UIBorderStyle", _borderStyle); } if (_font) { AddOutputMember(writer, "UIFont", _font); } if (_textColor && !_textColor->isNil()) { obj->AddOutputMember(writer, "UITextColor", _textColor); } else { UIColor* color = new UIColor(4, 4, 0.0f, 0.0f, 0.0f, 1.0f, "whiteColor"); obj->AddOutputMember(writer, "UITextColor", color->CreateObject(writer)); } if (_autoCorrectionType) { AddInt(writer, "UIAutocorrectionType", _autoCorrectionType); } if (_returnKeyType) { AddInt(writer, "UIReturnKeyType", _returnKeyType); } if (_clearsOnBeginEditing) { AddBool(writer, "UIClearsOnBeginEditing", _clearsOnBeginEditing); } if (_clearButtonOffset.width != 0.0f || _clearButtonOffset.height != 0.0f) { AddSize(writer, "UIClearButtonOffset", _clearButtonOffset); } AddOutputMember(writer, "UIMinimumScaleFactor", new XIBObjectFloat(1.0f)); Map(writer, obj, propertyMappings, numPropertyMappings); UIControl::ConvertStaticMappings(writer, obj); }