Ext.define('TXTextClass15', {
    extend:'DisplayableAction',
    constructor:function (cfgXML, o, actionSequence) {
        this.TextBox = null;
        this.Text = "";
        this.PictureBox = null;
        this.IsPictureVisible = false;
        this.PictureFileName = null;
        this.PictureWidth = 0;
        this.PictureHeight = 0;
        this.PictureX = 0;
        this.PictureY = 0;
        this.PicturePosition = AuthorAlignment.MiddleCenter;
        this.IsScrollBarVisible = false;
        this.callParent([cfgXML, o, actionSequence]);
        this.Text = XmlHelper.getString(cfgXML, "html");
        this.IsPictureVisible = XmlHelper.getBoolean(cfgXML, "isPictureVisible");
        var picFileNameNode = cfgXML.getElementsByTagName("pictureFileName")[0];
        try {
            this.PictureWidth = parseInt(picFileNameNode.getAttribute('width'));
            this.PictureHeight = parseInt(picFileNameNode.getAttribute('height'));
            this.PictureFileName = picFileNameNode.childNodes[0].nodeValue;
        }
        catch (err) {
        }
        this.PictureX = XmlHelper.getInteger(cfgXML, "pictureX");
        this.PictureY = XmlHelper.getInteger(cfgXML, "pictureY");
        this.PicturePosition = XmlHelper.getInteger(cfgXML, "picturePosition");
        this.IsScrollBarVisible = XmlHelper.tryGetValue(cfgXML, "isScrollBarVisible", TryGetValueOption.Boolean, false);
    },
    initializeDC:function (bg) {
        this.initializeDisplayComponent(bg);
        //initialize the pictureBox first
        if (this.IsPictureVisible) {
            this.PictureBox = this.ContentContainer.createChild({
                tag:'img',
                id:this.ObjectType + "-" + this.id + "-Picture",
                src:Author.resourcePath + this.PictureFileName,
                style:this.getPictureBoxStyle()
            })
        }
        var scrollCss = this.IsScrollBarVisible ? "scroll" : "hidden";
        var widthCss = 'width:' + (this.ContentContainerWidth) + 'px;';
        this.TextBox = this.ContentContainer.createChild({
            tag:'div',
            cls:'txtextcontent',
            id:this.ObjectType + "-" + this.id + "-TextBox",
            style:"position:absolute;left:0px;top:0px;width:100%;height:" + (this.ContentContainerHeight) + "px;overflow-x:hidden;overflow-y:" + scrollCss + "; " + (document.documentMode < 8 ? widthCss : ''),
            html:ExpressionEngine.replaceVariablesWithValue(this.Text)
        })
    },
    processAction:function (bg) {
        if (this.IsChangeAction) {
            Author.DisplayManager.changeAction(this);
        }
        this.initializeDC(bg);
        this.setInitialVisibility();
        this.applyEffect();
        return {MoveOn:true, Interval:0};
    }
});
TXTextClass15.borrow(TextClass15, ['getPictureBoxStyle']);








