public sGraphicImage(sAttribute attr, String image, Int32 x, Int32 y) : base(attr) { //Console.WriteLine("sGraphicImage: " + x + ":" + y); //pAttr = attr; if (image == null || image.Length == 0) { return; } try { pImage = Image.FromFile(cDataBase.getPath(image)); } catch (FileNotFoundException ex) { Console.WriteLine("File not found! (" + cDataBase.getPath(image) + ")"); return; } pX = x; pY = y; pWidth = (Int32)pImage.Width; pHeight = (Int32)pImage.Height; }
public sGraphicRectangel(sAttribute attr, bool filled, float linewidth, sColor color) : base(attr) { pFilled = filled; pLineWidth = linewidth; pColor = color; }
public sAttributePixmap(sAttribute parent, XmlNode node) : base(parent, node) { if (node.Attributes["pixmap"] != null) { pPixmapName = node.Attributes["pixmap"].Value; try { //PVMC Workaround if (pPixmapName.Contains("ProjectValerie")) { pPixmapName = pPixmapName.Substring(pPixmapName.IndexOf("ProjectValerie/skins/") + "ProjectValerie/skins/".Length); } Image pixmap = Image.FromFile(cDataBase.getPath(pPixmapName)); pPixmap = pixmap.Size; pixmap.Dispose(); } catch (FileNotFoundException) { pPixmap = new Size(0, 0); pHide = true; } } if (node.Attributes["alphatest"] != null) { pAlphatest = node.Attributes["alphatest"].Value.ToLower() == "on" ? cProperty.eAlphatest.on : node.Attributes["alphatest"].Value.ToLower() == "blend" ? cProperty.eAlphatest.blend : cProperty.eAlphatest.off; } }
public sGraphicFont(sAttribute attr, Int32 x, Int32 y, String text, float size, sFont font, sColor color, sColor backColor, cProperty.eHAlign hAlignment, cProperty.eVAlign vAlignment) : base(attr) { //pAttr = attr; pX = x; pY = y; pText = text; pSize = size; pFont = font; pColor = color; if (backColor != null) { pTranparent = false; pBackColor = backColor; } else { pTranparent = true; } pHAlignment = hAlignment; pVAlignment = vAlignment; }
public sAttributeProgress(sAttribute parent, XmlNode node) : base(parent, node) { if (node.Attributes["backgroundColor"] != null) pBackgroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value); else pBackgroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["Background"]; }
public sAttributeProgress(sAttribute parent, XmlNode node) : base(parent, node) { if (node.Attributes["backgroundColor"] != null) { pBackgroundColor = (sColor)cDataBase.pColors.get(node.Attributes["backgroundColor"].Value); } else { pBackgroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["Background"]; } }
public sGraphicElement(sAttribute attr) { pAttr = attr; if (pAttr != null) { pX = attr.pAbsolutX; pY = attr.pAbsolutY; pWidth = attr.pWidth; pHeight = attr.pHeight; pZPosition = attr.pZPosition; } else pZPosition = 0; }
public void updateObject(sAttribute parent, sAttribute me) { me.pAbsolutX = parent.pAbsolutX; me.pAbsolutY = parent.pAbsolutY; me.pRelativX = parent.pRelativX; me.pRelativY = parent.pRelativY; me.pWidth = parent.pWidth; me.pHeight = parent.pHeight; me.pName = parent.pName; me.pZPosition = parent.pZPosition; me.pTransparent = parent.pTransparent; me.pBorder = parent.pBorder; me.pBorderColor = parent.pBorderColor; me.pBorderWidth = parent.pBorderWidth; }
public sGraphicElement(sAttribute attr) { pAttr = attr; if (pAttr != null) { pX = attr.pAbsolutX; pY = attr.pAbsolutY; pWidth = attr.pWidth; pHeight = attr.pHeight; pZPosition = attr.pZPosition; } else { pZPosition = 0; } }
//protected sAttribute pAttr; public sGraphicFont(sAttribute attr, Int32 x, Int32 y, String text, float size, sFont font, sColor color, cProperty.eHAlign hAlignment, cProperty.eVAlign vAlignment) : base(attr) { //pAttr = attr; pX = x; pY = y; pText = text; pSize = size; pFont = font; pColor = color; pHAlignment = hAlignment; pVAlignment = vAlignment; pTranparent = true; }
public sGraphicImage(sAttribute attr, String image) : base(attr) { //Console.WriteLine("sGraphicImage: "); //pAttr = attr; if (image == null || image.Length == 0) return; try { pImage = Image.FromFile(cDataBase.getPath(image)); } catch (FileNotFoundException ex) { Console.WriteLine("File not found! (" + cDataBase.getPath(image) + ")"); return; } }
public sGraphicImage(sAttribute attr, String image) : base(attr) { //Console.WriteLine("sGraphicImage: "); //pAttr = attr; if (image == null || image.Length == 0) { return; } try { pImage = Image.FromFile(cDataBase.getPath(image)); } catch (FileNotFoundException ex) { Console.WriteLine("File not found! (" + cDataBase.getPath(image) + ")"); return; } }
//protected sAttribute pAttr; public sGraphicImage(sAttribute attr, String image, Int32 x, Int32 y, Int32 w, Int32 h) : base(attr) { //Console.WriteLine("sGraphicImage: " + x + ":" + y + " " + w + "x" + h); try { pImage = Image.FromFile(cDataBase.getPath(image)); } catch (FileNotFoundException ex) { Console.WriteLine("File not found! (" + cDataBase.getPath(image) + ")\n" + ex); return; } pX = x; pY = y; pWidth = w < (Int32)pImage.Width ? w : (Int32)pImage.Width; pHeight = h < (Int32)pImage.Height ? h : (Int32)pImage.Height; ; }
//protected sAttribute pAttr; public sGraphicImage(sAttribute attr, String image, Int32 x, Int32 y, Int32 w, Int32 h) : base(attr) { //Console.WriteLine("sGraphicImage: " + x + ":" + y + " " + w + "x" + h); try { pImage = Image.FromFile(cDataBase.getPath(image)); } catch (FileNotFoundException ex) { Console.WriteLine("File not found! (" + cDataBase.getPath(image) + ")\n" + ex); return; } pX = x; pY = y; pWidth = w < (Int32)pImage.Width ? w : (Int32)pImage.Width; pHeight = h < (Int32)pImage.Height ? h : (Int32)pImage.Height;; }
public sGraphicImage(sAttribute attr, String image, Int32 x, Int32 y) : base(attr) { //Console.WriteLine("sGraphicImage: " + x + ":" + y); //pAttr = attr; if (image == null || image.Length == 0) return; try { pImage = Image.FromFile(cDataBase.getPath(image)); } catch (FileNotFoundException ex) { Console.WriteLine("File not found! (" + cDataBase.getPath(image) + ")"); return; } pX = x; pY = y; pWidth = (Int32)pImage.Width; pHeight = (Int32)pImage.Height; }
public void draw(sAttribute attr) { sGraphicElement ele = null; Type type = attr.GetType(); if (type == typeof(sAttributeScreen)) { ele = new sGraphicScreen((sAttributeScreen)attr); } else if (type == typeof(sAttributeLabel)) { ele = new sGraphicLabel((sAttributeLabel)attr); } else if (type == typeof(sAttributePixmap)) { ele = new sGraphicPixmap((sAttributePixmap)attr); } else if (type == typeof(sAttributeWidget)) { //ele = new sGraphicRectangel((sAttributeWidget)attr, false, 1.0F, Color.GreenYellow); ele = new sGraphicWidget((sAttributeWidget)attr); } pDrawList.Add(ele); }
public void drawBackground() { sResolution res = cDataBase.pResolution.getResolution(); sAttribute attr = new sAttribute(0, 0, (Int32)res.Xres, (Int32)res.Yres, "Background"); attr.pZPosition = -1000; pDrawList.Add(new sGraphicImage(attr, "background.jpg")); }
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('|'); }
public sAttribute(sAttribute parent, XmlNode node) { if (node == null) { return; } myNode = node; _pParent = parent; pWidth = Convert.ToInt32(node.Attributes["size"].Value.Substring(0, node.Attributes["size"].Value.IndexOf(',')).Trim()); pHeight = Convert.ToInt32(node.Attributes["size"].Value.Substring(node.Attributes["size"].Value.IndexOf(',') + 1).Trim()); try { String sRelativeX = node.Attributes["position"].Value.Substring(0, node.Attributes["position"].Value.IndexOf(',')).Trim(); if (sRelativeX.Equals("center")) { pRelativX = (Int32)(cDataBase.pResolution.getResolution().Xres - pWidth) >> 1 /*1/2*/; } else { pRelativX = Convert.ToInt32(sRelativeX); } } catch (OverflowException) { pRelativX = 0; } pAbsolutX = parent.pAbsolutX + pRelativX; try { String sRelativeY = node.Attributes["position"].Value.Substring(node.Attributes["position"].Value.IndexOf(',') + 1).Trim(); if (sRelativeY.Equals("center")) { pRelativY = (Int32)(cDataBase.pResolution.getResolution().Yres - pHeight) >> 1 /*1/2*/; } else { pRelativY = Convert.ToInt32(sRelativeY); } } catch (OverflowException e) { pRelativY = 0; } pAbsolutY = parent.pAbsolutY + pRelativY; if (node.Attributes["name"] != null) { pName = node.Attributes["name"].Value.Trim(); } else { pName = ""; } if (node.Attributes["zPosition"] != null) { pZPosition = Convert.ToInt32(node.Attributes["zPosition"].Value.Trim()); } else { pZPosition = 0; } if (node.Attributes["transparent"] != null) { pTransparent = Convert.ToUInt32(node.Attributes["transparent"].Value.Trim()) != 0; } else { pTransparent = false; } if (node.Attributes["borderWidth"] != null) { pBorderWidth = Convert.ToUInt32(node.Attributes["borderWidth"].Value.Trim()); } else { pBorderWidth = 0; } if (node.Attributes["borderColor"] != null) { pBorderColor = (sColor)cDataBase.pColors.get(node.Attributes["borderColor"].Value.Trim()); } else { pBorderColor = null; } if (pBorderWidth > 0 && pBorderColor != null) { pBorder = true; } else { pBorder = false; } }
public sAttributePixmap(sAttribute parent, XmlNode node) : base(parent, node) { if (node.Attributes["pixmap"] != null) { pPixmapName = node.Attributes["pixmap"].Value; try { //PVMC Workaround if (pPixmapName.Contains("ProjectValerie")) { pPixmapName = pPixmapName.Substring(pPixmapName.IndexOf("ProjectValerie/skins/") + "ProjectValerie/skins/".Length); } Image pixmap = Image.FromFile(cDataBase.getPath(pPixmapName)); pPixmap = pixmap.Size; pixmap.Dispose(); } catch (FileNotFoundException) { pPixmap = new Size(0,0); pHide = true; } } if (node.Attributes["alphatest"] != null) pAlphatest = node.Attributes["alphatest"].Value.ToLower() == "on" ? cProperty.eAlphatest.on : node.Attributes["alphatest"].Value.ToLower() == "blend" ? cProperty.eAlphatest.blend : cProperty.eAlphatest.off; }
public sAttribute( sAttribute parent, XmlNode node) { if (node == null) return; myNode = node; _pParent = parent; pWidth = Convert.ToInt32(node.Attributes["size"].Value.Substring(0, node.Attributes["size"].Value.IndexOf(',')).Trim()); pHeight = Convert.ToInt32(node.Attributes["size"].Value.Substring(node.Attributes["size"].Value.IndexOf(',') + 1).Trim()); try { String sRelativeX = node.Attributes["position"].Value.Substring(0, node.Attributes["position"].Value.IndexOf(',')).Trim(); if (sRelativeX.Equals("center")) pRelativX = (Int32)(cDataBase.pResolution.getResolution().Xres - pWidth) >> 1 /*1/2*/; else pRelativX = Convert.ToInt32(sRelativeX); } catch(OverflowException) { pRelativX = 0; } pAbsolutX = parent.pAbsolutX + pRelativX; try { String sRelativeY = node.Attributes["position"].Value.Substring(node.Attributes["position"].Value.IndexOf(',') + 1).Trim(); if (sRelativeY.Equals("center")) pRelativY = (Int32)(cDataBase.pResolution.getResolution().Yres - pHeight) >> 1 /*1/2*/; else pRelativY = Convert.ToInt32(sRelativeY); } catch (OverflowException e) { pRelativY = 0; } pAbsolutY = parent.pAbsolutY + pRelativY; if (node.Attributes["name"] != null) pName = node.Attributes["name"].Value.Trim(); else pName = ""; if (node.Attributes["zPosition"] != null) pZPosition = Convert.ToInt32(node.Attributes["zPosition"].Value.Trim()); else pZPosition = 0; if (node.Attributes["transparent"] != null) pTransparent = Convert.ToUInt32(node.Attributes["transparent"].Value.Trim()) != 0; else pTransparent = false; if (node.Attributes["borderWidth"] != null) pBorderWidth = Convert.ToUInt32(node.Attributes["borderWidth"].Value.Trim()); else pBorderWidth = 0; if (node.Attributes["borderColor"] != null) pBorderColor = (sColor)cDataBase.pColors.get(node.Attributes["borderColor"].Value.Trim()); else pBorderColor = null; if (pBorderWidth > 0 && pBorderColor != null) pBorder = true; else pBorder = false; }
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('|'); } }
/// <summary> /// /////////////////////////////////////////////////////////////////// /// </summary> /// <param name="parent"></param> /// <param name="node"></param> public sAttributeLabel(sAttribute parent, XmlNode node) : base(parent, node) { pWindowStyle = (sWindowStyle)cDataBase.pWindowstyles.get(); if (myNode.Attributes["text"] != null) { pText = myNode.Attributes["text"].Value; } if (myNode.Attributes["font"] != null) { String tmpfont = myNode.Attributes["font"].Value; float size = Convert.ToSingle(tmpfont.Substring(tmpfont.IndexOf(';') + 1)); String fontname = tmpfont.Substring(0, tmpfont.IndexOf(';')); pFont = cDataBase.getFont(fontname); pFontSize = size; } else { pFont = cDataBase.getFont("Regular"); pFontSize = 16; } if (myNode.Attributes["backgroundColor"] != null) { pBackgroundColor = (sColor)cDataBase.pColors.get(myNode.Attributes["backgroundColor"].Value); } else if ((sColor)pWindowStyle.pColors["LabelBackground"] != null) { pBackgroundColor = (sColor)pWindowStyle.pColors["LabelBackground"]; } else { pBackgroundColor = (sColor)pWindowStyle.pColors["Background"]; } if (myNode.Attributes["foregroundColor"] != null) { pForegroundColor = (sColor)cDataBase.pColors.get(myNode.Attributes["foregroundColor"].Value); } else { pForegroundColor = (sColor)pWindowStyle.pColors["LabelForeground"]; } if (myNode.Attributes["valign"] != null) { pValign = myNode.Attributes["valign"].Value.ToLower() == "top" ? cProperty.eVAlign.Top : myNode.Attributes["valign"].Value.ToLower() == "center" ? cProperty.eVAlign.Center : cProperty.eVAlign.Bottom; } if (myNode.Attributes["halign"] != null) { pHalign = myNode.Attributes["halign"].Value.ToLower() == "left" ? cProperty.eHAlign.Left : myNode.Attributes["halign"].Value.ToLower() == "center" ? cProperty.eHAlign.Center : cProperty.eHAlign.Right; } if (myNode.Attributes["noWrap"] != null) { pNoWrap = Convert.ToUInt32(myNode.Attributes["noWrap"].Value.ToLower()) != 0 ? true : false; } if (pText == null || pText.Length > 0) { if (Name.Length > 0) { pPreviewText = cPreviewText.getText(parent.Name, Name); } } }
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; } } } } }
/// <summary> /// /////////////////////////////////////////////////////////////////// /// </summary> /// <param name="parent"></param> /// <param name="node"></param> public sAttributeLabel(sAttribute parent, XmlNode node) : base(parent, node) { pWindowStyle = (sWindowStyle)cDataBase.pWindowstyles.get(); if (myNode.Attributes["text"] != null) pText = myNode.Attributes["text"].Value; if (myNode.Attributes["font"] != null) { String tmpfont = myNode.Attributes["font"].Value; float size = Convert.ToSingle(tmpfont.Substring(tmpfont.IndexOf(';') + 1)); String fontname = tmpfont.Substring(0, tmpfont.IndexOf(';')); pFont = cDataBase.getFont(fontname); pFontSize = size; } else { pFont = cDataBase.getFont("Regular"); pFontSize = 16; } if (myNode.Attributes["backgroundColor"] != null) pBackgroundColor = (sColor)cDataBase.pColors.get(myNode.Attributes["backgroundColor"].Value); else if ((sColor)pWindowStyle.pColors["LabelBackground"] != null) pBackgroundColor = (sColor)pWindowStyle.pColors["LabelBackground"]; else pBackgroundColor = (sColor)pWindowStyle.pColors["Background"]; if (myNode.Attributes["foregroundColor"] != null) pForegroundColor = (sColor)cDataBase.pColors.get(myNode.Attributes["foregroundColor"].Value); else pForegroundColor = (sColor)pWindowStyle.pColors["LabelForeground"]; if (myNode.Attributes["valign"] != null) pValign = myNode.Attributes["valign"].Value.ToLower() == "top" ? cProperty.eVAlign.Top : myNode.Attributes["valign"].Value.ToLower() == "center" ? cProperty.eVAlign.Center : cProperty.eVAlign.Bottom; if (myNode.Attributes["halign"] != null) pHalign = myNode.Attributes["halign"].Value.ToLower() == "left" ? cProperty.eHAlign.Left : myNode.Attributes["halign"].Value.ToLower() == "center" ? cProperty.eHAlign.Center : cProperty.eHAlign.Right; if (myNode.Attributes["noWrap"] != null) pNoWrap = Convert.ToUInt32(myNode.Attributes["noWrap"].Value.ToLower()) != 0 ? true : false; if (pText == null || pText.Length > 0) if(Name.Length > 0) pPreviewText = cPreviewText.getText(parent.Name, Name); }
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; } } } } } }