Exemple #1
0
        private void refresh()
        {
            refreshEditor();

            propertyGrid1.SelectedObject = null;

            TreeNode selectedNode = treeView1.SelectedNode;
            if (selectedNode != null)
            {
                int hash = selectedNode.GetHashCode();
                XmlNode node = pXmlHandler.getXmlNode(hash);
                {
                    //Get Screen Node
                    XmlNode screenNode = node;
                    //As we could be selecting a sub Element, walk up
                    while (screenNode != null && screenNode.Name != "screen")
                    {
                        hash = pXmlHandler.XmlGetParentHandle(hash);
                        screenNode = pXmlHandler.getXmlNode(hash);
                    }

                    pDesigner.clear();

                    if (screenNode != null)
                    {
                        //Draw Screen and its Elements

                        if (cProperties.getPropertyBool("enable_backdrop"))
                            pDesigner.drawBackground();

                        sAttribute subattr = null;
                        {
                            sAttribute attr = new sAttributeScreen(screenNode);
                            if (screenNode.Name == "screen")
                            {
                                //sAttribute subattr = new sAttributeScreen(node);
                                propertyGrid1.SelectedObject = attr;
                            }
                            pDesigner.draw(attr);

                            XmlNode[] nodes = pXmlHandler.XmlGetChildNodes(hash);

                            if (nodes.Length > 0 && screenNode != node)
                                propertyGrid1.SelectedObject = null;

                            foreach (XmlNode tmpnode in nodes)
                            {
                                 if (tmpnode.Name == "eLabel")
                                {
                                    subattr = new sAttributeLabel(attr, tmpnode);
                                    pDesigner.draw(subattr);
                                }
                                else if (tmpnode.Name == "ePixmap")
                                {
                                    subattr = new sAttributePixmap(attr, tmpnode);
                                    pDesigner.draw(subattr);
                                }
                                else if (tmpnode.Name == "widget")
                                {
                                    subattr = new sAttributeWidget(attr, tmpnode);
                                    pDesigner.draw(subattr);
                                }

                                 if (tmpnode == node)
                                 {
                                     propertyGrid1.SelectedObject = subattr;
                                     if (cProperties.getPropertyBool("fading"))
                                         pDesigner.drawFog((int)subattr.pAbsolutX, (int)subattr.pAbsolutY, (int)subattr.pWidth, (int)subattr.pHeight);
                                 }
                            }
                        }
                          
                        pDesigner.drawFrame();
                    }

                    pDesigner.sort();
                    pictureBox1.Invalidate();
                }
            }
        }
Exemple #2
0
        //protected sAttributeScreen pAttr;


        public sGraphicScreen(sAttributeScreen attr)
            : base(attr)
        {
            pAttr = attr;
        }
        //protected sAttributeScreen pAttr;
        

        public sGraphicScreen(sAttributeScreen attr)
            : base(attr)
        {
            pAttr = attr;
        }
Exemple #4
0
        private void refreshStyle()
        {
            sWindowStyle style = (sWindowStyle)cDataBase.pWindowstyles.get();
            sWindowStyle.sBorderSet borderset = (sWindowStyle.sBorderSet)style.pBorderSets[comboBoxStyles.SelectedItem.ToString()];

            propertyGridTable.SelectedObject = borderset;

            if (borderset.pbpTopLeftName.Length > 0)
            {
                textBoxTopLeft.Text = borderset.pbpTopLeftName;
                pictureBoxTopLeft.Image = Image.FromFile(cDataBase.getPath(borderset.pbpTopLeftName));
            }
            if (borderset.pbpTopName.Length > 0)
            {
                textBoxTop.Text = borderset.pbpTopName;
                pictureBoxTop.Image = Image.FromFile(cDataBase.getPath(borderset.pbpTopName));
            }
            if (borderset.pbpTopRightName.Length > 0)
            {
                textBoxTopRight.Text = borderset.pbpTopRightName;
                pictureBoxTopRight.Image = Image.FromFile(cDataBase.getPath(borderset.pbpTopRightName));
            }


            if (borderset.pbpLeftName.Length > 0)
            {
                textBoxLeft.Text = borderset.pbpLeftName;
                pictureBoxLeft.Image = Image.FromFile(cDataBase.getPath(borderset.pbpLeftName));
            }
            if (borderset.pbpRightName.Length > 0)
            {
                textBoxRight.Text = borderset.pbpRightName;
                pictureBoxRight.Image = Image.FromFile(cDataBase.getPath(borderset.pbpRightName));
            }


            if (borderset.pbpBottomLeftName.Length > 0)
            {
                textBoxBottomLeft.Text = borderset.pbpBottomLeftName;
                pictureBoxBottomLeft.Image = Image.FromFile(cDataBase.getPath(borderset.pbpBottomLeftName));
            }
            if (borderset.pbpBottomName.Length > 0)
            {
                textBoxBottom.Text = borderset.pbpBottomName;
                pictureBoxBottom.Image = Image.FromFile(cDataBase.getPath(borderset.pbpBottomName));
            }
            if (borderset.pbpBottomRightName.Length > 0)
            {
                textBoxBottomRight.Text = borderset.pbpBottomRightName;
                pictureBoxBottomRight.Image = Image.FromFile(cDataBase.getPath(borderset.pbpBottomRightName));
            }


            sAttributeScreen attr = new sAttributeScreen(null);
            attr.pZPosition = -100;

            attr.pAbsolutX = attr.pRelativX = 50;
            attr.pAbsolutY = attr.pRelativY = 50;

            attr.pWidth = 200;
            attr.pHeight = 200;

            attr.pBackgroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["Background"];

            attr.pLabelForegroundColor = (sColor)((sWindowStyle)cDataBase.pWindowstyles.get()).pColors["LabelForeground"];

            attr.pTitle = "Title";

            attr.pTitleFont = ((sWindowStyle)cDataBase.pWindowstyles.get()).pFont;
            attr.pTitleSize = ((sWindowStyle)cDataBase.pWindowstyles.get()).pTitleSize * (((float)attr.pTitleFont.Scale) / 100.0F);

            attr.pTitleXOff = ((sWindowStyle)cDataBase.pWindowstyles.get()).pXOff;
            attr.pTitleYOff = ((sWindowStyle)cDataBase.pWindowstyles.get()).pYOff;

            attr.pbpTopLeft = borderset.pbpTopLeft;
            attr.pbpTop = borderset.pbpTop;
            attr.pbpTopRight = borderset.pbpTopRight;

            attr.pbpLeft = borderset.pbpLeft;
            attr.pbpRight = borderset.pbpRight;

            attr.pbpBottomLeft = borderset.pbpBottomLeft;
            attr.pbpBottom = borderset.pbpBottom;
            attr.pbpBottomRight = borderset.pbpBottomRight;

            //attr.Flags = "wfBorder";

            pDesigner.clear();
            pDesigner.draw(attr);
        }