Exemplo n.º 1
0
        /**
         *
         *  Called when the rollOverDelay Timer is up and we should show the drop down.
         */
        private void rollOverDelay_timerCompleteHandler(Event e)
        {
            OpenButton.RemoveEventListener(MouseEvent.ROLL_OUT, OpenButtonRollOutHandler);
            _rollOverOpenDelayTimer = null;

            OpenDropDownHelper();
        }
Exemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            OpenButton.SetImage(UIImage.FromBundle("Green.png"), UIControlState.Normal);

            // Perform any additional setup after loading the view, typically from a nib.
        }
Exemplo n.º 3
0
    private void Update()
    {
        //вот тут
        if (Input.GetKeyDown(KeyCode.F))
        {
            RaycastHit Hit        = (RaycastHit)DoRayCasting();
            OpenButton openButton = Hit.transform.GetComponentInParent <OpenButton>();
            Key        key        = Hit.transform.GetComponentInParent <Key>();

            if (key != null)
            {
                key.OnButtonB();
            }
            if (openButton != null)
            {
                openButton.OnClickB();
            }
            Debug.Log(Hit.transform.name);
        }



        //лок мышки
        if (Input.GetKeyDown(KeyCode.O))
        {
            if (Cursor.lockState == CursorLockMode.Locked)
            {
                Cursor.lockState = CursorLockMode.None;
            }
            else if (Cursor.lockState != CursorLockMode.Locked)
            {
                Cursor.lockState = CursorLockMode.Locked;
            }
        }
    }
Exemplo n.º 4
0
 void CreateOpenButton()
 {
     OpenButton = Instantiate(OpenButtonPrefab, Canvas.transform);
     OpenButton.GetComponent <OpenButton>().SetTarget(transform);
     OpenButton.GetComponent <Button>().onClick.AddListener(
         () => OnClickOpenButton(OpenButton)
         );
     OpenButton.GetComponentInChildren <Text>().text = name;
 }
Exemplo n.º 5
0
        /**
         *
         *  Called when the openButton's rollOut event is dispatched while waiting
         *  for the rollOverOpenDelay. This will cancel the timer so we don't open
         *  any more.
         */
        private void OpenButtonRollOutHandler(Event e)
        {
            if (null != _rollOverOpenDelayTimer && _rollOverOpenDelayTimer.IsRunning)
            {
                _rollOverOpenDelayTimer.Stop();
                _rollOverOpenDelayTimer = null;
            }

            OpenButton.RemoveEventListener(MouseEvent.ROLL_OUT, OpenButtonRollOutHandler);
        }
 private void ConfigureComponents()
 {
     // load description
     description.LoadFile(new MemoryStream(Resources.description), RichTextBoxStreamType.RichText);
     // set commands for buttons
     OpenButton.SetCommand(Commands.Open, graphControl);
     PrintButton.SetCommand(Commands.Print, graphControl);
     ZoomInButton.SetCommand(Commands.IncreaseZoom, graphControl);
     ZoomOutButton.SetCommand(Commands.DecreaseZoom, graphControl);
     FitContentButton.SetCommand(Commands.FitGraphBounds, graphControl.FitContentViewMargins, graphControl);
 }
Exemplo n.º 7
0
        private void CreateTooltips()
        {
            ShowErrorToggleButton.SetTooltip(LogViewerCommands.Logging.ToggleErrorInputGesture);
            ShowWarningToggleButton.SetTooltip(LogViewerCommands.Logging.ToggleWarningInputGesture);
            ShowInfoToggleButton.SetTooltip(LogViewerCommands.Logging.ToggleInfoInputGesture);
            ShowDebugToggleButton.SetTooltip(LogViewerCommands.Logging.ToggleDebugInputGesture);

            EnableTimestampToggleButton.SetTooltip(LogViewerCommands.Logging.ToggleTimestampInputGesture, "Show timestamps");
            FilterBox.SetTooltip(LogViewerCommands.Logging.FilterInputGesture);

            ClearButton.SetTooltip(LogViewerCommands.Logging.ClearInputGesture);
            CopyButton.SetTooltip(LogViewerCommands.Logging.CopyToClipboardInputGesture);
            OpenButton.SetTooltip(LogViewerCommands.Logging.OpenInEditorInputGesture);
        }
Exemplo n.º 8
0
 /**
  *
  *  Removes event triggers from the openButton to open the popup.
  *
  *  <p>This is called from the openButton setter after the openButton has been set.</p>
  */
 private void RemoveOpenTriggers()
 {
     if (null == OpenButton)
     {
         return;
     }
     if (null == RolloverOpenDelay)
     {
         OpenButton.RemoveEventListener(ButtonEvent.BUTTON_DOWN, OpenButtonButtonDownHandler);
     }
     else
     {
         OpenButton.RemoveEventListener(MouseEvent.ROLL_OVER, OpenButtonRollOverHandler);
     }
 }
Exemplo n.º 9
0
        /**
         *
         *  Set isProgrammatic to true if you are opening the dropDown programmatically
         *  or not through a mouse click or rollover.
         */
        private void OpenDropDownHelper(bool isProgrammatic = false)
        {
            if (!IsOpen)
            {
                AddCloseTriggers();

                _isOpen = true;
                // Force the button to stay in the down state
                if (null != OpenButton)
                {
                    OpenButton.KeepDown(true, !isProgrammatic);
                }

                DispatchEvent(new DropDownEvent(DropDownEvent.OPEN));
            }
        }
        /*
         * Experimental code!
         * Exploring the use of the Command pattern to wire up controls to
         * OnClick events, and have the controls enable/disable themselves using the
         * command's CanExecuteChanged() method.
         */
        private void AttachCommands()
        {
            var maybeController = SharedResources.ConnectionManager.MaybeControllerInstance;

            if (!maybeController.Any())
            {
                return;
            }
            var controller = maybeController.Single();

            clickCommands = new List <ClickCommand>
            {
                OpenButton.AttachCommand(ExecuteOpenShutter, CanMoveShutterOrDome),
                CloseButton.AttachCommand(ExecuteCloseShutter, CanMoveShutterOrDome)
            };
        }
Exemplo n.º 11
0
 public MainMasterView()
 {
     InitializeComponent();
     this.WhenActivated(disposables =>
     {
         OpenButton
         .Events()
         .Clicked
         .Select(args => ViewModel.SelectedProvider)
         .Where(provider => provider != null)
         .Select(x => new CloudExplorerView {
             ViewModel = x
         })
         .Subscribe(NavigateToProvider)
         .DisposeWith(disposables);
     });
 }
Exemplo n.º 12
0
        public Tooltip(string tooltipText, string innerText, string backgroundColor, string id,  double width, string href = "")
        {
            Style = GetStyle();

            var strWr = new StringWriter();
            using (var writer = new HtmlTextWriter(strWr))
            {
                writer.AddAttribute("data-tooltip", tooltipText);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "tooltip");
                writer.AddAttribute(HtmlTextWriterAttribute.Id, id);
                writer.AddStyleAttribute(HtmlTextWriterStyle.BackgroundColor, backgroundColor);
                writer.AddStyleAttribute(HtmlTextWriterStyle.Width, width.ToString("00.000", CultureInfo.InvariantCulture) + @"%");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                if (!href.Equals(""))
                {
                    var button = new OpenButton("", href, backgroundColor);
                    writer.Write(button.ButtonHtml);
                }

                writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "inline-block");
                writer.AddStyleAttribute(HtmlTextWriterStyle.Overflow, "hidden");
                writer.AddAttribute(HtmlTextWriterAttribute.Id, "tooltip-item-inner-text");
                writer.RenderBeginTag(HtmlTextWriterTag.A);
                if (innerText.Contains(Environment.NewLine))
                {
                    var lines = innerText.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
                    foreach (var line in lines)
                    {
                        writer.Write(line);
                        writer.AddTag(HtmlTextWriterTag.Br);
                    }
                }
                else
                {
                    writer.Write(innerText);
                }
                writer.RenderEndTag(); //A

                writer.RenderEndTag(); //DIV

            }

            HtmlCode = strWr.ToString();
        }
Exemplo n.º 13
0
        /**
         *
         *  Called when the openButton's <code>rollOver</code> event is dispatched. This function opens
         *  the drop down, or opens the drop down after the length of time specified by the
         *  <code>rollOverOpenDelay</code> property.
         */
        internal void OpenButtonRollOverHandler(Event e)
        {
            if (null == RolloverOpenDelay)
            {
                return;
            }

            if (RolloverOpenDelay == 0)
            {
                OpenDropDownHelper();
            }
            else
            {
                OpenButton.AddEventListener(MouseEvent.ROLL_OUT, OpenButtonRollOutHandler);
                _rollOverOpenDelayTimer = new Timer((float)RolloverOpenDelay, 1);
                _rollOverOpenDelayTimer.AddEventListener(Timer.COMPLETE, rollOverDelay_timerCompleteHandler);
                _rollOverOpenDelayTimer.Start();
            }
        }
Exemplo n.º 14
0
        /**
         *
         *  Helper method for the mouseMove and mouseUp handlers to see if
         *  the mouse is over a "valid" region.  This is used to help determine
         *  when the dropdown should be closed.
         */
        private bool IsTargetOverDropDownOrOpenButton(DisplayObject target)
        {
            if (null != target)
            {
                // check if the target is the openButton or contained within the openButton
                if (OpenButton.Contains(target as DisplayListMember))
                {
                    return(true);
                }
                if (HitAreaAdditions != null)
                {
                    foreach (DisplayObject displayObject in HitAreaAdditions)
                    {
                        if (displayObject == target ||
                            ((displayObject is DisplayObjectContainer) && ((DisplayObjectContainer)displayObject).Contains(target as DisplayListMember)))
                        {
                            return(true);
                        }
                    }
                }

                // check if the target is the dropdown or contained within the dropdown
                var down = DropDown as DisplayObjectContainer;
                if (down != null)
                {
                    if (down.Contains((DisplayListMember)target))
                    {
                        return(true);
                    }
                }
                else
                {
                    if (target == DropDown)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Exemplo n.º 15
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="commit"></param>
        public void CloseDropDown(bool commit)
        {
            if (IsOpen)
            {
                _isOpen = false;
                if (null != OpenButton)
                {
                    OpenButton.KeepDown(false);
                }

                var dde = new DropDownEvent(DropDownEvent.CLOSE, false, true);

                if (!commit)
                {
                    dde.PreventDefault();
                }

                DispatchEvent(dde);

                RemoveCloseTriggers();
            }
        }
Exemplo n.º 16
0
        public Plate_Window()
        {
            InitializeComponent();

            timer_PlateLink          = new System.Threading.Timer(PlateTimeLink, null, TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(10));
            OnLineLable.BackColor    = Color.DarkRed;
            Plate_.PlateCallBack     = new Action <string, uint>(PlateCallBack);
            PlateStar               += Plate_.CallbackFuntion;
            Plate_.GetmessageAction  = new Action <string>(Message);
            Plate_.PlateDataCallBack = new Action <string, string, string, string>(PlateDataInfoOut);
            Plate_.JpegCallBack      = new Action <byte[]>(JpegCallBack);
            Plate_.DataJpegCallBack  = new Action <byte[]>(DataJpeg);
            setRelayClose           += Plate_.SetRelayClose;
            PlateSettiger           += Plate_.SetTrigger;
            PlateQuitDevice         += Plate_.QuitDevice;
            PlayAction               = new Action <bool>(Plate_.Play);
            Send485Action            = new Action <string>(Plate_.RS485Send);
            SetIpAction              = new Action <string>(Plate_.SetIpNetwork);
            SetSaveImg               = new Action <string>(Plate_.SetSavrImagePath);
            PlateSearchDevice       += Plate_.SearchDeviceList;

            PlateIpTextBox.Text   = Properties.Settings.Default.PlateIPAddr;
            PlatePortTextBox.Text = Properties.Settings.Default.PlatePort.ToString();
            PlateSetIp();
            PlateSetPath();

            LinkButton.Hide();
            AbortButton.Hide();
            TiggerButton.Hide();
            LinkButton.Hide();
            LiftingButton.Hide();
            TransmissionButton.Hide();
            SearchButton.Hide();
            SetIpButton.Hide();
            SetPathButton.Hide();
            OpenButton.Hide();
            CloseButton.Hide();
            OnLineLable.Hide();
        }
Exemplo n.º 17
0
        partial void OpenButton_TouchUpInside(UIButton sender)
        {
            if (mark == false)
            {
                //OpenButton.SetTitle("关闭", UIControlState.Normal);
                OpenButton.SetImage(UIImage.FromBundle("Red.png"), UIControlState.Normal);

                #region 摄像头调用
                CaptureSession = new AVCaptureSession();
                CaptureSession.SessionPreset = AVCaptureSession.PresetMedium;
                videoDevice = AVCaptureDevice.GetDefaultDevice(AVMediaType.Video);

                NSError error = null;
                videoDevice.LockForConfiguration(out error);
                if (error != null)
                {
                    videoDevice.UnlockForConfiguration();
                }
                videoDevice.TorchMode = AVCaptureTorchMode.On;
                videoDevice.UnlockForConfiguration();

                CaptureSession.StartRunning();
                #endregion
            }
            else
            {
                //OpenButton.SetTitle("打开", UIControlState.Normal);
                OpenButton.SetImage(UIImage.FromBundle("Green.png"), UIControlState.Normal);
                NSError error = null;
                videoDevice.LockForConfiguration(out error);
                if (error != null)
                {
                    videoDevice.UnlockForConfiguration();
                }
                videoDevice.TorchMode = AVCaptureTorchMode.Off;
                videoDevice.UnlockForConfiguration();
            }
            mark = !mark;
        }
Exemplo n.º 18
0
        void ReleaseDesignerOutlets()
        {
            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

            if (LinkComboBox != null)
            {
                LinkComboBox.Dispose();
                LinkComboBox = null;
            }

            if (OpenButton != null)
            {
                OpenButton.Dispose();
                OpenButton = null;
            }

            if (OpenLocationWindow != null)
            {
                OpenLocationWindow.Dispose();
                OpenLocationWindow = null;
            }

            if (TokenTextField != null)
            {
                TokenTextField.Dispose();
                TokenTextField = null;
            }

            if (TokenStatusTextField != null)
            {
                TokenStatusTextField.Dispose();
                TokenStatusTextField = null;
            }
        }
Exemplo n.º 19
0
 private void OpenTButton_Click(object sender, EventArgs e)
 {
     OpenButton.PerformClick();
 }
Exemplo n.º 20
0
        public void Save(TextBlock block)
        {
            block.SetAttribute(nameof(PanelMode), PanelMode.ToString());
            if (ListMode != ContentBrowser.ListModeEnum.List)
            {
                block.SetAttribute(nameof(ListMode), ListMode.ToString());
            }
            if (TileImageSize != TileImageSizeDefault)
            {
                block.SetAttribute(nameof(TileImageSize), TileImageSize.ToString());
            }
            if (ListImageSize != ListImageSizeDefault)
            {
                block.SetAttribute(nameof(ListImageSize), ListImageSize.ToString());
            }
            if (ListColumnWidth != ListColumnWidthDefault)
            {
                block.SetAttribute(nameof(ListColumnWidth), ListColumnWidth.ToString());
            }
            if (!Breadcrumb)
            {
                block.SetAttribute(nameof(Breadcrumb), Breadcrumb.ToString());
            }
            if (DisplayPropertiesSortFilesBy)
            {
                if (SortFilesBy != ContentBrowser.SortByItems.Name)
                {
                    block.SetAttribute(nameof(SortFilesBy), SortFilesBy.ToString());
                }
                if (!SortFilesByAscending)
                {
                    block.SetAttribute(nameof(SortFilesByAscending), SortFilesByAscending.ToString());
                }
            }
            if (owner.Mode == ContentBrowser.ModeEnum.Resources)
            {
                if (!FilteringModeButton)
                {
                    block.SetAttribute(nameof(FilteringModeButton), FilteringModeButton.ToString());
                }
            }
            if (owner.Mode == ContentBrowser.ModeEnum.Objects)
            {
                if (!MembersButton)
                {
                    block.SetAttribute(nameof(MembersButton), MembersButton.ToString());
                }
            }
            if (DisplayPropertiesOpenButton)
            {
                if (!OpenButton)
                {
                    block.SetAttribute(nameof(OpenButton), OpenButton.ToString());
                }
            }
            if (DisplayPropertiesEditorSettingsButtons)
            {
                if (!EditorButton)
                {
                    block.SetAttribute(nameof(EditorButton), EditorButton.ToString());
                }
                if (!SettingsButton)
                {
                    block.SetAttribute(nameof(SettingsButton), SettingsButton.ToString());
                }
            }
            if (!ButtonsForEditing)
            {
                block.SetAttribute(nameof(ButtonsForEditing), ButtonsForEditing.ToString());
            }
            if (owner.Mode == ContentBrowser.ModeEnum.Objects)
            {
                if (!SearchButton)
                {
                    block.SetAttribute(nameof(SearchButton), SearchButton.ToString());
                }
            }

            //!!!!
            if (!SearchBar)
            {
                block.SetAttribute(nameof(SearchBar), SearchBar.ToString());
            }

            block.SetAttribute(nameof(SplitterPosition), SplitterPosition.ToString());
        }
Exemplo n.º 21
0
 public void ClickOpenButton()
 {
     logger.Info("Click open button");
     OpenButton.Click();
 }
Exemplo n.º 22
0
 public SendPage ClickOpenButton()
 {
     OpenButton.Click();
     return(this);
 }
Exemplo n.º 23
0
 public void OpenButtonClick()
 {
     logger.Info("Open button click");
     OpenButton.Click();
     WaitForAMinute();
 }
Exemplo n.º 24
0
        private void SquezeButton_Click(object sender, EventArgs e)
        {
            if (selectedState == null)
            {
                DialogResult rezult = MessageBox.Show("Choose image fourth.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            else if (SourceImage.Image == null)
            {
                DialogResult rezult = MessageBox.Show("Choose image.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            else
            {
                SaveButton.Location = new Point(OpenButton.Location.X, OpenButton.Location.Y);
                SaveButton.Show();
                FileName.Text = "File path ...";
                OpenButton.Hide();

                for (int i = 0; i < 256; i++)
                {
                    ArrR[i]  = new double[256];
                    ArrG[i]  = new double[256];
                    ArrB[i]  = new double[256];
                    ArrR1[i] = new double[256];
                    ArrG1[i] = new double[256];
                    ArrB1[i] = new double[256];
                }

                code.ImageToArray(image, ref ArrR, ref ArrG, ref ArrB, sFileName);
                code.Fragmentation(ArrR, ArrG, ArrB, coordX, coordY);
                code.Comprassion(ref timeMain, ref timeBg);
                code.Merge(ref ArrR1, ref ArrG1, ref ArrB1);
                code.Calculation(ref SKO, ref PSNR, ArrR, ArrG, ArrB, ArrR1, ArrG1, ArrB1);
                code.ArrayToImage(ref image, ArrR1, ArrG1, ArrB1);
                ResultImage.Image = image;
                ResultImage.Invalidate();
                sFileName = "C:\\Users\\Public\\Documents\\AdaptiveComprassion\\tmp";
                System.IO.Directory.CreateDirectory("C:\\Users\\Public\\Documents\\AdaptiveComprassion");
                if (System.IO.File.Exists(sFileName))
                {
                    do
                    {
                        sFileName += DateTime.Now.Minute;
                    } while (System.IO.File.Exists(sFileName));
                }
                image.Save(sFileName, System.Drawing.Imaging.ImageFormat.Png);
                FileInfo imageInfo = new FileInfo(sFileName);
                resultSizeInKBytes = Convert.ToInt32(imageInfo.Length / 1024);
                File.Delete("C:\\Users\\Public\\Documents\\AdaptiveComprassion\\tmp");
                sFileName = null;

                conn.Open();
                string insert = "INSERT INTO Characteristics (Data, InputS, OutputS, RatioMain, RatioBg, TimeMain, TimeBg, NN1, NN2, SKO, PSNR) VALUES ( ";
                insert += "'" + Dat.ToString() + "', " + sourceSizeInKBytes + ", " + resultSizeInKBytes + ", 2 , 4, " + timeMain + ", " + timeBg + ", '{64;32;64}', '{64;16;64}', " + "'" + SKO.ToString() + "', " + "'" + PSNR.ToString() + "')";
                SQLiteCommand ins = new SQLiteCommand(insert, conn);
                ins.ExecuteNonQuery();
                conn.Close();

                SquezeButton.Enabled = false;
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// Make a shadow copy of the element at the current state which stays available even the element is gone.
        /// </summary>
        /// <returns>A shadow copy of the current element.</returns>
        public new BasicOpenFileDialogData GetDataCopy()
        {
            var data = new BasicOpenFileDialogData();

            FillData(data);

            data.InputComboBox = GetSafeData(() =>
            {
                if (InputComboBox == null)
                {
                    return(null);
                }
                return(InputComboBox.GetDataCopy());
            });

            data.BreadCrumbBar = GetSafeData(() =>
            {
                if (BreadCrumbBar == null)
                {
                    return(null);
                }
                return(BreadCrumbBar.GetDataCopy());
            });

            data.BreadCrumbTextBox = GetSafeData(() =>
            {
                if (BreadCrumbTextBox == null)
                {
                    return(null);
                }
                return(BreadCrumbTextBox.GetDataCopy());
            });

            data.FilterComboBox = GetSafeData(() =>
            {
                if (FilterComboBox == null)
                {
                    return(null);
                }
                return(FilterComboBox.GetDataCopy());
            });

            data.CancelButton = GetSafeData(() =>
            {
                if (CancelButton == null)
                {
                    return(null);
                }
                return(CancelButton.GetDataCopy());
            });

            data.OpenButton = GetSafeData(() =>
            {
                if (OpenButton == null)
                {
                    return(null);
                }
                return(OpenButton.GetDataCopy());
            });

            data.FilesList = GetSafeData(() =>
            {
                if (FilesList == null)
                {
                    return(null);
                }
                return(FilesList.GetDataCopy());
            });

            data.SearchTextBox = GetSafeData(() =>
            {
                if (SearchTextBox == null)
                {
                    return(null);
                }
                return(SearchTextBox.GetDataCopy());
            });

            data.SearchButton = GetSafeData(() =>
            {
                if (SearchButton == null)
                {
                    return(null);
                }
                return(SearchButton.GetDataCopy());
            });

            data.FolderTree = GetSafeData(() =>
            {
                if (FolderTree == null)
                {
                    return(null);
                }
                return(FolderTree.GetDataCopy());
            });

            data.ToolBar = GetSafeData(() =>
            {
                if (ToolBar == null)
                {
                    return(null);
                }
                return(ToolBar.GetDataCopy());
            });

            data.ChangeViewButton = GetSafeData(() =>
            {
                if (ChangeViewButton == null)
                {
                    return(null);
                }
                return(ChangeViewButton.GetDataCopy());
            });

            data.ShowPreviewButton = GetSafeData(() =>
            {
                if (ShowPreviewButton == null)
                {
                    return(null);
                }
                return(ShowPreviewButton.GetDataCopy());
            });

            data.HelpButton = GetSafeData(() =>
            {
                if (HelpButton == null)
                {
                    return(null);
                }
                return(HelpButton.GetDataCopy());
            });

            return(data);
        }