void ReleaseDesignerOutlets()
        {
            if (AboutButton != null)
            {
                AboutButton.Dispose();
                AboutButton = null;
            }

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

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

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

            if (UsernameInput != null)
            {
                UsernameInput.Dispose();
                UsernameInput = null;
            }
        }
Esempio n. 2
0
        void ReleaseDesignerOutlets()
        {
            if (AboutButton != null)
            {
                AboutButton.Dispose();
                AboutButton = null;
            }

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

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

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

            if (TeamButton != null)
            {
                TeamButton.Dispose();
                TeamButton = null;
            }
        }
 private void MainForm_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F1)
     {
         AboutButton.PerformClick();
     }
 }
Esempio n. 4
0
        void ReleaseDesignerOutlets()
        {
            if (AboutButton != null)
            {
                AboutButton.Dispose();
                AboutButton = null;
            }

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

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

            if (RefreshButton != null)
            {
                RefreshButton.Dispose();
                RefreshButton = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (AboutButton != null)
            {
                AboutButton.Dispose();
                AboutButton = null;
            }

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

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

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

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

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

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

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

            if (WindSpeedLabel != null)
            {
                WindSpeedLabel.Dispose();
                WindSpeedLabel = null;
            }
        }
Esempio n. 6
0
 private void InitialiseAllStrings()
 {
     FirstNameTextField.Placeholder = Application.LocalizedString("FirstName");
     FirstNameLabel.Text            = Application.LocalizedString("FirstName");
     LastNameTextField.Placeholder  = Application.LocalizedString("LastName");
     LastNameLabel.Text             = Application.LocalizedString("LastName");
     EmailTextField.Placeholder     = Application.LocalizedString("EmailAddress");
     EmailTitleLabel.Text           = Application.LocalizedString("EmailParam");
     SaveButton.SetTitle(Application.LocalizedString("Save"), UIControlState.Normal);
     AboutButton.SetTitle(Application.LocalizedString("AboutParam"), UIControlState.Normal);
     LogOutButton.SetTitle(Application.LocalizedString("Logout"), UIControlState.Normal);
     ModifyUserImageButton.SetTitle(Application.LocalizedString("ModifyImage"), UIControlState.Normal);
     PhoneNumberLabel.Text = Application.LocalizedString("PhoneNumber");
     UpdatePasswordButton.SetTitle(Application.LocalizedString("PasswordParam"), UIControlState.Normal);
 }
Esempio n. 7
0
 void ReleaseDesignerOutlets()
 {
     if (AboutButton != null)
     {
         AboutButton.Dispose();
         AboutButton = null;
     }
     if (AddButton != null)
     {
         AddButton.Dispose();
         AddButton = null;
     }
     if (Collection != null)
     {
         Collection.Dispose();
         Collection = null;
     }
 }
        void ReleaseDesignerOutlets()
        {
            if (AboutButton != null)
            {
                AboutButton.Dispose();
                AboutButton = null;
            }

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

            if (MyLabel != null)
            {
                MyLabel.Dispose();
                MyLabel = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (AboutButton != null)
            {
                AboutButton.Dispose();
                AboutButton = null;
            }

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

            if (SummaryButton != null)
            {
                SummaryButton.Dispose();
                SummaryButton = null;
            }
        }
Esempio n. 10
0
        void ReleaseDesignerOutlets()
        {
            if (AboutButton != null)
            {
                AboutButton.Dispose();
                AboutButton = null;
            }

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

            if (MyText != null)
            {
                MyText.Dispose();
                MyText = null;
            }
        }
Esempio n. 11
0
 void _ui_events()
 {
     AppNameText.text = Application.productName;
     BgButton.onClick.AddListener(() => {
         if (!canHide && !canShow)
         {
             canHide = true;
         }
     });
     ExitButton.GetComponent <Button>().onClick.AddListener(() => {
         Application.Quit();
     });
     UserButton.GetComponent <Button>().onClick.AddListener(() => {
         Debug.Log(" 点击了用户指南按钮!");
         GuidePanel.SetActive(true);
     });
     AboutButton.GetComponent <Button>().onClick.AddListener(() => {
         Debug.Log(" 点击了关于我们按钮!");
         AboutPanel.SetActive(true);
     });
 }
 void ReleaseDesignerOutlets()
 {
     if (AboutButton != null)
     {
         AboutButton.Dispose();
         AboutButton = null;
     }
     if (IPTextField != null)
     {
         IPTextField.Dispose();
         IPTextField = null;
     }
     if (PortTextField != null)
     {
         PortTextField.Dispose();
         PortTextField = null;
     }
     if (RegisterButton != null)
     {
         RegisterButton.Dispose();
         RegisterButton = null;
     }
     if (ResetButton != null)
     {
         ResetButton.Dispose();
         ResetButton = null;
     }
     if (SettingsInfoText != null)
     {
         SettingsInfoText.Dispose();
         SettingsInfoText = null;
     }
     if (TimeoutSlider != null)
     {
         TimeoutSlider.Dispose();
         TimeoutSlider = null;
     }
 }
Esempio n. 13
0
        /////////////////////////////////////////////////////////////////////////////
        // Overridden Package Implementation
        #region Package Members

        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initialization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            Instance = this;
            Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString()));
            base.Initialize();

            m_writer = OutputWriter.Instance;

            var teamPage = (TeamSettingsPage)PublicGetDialogPage(typeof(TeamSettingsPage));
            var extPage  = (ExtensionSettingsPage)PublicGetDialogPage(typeof(ExtensionSettingsPage));
            var depPage  = (DependencySettingsPage)PublicGetDialogPage(typeof(DependencySettingsPage));

            SettingsProvider.SetSettingsPages(teamPage, extPage, depPage);


            m_deployButton = new DeployDebugButton(this, (int)PkgCmdIDList.cmdidDeployCode, false);
            m_debugButton  = new DeployDebugButton(this, (int)PkgCmdIDList.cmdidDebugCode, true);

            m_killButton = new KillButton(this);


            string monoFolder = WPILibFolderStructure.CreateMonoFolder();

            string monoFile = monoFolder + Path.DirectorySeparatorChar + DeployProperties.MonoVersion;

            m_monoFile = new MonoFile(monoFile);

            m_installMonoButton  = new InstallMonoButton(this, m_monoFile);
            m_downloadMonoButton = new DownloadMonoButton(this, m_monoFile, m_installMonoButton);
            m_saveMonoButton     = new SaveMonoButton(this, m_monoFile);


            m_aboutButton      = new AboutButton(this);
            m_netConsoleButton = new NetConsoleButton(this);
            m_settingsButton   = new SettingsButton(this);

            m_setMainRobotButton = new SetMainRobotButton(this);
        }
 void ReleaseDesignerOutlets()
 {
     if (AboutButton != null)
     {
         AboutButton.Dispose();
         AboutButton = null;
     }
     if (GenerositySlider != null)
     {
         GenerositySlider.Dispose();
         GenerositySlider = null;
     }
     if (SubTotalTextField != null)
     {
         SubTotalTextField.Dispose();
         SubTotalTextField = null;
     }
     if (TipLabel != null)
     {
         TipLabel.Dispose();
         TipLabel = null;
     }
 }
        void ReleaseDesignerOutlets()
        {
            if (AboutButton != null)
            {
                AboutButton.Dispose();
                AboutButton = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if (UserImageView != null)
            {
                UserImageView.Dispose();
                UserImageView = null;
            }
        }
Esempio n. 16
0
 public AboutPage ClickOnAboutButton()
 {
     AboutButton.Click();
     return(new AboutPage(_driver));
 }
Esempio n. 17
0
        public Editor()
        {
            this.ClientSize = new Size(BackgroundBitmap.Width, BackgroundBitmap.Height + TopBarBitmap.Height);

            InputA = new BitmapSliderSimple(TopSliderBitmap);
            InputA.Top = SliderY;
            InputA.Left = Slider1X;

            InputB = new BitmapSliderSimple(TopSliderBitmap);
            InputB.Top = SliderY;
            InputB.Left = Slider2X;

            // -------- first 4 knobs

            GainA = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX1, KnobY1, 0, BackgroundBitmap.Height);
            GainA.Left = KnobX1;
            GainA.Top = KnobY1 + TopH;

            VolA = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX1 + KnobW, KnobY1, 0, BackgroundBitmap.Height);
            VolA.Left = KnobX1 + KnobW;
            VolA.Top = KnobY1 + TopH;

            GainB = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX1, KnobY2, 0, BackgroundBitmap.Height);
            GainB.Left = KnobX1;
            GainB.Top = KnobY1 + KnobH + TopH;

            VolB = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX1 + KnobW, KnobY2, 0, BackgroundBitmap.Height);
            VolB.Left = KnobX1 + KnobW;
            VolB.Top = KnobY1 + KnobH + TopH;

            // ------- Channel Switch

            Channel = new BitmapSwitch(SwitchBitmap, SwitchBitmap.Width / 2, SwitchBitmap.Height, true, false);
            Channel.Left = SwitchX;
            Channel.Top = SwitchY + TopH;

            // -------- Channel Indicators

            LightA = new BitmapIndicator(Light1Bitmap, Light1Bitmap.Width / 2, Light1Bitmap.Height, false, false);
            LightA.Left = Light1X;
            LightA.Top = Light1Y + TopH;

            LightB = new BitmapIndicator(Light2Bitmap, Light2Bitmap.Width / 2, Light2Bitmap.Height, false, false);
            LightB.Left = Light2X;
            LightB.Top = Light2Y + TopH;

            LightC = new BitmapIndicator(Light3Bitmap, Light3Bitmap.Width / 2, Light3Bitmap.Height, false, false);
            LightC.Left = Light3X;
            LightC.Top = Light3Y + TopH;

            // -------- Channel A Controls

            BassA = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX2, KnobY1, 0, BackgroundBitmap.Height);
            BassA.Left = KnobX2;
            BassA.Top = KnobY1 + TopH;

            MidA = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX2 + KnobW, KnobY1, 0, BackgroundBitmap.Height);
            MidA.Left = KnobX2 + KnobW;
            MidA.Top = KnobY1 + TopH;

            TrebleA = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX2 + 2 * KnobW, KnobY1, 0, BackgroundBitmap.Height);
            TrebleA.Left = KnobX2 + 2 * KnobW;
            TrebleA.Top = KnobY1 + TopH;

            PresA = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX2 + 3 * KnobW, KnobY1, 0, BackgroundBitmap.Height);
            PresA.Left = KnobX2 + 3 * KnobW;
            PresA.Top = KnobY1 + TopH;

            // -------- Channel B Controls

            BassB = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX2, KnobY2, 0, BackgroundBitmap.Height);
            BassB.Left = KnobX2;
            BassB.Top = KnobY2 + TopH;

            MidB = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX2 + KnobW, KnobY2, 0, BackgroundBitmap.Height);
            MidB.Left = KnobX2 + KnobW;
            MidB.Top = KnobY2 + TopH;

            TrebleB = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX2 + 2 * KnobW, KnobY2, 0, BackgroundBitmap.Height);
            TrebleB.Left = KnobX2 + 2 * KnobW;
            TrebleB.Top = KnobY2 + TopH;

            PresB = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX2 + 3 * KnobW, KnobY2, 0, BackgroundBitmap.Height);
            PresB.Left = KnobX2 + 3 * KnobW;
            PresB.Top = KnobY2 + TopH;

            // Switches

            Boost = new BitmapSwitch(BoostBitmap, BoostBitmap.Width / 2, BoostBitmap.Height, false, false);
            Boost.Left = BoostX;
            Boost.Top = BoostY + TopH;

            MapControls();

            foreach(var ctrl in ControlMap)
            {
                if (ctrl.Value == null)
                    continue;

                if (ctrl.Value as Knob != null)
                {
                    ((Knob)ctrl.Value).Brush = Brushes.White;
                    ((Knob)ctrl.Value).ValueChanged += ParameterChanged;
                }
                else if (ctrl.Value as Switch != null)
                {
                    ((Switch)ctrl.Value).Brush = Brushes.White;
                    ((Switch)ctrl.Value).OffBrush = Brushes.White;
                    ((Switch)ctrl.Value).ValueChanged += ParameterChanged;
                }
                else if (ctrl.Value as BitmapSliderSimple != null)
                {
                    ((BitmapSliderSimple)ctrl.Value).ValueChanged += ParameterChanged;
                }

                Controls.Add((Control)ctrl.Value);
            }

            Controls.Add(LightA);
            Controls.Add(LightB);
            Controls.Add(LightC);

            var about = new AboutButton();
            about.Top = 0;
            about.Left = TopBarBitmap.Width - about.Width;
            about.Click += about_Click;
            Controls.Add(about);
        }
Esempio n. 18
0
        void ReleaseDesignerOutlets()
        {
            if (AboutButton != null)
            {
                AboutButton.Dispose();
                AboutButton = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if (myView != null)
            {
                myView.Dispose();
                myView = null;
            }
        }
Esempio n. 19
0
        public Editor()
        {
            this.ClientSize = new Size(BackgroundBitmap.Width, BackgroundBitmap.Height + TopBarBitmap.Height);

            InputA      = new BitmapSliderSimple(TopSliderBitmap);
            InputA.Top  = SliderY;
            InputA.Left = Slider1X;

            InputB      = new BitmapSliderSimple(TopSliderBitmap);
            InputB.Top  = SliderY;
            InputB.Left = Slider2X;

            // -------- first 4 knobs

            GainA      = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX1, KnobY1, 0, BackgroundBitmap.Height);
            GainA.Left = KnobX1;
            GainA.Top  = KnobY1 + TopH;

            VolA      = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX1 + KnobW, KnobY1, 0, BackgroundBitmap.Height);
            VolA.Left = KnobX1 + KnobW;
            VolA.Top  = KnobY1 + TopH;


            GainB      = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX1, KnobY2, 0, BackgroundBitmap.Height);
            GainB.Left = KnobX1;
            GainB.Top  = KnobY1 + KnobH + TopH;

            VolB      = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX1 + KnobW, KnobY2, 0, BackgroundBitmap.Height);
            VolB.Left = KnobX1 + KnobW;
            VolB.Top  = KnobY1 + KnobH + TopH;

            // ------- Channel Switch

            Channel      = new BitmapSwitch(SwitchBitmap, SwitchBitmap.Width / 2, SwitchBitmap.Height, true, false);
            Channel.Left = SwitchX;
            Channel.Top  = SwitchY + TopH;

            // -------- Channel Indicators

            LightA      = new BitmapIndicator(Light1Bitmap, Light1Bitmap.Width / 2, Light1Bitmap.Height, false, false);
            LightA.Left = Light1X;
            LightA.Top  = Light1Y + TopH;

            LightB      = new BitmapIndicator(Light2Bitmap, Light2Bitmap.Width / 2, Light2Bitmap.Height, false, false);
            LightB.Left = Light2X;
            LightB.Top  = Light2Y + TopH;

            LightC      = new BitmapIndicator(Light3Bitmap, Light3Bitmap.Width / 2, Light3Bitmap.Height, false, false);
            LightC.Left = Light3X;
            LightC.Top  = Light3Y + TopH;

            // -------- Channel A Controls

            BassA      = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX2, KnobY1, 0, BackgroundBitmap.Height);
            BassA.Left = KnobX2;
            BassA.Top  = KnobY1 + TopH;

            MidA      = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX2 + KnobW, KnobY1, 0, BackgroundBitmap.Height);
            MidA.Left = KnobX2 + KnobW;
            MidA.Top  = KnobY1 + TopH;

            TrebleA      = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX2 + 2 * KnobW, KnobY1, 0, BackgroundBitmap.Height);
            TrebleA.Left = KnobX2 + 2 * KnobW;
            TrebleA.Top  = KnobY1 + TopH;

            PresA      = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX2 + 3 * KnobW, KnobY1, 0, BackgroundBitmap.Height);
            PresA.Left = KnobX2 + 3 * KnobW;
            PresA.Top  = KnobY1 + TopH;

            // -------- Channel B Controls

            BassB      = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX2, KnobY2, 0, BackgroundBitmap.Height);
            BassB.Left = KnobX2;
            BassB.Top  = KnobY2 + TopH;

            MidB      = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX2 + KnobW, KnobY2, 0, BackgroundBitmap.Height);
            MidB.Left = KnobX2 + KnobW;
            MidB.Top  = KnobY2 + TopH;

            TrebleB      = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX2 + 2 * KnobW, KnobY2, 0, BackgroundBitmap.Height);
            TrebleB.Left = KnobX2 + 2 * KnobW;
            TrebleB.Top  = KnobY2 + TopH;

            PresB      = new BitmapKnob(KnobsBitmap, KnobW, KnobH, Positions, KnobX2 + 3 * KnobW, KnobY2, 0, BackgroundBitmap.Height);
            PresB.Left = KnobX2 + 3 * KnobW;
            PresB.Top  = KnobY2 + TopH;

            // Switches

            Boost      = new BitmapSwitch(BoostBitmap, BoostBitmap.Width / 2, BoostBitmap.Height, false, false);
            Boost.Left = BoostX;
            Boost.Top  = BoostY + TopH;

            MapControls();

            foreach (var ctrl in ControlMap)
            {
                if (ctrl.Value == null)
                {
                    continue;
                }

                if (ctrl.Value as Knob != null)
                {
                    ((Knob)ctrl.Value).ValueChanged += ParameterChanged;
                }
                else if (ctrl.Value as Switch != null)
                {
                    ((Switch)ctrl.Value).Brush         = Brushes.White;
                    ((Switch)ctrl.Value).OffBrush      = Brushes.White;
                    ((Switch)ctrl.Value).ValueChanged += ParameterChanged;
                }
                else if (ctrl.Value as BitmapSliderSimple != null)
                {
                    ((BitmapSliderSimple)ctrl.Value).ValueChanged += ParameterChanged;
                }

                Controls.Add((Control)ctrl.Value);
            }

            Controls.Add(LightA);
            Controls.Add(LightB);
            Controls.Add(LightC);

            var about = new AboutButton();

            about.Top    = 0;
            about.Left   = TopBarBitmap.Width - about.Width;
            about.Click += about_Click;
            Controls.Add(about);
        }
        void ReleaseDesignerOutlets()
        {
            if (AboutButton != null)
            {
                AboutButton.Dispose();
                AboutButton = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if (ZeroButton != null)
            {
                ZeroButton.Dispose();
                ZeroButton = null;
            }
        }
Esempio n. 21
0
    void _ui()
    {
        // bgPanel
        float bg_panel_width = (float)(317 / 375.0) * Display.main.systemWidth;

        BgPanel.GetComponent <RectTransform>().sizeDelta = new Vector2(bg_panel_width, Display.main.systemHeight);
        // topPanel
        float top_panel_height = (float)(176 / 667.0) * Display.main.systemHeight;

        TopPanel.GetComponent <RectTransform>().sizeDelta = new Vector2(TopPanel.GetComponent <RectTransform>().sizeDelta.x, top_panel_height);
        // Panel
        float panel_height = Display.main.systemHeight - top_panel_height;

        Panel.GetComponent <RectTransform>().sizeDelta = new Vector2(Panel.GetComponent <RectTransform>().sizeDelta.x, panel_height);
        // logoImage
        float logo_image_posy   = -(float)(35 / 667.0) * Display.main.systemHeight,
              logo_image_width  = (float)(57 / 375.0) * Display.main.systemWidth,
              logo_image_height = (float)(74.5 / 57) * logo_image_width;

        logoImage.rectTransform.sizeDelta          = new Vector2(logo_image_width, logo_image_height);
        logoImage.rectTransform.anchoredPosition3D = new Vector3(0, logo_image_posy, 0);
        // topPanel text
        float logo_panel_text_posy   = (float)(33.5 / 667.0) * Display.main.systemHeight,
              logo_panel_text_height = (float)(20 / 667.0) * Display.main.systemHeight;

        AppNameText.rectTransform.sizeDelta          = new Vector2(AppNameText.rectTransform.sizeDelta.x, logo_panel_text_height);
        AppNameText.rectTransform.anchoredPosition3D = new Vector3(0, logo_panel_text_posy, 0);
        // userButton、aboutButton
        float user_about_button_height   = (float)(60 / 667.0) * Display.main.systemHeight,
              about_button_posy          = -user_about_button_height,
              user_button_image_posx     = (float)(25 / 375.0) * Display.main.systemWidth,
              user_button_image_width    = (float)(17.8 / 375.0) * Display.main.systemWidth,
              user_button_text_left      = (float)(60 / 375.0) * Display.main.systemWidth,
              user_button_text_height    = (float)(20 / 667.0) * Display.main.systemHeight,
              user_button_bgImage_left   = (float)(16 / 375.0) * Display.main.systemWidth,
              user_button_bgImage_height = Display.main.systemWidth > 375 ? (float)(1 / 375.0) * Display.main.systemWidth : 1f,
              about_button_image_width   = (float)(17.5 / 375.0) * Display.main.systemWidth,
              about_button_image_height  = (float)(16.9 / 17.5) * about_button_image_width;

        // userButton
        UserButton.GetComponent <RectTransform>().sizeDelta = new Vector2(UserButton.GetComponent <RectTransform>().sizeDelta.x, user_about_button_height);
        // userButton_image
        UserButton_Image.rectTransform.anchoredPosition3D = new Vector3(user_button_image_posx, 0, 0);
        UserButton_Image.rectTransform.sizeDelta          = new Vector2(user_button_image_width, user_button_image_width);
        // userButton_bgIamge
        UserButton_BgImage.rectTransform.sizeDelta = new Vector2(UserButton_BgImage.rectTransform.sizeDelta.x, user_button_bgImage_height);
        UserButton_BgImage.rectTransform.offsetMin = new Vector2(user_button_bgImage_left, UserButton_BgImage.rectTransform.offsetMin.y);
        UserButton_BgImage.rectTransform.offsetMax = new Vector2(user_button_bgImage_left, UserButton_BgImage.rectTransform.offsetMax.y);
        // userButton_text
        UserButton_Text.rectTransform.sizeDelta = new Vector2(UserButton_Text.rectTransform.sizeDelta.x, user_button_text_height);
        UserButton_Text.rectTransform.offsetMin = new Vector2(user_button_text_left, UserButton_Text.rectTransform.offsetMin.y);
        // aboutButton
        AboutButton.GetComponent <RectTransform>().anchoredPosition3D = new Vector3(0, about_button_posy, 0);
        AboutButton.GetComponent <RectTransform>().sizeDelta          = new Vector2(AboutButton.GetComponent <RectTransform>().sizeDelta.x, user_about_button_height);
        // aboutButton_Image
        AboutButton_Iamge.rectTransform.sizeDelta          = new Vector2(about_button_image_width, about_button_image_height);
        AboutButton_Iamge.rectTransform.anchoredPosition3D = new Vector3(user_button_image_posx, 0, 0);
        // aboutButton_bgImage
        AboutButton_BgImage.rectTransform.sizeDelta = new Vector2(AboutButton_BgImage.rectTransform.sizeDelta.x, user_button_bgImage_height);
        AboutButton_BgImage.rectTransform.offsetMin = new Vector2(user_button_bgImage_left, AboutButton_BgImage.rectTransform.offsetMin.y);
        AboutButton_BgImage.rectTransform.offsetMax = new Vector2(user_button_bgImage_left, AboutButton_BgImage.rectTransform.offsetMax.y);
        // aboutButton_text
        AboutButton_Text.rectTransform.sizeDelta = new Vector2(AboutButton_Text.rectTransform.sizeDelta.x, user_button_text_height);
        AboutButton_Text.rectTransform.offsetMin = new Vector2(user_button_text_left, AboutButton_Text.rectTransform.offsetMin.y);
        // exitButton
        float exit_button_height      = (float)(50 / 667.0) * Display.main.systemHeight,
              exit_button_text_height = (float)(27 / 667.0) * Display.main.systemHeight;

        ExitButton.GetComponent <RectTransform>().sizeDelta = new Vector2(ExitButton.GetComponent <RectTransform>().sizeDelta.x, exit_button_height);
        ExitButton_Text.rectTransform.sizeDelta             = new Vector2(ExitButton_Text.rectTransform.sizeDelta.x, exit_button_text_height);
        //
        AboutPanel.SetActive(false);
        GuidePanel.SetActive(false);
    }
 public void AboutRedirectionAssertion()
 {
     AboutButton.Click();
     StringAssert.Contains("About - Quality Cinema", AboutPageTitle);
 }
Esempio n. 23
0
        public Editor(Rodent instance)
        {
            this.Rodent = instance;

            this.ClientSize = new Size(BaseBitmap.Width, BaseBitmap.Height + TopBarBitmap.Height);

            Gain = new BitmapKnob(KnobsBitmap, Knob1Width, KnobHeight, Positions, 0, 0, 0, KnobHeight);
            Gain.Brush = Brushes.White;
            Gain.Top = TopH;
            Gain.Left = Knob1X;

            Filter = new BitmapKnob(KnobsBitmap, Knob2Width, KnobHeight, Positions, Knob1Width, 0, 0, KnobHeight);
            Filter.Brush = Brushes.White;
            Filter.Top = TopH;
            Filter.Left = Knob2X;

            Vol = new BitmapKnob(KnobsBitmap, Knob3Width, KnobHeight, Positions, Knob1Width + Knob2Width, 0, 0, KnobHeight);
            Vol.Brush = Brushes.White;
            Vol.Top = TopH;
            Vol.Left = Knob3X;

            Ruetz = new BitmapSwitch(SwitchBitmap, Switch1Width, SwitchHeight, false, true, Switch1X, SwitchY);
            Ruetz.Brush = Brushes.White;
            Ruetz.OffBrush = Brushes.White;
            Ruetz.Top = TopH + SwitchY;
            Ruetz.Left = Switch1X;

            Turbo = new BitmapSwitch(SwitchBitmap, Switch2Width, SwitchHeight, false, true, Switch2X, SwitchY);
            Turbo.Brush = Brushes.White;
            Turbo.OffBrush = Brushes.White;
            Turbo.Top = TopH + SwitchY;
            Turbo.Left = Switch2X;

            Tight = new BitmapSwitch(SwitchBitmap, Switch3Width, SwitchHeight, false, true, Switch3X, SwitchY);
            Tight.Brush = Brushes.White;
            Tight.OffBrush = Brushes.White;
            Tight.Top = TopH + SwitchY;
            Tight.Left = Switch3X;

            OD = new BitmapSwitch(SwitchBitmap, Switch4Width, SwitchHeight, false, true, Switch4X, SwitchY);
            OD.Brush = Brushes.White;
            OD.OffBrush = Brushes.White;
            OD.Top = TopH + SwitchY;
            OD.Left = Switch4X;

            Light = new BitmapIndicator(SwitchBitmap, LightWidth, SwitchHeight, false, true, LightX, SwitchY);
            Light.Left = LightX;
            Light.Top = TopH + SwitchY;

            Stomp = new BitmapSwitch(SwitchBitmap, StompWidth, StompHeight, false, true, StompX, StompY);
            Stomp.Left = StompX;
            Stomp.Top = TopH + StompY;
            Stomp.Mode = Switch.SwitchMode.Toggle;

            Controls.Add(Gain);
            Controls.Add(Filter);
            Controls.Add(Vol);
            Controls.Add(Ruetz);
            Controls.Add(Turbo);
            Controls.Add(Tight);
            Controls.Add(OD);
            Controls.Add(Light);
            Controls.Add(Stomp);

            Gain.ValueChanged += ParameterChanged;
            Filter.ValueChanged += ParameterChanged;
            Vol.ValueChanged += ParameterChanged;
            Ruetz.ValueChanged += ParameterChanged;
            Turbo.ValueChanged += ParameterChanged;
            Tight.ValueChanged += ParameterChanged;
            OD.ValueChanged += ParameterChanged;
            Stomp.ValueChanged += ParameterChanged;

            var about = new AboutButton();
            about.Top = 0;
            about.Left = TopBarBitmap.Width - about.Width;
            about.Click += about_Click;
            Controls.Add(about);
        }
        void ReleaseDesignerOutlets()
        {
            if (AboutButton != null)
            {
                AboutButton.Dispose();
                AboutButton = null;
            }

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

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

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

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

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

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

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

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

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

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

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

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }
        }
Esempio n. 25
0
        public MainForm()
        {
            InitializeComponent();

            Load += async(s, e) =>
            {
                if (GetRegistry("autorun") == null)
                {
                    SetRegistry("autorun", "True");
                }

                if (GetRegistry("autorun") == "True")
                {
                    SettingsAutoRun.Checked = true;
                    String[] args = Environment.GetCommandLineArgs();

                    if (args.Length > 1)
                    {
                        if (args[1] == "/minimized")
                        {
                            // костыль ебаный!
                            await Task.Delay(10);

                            WindowState = FormWindowState.Minimized;
                            Hide();
                        }
                    }
                }
                else
                {
                    SettingsAutoRun.Checked = false;
                }
            };
            Resize += (s, e) =>
            {
                if (WindowState == FormWindowState.Minimized)
                {
                    Hide();
                    Tray.Visible = true;
                }
                else if (FormWindowState.Normal == WindowState)
                {
                    Tray.Visible = false;
                }
            };
            KeyDown += (s, e) =>
            {
                if (e.KeyCode == Keys.Escape && !SettingPanel.Visible)
                {
                    LocMessage.ForeColor = SystemColors.ControlDarkDark;
                    e.SuppressKeyPress   = true;
                    LocationInput.Text   = GetRegistry("location");
                    LocationInput.SelectAll();
                    LocationInput.Focus();
                }
            };

            TitleBar.MouseDown += (s, e) =>
            {
                TitleBar.Capture = false;
                Message m = Message.Create(Handle, 161, new IntPtr(2), IntPtr.Zero);
                WndProc(ref m);
            };
            MinimizeButton.Click  += (s, e) => { WindowState = FormWindowState.Minimized; };
            CloseButton.Click     += (s, e) => { Close(); };
            CloseButton.MouseMove += (s, e) =>
            {
                CloseButton.BackColor = Color.FromArgb(255, 38, 60);
                CloseButton.Image     = Properties.Resources.close_white;
            };
            CloseButton.MouseLeave += (s, e) =>
            {
                CloseButton.BackColor = SystemColors.Control;
                CloseButton.Image     = Properties.Resources.close_gray;
            };
            SettingButton.Click += (s, e) =>
            {
                if (AboutPanel.Visible)
                {
                    AboutPanel.Visible    = false;
                    AboutButton.BackColor = SystemColors.Control;
                }
                SettingPanel.Visible    = !SettingPanel.Visible;
                SettingButton.BackColor = SettingPanel.Visible ? SystemColors.ControlLight : SystemColors.Control;
            };
            AboutButton.Click += (s, e) =>
            {
                if (SettingPanel.Visible)
                {
                    SettingPanel.Visible    = false;
                    SettingButton.BackColor = SystemColors.Control;
                }
                AboutPanel.Visible    = !AboutPanel.Visible;
                AboutButton.BackColor = AboutPanel.Visible ? SystemColors.ControlLight : SystemColors.Control;
            };

            Tray.MouseClick += (s, e) =>
            {
                if (e.Button == MouseButtons.Left)
                {
                    Show();
                    Tray.Visible = false;
                    WindowState  = FormWindowState.Normal;
                    FadeInApp();
                }
            };
            TrayAboutButton.Click += (s, e) =>
            {
                Show();
                Tray.Visible = false;
                WindowState  = FormWindowState.Normal;
                FadeInApp();

                if (!AboutPanel.Visible)
                {
                    AboutButton.Focus();
                    SendKeys.Send(" ");
                }
            };
            TraySettingsButton.Click += (s, e) =>
            {
                Show();
                Tray.Visible = false;
                WindowState  = FormWindowState.Normal;
                FadeInApp();

                if (!SettingPanel.Visible)
                {
                    SettingButton.Focus();
                    SendKeys.Send(" ");
                }
            };
            TrayCloseButton.Click += (s, e) => { Close(); };

            LocationInput.Enter   += (s, e) => { isEntered = true; LocMessage.Text = "Нажмите Enter, чтобы сохранить."; };
            LocationInput.KeyDown += (s, e) => {
                if (e.KeyCode == Keys.Enter)
                {
                    ActiveControl      = null;
                    e.SuppressKeyPress = true;
                    GetWeather((s as TextBox).Text);
                }
            };
            LocationInput.KeyPress    += (s, e) => { RegExpLocationInput(s, e); };
            LocationInput.TextChanged += (s, e) =>
            {
                int i = LocationInput.TextLength;

                if (i >= 25)
                {
                    LocationInput.Font     = new Font("Segoe UI Semibold", 16.75F);
                    LocationInput.Location = new Point(11, 15);
                }
                else if (i >= 20)
                {
                    LocationInput.Location = new Point(11, 10);
                    LocationInput.Font     = new Font("Segoe UI Semibold", 18.75F);
                }
                else if (i >= 15)
                {
                    LocationInput.Location = new Point(11, 6);
                    LocationInput.Font     = new Font("Segoe UI Semibold", 20.75F);
                }
                else
                {
                    LocationInput.Location = new Point(11, 3);
                    LocationInput.Font     = new Font("Segoe UI Semibold", 27.75F);
                }
            };

            SettingsLocation.KeyPress += (s, e) => { RegExpLocationInput(s, e); };
            SettingsApiKey.Enter      += (s, e) => { SettingsApiKey.PasswordChar = '\0'; };
            SettingsApiKey.Leave      += (s, e) => { SettingsApiKey.PasswordChar = '●'; };
            SettingsApiKey.KeyPress   += (s, e) =>
            {
                char k = e.KeyChar;
                if (!char.IsControl(k) &&
                    !char.IsNumber(k) &&
                    (k <= 96 || k >= 193))
                {
                    e.Handled = true;
                }
            };
            SettingsRunPath.Text            = exPath;
            SettingsAutoRun.CheckedChanged += (s, e) =>
            {
                bool check = (s as CheckBox).Checked;

                if (check)
                {
                    SetRegistry("autorun", "True");
                    using (RegistryKey r = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true))
                        r.SetValue(appName, exPath + " /minimized");
                }
                else
                {
                    SetRegistry("autorun", "False");
                    using (RegistryKey r = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true))
                        r.DeleteValue(appName);
                }
            };
            SettingsInterval.KeyPress += (s, e) =>
            {
                char k = e.KeyChar;
                if (!char.IsControl(k) && !char.IsNumber(k))
                {
                    e.Handled = true;
                }
            };
            SettingsSaveButton.Click += (s, e) =>
            {
                var b = (s as Button);
                b.Enabled = false;
                if (SettingsInterval.Text != "0")
                {
                    SetRegistry("interval", SettingsInterval.Text);
                    Timer.Interval             = Convert.ToInt32(SettingsInterval.Text) * 60000;
                    SettingsInterval.ForeColor = SystemColors.ControlDarkDark;
                }
                else
                {
                    SettingsInterval.ForeColor = Color.Firebrick;
                }
                SetRegistry("api", SettingsApiKey.Text);
                GetWeather(SettingsLocation.Text);
                b.Enabled = true;
            };
            SettingsRestoreButton.Click += (s, e) =>
            {
                using (RegistryKey reg = Registry.CurrentUser.OpenSubKey(@"Software\" + appName))
                {
                    if (reg != null)
                    {
                        Registry.CurrentUser.DeleteSubKey(@"Software\" + appName);
                    }
                }

                using (RegistryKey run = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run"))
                {
                    if (run.GetValue(appName) != null)
                    {
                        run.DeleteValue(appName);
                    }
                    SetRegistry("autorun", "True");
                    SettingsAutoRun.Checked = true;
                }

                InitializeApp();
            };

            ReconnectButton.Click += (s, e) =>
            {
                ReconnectButton.Text    = "Подключаюсь...";
                ReconnectButton.Enabled = false;
                InitializeApp();
            };

            AboutAppName.Text        = appName;
            AboutAppVer.Text         = $"Версия {About.AssemblyVersion}";
            AboutAppDesc.Text        = About.AssemblyDescription;
            openGitHub.Click        += (s, e) => { Process.Start("https://github.com/crashmax-dev/WeatherCS"); };
            GetAPIButton.Click      += (s, e) => { Process.Start("https://openweathermap.org/appid"); };
            AboutCheckUpdates.Click += (s, e) =>
            {
                var b = (s as Button);
                b.Enabled = false;
                CheckForUpdates();
            };

            InitializeApp();
        }
Esempio n. 26
0
        protected override void InitBindings()
        {
            Bindings.Add(this.SetBinding(() => ViewModel.CurrentData)
                         .WhenSourceChanges(async() =>
            {
                ProfilePageGeneralTabScrollingContainer.ScrollY = 0;

                if (string.IsNullOrEmpty(ViewModel.CurrentData.User.ImgUrl))
                {
                    ProfilePageGeneralTabAnimeUserImg.Visibility     = ViewStates.Invisible;
                    ProfilePageGeneralTabImagePlaceholder.Visibility = ViewStates.Visible;
                }
                else
                {
                    ProfilePageGeneralTabAnimeUserImg.Into(ViewModel.CurrentData.User.ImgUrl);
                    ProfilePageGeneralTabImagePlaceholder.Visibility = ViewStates.Gone;
                }


                ProfilePageGeneralTabDetailsList.SetAdapter(
                    ViewModel.CurrentData.Details.GetAdapter(GetDetailTemplateDelegate));

                ProfilePageGeneralTabFriendsGrid.ItemHeight    =
                    ProfilePageGeneralTabFriendsGrid.ItemWidth = DimensionsHelper.DpToPx(65);
                ProfilePageGeneralTabFriendsGrid.SetColumnWidth((int)ProfilePageGeneralTabFriendsGrid.ItemWidth);
                if (ViewModel.CurrentData.Friends.Any())
                {
                    ProfilePageGeneralTabFriendsGrid.Adapter =
                        ViewModel.CurrentData.Friends.GetAdapter(GetFriendTemplateDelegate);
                    ProfilePageGeneralTabFriendsEmptyNotice.Visibility = ViewStates.Gone;
                    ProfilePageGeneralTabMoreFriendsButton.Visibility  = ViewStates.Visible;
                }
                else
                {
                    ProfilePageGeneralTabFriendsGrid.Adapter           = null;
                    ProfilePageGeneralTabFriendsEmptyNotice.Visibility = ViewStates.Visible;
                    ProfilePageGeneralTabMoreFriendsButton.Visibility  = ViewStates.Gone;
                }

                await Task.Delay(500);
                PopulateComments();
            }));

            Bindings.Add(
                this.SetBinding(() => ViewModel.EmptyCommentsNoticeVisibility,
                                () => ProfilePageGeneralTabCommentsEmptyNotice.Visibility)
                .ConvertSourceToTarget(Converters.BoolToVisibility));

            Bindings.Add(this.SetBinding(() => ViewModel.LoadingOhersLibrariesProgressVisiblity).WhenSourceChanges(() =>
            {
                if (ViewModel.LoadingOhersLibrariesProgressVisiblity)
                {
                    ProfilePageGeneralTabCompareList.Enabled = false;
                }
                else
                {
                    ProfilePageGeneralTabCompareList.Enabled = true;
                }
            }));

            Bindings.Add(this.SetBinding(() => ViewModel.CommentInputBoxVisibility).WhenSourceChanges(() =>
            {
                if (ViewModel.CommentInputBoxVisibility)
                {
                    ProfilePageGeneralTabCommentInput.Visibility      = ViewStates.Visible;
                    ProfilePageGeneralTabSendCommentButton.Visibility = ViewStates.Visible;

                    if (ViewModel.CurrentData.IsFriend)
                    {
                        ProfilePageGeneralTabRemoveFriendButton.Visibility = ViewStates.Visible;
                    }
                    else
                    {
                        ProfilePageGeneralTabRemoveFriendButton.Visibility = ViewStates.Gone;
                    }

                    if (ViewModel.CurrentData.CanAddFriend)
                    {
                        ProfilePageGeneralTabSendRequestButton.Visibility = ViewStates.Visible;
                    }
                    else
                    {
                        ProfilePageGeneralTabSendRequestButton.Visibility = ViewStates.Gone;
                    }
                }
                else
                {
                    ProfilePageGeneralTabCommentInput.Visibility       = ViewStates.Gone;
                    ProfilePageGeneralTabSendCommentButton.Visibility  = ViewStates.Gone;
                    ProfilePageGeneralTabSendRequestButton.Visibility  = ViewStates.Gone;
                    ProfilePageGeneralTabRemoveFriendButton.Visibility = ViewStates.Gone;
                }
            }));

            Bindings.Add(
                this.SetBinding(() => ViewModel.IsMyProfile,
                                () => ProfilePageGeneralTabCompareList.Visibility)
                .ConvertSourceToTarget(Converters.BoolToVisibilityInverted));

            Bindings.Add(
                this.SetBinding(() => ViewModel.CommentText,
                                () => ProfilePageGeneralTabCommentInput.Text, BindingMode.TwoWay));

            Bindings.Add(
                this.SetBinding(() => ViewModel.PinProfileVisibility,
                                () => PinButton.Visibility).ConvertSourceToTarget(Converters.BoolToVisibility));

            Bindings.Add(
                this.SetBinding(() => ViewModel.LoadingCommentsVisiblity,
                                () => AnimeDetailsPageLoadingUpdateSpinner.Visibility)
                .ConvertSourceToTarget(Converters.BoolToVisibility));


            Bindings.Add(this.SetBinding(() => ViewModel.IsPinned).WhenSourceChanges(() =>
            {
                if (!ViewModel.PinProfileVisibility)
                {
                    return;
                }

                if (ViewModel.IsPinned)
                {
                    PinButton.SetBackgroundColor(new Color(ResourceExtension.AccentColour));
                    PinButtonIcon.Rotation = 0;
                    PinButtonIcon.SetImageResource(Resource.Drawable.icon_unpin);
                }
                else
                {
                    PinButton.SetBackgroundColor(new Color(ResourceExtension.OpaqueAccentColour));
                    PinButtonIcon.Rotation = 45;
                    PinButtonIcon.SetImageResource(Resource.Drawable.icon_pin);
                }
            }));


            PinButton.SetOnClickListener(new OnClickListener(view =>
            {
                ViewModel.IsPinned     = !ViewModel.IsPinned;
                PinButtonIcon.Rotation = ViewModel.IsPinned ? 0 : 45;
            }));
            ProfilePageGeneralTabAnimeListButton.SetOnClickListener(new OnClickListener(v => ViewModel.NavigateAnimeListCommand.Execute(null)));
            ProfilePageGeneralTabMangaListButton.SetOnClickListener(new OnClickListener(v => ViewModel.NavigateMangaListCommand.Execute(null)));
            ProfilePageGeneralTabHistoryButton.SetOnClickListener(new OnClickListener(v => ViewModel.NavigateHistoryCommand.Execute(null)));
            ProfilePageGeneralTabSendCommentButton.SetOnClickListener(new OnClickListener(v => ViewModel.SendCommentCommand.Execute(null)));
            ProfilePageGeneralTabActionButton.SetOnClickListener(new OnClickListener(v => ProfilePageGeneralTabActionButtonOnClick()));
            ProfilePageGeneralTabCompareList.SetOnClickListener(new OnClickListener(v => ViewModel.NavigateComparisonCommand.Execute(null)));
            ProfilePageGeneralTabMoreFriendsButton.SetOnClickListener(new OnClickListener(v => ViewModel.NavigateFriendsCommand.Execute(null)));
            ReloadButton.SetOnClickListener(new OnClickListener(view => ViewModel.RefreshCommentsCommand.Execute(null)));
            ProfilePageGeneralTabSendRequestButton.SetOnClickListener(new OnClickListener(view => AddFriendDialog.Instance.ShowDialog(Activity, ViewModel.CurrentData, this)));
            ProfilePageGeneralTabRemoveFriendButton.SetOnClickListener(new OnClickListener(view => ViewModel.RemoveFriendCommand.Execute(null)));
            AboutButton.SetOnClickListener(new OnClickListener(view => ProfileDescriptionDialog.Instance.ShowDialog(Activity, RootView, ViewModel.CurrentData.HtmlContent)));

            PopulateComments();
            ProfilePageGeneralTabScrollingContainer.ViewTreeObserver.ScrollChanged -= ViewTreeObserverOnScrollChanged;
            ProfilePageGeneralTabScrollingContainer.ViewTreeObserver.ScrollChanged += ViewTreeObserverOnScrollChanged;
            ProfilePageGeneralTabScrollingContainer.Touch -= RootViewOnTouch;
            ProfilePageGeneralTabScrollingContainer.Touch += RootViewOnTouch;
            ProfilePageGeneralTabCommentsList.Touch       -= RootViewOnTouch;
            ProfilePageGeneralTabCommentsList.Touch       += RootViewOnTouch;
        }
Esempio n. 27
0
        public Editor(Rodent instance)
        {
            this.Rodent     = instance;
            this.ClientSize = new Size(BaseBitmap.Width, BaseBitmap.Height + TopBarBitmap.Height);

            Gain      = new BitmapKnob(KnobsBitmap, Knob1Width, KnobHeight, Positions, 0, 0, 0, KnobHeight);
            Gain.Top  = TopH;
            Gain.Left = Knob1X;

            Filter      = new BitmapKnob(KnobsBitmap, Knob2Width, KnobHeight, Positions, Knob1Width, 0, 0, KnobHeight);
            Filter.Top  = TopH;
            Filter.Left = Knob2X;

            Vol      = new BitmapKnob(KnobsBitmap, Knob3Width, KnobHeight, Positions, Knob1Width + Knob2Width, 0, 0, KnobHeight);
            Vol.Top  = TopH;
            Vol.Left = Knob3X;


            Ruetz          = new BitmapSwitch(SwitchBitmap, Switch1Width, SwitchHeight, false, true, Switch1X, SwitchY);
            Ruetz.Brush    = Brushes.White;
            Ruetz.OffBrush = Brushes.White;
            Ruetz.Top      = TopH + SwitchY;
            Ruetz.Left     = Switch1X;

            Turbo          = new BitmapSwitch(SwitchBitmap, Switch2Width, SwitchHeight, false, true, Switch2X, SwitchY);
            Turbo.Brush    = Brushes.White;
            Turbo.OffBrush = Brushes.White;
            Turbo.Top      = TopH + SwitchY;
            Turbo.Left     = Switch2X;

            Tight          = new BitmapSwitch(SwitchBitmap, Switch3Width, SwitchHeight, false, true, Switch3X, SwitchY);
            Tight.Brush    = Brushes.White;
            Tight.OffBrush = Brushes.White;
            Tight.Top      = TopH + SwitchY;
            Tight.Left     = Switch3X;

            OD          = new BitmapSwitch(SwitchBitmap, Switch4Width, SwitchHeight, false, true, Switch4X, SwitchY);
            OD.Brush    = Brushes.White;
            OD.OffBrush = Brushes.White;
            OD.Top      = TopH + SwitchY;
            OD.Left     = Switch4X;

            Light      = new BitmapIndicator(SwitchBitmap, LightWidth, SwitchHeight, false, true, LightX, SwitchY);
            Light.Left = LightX;
            Light.Top  = TopH + SwitchY;

            Stomp      = new BitmapSwitch(SwitchBitmap, StompWidth, StompHeight, false, true, StompX, StompY);
            Stomp.Left = StompX;
            Stomp.Top  = TopH + StompY;
            Stomp.Mode = Switch.SwitchMode.Toggle;

            Controls.Add(Gain);
            Controls.Add(Filter);
            Controls.Add(Vol);
            Controls.Add(Ruetz);
            Controls.Add(Turbo);
            Controls.Add(Tight);
            Controls.Add(OD);
            Controls.Add(Light);
            Controls.Add(Stomp);

            Gain.ValueChanged   += ParameterChanged;
            Filter.ValueChanged += ParameterChanged;
            Vol.ValueChanged    += ParameterChanged;
            Ruetz.ValueChanged  += ParameterChanged;
            Turbo.ValueChanged  += ParameterChanged;
            Tight.ValueChanged  += ParameterChanged;
            OD.ValueChanged     += ParameterChanged;
            Stomp.ValueChanged  += ParameterChanged;

            var about = new AboutButton();

            about.Top    = 0;
            about.Left   = TopBarBitmap.Width - about.Width;
            about.Click += about_Click;
            Controls.Add(about);
        }
Esempio n. 28
0
        public MainPage()
        {
            this.InitializeComponent();

            sourcesize = Window.Current.CoreWindow.Bounds;

            GlobalNodeHandler.standardtextFormat = new CanvasTextFormat();

            MyFontPicker = new List <FontClass>();
            MyFontPicker.Add(new FontClass()
            {
                MyFontFamily = new FontFamily("Arial"), FontFamilyValue = "Arial"
            });
            MyFontPicker.Add(new FontClass()
            {
                MyFontFamily = new FontFamily("Times New Roman"), FontFamilyValue = "Times New Roman"
            });
            MyFontPicker.Add(new FontClass()
            {
                MyFontFamily = new FontFamily("Verdana"), FontFamilyValue = "Verdana"
            });
            MyFontPicker.Add(new FontClass()
            {
                MyFontFamily = new FontFamily("Calibri"), FontFamilyValue = "Calibri"
            });
            MyFontPicker.Add(new FontClass()
            {
                MyFontFamily = new FontFamily("Rockwell"), FontFamilyValue = "Rockwell"
            });
            MyFontPicker.Add(new FontClass()
            {
                MyFontFamily = new FontFamily("Twentieth Century"), FontFamilyValue = "Twentieth Century"
            });
            MyFontPicker.Add(new FontClass()
            {
                MyFontFamily = new FontFamily("Helvetica"), FontFamilyValue = "Helvetica"
            });
            MyFontPicker.Add(new FontClass()
            {
                MyFontFamily = new FontFamily("Trajan"), FontFamilyValue = "Trajan"
            });
            MyFontPicker.Add(new FontClass()
            {
                MyFontFamily = new FontFamily("Optima Std"), FontFamilyValue = "Optima Std"
            });
            MyFontPicker.Add(new FontClass()
            {
                MyFontFamily = new FontFamily("Franklin Gothic"), FontFamilyValue = "Franklin Gothic"
            });
            MyFontPicker.Add(new FontClass()
            {
                MyFontFamily = new FontFamily("Futura"), FontFamilyValue = "Futura"
            });
            MyFontPicker.Add(new FontClass()
            {
                MyFontFamily = new FontFamily("Bickham Script"), FontFamilyValue = "Bickham Script"
            });
            MyFontPicker.Add(new FontClass()
            {
                MyFontFamily = new FontFamily("Gill Sans"), FontFamilyValue = "Gill Sans"
            });
            MyFontPicker.Add(new FontClass()
            {
                MyFontFamily = new FontFamily("Sans Serif"), FontFamilyValue = "Sans Serif"
            });
            MyFontPicker.Add(new FontClass()
            {
                MyFontFamily = new FontFamily("Gotham"), FontFamilyValue = "Gotham"
            });
            FontStyleBox.ItemsSource = MyFontPicker;


            MyFontSizePicker = new List <int>();
            for (int i = 6; i < 45; i++)
            {
                MyFontSizePicker.Add(i);
            }
            FontSizeBox.ItemsSource = MyFontSizePicker;

            GlobalNodeHandler.standardtextFormat.FontSize   = 18;
            GlobalNodeHandler.standardtextFormat.FontStyle  = FontStyle.Normal;
            GlobalNodeHandler.standardtextFormat.FontFamily = new FontFamily("Arial").Source;
            FontSizeBox.SelectedItem   = 18;
            FontStyleBox.SelectedIndex = 0;

            GlobalNodeHandler.pick1 = new ColorPicker(5, 5, new Rect(1920 - 200, 50, 200, 260));

            AttributePanel.Margin = new Thickness(0, 260, refwidth - sourcesize.Width, 0);
            UseModePanel.Margin   = new Thickness(0, 0, refwidth - sourcesize.Width, 0);

            //AttributePanel.Margin = new Thickness(0, 260, refwidth - sourcesize.Width, 0);
            GlobalNodeHandler.pick1.boundingbox.X = refwidth - (refwidth - sourcesize.Width) - GlobalNodeHandler.pick1.boundingbox.Width;
            repaint(this, new EventArgs());

            /*var picker = new Windows.Storage.Pickers.FileOpenPicker();
             * picker.ViewMode = Windows.Storage.Pickers.PickerViewMode.Thumbnail;
             * picker.SuggestedStartLocation =
             *  Windows.Storage.Pickers.PickerLocationId.PicturesLibrary;
             * picker.FileTypeFilter.Add(".jpg");
             * picker.FileTypeFilter.Add(".jpeg");
             * picker.FileTypeFilter.Add(".png");
             *
             * Windows.Storage.StorageFile file = await picker.PickSingleFileAsync();
             * if (file != null)
             * {
             *  // Application now has read/write access to the picked file
             *  this.textBlock.Text = "Picked photo: " + file.Name;
             * }
             * else
             * {
             *  this.textBlock.Text = "Operation cancelled.";
             * }*/

            GlobalNodeHandler.masterNode = new MindNode(GlobalNodeHandler.id, 0, 0, 0, 0, false);
            GlobalNodeHandler.id++;
            GlobalNodeHandler.masterNode.text = "masterNode";

            GlobalNodeHandler.viewNode = GlobalNodeHandler.masterNode;

            Application.Current.DebugSettings.EnableFrameRateCounter = false;

            activetext.KeyDown   += new KeyEventHandler(activeTextfield_KeyDown);
            activetext.Visibility = Visibility.Collapsed;

            DispatcherTimer timer1 = new DispatcherTimer();

            timer1.Interval = new TimeSpan(1000 / 8);
            timer1.Start();
            timer1.Tick += this.timer1_Tick;


            mouse            = new MouseHandler(activetext);
            mouse.repainted += this.repaint;

            keymanager            = new KeyHandler(activetext);
            keymanager.repainted += this.repaint;

            btnMngr = new ButtonManager();

            viewPane.PointerPressed  += this.viewPane_MouseDown;
            viewPane.PointerReleased += this.viewPane_MouseUp;

            AddNode.AddHandler(PointerPressedEvent, new PointerEventHandler(AddNode_PointerPressed), true);
            ConnectNodes.AddHandler(PointerPressedEvent, new PointerEventHandler(ConnectNodes_PointerPressed), true);
            DeConnectNodes.AddHandler(PointerPressedEvent, new PointerEventHandler(DeConnectNodes_PointerPressed), true);
            TransformNode.AddHandler(PointerPressedEvent, new PointerEventHandler(TransformNode_PointerPressed), true);
            MoveNodes.AddHandler(PointerPressedEvent, new PointerEventHandler(MoveNodes_PointerPressed), true);
            DeleteNode.AddHandler(PointerPressedEvent, new PointerEventHandler(DeleteNode_PointerPressed), true);
            SelectNodes.AddHandler(PointerPressedEvent, new PointerEventHandler(SelectNodes_PointerPressed), true);
            UnDo.AddHandler(PointerPressedEvent, new PointerEventHandler(UnDo_PointerPressed), true);
            ReDo.AddHandler(PointerPressedEvent, new PointerEventHandler(ReDo_PointerPressed), true);
            Copy.AddHandler(PointerPressedEvent, new PointerEventHandler(Copy_PointerPressed), true);
            Cut.AddHandler(PointerPressedEvent, new PointerEventHandler(Cut_PointerPressed), true);
            Paste.AddHandler(PointerPressedEvent, new PointerEventHandler(Paste_PointerPressed), true);
            PlaceLabel.AddHandler(PointerPressedEvent, new PointerEventHandler(PlaceLabel_PointerPressed), true);
            JumpInto.AddHandler(PointerPressedEvent, new PointerEventHandler(JumpInto_PointerPressed), true);
            JumpOutof.AddHandler(PointerPressedEvent, new PointerEventHandler(JumpOutof_PointerPressed), true);
            ColorNode.AddHandler(PointerPressedEvent, new PointerEventHandler(ColorNode_PointerPressed), true);

            UNDOMENU.AddHandler(PointerPressedEvent, new PointerEventHandler(UnDo_PointerPressed), true);
            REDOMENU.AddHandler(PointerPressedEvent, new PointerEventHandler(ReDo_PointerPressed), true);
            CUTMENU.AddHandler(PointerPressedEvent, new PointerEventHandler(Cut_PointerPressed), true);
            COPYMENU.AddHandler(PointerPressedEvent, new PointerEventHandler(Copy_PointerPressed), true);
            PASTEMENU.AddHandler(PointerPressedEvent, new PointerEventHandler(Paste_PointerPressed), true);
            TRANSFORMMENU.AddHandler(PointerPressedEvent, new PointerEventHandler(TransformNode_PointerPressed), true);
            EDITMENU.AddHandler(PointerPressedEvent, new PointerEventHandler(PlaceLabel_PointerPressed), true);
            JUMPINMENU.AddHandler(PointerPressedEvent, new PointerEventHandler(JumpInto_PointerPressed), true);
            JUMPOUTMENU.AddHandler(PointerPressedEvent, new PointerEventHandler(JumpOutof_PointerPressed), true);
            CHANGECOLORMENU.AddHandler(PointerPressedEvent, new PointerEventHandler(ColorNode_PointerPressed), true);

            //FileButtonFlyout.AddHandler(PointerPressedEvent, new PointerEventHandler(FileButton_PointerPressed), true);
            this.NEW.AddHandler(PointerPressedEvent, new PointerEventHandler(NEW_PointerPressed), true);
            this.OPEN.AddHandler(PointerPressedEvent, new PointerEventHandler(OPEN_PointerPressed), true);
            this.SAVE.AddHandler(PointerPressedEvent, new PointerEventHandler(SAVE_PointerPressed), true);
            this.SAVEAS.AddHandler(PointerPressedEvent, new PointerEventHandler(SAVEAS_PointerPressed), true);
            this.EXPORT.AddHandler(PointerPressedEvent, new PointerEventHandler(EXPORT_PointerPressed), true);
            this.CLOSE.AddHandler(PointerPressedEvent, new PointerEventHandler(CLOSE_PointerPressed), true);
            this.EXIT.AddHandler(PointerPressedEvent, new PointerEventHandler(EXIT_PointerPressed), true);

            Application.Current.Suspending += AppSuspending;

            STYLESBAR.AddHandler(PointerPressedEvent, new PointerEventHandler(STYLESBAR_PointerPressed), true);
            ZOOMIN.AddHandler(PointerPressedEvent, new PointerEventHandler(ZOOMIN_PointerPressed), true);
            ZOOMOUT.AddHandler(PointerPressedEvent, new PointerEventHandler(ZOOMOUT_PointerPressed), true);

            ABOUT.AddHandler(PointerPressedEvent, new PointerEventHandler(ABOUT_PointerPressed), true);
            DOCU.AddHandler(PointerPressedEvent, new PointerEventHandler(DOCU_PointerPressed), true);

            BoldText.AddHandler(PointerPressedEvent, new PointerEventHandler(UpdateFontStyle), true);
            ItalicText.AddHandler(PointerPressedEvent, new PointerEventHandler(UpdateFontStyle), true);
            UnderlineText.AddHandler(PointerPressedEvent, new PointerEventHandler(UpdateFontStyle), true);

            AboutButton.AddHandler(PointerPressedEvent, new PointerEventHandler(AboutButton_PointerPressed), true);


            viewPane.PointerMoved        += viewPane_UpdateMousePos;
            viewPane.PointerWheelChanged += OnMouseScroll;

            timer1.Tick += mouse.timer1_Tick;

            OpenAutoSave();

            repaint(this, new EventArgs());

            /*Random r = new Random();
             *
             * for (int x = 0; x < 100; x++) {
             *  for (int y = 0; y < 100; y++)
             *  {
             *      //mouse.CreateNewNode((int)(r.NextDouble() * 1000), (int)(r.NextDouble() * 1000), true);
             *
             *      GlobalNodeHandler.CreateNewNode((int)(y * 50), (int)(x * 30), true);
             *
             *      mouse.activetext.Text = "n:";
             *      keymanager.EnterTextBox();
             *      repaint(this,new EventArgs());
             *  }
             * }*/

            GlobalNodeHandler.TabletSelected = true;
            this.Focus(FocusState.Keyboard);
        }