示例#1
0
文件: App.cs 项目: 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);
        }
示例#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);
            }
        }
示例#3
0
        void DisplayItem3(ScLayer columnItem, int dataRowIdx)
        {
            ScListView listView;

            if (columnItem.Name == "ListViewPack")
            {
                listView = (ScListView)(columnItem.controls[1]);
            }
            else
            {
                listView = (ScListView)(columnItem);
            }

            listView.ResetDataRowCount(testDatalistFront.Count());
        }
示例#4
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);
        }
示例#5
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();



            //
        }
示例#6
0
        void DisplayItem(ScLayer columnItem, int dataRowIdx)
        {
            ScLabel label = (ScLabel)columnItem;

            if (label == null)
            {
                return;
            }

            if (dataRowIdx % 2 == 0)
            {
                label.ForeColor = Color.FromArgb(255, 0, 0, 0);
                label.ForeFont  = new D2DFont("微软雅黑", 12, SharpDX.DirectWrite.FontWeight.Regular);
            }
            else
            {
                label.ForeColor = Color.FromArgb(255, 0, 0, 255);
                label.ForeFont  = new D2DFont("微软雅黑", 17, SharpDX.DirectWrite.FontWeight.Bold);
            }


            label.Text  = testDatalistFront[dataRowIdx].test;
            label.Value = label.Text;
        }
示例#7
0
 void DisplayItem1(ScLayer columnItem, int dataRowIdx)
 {
 }
示例#8
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);
        }