Пример #1
0
        void blockSpace_OnTopLevelAdded(object sender, TopLevelScript tl)
        {
            IBlockView v = viewFactory.ViewFromBlock(tl.Block);

            allViews[v]   = tl.Location;
            v.RelativePos = tl.Location;
            v.Parent      = null;

            Update(ViewBounds(v));
            Modified(this);
        }
Пример #2
0
        public void AddText()
        {
            //string text = GenerateNewName("label");
            string         text = "";
            ProcDefTextBit t    = new ProcDefTextBit(text);

            t.ParentRelationship = new ParentRelationship(ParentRelationshipType.None, model, -1);
            model.AddBit(t);
            ITextualView v = (ITextualView)factory.ViewFromBlock(t);

            SetEditState(v);
        }
Пример #3
0
        private void AddNewTool(BlockSpace blockSpace, ToolPrototype spec)
        {
            string[] parts = spec.tool.Split("|".ToCharArray());
            //string fileName = Path.Combine(filePrefix, parts[0]) + ".bmp";
            string funcName = parts[1];
            // Bitmap tbBmp = (Bitmap)Bitmap.FromFile(fileName);
            Bitmap tbBmp = dummyFactory.ViewFromBlock(blockSpace.makeNewBlock(funcName, spec.defaultArgs))
                           .Assemble();

            //tbBmp.MakeTransparent(tbBmp.GetPixel(0, 0));
            tools.Add(new ToolSpec(tbBmp, funcName, spec.category, spec.defaultArgs));
            categories.Add(spec.category);
        }