AddNewRect() public method

public AddNewRect ( int x, int y, int w, int h ) : void
x int
y int
w int
h int
return void
Ejemplo n.º 1
0
        void menuModule_menuItemClick(object sender, MenuItemClickEventArgs e)
        {
            switch (e.MenuName)
            {
            case "Rect":
            {
                //create rect from spec

                dzBoardModule.AddNewRect(0, 0, 50, 50);
            } break;

            case "Box":
            {
                dzBoardModule.AddNewBox(20, 20, 50, 50);
            } break;

            case "Text":
            {
            } break;

            case "Image":
            {
                //load image
                //Image img = viewport.P.CreatePlatformBitmap(
                //dzBoardModule.AddNewImageBox(20, 20, 100, 50);
                ImageBinder imgBinder = LoadImage("../../Demo/favorites32.png");
                var         holder    = dzBoardModule.AddNewImageBox(20, 20, 50, 50, imgBinder);
                holder.SetSerializeDelegate(SerializeDzImageBox);
                holder.SetCloneDelegate(CloneImageBox);
            } break;
            }
        }
Ejemplo n.º 2
0
        public void DrawContents(DesignBoardModule dzBoard)
        {
            //write content to the viewport
            var rootdoc = xmldoc.DocumentElement;

            foreach (var childnode in rootdoc.ChildNodes)
            {
                var elemNode = childnode as XmlElement;
                if (elemNode == null)
                {
                    continue;
                }
                //create element
                int left, top, width, height;
                switch (elemNode.Name)
                {
                case "rectbox":
                {
                    //create rect box and add to viewport
                    GetDimensionAttr(elemNode, out left, out top, out width, out height);
                    dzBoard.AddNewBox(left, top, width, height);
                }
                break;

                case "shapebox":
                {
                    GetDimensionAttr(elemNode, out left, out top, out width, out height);
                    dzBoard.AddNewRect(left, top, width, height);
                }
                break;

                case "textbox":
                {
                }
                break;

                default:
                {
                }
                break;
                }
            }
        }
Ejemplo n.º 3
0
 public void DrawContents(DesignBoardModule dzBoard)
 {
     //write content to the viewport
     var rootdoc = xmldoc.DocumentElement;
     foreach (var childnode in rootdoc.ChildNodes)
     {
         var elemNode = childnode as XmlElement;
         if (elemNode == null)
         {
             continue;
         }
         //create element
         int left, top, width, height;
         switch (elemNode.Name)
         {
             case "rectbox":
                 {
                     //create rect box and add to viewport
                     GetDimensionAttr(elemNode, out left, out top, out width, out height);
                     dzBoard.AddNewBox(left, top, width, height);
                 }
                 break;
             case "shapebox":
                 {
                     GetDimensionAttr(elemNode, out left, out top, out width, out height);
                     dzBoard.AddNewRect(left, top, width, height);
                 }
                 break;
             case "textbox":
                 {
                 }
                 break;
             default:
                 {
                 }
                 break;
         }
     }
 }