Exemplo n.º 1
0
Arquivo: App.cs Projeto: WzjmW/Sc
        public App(ScMgr scMgr)
        {
            this.scMgr = scMgr;
            root       = scMgr.GetRootLayer();

            TestLayer testLayer = new TestLayer(scMgr);

            testLayer.Name = "layer1";
            testLayer.Dock = ScDockStyle.Fill;
            // testLayer.BackgroundColor = Color.FromArgb(100, 255,0,255);
            root.Add(testLayer);


            //  testLayer = new TestLayer(scMgr);
            //  testLayer.Name = "layer2";
            //  testLayer.Location = new PointF(500, 400);
            //  testLayer.Width = 300;
            //  testLayer.Height = 800;
            //  testLayer.BackgroundColor = Color.FromArgb(100, 255, 0, 255);
            //  root.Add(testLayer);


            ScTextBox text = new ScTextBox(scMgr);

            text.Location = new PointF(150, 0);
            text.Width    = 200;
            text.Height   = 30;
            root.Add(text);
        }
Exemplo n.º 2
0
        ScLayer CreateItemControlFieldTest3(ScMgr scmgr, ColumnSetting columnSetting)
        {
            listView             = new ScListView(scmgr);
            listView.Name        = "ListView";
            listView.IsUseShadow = false;
            listView.ShadowRange = 4;
            listView.Margin      = new Margin(10, 10, 10, 10);

            listView.DisplayItemValue += DisplayItem;
            listView.CreateDefaultContentInfoSeting();
            listView.Dock = ScDockStyle.Fill;

            ScLayer listViewPack;

            if (listView.IsUseShadow)
            {
                listViewPack      = new ScLayer();
                listViewPack.Name = "ListViewPack";
                listViewPack.Dock = ScDockStyle.Fill;
                listViewPack.Add(listView);
                return(listViewPack);
            }
            else
            {
                return(listView);
            }
        }
Exemplo n.º 3
0
        ScLayer CreateItemControlFieldTest1(ScMgr scmgr, ColumnSetting columnSetting)
        {
            ScLayer layer = new ScLayer(scmgr);

            layer.Dock = ScDockStyle.Fill;

            ScCheckBox checkBox = new ScCheckBox(scmgr);

            checkBox.CheckType    = 0;
            checkBox.boxSideWidth = 1;
            checkBox.FillMargin   = new Margin(2, 2, 3, 3);
            checkBox.CheckColor   = Color.DarkRed;
            checkBox.Dock         = ScDockStyle.Center;
            checkBox.Size         = new SizeF(15, 15);

            checkBox.SetDrawCheckDirectParentLayer(layer);
            layer.Add(checkBox);
            return(layer);
        }
Exemplo n.º 4
0
        public GoodsListViewer(Control control)
        {
            scMgr = new ScMgr(control.Width, control.Height);
            scMgr.BackgroundColor = Color.FromArgb(255, 246, 245, 251);
            control.Controls.Add(scMgr.control);
            scMgr.control.Dock = DockStyle.Fill;
            root      = scMgr.GetRootLayer();
            root.Dock = ScDockStyle.Fill;
            // root.Padding = new Utils.Margin(100, 100, 100, 100);


            gridView = new ScGridView(scMgr);



            //样式设置
            Setting();


            //生成列
            CreateColumnSetting();


            root.Add(gridView);



            scMgr.ReBulid();
            CreateBackDataList();

            List <TestData> tmp = testDatalistFront;

            testDatalistFront = testDatalistBack;
            testDatalistBack  = tmp;
            testDatalistBack.Clear();

            UpdateDataSource();



            //
        }
Exemplo n.º 5
0
        public ChartApp(ScMgr scMgr)
        {
            SF2          sf2     = new SF2("g:\\test.sf2");
            List <short> samples = sf2.SoundChunk.SMPLSubChunk.samples;

            pcmProcesser = new PCMProcesser();
            short[] newSamples = pcmProcesser.PitchPcmNote(samples.ToArray(), -24, true, 10);

            pcm_buffer = new byte[newSamples.Length * 2];
            int idx = 0;

            for (int i = 0; i < newSamples.Length; i++)
            {
                pcm_buffer[idx++] = (byte)(newSamples[i] & 0xff);
                pcm_buffer[idx++] = (byte)((newSamples[i] >> 8) & 0xff);
            }


            List <short> shortBufs = new List <short>();
            short        val;

            for (int i = 0; i < pcm_buffer.Length; i += 2)
            {
                val = (short)((pcm_buffer[i + 1] << 8) | pcm_buffer[i]);
                shortBufs.Add(val);
            }

            List <float> floatBufs = new List <float>();

            for (int i = 0; i < pcm_buffer.Length; i += 2)
            {
                val = (short)((pcm_buffer[i + 1] << 8) | pcm_buffer[i]);
                floatBufs.Add(val);
            }

            pcm = shortBufs.ToArray();
            float[] seqDatas = pcmProcesser.CreatePcmFreqNormAmpSpectrum(pcm, 44100);

            List <float> samplesFloat = new List <float>();

            for (int i = 0; i < shortBufs.Count; i++)
            {
                samplesFloat.Add(shortBufs[i]);
            }


            this.scMgr = scMgr;
            root       = scMgr.GetRootLayer();

            ScChart chart = new ScChart(scMgr);

            chart.GetAxisXSeq = GetAxisXSeq;
            chart.Datas       = samplesFloat.ToArray();
            // chart.DataLineColor = Color.Blue;
            //  chart.XAxisColor = Color.White;
            // chart.DataRange = new DrawDataRange(0, 5000);
            chart.xAxisSeqCount = 10;
            chart.Dock          = ScDockStyle.Fill;
            // chart.BackgroundColor = Color.Black;
            root.Add(chart);
        }