Esempio n. 1
0
        //protected sAttributeListbox pAttr;

        public sGraphicListbox(sAttributeListbox attr)
            : base(attr)
        {
            pAttr = attr;
        }
Esempio n. 2
0
        public sAttributeWidget(sAttribute parent, XmlNode node)
            : base(parent, node)
        {
            if (node.Attributes["source"] != null)
                pSource = node.Attributes["source"].Value;

            if (node.Attributes["render"] != null)
                pRender = node.Attributes["render"].Value;

            if (pRender == null)
            {
                if (node.Attributes["pixmap"] != null)
                    pRender = "Pixmap";
                else if (pName == "menu" || pName == "list" || pName.EndsWith("list")) //depreceated
                    pRender = "Listbox";
                else if (pName == "PositionGauge") //depreceated
                    pRender = "PositionGauge";
                else if (node.Attributes["pointer"] != null)
                    pRender = "PositionGauge";
                else
                    pRender = "Label";
            }

            if (pRender.ToLower() == "label" || pRender.ToLower() == "fixedlabel")
            {
                pLabel = new sAttributeLabel(parent, node);
            }
            else if (pRender.ToLower() == "pixmap")
            {
                pPixmap = new sAttributePixmap(parent, node);
            }
            else if (pRender.ToLower() == "progress")
            {
                pProgress = new sAttributeProgress(parent, node);
            }
            else if (pRender.ToLower() == "listbox")
            {
                pListbox = new sAttributeListbox(parent, node);
            }

            if (pSource != null && pSource.Length > 0)
            {
                String text = cPreviewText.getText(parent.Name, pSource);
                if (text.Length > 0)
                {
                    if (pLabel != null && (pLabel.pText == null || pLabel.pText.Length == 0))
                        pLabel.pPreviewText = text;
                    if (pListbox != null)
                        pListbox.pPreviewEntries = text.Split('|');
                }
            }

            if (node.HasChildNodes)
            {
                foreach (XmlNode nodeConverter in node.ChildNodes)
                {
                    if (nodeConverter.Attributes != null)
                    {
                        String type = nodeConverter.Attributes["type"].Value;
                        String parameter = nodeConverter.InnerText;

                        String text = cConverter.getText(pSource, type, parameter);
                        if (text != null)
                        {
                            if (pLabel != null)
                            {
                                if (text.Length > 0 && (pLabel.pText == null || pLabel.pText.Length <= 0))
                                    pLabel.pPreviewText = text;

                                if (text == "MAGIC#TRUE")
                                {
                                    //pLabel.pText = "";
                                }
                                else if (text == "MAGIC#FALSE")
                                {
                                    pLabel.pPreviewText = "";
                                }
                            }
                            else if (pPixmap != null)
                            {
                                if (text == "MAGIC#TRUE")
                                {
                                    //pLabel.pText = "";
                                }
                                else if (text == "MAGIC#FALSE")
                                {
                                    pPixmap.pPixmap = new Size(0, 0);
                                    pPixmap.pHide = true;
                                }
                            }
                        }
                    }
                }
                
                cConverter.reset();
            }
            else
            {
                if (pSource != null)
                {
                    if (pSource.ToLower() == "title")
                    {
                        if (parent is sAttributeScreen)
                        {
                            if (pLabel != null)
                                pLabel.pPreviewText = ((sAttributeScreen)parent).pTitle;
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        public sAttributeWidget(sAttribute parent, XmlNode node)
            : base(parent, node)
        {
            if (node.Attributes["source"] != null)
            {
                pSource = node.Attributes["source"].Value;
            }

            if (node.Attributes["render"] != null)
            {
                pRender = node.Attributes["render"].Value;
            }

            if (pRender == null)
            {
                if (node.Attributes["pixmap"] != null)
                {
                    pRender = "Pixmap";
                }
                else if (pName == "menu" || pName == "list" || pName.EndsWith("list")) //depreceated
                {
                    pRender = "Listbox";
                }
                else if (pName == "PositionGauge") //depreceated
                {
                    pRender = "PositionGauge";
                }
                else if (node.Attributes["pointer"] != null)
                {
                    pRender = "PositionGauge";
                }
                else
                {
                    pRender = "Label";
                }
            }

            if (pRender.ToLower() == "label" || pRender.ToLower() == "fixedlabel")
            {
                pLabel = new sAttributeLabel(parent, node);
            }
            else if (pRender.ToLower() == "pixmap")
            {
                pPixmap = new sAttributePixmap(parent, node);
            }
            else if (pRender.ToLower() == "progress")
            {
                pProgress = new sAttributeProgress(parent, node);
            }
            else if (pRender.ToLower() == "listbox")
            {
                pListbox = new sAttributeListbox(parent, node);
            }

            if (pSource != null && pSource.Length > 0)
            {
                String text = cPreviewText.getText(parent.Name, pSource);
                if (text.Length > 0)
                {
                    if (pLabel != null && (pLabel.pText == null || pLabel.pText.Length == 0))
                    {
                        pLabel.pPreviewText = text;
                    }
                    if (pListbox != null)
                    {
                        pListbox.pPreviewEntries = text.Split('|');
                    }
                }
            }

            if (node.HasChildNodes)
            {
                foreach (XmlNode nodeConverter in node.ChildNodes)
                {
                    if (nodeConverter.Attributes != null)
                    {
                        String type      = nodeConverter.Attributes["type"].Value;
                        String parameter = nodeConverter.InnerText;

                        String text = cConverter.getText(pSource, type, parameter);
                        if (text != null)
                        {
                            if (pLabel != null)
                            {
                                if (text.Length > 0 && (pLabel.pText == null || pLabel.pText.Length <= 0))
                                {
                                    pLabel.pPreviewText = text;
                                }

                                if (text == "MAGIC#TRUE")
                                {
                                    //pLabel.pText = "";
                                }
                                else if (text == "MAGIC#FALSE")
                                {
                                    pLabel.pPreviewText = "";
                                }
                            }
                            else if (pPixmap != null)
                            {
                                if (text == "MAGIC#TRUE")
                                {
                                    //pLabel.pText = "";
                                }
                                else if (text == "MAGIC#FALSE")
                                {
                                    pPixmap.pPixmap = new Size(0, 0);
                                    pPixmap.pHide   = true;
                                }
                            }
                        }
                    }
                }

                cConverter.reset();
            }
            else
            {
                if (pSource != null)
                {
                    if (pSource.ToLower() == "title")
                    {
                        if (parent is sAttributeScreen)
                        {
                            if (pLabel != null)
                            {
                                pLabel.pPreviewText = ((sAttributeScreen)parent).pTitle;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 4
0
        //protected sAttributeListbox pAttr;

        public sGraphicListbox(sAttributeListbox attr)
            : base(attr)
        {
            pAttr = attr;
        }