Exemplo n.º 1
0
        public sAttributeListbox(sAttribute parent, XmlNode node)
            : base(parent, node)
        {
            if (node.Attributes["backgroundColor"] != null)
            {
                pListboxBackgroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            }
            else
            {
                pListboxBackgroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxBackground"];
            }

            if (node.Attributes["foregroundColor"] != null)
            {
                pListboxForegroundColor = (sColor)cDataBase.pColors.get(node.Attributes["foregroundColor"].Value);
            }
            else
            {
                pListboxForegroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxForeground"];
            }


            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxSelectedBackgroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxSelectedBackgroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxSelectedBackground"];

            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxSelectedForegroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxSelectedForegroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxSelectedForeground"];


            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxMarkedBackgroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxMarkedBackgroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxMarkedBackground"];

            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxMarkedForegroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxMarkedForegroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxMarkedForeground"];


            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxMarkedAndSelectedBackgroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxMarkedAndSelectedBackgroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxMarkedAndSelectedBackground"];

            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxMarkedAndSelectedForegroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxMarkedAndSelectedForegroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxMarkedAndSelectedForeground"];


            if (node.Attributes["backgroundPixmap"] != null)
            {
                pBackgroundPixmapName = node.Attributes["backgroundPixmap"].Value;
                try
                {
                    pBackgroundPixmap = Image.FromFile(cDataBase.getPath(pBackgroundPixmapName));
                }
                catch (FileNotFoundException)
                {
                    pBackgroundPixmap = null;
                }
            }
            if (node.Attributes["selectionPixmap"] != null)
            {
                pSelectionPixmapName = node.Attributes["selectionPixmap"].Value;
                try
                {
                    pSelectionPixmap = Image.FromFile(cDataBase.getPath(pSelectionPixmapName));
                }
                catch (FileNotFoundException)
                {
                    pSelectionPixmap = null;
                }
            }

            if (myNode.Attributes["scrollbarMode"] != null)
            {
                pScrollbarMode = myNode.Attributes["scrollbarMode"].Value.ToLower() == "showAlways".ToLower() ? cProperty.eScrollbarMode.showAlways :
                                 myNode.Attributes["scrollbarMode"].Value.ToLower() == "showOnDemand".ToLower() ? cProperty.eScrollbarMode.showOnDemand :
                                 cProperty.eScrollbarMode.showNever;
            }

            sWindowStyle style = (sWindowStyle)cDataBase.pWindowstyles.get();

            sWindowStyle.sBorderSet borderset = (sWindowStyle.sBorderSet)style.pBorderSets["bsListboxEntry"];

            if (borderset != null)
            {
                if (borderset.pbpTopLeftName.Length > 0)
                {
                    pbpTopLeftName = borderset.pbpTopLeftName;
                    pbpTopLeft     = borderset.pbpTopLeft;
                }
                if (borderset.pbpTopName.Length > 0)
                {
                    pbpTopName = borderset.pbpTopName;
                    pbpTop     = borderset.pbpTop;
                }
                if (borderset.pbpTopRightName.Length > 0)
                {
                    pbpTopRightName = borderset.pbpTopRightName;
                    pbpTopRight     = borderset.pbpTopRight;
                }


                if (borderset.pbpLeftName.Length > 0)
                {
                    pbpLeftName = borderset.pbpLeftName;
                    pbpLeft     = borderset.pbpLeft;
                }
                if (borderset.pbpRightName.Length > 0)
                {
                    pbpRightName = borderset.pbpRightName;
                    pbpRight     = borderset.pbpRight;
                }


                if (borderset.pbpBottomLeftName.Length > 0)
                {
                    pbpBottomLeftName = borderset.pbpBottomLeftName;
                    pbpBottomLeft     = borderset.pbpBottomLeft;
                }
                if (borderset.pbpBottomName.Length > 0)
                {
                    pbpBottomName = borderset.pbpBottomName;
                    pbpBottom     = borderset.pbpBottom;
                }
                if (borderset.pbpBottomRightName.Length > 0)
                {
                    pbpBottomRightName = borderset.pbpBottomRightName;
                    pbpBottomRight     = borderset.pbpBottomRight;
                }
            }


            if (node.Attributes["itemHeight"] != null)
            {
                pItemHeight = Convert.ToInt32(node.Attributes["itemHeight"].Value.Trim());
            }
            else
            {
                pItemHeight = 20;
            }


            String entries = cPreviewText.getText(parent.Name, Name);

            if (entries.Length > 0)
            {
                pPreviewEntries = entries.Split('|');
            }
        }
Exemplo n.º 2
0
        public sAttributeListbox(sAttribute parent, XmlNode node)
            : base(parent, node)
        {

            if (node.Attributes["backgroundColor"] != null)
                pListboxBackgroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            else
                pListboxBackgroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxBackground"];

            if (node.Attributes["foregroundColor"] != null)
                pListboxForegroundColor = (sColor)cDataBase.pColors.get(node.Attributes["foregroundColor"].Value);
            else
                pListboxForegroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxForeground"];


            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxSelectedBackgroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxSelectedBackgroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxSelectedBackground"];

            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxSelectedForegroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxSelectedForegroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxSelectedForeground"];


            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxMarkedBackgroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxMarkedBackgroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxMarkedBackground"];

            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxMarkedForegroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxMarkedForegroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxMarkedForeground"];


            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxMarkedAndSelectedBackgroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxMarkedAndSelectedBackgroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxMarkedAndSelectedBackground"];

            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxMarkedAndSelectedForegroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxMarkedAndSelectedForegroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxMarkedAndSelectedForeground"];


            if (node.Attributes["backgroundPixmap"] != null)
            {
                pBackgroundPixmapName = node.Attributes["backgroundPixmap"].Value;
                try
                {
                    pBackgroundPixmap = Image.FromFile(cDataBase.getPath(pBackgroundPixmapName));
                }
                catch (FileNotFoundException)
                {
                    pBackgroundPixmap = null;
                }
            }
            if (node.Attributes["selectionPixmap"] != null)
            {
                pSelectionPixmapName = node.Attributes["selectionPixmap"].Value;
                try
                {
                    pSelectionPixmap = Image.FromFile(cDataBase.getPath(pSelectionPixmapName));
                }
                catch (FileNotFoundException)
                {
                    pSelectionPixmap = null;
                }
            }

            if (myNode.Attributes["scrollbarMode"] != null)
                pScrollbarMode = myNode.Attributes["scrollbarMode"].Value.ToLower() == "showAlways".ToLower() ? cProperty.eScrollbarMode.showAlways :
                    myNode.Attributes["scrollbarMode"].Value.ToLower() == "showOnDemand".ToLower() ? cProperty.eScrollbarMode.showOnDemand :
                    cProperty.eScrollbarMode.showNever;

            sWindowStyle style = (sWindowStyle)cDataBase.pWindowstyles.get();
            sWindowStyle.sBorderSet borderset = (sWindowStyle.sBorderSet)style.pBorderSets["bsListboxEntry"];

            if (borderset != null)
            {

                if (borderset.pbpTopLeftName.Length > 0)
                {
                    pbpTopLeftName = borderset.pbpTopLeftName;
                    pbpTopLeft = borderset.pbpTopLeft;
                }
                if (borderset.pbpTopName.Length > 0)
                {
                    pbpTopName = borderset.pbpTopName;
                    pbpTop = borderset.pbpTop;
                }
                if (borderset.pbpTopRightName.Length > 0)
                {
                    pbpTopRightName = borderset.pbpTopRightName;
                    pbpTopRight = borderset.pbpTopRight;
                }


                if (borderset.pbpLeftName.Length > 0)
                {
                    pbpLeftName = borderset.pbpLeftName;
                    pbpLeft = borderset.pbpLeft;
                }
                if (borderset.pbpRightName.Length > 0)
                {
                    pbpRightName = borderset.pbpRightName;
                    pbpRight = borderset.pbpRight;
                }


                if (borderset.pbpBottomLeftName.Length > 0)
                {
                    pbpBottomLeftName = borderset.pbpBottomLeftName;
                    pbpBottomLeft = borderset.pbpBottomLeft;
                }
                if (borderset.pbpBottomName.Length > 0)
                {
                    pbpBottomName = borderset.pbpBottomName;
                    pbpBottom = borderset.pbpBottom;
                }
                if (borderset.pbpBottomRightName.Length > 0)
                {
                    pbpBottomRightName = borderset.pbpBottomRightName;
                    pbpBottomRight = borderset.pbpBottomRight;
                }
            }


            if (node.Attributes["itemHeight"] != null)
                pItemHeight = Convert.ToInt32(node.Attributes["itemHeight"].Value.Trim());
            else
                pItemHeight = 20;


            String entries = cPreviewText.getText(parent.Name, Name);
            if(entries.Length > 0)
                pPreviewEntries = entries.Split('|');
        }
Exemplo n.º 3
0
        public sAttributeListbox(sAttribute parent, XmlNode node)
            : base(parent, node)
        {
            if (node.Attributes["backgroundColor"] != null)
            {
                pListboxBackgroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            }
            else
            {
                pListboxBackgroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxBackground"];
            }

            if (node.Attributes["foregroundColor"] != null)
            {
                pListboxForegroundColor = (sColor)cDataBase.pColors.get(node.Attributes["foregroundColor"].Value);
            }
            else
            {
                pListboxForegroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxForeground"];
            }

            if (myNode.Attributes["font"] != null)
            {
                pFont     = cDataBase.getFont(myNode.Attributes["font"].Value);
                pFontSize = pFont.Size;
            }

            if (myNode.Attributes["secondfont"] != null)
            {
                pFontSecond     = cDataBase.getFont(myNode.Attributes["secondfont"].Value);
                pFontSecondSize = pFontSecond.Size;
            }

            //if (node.HasChildNodes && node.FirstChild.Attributes["type"] != null && node.FirstChild.Attributes["type"].Value.ToLower() == "templatedmulticontent")
            //{
            //    String input = node.FirstChild.InnerText;
            //    Match match = Regex.Match(input, @"""itemHeight"": (\d+)");
            //    if (match.Success)
            //        pItemHeight = Int16.Parse(match.Groups[1].ToString());

            //    //MessageBox.Show(match.Groups[1].ToString());

            //}

            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxSelectedBackgroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxSelectedBackgroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxSelectedBackground"];

            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxSelectedForegroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxSelectedForegroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxSelectedForeground"];


            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxMarkedBackgroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxMarkedBackgroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxMarkedBackground"];

            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxMarkedForegroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxMarkedForegroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxMarkedForeground"];


            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxMarkedAndSelectedBackgroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxMarkedAndSelectedBackgroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxMarkedAndSelectedBackground"];

            //if (node.Attributes["backgroundColor"] != null)
            //    pListboxMarkedAndSelectedForegroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value);
            //else
            pListboxMarkedAndSelectedForegroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["ListboxMarkedAndSelectedForeground"];


            if (node.Attributes["backgroundPixmap"] != null)
            {
                pBackgroundPixmapName = node.Attributes["backgroundPixmap"].Value;
                try
                {
                    pBackgroundPixmap = Image.FromFile(cDataBase.getPath(pBackgroundPixmapName));
                }
                catch (FileNotFoundException)
                {
                    pBackgroundPixmap = null;
                }
            }
            if (node.Attributes["selectionPixmap"] != null)
            {
                pSelectionPixmapName = node.Attributes["selectionPixmap"].Value;
                try
                {
                    pSelectionPixmap = Image.FromFile(cDataBase.getPath(pSelectionPixmapName));
                }
                catch (FileNotFoundException)
                {
                    pSelectionPixmap = null;
                }
            }

            if (myNode.Attributes["scrollbarMode"] != null)
            {
                pScrollbarMode = myNode.Attributes["scrollbarMode"].Value.ToLower() == "showAlways".ToLower() ? cProperty.eScrollbarMode.showAlways :
                                 myNode.Attributes["scrollbarMode"].Value.ToLower() == "showOnDemand".ToLower() ? cProperty.eScrollbarMode.showOnDemand :
                                 cProperty.eScrollbarMode.showNever;
            }

            sWindowStyle style = (sWindowStyle)cDataBase.pWindowstyles.get();

            sWindowStyle.sBorderSet borderset = (sWindowStyle.sBorderSet)style.pBorderSets["bsListboxEntry"];

            if (borderset != null)
            {
                if (borderset.pbpTopLeftName.Length > 0)
                {
                    pbpTopLeftName = borderset.pbpTopLeftName;
                    pbpTopLeft     = borderset.pbpTopLeft;
                }
                if (borderset.pbpTopName.Length > 0)
                {
                    pbpTopName = borderset.pbpTopName;
                    pbpTop     = borderset.pbpTop;
                }
                if (borderset.pbpTopRightName.Length > 0)
                {
                    pbpTopRightName = borderset.pbpTopRightName;
                    pbpTopRight     = borderset.pbpTopRight;
                }


                if (borderset.pbpLeftName.Length > 0)
                {
                    pbpLeftName = borderset.pbpLeftName;
                    pbpLeft     = borderset.pbpLeft;
                }
                if (borderset.pbpRightName.Length > 0)
                {
                    pbpRightName = borderset.pbpRightName;
                    pbpRight     = borderset.pbpRight;
                }


                if (borderset.pbpBottomLeftName.Length > 0)
                {
                    pbpBottomLeftName = borderset.pbpBottomLeftName;
                    pbpBottomLeft     = borderset.pbpBottomLeft;
                }
                if (borderset.pbpBottomName.Length > 0)
                {
                    pbpBottomName = borderset.pbpBottomName;
                    pbpBottom     = borderset.pbpBottom;
                }
                if (borderset.pbpBottomRightName.Length > 0)
                {
                    pbpBottomRightName = borderset.pbpBottomRightName;
                    pbpBottomRight     = borderset.pbpBottomRight;
                }
            }


            if (node.Attributes["itemHeight"] != null)
            {
                pItemHeight = Convert.ToInt32(node.Attributes["itemHeight"].Value.Trim());
            }
            else
            if (pItemHeight == 0)
            {
                pItemHeight = 20;
            }


            String entries = cPreviewText.getText(parent.Name, Name);

            if (entries.Length > 0)
            {
                pPreviewEntries = new List <string>(entries.Split('|'));
            }
            else
            {
                for (int i = 1; i < 50; i++)
                {
                    pPreviewEntries.Add("List entry " + i);
                }
            }
        }