Пример #1
0
        public SplitContainer()
        {
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

            fixed_panel = FixedPanel.None;
            orientation = Orientation.Vertical;

            splitter_rectangle = new Rectangle(50, 0, 4, this.Height);
            splitter_increment = 1;
            splitter_prev_move = -1;
            restore_cursor     = null;

            splitter_fixed   = false;
            panel1_collapsed = false;
            panel2_collapsed = false;
            panel1_min_size  = 25;
            panel2_min_size  = 25;

            panel1      = new SplitterPanel(this);
            panel2      = new SplitterPanel(this);
            panel1.Size = new Size(50, 50);
            UpdateSplitter();

            this.Controls.Add(panel2);
            this.Controls.Add(panel1);
        }
Пример #2
0
        //private void button1_Click(object sender, EventArgs e)
        //{
        //    this.textBox3.Text = clsASCIITransfer.StringToHexString(this.textBox2.Text+"\n\r", Encoding.ASCII).ToUpper();
        //    byte[] bytes;
        //    try
        //    {
        //        bytes = new byte[this.textBox3.Text.Length / 3];
        //        for (int i = 0; i < this.textBox3.Text.Length; i += 3)
        //        {
        //            try
        //            {
        //                bytes[i / 3] = Convert.ToByte(this.textBox3.Text.Substring(i, 2), 0x10);
        //            }
        //            catch
        //            {
        //            }
        //        }
        //        //if (this.serialPort1.IsOpen)
        //        //{
        //        //    this.serialPort1.Close();
        //        //}
        //        //this.serialPort1.Open();
        //        //this.ab.Write(bytes, 0, bytes.Length);
        //        this.ab.WriteLine(this.textBox2.Text);
        //    }
        //    catch(Exception ex)
        //    {
        //        MessageBox.Show( ex.Message, "LCR设备测试", MessageBoxButtons.OK, MessageBoxIcon.Error);
        //    }

        //}
        private void SetSplitContainer(ref SplitContainer SplitC, FixedPanel _Panel)
        {
            SplitC.FixedPanel      = _Panel;
            SplitC.BorderStyle     = BorderStyle.None;
            SplitC.SplitterWidth   = 1;
            SplitC.IsSplitterFixed = true;
        }
Пример #3
0
        public void FixedPanelSetter_InvertedTest(FixedPanel inputValue, FixedPanel internalValue)
        {
            using (var splitContainer = new OTSplitContainer())
            {
                splitContainer.IsPanelInverted = true;

                // 反転中に FixedPanel を変更する
                splitContainer.FixedPanel = inputValue;
                Assert.Equal(internalValue, ((SplitContainer)splitContainer).FixedPanel);
            }
        }
Пример #4
0
        public void FixedPanelGetter_InvertedTest(FixedPanel fixedPanel)
        {
            using (var splitContainer = new OTSplitContainer())
            {
                splitContainer.FixedPanel = fixedPanel;

                Assert.Equal(fixedPanel, splitContainer.FixedPanel);

                // 反転した状態でも OTSplitterContainer.FixedPanel の値は外見上変化しない
                splitContainer.IsPanelInverted = true;
                Assert.Equal(fixedPanel, splitContainer.FixedPanel);
            }
        }
Пример #5
0
 public MoveAnimation(FixedPanel f, Widget w, int destx, int desty)
     : base(w)
 {
     panel = f;
     int x, y;
     f.GetPosition (w, out x, out y);
     curx = (float)x;
     cury = (float)y;
     this.destx = (float) destx;
     this.desty = (float) desty;
 }
Пример #6
0
        public void FixedPanelSetter_InvertedTest(FixedPanel inputValue, FixedPanel internalValue)
        {
            using (var splitContainer = new OTSplitContainer())
            {
                splitContainer.IsPanelInverted = true;

                // 反転中に FixedPanel を変更する
                splitContainer.FixedPanel = inputValue;
                Assert.Equal(internalValue, ((SplitContainer)splitContainer).FixedPanel);
            }
        }
Пример #7
0
        public void FixedPanelGetter_InvertedTest(FixedPanel fixedPanel)
        {
            using (var splitContainer = new OTSplitContainer())
            {
                splitContainer.FixedPanel = fixedPanel;

                Assert.Equal(fixedPanel, splitContainer.FixedPanel);

                // 反転した状態でも OTSplitterContainer.FixedPanel の値は外見上変化しない
                splitContainer.IsPanelInverted = true;
                Assert.Equal(fixedPanel, splitContainer.FixedPanel);
            }
        }
Пример #8
0
		public SplitContainer ()
		{
			SetStyle (ControlStyles.SupportsTransparentBackColor, true);
			SetStyle (ControlStyles.OptimizedDoubleBuffer, true);
			
			fixed_panel = FixedPanel.None;
			orientation = Orientation.Vertical;

			splitter_rectangle = new Rectangle (50, 0, 4, this.Height);
			splitter_increment = 1;
			splitter_prev_move = -1;
			restore_cursor = null;

			splitter_fixed = false;
			panel1_collapsed = false;
			panel2_collapsed = false;
			panel1_min_size = 25;
			panel2_min_size = 25;

			panel1 = new SplitterPanel (this);
			panel2 = new SplitterPanel (this);
			panel1.Size = new Size (50, 50);
			UpdateSplitter ();

			this.Controls.Add (panel2);
			this.Controls.Add (panel1);
		}
        /// <summary>
        /// Initialize a new instance of the KryptonSplitContainer class.
        /// </summary>
        public KryptonSplitContainer()
        {
            // Create the palette storage
            _stateCommon = new PaletteSplitContainerRedirect(Redirector, PaletteBackStyle.PanelClient,
                                                             PaletteBorderStyle.ControlClient, PaletteBackStyle.SeparatorLowProfile,
                                                             PaletteBorderStyle.SeparatorLowProfile, NeedPaintDelegate);

            _stateDisabled = new PaletteSplitContainer(_stateCommon, _stateCommon.Separator, _stateCommon.Separator, NeedPaintDelegate);
            _stateNormal = new PaletteSplitContainer(_stateCommon, _stateCommon.Separator, _stateCommon.Separator, NeedPaintDelegate);
            _stateTracking = new PaletteSeparatorPadding(_stateCommon.Separator, _stateCommon.Separator, NeedPaintDelegate);
            _statePressed = new PaletteSeparatorPadding(_stateCommon.Separator, _stateCommon.Separator, NeedPaintDelegate);

            // Our view contains just a simple canvas that covers entire client area and a separator view
            _drawSeparator = new ViewDrawSeparator(_stateDisabled.Separator, _stateNormal.Separator, _stateTracking, _statePressed,
                                                   _stateDisabled.Separator, _stateNormal.Separator, _stateTracking, _statePressed,
                                                    PaletteMetricPadding.SeparatorPaddingLowProfile, Orientation.Vertical);

            _drawPanel = new ViewDrawPanel(_stateNormal.Back);
            _drawPanel.Add(_drawSeparator);

            // Create a separator controller to handle separator style behaviour
            _separatorController = new SeparatorController(this, _drawSeparator, true, true, NeedPaintDelegate);

            // Assign the controller to the view element to treat as a separator
            _drawSeparator.MouseController = _separatorController;
            _drawSeparator.KeyController = _separatorController;
            _drawSeparator.SourceController = _separatorController;

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawPanel);

            // Set other internal starting values
            _splitterDistance = 50;
            _splitterPercent = 1f / 3f;
            _splitterIncrement = 1;
            _panel1MinSize = 25;
            _panel2MinSize = 25;
            _splitterWidth = 5;
            _fixedDistance = 50;
            _fixedPanel = FixedPanel.None;
            _orientation = Orientation.Vertical;

            // Create the two fixed child panels
            _panel1 = new KryptonSplitterPanel(this);
            _panel2 = new KryptonSplitterPanel(this);

            // Add both panels to the controls collection
            ((KryptonReadOnlyControls)Controls).AddInternal(_panel1);
            ((KryptonReadOnlyControls)Controls).AddInternal(_panel2);
        }
    public void OnInputClicked(InputClickedEventData eventData)
    {
        if (eventData.used)
        {
            return;
        }
        eventData.Use();

        toolbar.GetComponent <Toolbar>().DisableAllButtons();
        toolbar.GetComponent <Tagalong>().enabled = false;

        AnchorsManager.Instance.DiskSaveCompletedAction += OnSaveCompleted;

        WorldAnchor[] anchors = FindObjectsOfType <WorldAnchor>();

        switch (TargetsManager.Instance.calibrationMode)
        {
        case TargetsManager.CalibrationMode.COLUMN:

            List <WorldAnchor> columnAnchors = new List <WorldAnchor>();
            foreach (WorldAnchor anchor in anchors)
            {
                //If its a FixedColumn, then it has 4 children.
                if (anchor.gameObject.transform.childCount != 4)
                {
                    Debug.LogFormat("{0} does not have 4 children, cannot be FixedColumn. Skipping anchor!", anchor.name);
                    continue;
                }

                if (!AnchorsManager.IsValidColumnAnchorId(anchor.gameObject.name))
                {
                    Debug.LogFormat("Anchor gameobject's name does not suit column image target. Skipping anchor!", anchor.name);
                    continue;
                }

                columnAnchors.Add(anchor);
            }

            AnchorsManager.Instance.SaveAllColumnAnchorsToDisk(columnAnchors.ToArray());
            break;

        case TargetsManager.CalibrationMode.PANEL:

            List <WorldAnchor> panelAnchors = new List <WorldAnchor>();
            foreach (WorldAnchor anchor in anchors)
            {
                //Since we only anchor FixedPanel and FixedColumn, we can start by checking if it has FixedPanel.
                FixedPanel fixedPanel = anchor.gameObject.GetComponent <FixedPanel>();
                if (fixedPanel == null)
                {
                    Debug.LogFormat("Anchor's gameobject does not have FixedPanel. Skipping anchor!", anchor.name);
                    continue;
                }

                panelAnchors.Add(anchor);
            }

            AnchorsManager.Instance.SaveAllPanelAnchorsToDisk(panelAnchors.ToArray());
            break;

        default:
            OnSaveCompleted();
            break;
        }
    }