Пример #1
0
        public CBlockView(InvokationBlock model,
            BlockAttributes attribute,
            List<ContentView> contents,
            IEnumerable<BlockStackView> scripts, 
            CBlockImgParts parts, 
            List<ArgumentPartition> argPartitions)
        {
            this.model = model;
            this.attribute = attribute;
            Contents.AddRange(contents);
            Scripts.AddRange(scripts);
            this.ArgPartitions = argPartitions;
            int si = 0;
            foreach (ArgumentPartition p in argPartitions)
            {
                if (p.Type == ArgViewType.Script)
                    scriptIndexes.Add(si);
                si += p.N;
            }
            this.parts = parts;
            Changed += delegate(object sender) { };

            foreach (ContentView cv in contents)
            {
                cv.Parent = this;
                cv.Changed += new ViewChangedEvent(subView_Changed);
            }
            foreach (BlockStackView sv in scripts)
            {
                sv.Parent = this;
                sv.Changed += new ViewChangedEvent(subView_Changed);
            }
            Reassemble();
        }
Пример #2
0
        void InitImageParts()
        {
            sb_parts   = StackBlockImgParts.FromBitmap(BitmapExtensions.LoadBmp("stack_blue_small.bmp"));
            fib_parts  = StackBlockImgParts.FromBitmap(BitmapExtensions.LoadBmp("function_green_small.bmp"));
            bool_parts = StackBlockImgParts.FromBitmap(BitmapExtensions.LoadBmp("boolean.bmp"));
            pdb_parts  = StackBlockImgParts.FromBitmap(BitmapExtensions.LoadBmp("procdef_small.bmp"));
            varb_parts = Nine.FromBitmap(BitmapExtensions.LoadBmp("var_purple_small.bmp"), Color.Red);
            hatb_parts = StackBlockImgParts.FromBitmap(BitmapExtensions.LoadBmp("hat_small.bmp"));
            capb_parts = StackBlockImgParts.FromBitmap(BitmapExtensions.LoadBmp("cap_small.bmp"));

            cb_parts = new CBlockImgParts();
            cb_parts.FromBitmapCutting(BitmapExtensions.LoadBmp("C_stack_full.bmp"), Color.Red);
            ib_parts = Nine.FromBitmap(BitmapExtensions.LoadBmp("input_controls_small.bmp"), Color.Red);

            specialTextBits["_flag"] = (BitmapExtensions.LoadBmp("flag_textbit.bmp")).Transparent();
        }
Пример #3
0
        public CBlockView(InvokationBlock model,
                          BlockAttributes attribute,
                          List <ContentView> contents,
                          IEnumerable <BlockStackView> scripts,
                          CBlockImgParts parts,
                          List <ArgumentPartition> argPartitions)
        {
            this.model     = model;
            this.attribute = attribute;
            Contents.AddRange(contents);
            Scripts.AddRange(scripts);
            this.ArgPartitions = argPartitions;
            int si = 0;

            foreach (ArgumentPartition p in argPartitions)
            {
                if (p.Type == ArgViewType.Script)
                {
                    scriptIndexes.Add(si);
                }
                si += p.N;
            }
            this.parts = parts;
            Changed   += delegate(object sender) { };

            foreach (ContentView cv in contents)
            {
                cv.Parent   = this;
                cv.Changed += new ViewChangedEvent(subView_Changed);
            }
            foreach (BlockStackView sv in scripts)
            {
                sv.Parent   = this;
                sv.Changed += new ViewChangedEvent(subView_Changed);
            }
            Reassemble();
        }
Пример #4
0
        void InitImageParts()
        {
            sb_parts = StackBlockImgParts.FromBitmap(BitmapExtensions.LoadBmp("stack_blue_small.bmp"));
            fib_parts = StackBlockImgParts.FromBitmap(BitmapExtensions.LoadBmp("function_green_small.bmp"));
            bool_parts = StackBlockImgParts.FromBitmap(BitmapExtensions.LoadBmp("boolean.bmp"));
            pdb_parts = StackBlockImgParts.FromBitmap(BitmapExtensions.LoadBmp("procdef_small.bmp"));
            varb_parts = Nine.FromBitmap(BitmapExtensions.LoadBmp("var_purple_small.bmp"), Color.Red);
            hatb_parts = StackBlockImgParts.FromBitmap(BitmapExtensions.LoadBmp("hat_small.bmp"));
            capb_parts = StackBlockImgParts.FromBitmap(BitmapExtensions.LoadBmp("cap_small.bmp"));

            cb_parts = new CBlockImgParts();
            cb_parts.FromBitmapCutting(BitmapExtensions.LoadBmp("C_stack_full.bmp"), Color.Red);
            ib_parts = Nine.FromBitmap(BitmapExtensions.LoadBmp("input_controls_small.bmp"), Color.Red);

            specialTextBits["_flag"] = (BitmapExtensions.LoadBmp("flag_textbit.bmp")).Transparent();
        }