public override void Initialize(params object[] list) { if (list != null && list[0] != null) { controled = list[0] as UIObject; } mainButton = ToolbarManager.Instance.add("AGM", "AGMMainSwitch"); string str = SettingsManager.Settings.GetValue<bool>( SettingsManager.IsMainWindowVisible, true) ? mainPath + onButton : mainPath + offButton; mainButton.ToolTip = "Action Group Manager"; mainButton.TexturePath = str; mainButton.Visibility = new GameScenesVisibility(GameScenes.FLIGHT); mainButton.OnClick += (e) => { if (e.MouseButton == 0) { controled.SetVisible(!controled.IsVisible()); mainButton.TexturePath = controled.IsVisible() ? mainPath + onButton : mainPath + offButton; } }; }
public override void Start() { base.Start(); IStack stack = Platform.Current.Create<IStack>(); cmdShow = Platform.Current.Create<IButton>(); cmdShow.Text = "Show/Hide"; cmdShow.Click += CmdShow_Click; cmdShow.BackgroundColor = new Color(1, 255, 0, 0); cmdShow.FontColor = new Color(1, 255, 255, 255); stack.Children.Add(cmdShow); lbltext = Platform.Current.Create<ILabel>(); lbltext.Text = "I'm visible, i want an ice-cream"; lbltext.Visible = false; stack.Children.Add(lbltext); IButton cmdClose = Platform.Current.Create<IButton>(); cmdClose.Text = "Close"; cmdClose.Click += CmdClose_Click; stack.Children.Add(cmdClose); Platform.Current.Page.Title = "Test label"; Platform.Current.Page.Content = stack; }
protected override void AttachChildControls() { this.lblOrderId = (Label) this.FindControl("lblOrderId"); this.lblOrderAmount = (FormatedMoneyLabel) this.FindControl("lblOrderAmount"); this.txtPassword = (TextBox) this.FindControl("txtPassword"); this.litUseableBalance = (FormatedMoneyLabel) this.FindControl("litUseableBalance"); this.btnPay = ButtonManager.Create(this.FindControl("btnPay")); this.orderId = this.Page.Request.QueryString["orderId"]; PageTitle.AddSiteNameTitle("订单支付", HiContext.Current.Context); this.btnPay.Click += new EventHandler(this.btnPay_Click); if (string.IsNullOrEmpty(this.orderId)) { base.GotoResourceNotFound(); } if (!this.Page.IsPostBack) { Member user = Users.GetUser(HiContext.Current.User.UserId, false) as Member; if (!user.IsOpenBalance) { this.Page.Response.Redirect(Globals.ApplicationPath + string.Format("/user/OpenBalance.aspx?ReturnUrl={0}", HttpContext.Current.Request.Url)); } OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId); if (!orderInfo.CheckAction(OrderActions.BUYER_PAY)) { this.ShowMessage("当前的订单订单状态不是等待付款,所以不能支付", false); this.btnPay.Visible = false; } this.lblOrderId.Text = orderInfo.OrderId; this.lblOrderAmount.Money = orderInfo.GetTotal(); this.litUseableBalance.Money = user.Balance - user.RequestBalance; } }
public Automation WithButtonPressedLongTrigger(IButton button) { if (button == null) throw new ArgumentNullException(nameof(button)); button.PressedLong += (s, e) => Trigger(); return this; }
public void Awake() { if (HighLogic.LoadedScene == GameScenes.FLIGHT) { DontDestroyOnLoad(this); Settings.Load(); InvokeRepeating("RunSave", interval, interval); if (ToolbarManager.ToolbarAvailable) { button = ToolbarManager.Instance.add("CrewManifest", "CrewManifest"); button.TexturePath = "CrewManifest/Icons/IconOff_24"; button.ToolTip = "Crew Manifest"; button.Visibility = new GameScenesVisibility(GameScenes.FLIGHT); button.OnClick += onButtonClick; } //if (appButton == null && Settings.AppLauncher) if (appButton == null) { appButton = ApplicationLauncher.Instance.AddModApplication( onButtonClick, onButtonClick, null, null, null, null, ApplicationLauncher.AppScenes.ALWAYS, offTexture); } } }
public void Start() { VABThermalUI.render_window = false; PluginHelper.using_toolbar = true; button_mega = ToolbarManager.Instance.add("interstellar", "mega_button"); button_mega.Visibility = new GameScenesVisibility(GameScenes.FLIGHT); button_mega.TexturePath = "Interstellar/megajoule_click2"; button_mega.ToolTip = "Show Megajoule Power Manager"; button_mega.OnClick += (e) => { FlightUIStarter.show_window = true; }; button_thermal = ToolbarManager.Instance.add("interstellar", "thermal_button"); button_thermal.Visibility = new GameScenesVisibility(GameScenes.EDITOR, GameScenes.SPH); button_thermal.TexturePath = "Interstellar/thermal_click"; button_thermal.ToolTip = "Toggle VAB Thermal Helper"; button_thermal.OnClick += (e) => { if (HighLogic.LoadedSceneIsEditor) { VABThermalUI.render_window = !VABThermalUI.render_window; } }; }
protected override void AttachChildControls() { this.txtShipTo = (TextBox) this.FindControl("txtShipTo"); this.txtAddress = (TextBox) this.FindControl("txtAddress"); this.txtZipcode = (TextBox) this.FindControl("txtZipcode"); this.txtTelPhone = (TextBox) this.FindControl("txtTelPhone"); this.txtCellPhone = (TextBox) this.FindControl("txtCellPhone"); this.dropRegionsSelect = (RegionSelector) this.FindControl("dropRegions"); this.btnAddAddress = ButtonManager.Create(this.FindControl("btnAddAddress")); this.btnCancel = ButtonManager.Create(this.FindControl("btnCancel")); this.btnEditAddress = ButtonManager.Create(this.FindControl("btnEditAddress")); this.dtlstRegionsSelect = (Common_Address_AddressList) this.FindControl("list_Common_Consignee_ConsigneeList"); this.lblAddressCount = (Literal) this.FindControl("lblAddressCount"); this.btnAddAddress.Click += new EventHandler(this.btnAddAddress_Click); this.btnEditAddress.Click += new EventHandler(this.btnEditAddress_Click); this.btnCancel.Click += new EventHandler(this.btnCancel_Click); this.dtlstRegionsSelect.ItemCommand += new Common_Address_AddressList.CommandEventHandler(this.dtlstRegionsSelect_ItemCommand); PageTitle.AddSiteNameTitle("我的收货地址", HiContext.Current.Context); if (!this.Page.IsPostBack) { this.lblAddressCount.Text = HiContext.Current.Config.ShippingAddressQuantity.ToString(); this.dropRegionsSelect.DataBind(); this.Reset(); this.btnEditAddress.Visible = false; this.BindList(); } }
///<summary> /// Constructor for <see cref="CollapsiblePanelManager"/> ///</summary> ///<param name="collapsiblePanel"></param> ///<param name="controlFactory"></param> public CollapsiblePanelManager(ICollapsiblePanel collapsiblePanel, IControlFactory controlFactory) { _controlFactory = controlFactory; _collapsiblePanel = collapsiblePanel; _collapseButton = _controlFactory.CreateButtonCollapsibleStyle(); _collapseButton.Click += delegate { Collapsed = !Collapsed; }; _pinLabel = controlFactory.CreateLabelPinOffStyle(); _pinLabel.Click += delegate { Pinned = !Pinned; }; IPanel buttonPanel = _controlFactory.CreatePanel(); BorderLayoutManager buttonLayoutManager = _controlFactory.CreateBorderLayoutManager(buttonPanel); buttonPanel.Height = _collapseButton.Height; buttonLayoutManager.AddControl(_collapseButton, BorderLayoutManager.Position.Centre); buttonLayoutManager.AddControl(_pinLabel, BorderLayoutManager.Position.East); _layoutManager = _controlFactory.CreateBorderLayoutManager(collapsiblePanel); _layoutManager.AddControl(buttonPanel, BorderLayoutManager.Position.North); _collapseButton.BackColor = System.Drawing.Color.Transparent; _collapseButton.ForeColor = System.Drawing.Color.Transparent; }
protected override void OnButtonPressed(IButton button, ButtonPressedDuration duration) { JsonObject data = CreateDataPackage(button.Id, EventType.ButtonPressed); data.SetNamedValue("kind", JsonValue.CreateStringValue(duration.ToString())); Task.Run(() => SendToAzureEventHubAsync(data)); }
private void createPopupMenu(IButton button) { // create menu drawable PopupMenuDrawable _menu = new PopupMenuDrawable(); // create menu options IButton _option1 = _menu.AddOption("Show/Hide image"); _option1.OnClick += e => Toggle(); IButton _option2 = _menu.AddOption("Show/hide image list"); _option2.OnClick += e => _showList = !_showList; IButton _option3 = _menu.AddOption("Change skin"); _option3.OnClick += e => _useKSPskin = !_useKSPskin; IButton _option4 = _menu.AddOption("Next image"); _option4.OnClick += e => ImageNext(); IButton _option5 = _menu.AddOption("Prev image"); _option5.OnClick += e => ImagePrev(); IButton _option6 = _menu.AddOption("-10% size"); _option6.OnClick += e => ImageZm(); IButton _option7 = _menu.AddOption("Original"); _option7.OnClick += e => ImageOrig(); IButton _option8 = _menu.AddOption("+10% size"); _option8.OnClick += e => ImageZp(); // auto-close popup menu when any option is clicked _menu.OnAnyOptionClicked += () => destroyPopupMenu(button); // hook drawable to button button.Drawable = _menu; }
public TestPage1(IBrowserDriver driver) : base(driver) { InputField = driver.CreateTextField().FromID("TextField"); OutputField = driver.CreateTextField().FromID("TextFieldOutput"); Button = driver.CreateButton().FromID("UpdateButton"); }
public Delete(IButton button, SandboxControl control, UUID owner) : base(button) { _control = control; _control.State.AddStateButton(owner, button); button.SetVisualState(_control.Fade, 0); }
internal SCANtoolbar () { if (!ToolbarManager.ToolbarAvailable) return; // bail if we don't have a toolbar SCANButton = ToolbarManager.Instance.add ("SCANsat" , "UIMenu"); MapButton = ToolbarManager.Instance.add ("SCANsat" , "BigMap"); SmallButton = ToolbarManager.Instance.add ("SCANsat" , "SmallMap"); //Fall back to some default toolbar icons if someone deletes the SCANsat icons or puts them in the wrong folder if (File.Exists(Path.Combine(new DirectoryInfo(KSPUtil.ApplicationRootPath).FullName, "GameData/SCANsat/Icons/SCANsat_Icon.png").Replace("\\", "/"))) SCANButton.TexturePath = "SCANsat/Icons/SCANsat_Icon"; // S.C.A.N else SCANButton.TexturePath = "000_Toolbar/toolbar-dropdown"; if (File.Exists(Path.Combine(new DirectoryInfo(KSPUtil.ApplicationRootPath).FullName, "GameData/SCANsat/Icons/SCANsat_Map_Icon.png").Replace("\\", "/"))) MapButton.TexturePath = "SCANsat/Icons/SCANsat_Map_Icon"; // from in-game biome map of Kerbin else MapButton.TexturePath = "000_Toolbar/move-cursor"; if (File.Exists(Path.Combine(new DirectoryInfo(KSPUtil.ApplicationRootPath).FullName, "GameData/SCANsat/Icons/SCANsat_SmallMap_Icon.png").Replace("\\", "/"))) SmallButton.TexturePath = "SCANsat/Icons/SCANsat_SmallMap_Icon"; // from unity, edited by DG else SmallButton.TexturePath = "000_Toolbar/resize-cursor"; SCANButton.ToolTip = "SCANsat"; MapButton.ToolTip = "SCANsat Big Map"; SmallButton.ToolTip = "SCANsat Small Map"; SCANButton.OnClick += (e) => toggleMenu (SCANButton); MapButton.OnClick += (e) => SCANui.bigmap_visible = !SCANui.bigmap_visible; SmallButton.OnClick += (e) => SCANui.minimode = (SCANui.minimode == 0 ? 2 : -SCANui.minimode); }
public void Awake() { if (HighLogic.LoadedScene == GameScenes.FLIGHT) { DontDestroyOnLoad(this); Settings.Load(); InvokeRepeating("RunSave", interval, interval); button = ToolbarManager.Instance.add("CrewManifest", "CrewManifest"); button.TexturePath = "CrewManifest/Icons/IconOff_24"; button.ToolTip = "Crew Manifest"; button.Visibility = new GameScenesVisibility(GameScenes.FLIGHT); button.OnClick += (e) => { if(!MapView.MapIsEnabled && !PauseMenu.isOpen && !FlightResultsDialog.isDisplaying && FlightGlobals.fetch != null && FlightGlobals.ActiveVessel != null && ManifestController.GetInstance(FlightGlobals.ActiveVessel).CanDrawButton ) { ManifestController manifestController = ManifestController.GetInstance(FlightGlobals.ActiveVessel); button.TexturePath = manifestController.ShowWindow ? "CrewManifest/Icons/IconOff_24" : "CrewManifest/Icons/IconOn_24"; manifestController.ShowWindow = !manifestController.ShowWindow; } }; } }
public void Awake() { ExEditorButton = ToolbarManager.Instance.add ("ExtraplanetaryLaunchpads", "ExEditorButton"); ExEditorButton.TexturePath = "ExtraplanetaryLaunchpads/Textures/icon_button"; ExEditorButton.ToolTip = "EL Build Resources Display"; ExEditorButton.OnClick += (e) => ExShipInfo.ToggleGUI (); }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId)) { base.GotoResourceNotFound(); } this.txtEmail = (TextBox) this.FindControl("txtEmail"); this.txtUserName = (TextBox) this.FindControl("txtUserName"); this.txtContent = (TextBox) this.FindControl("txtContent"); this.btnRefer = ButtonManager.Create(this.FindControl("btnRefer")); this.txtConsultationCode = (HtmlInputText) this.FindControl("txtConsultationCode"); this.prodetailsLink = (ProductDetailsLink) this.FindControl("ProductDetailsLink1"); this.btnRefer.Click += new EventHandler(this.btnRefer_Click); if (!this.Page.IsPostBack) { PageTitle.AddSiteNameTitle("商品咨询", HiContext.Current.Context); if ((HiContext.Current.User.UserRole == UserRole.Member) || (HiContext.Current.User.UserRole == UserRole.Underling)) { this.txtUserName.Text = HiContext.Current.User.Username; this.txtEmail.Text = HiContext.Current.User.Email; this.btnRefer.Text = "咨询"; } ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId); if (productSimpleInfo != null) { this.prodetailsLink.ProductId = this.productId; this.prodetailsLink.ProductName = productSimpleInfo.ProductName; } this.txtConsultationCode.Value = string.Empty; } }
/// <summary> /// Start this instance. /// <para xml:lang="es"> /// Inicia la instancia del boton. /// </para> /// </summary> public override void Start() { base.Start(); // Create an stack IStack stack = Platform.Current.Create<IStack>(); // Creates the button with text, size and specific color, with the event also click and adds it to the stack cmdShow = Platform.Current.Create<IButton>(); cmdShow.Text = "Show/Hide"; cmdShow.Click += CmdShow_Click; cmdShow.BackgroundColor = new Color(1, 255, 0, 0); cmdShow.FontColor = new Color(1, 255, 255, 255); stack.Children.Add(cmdShow); // Create an Label with text specific, not visible and adds it to the stack lbltext = Platform.Current.Create<ILabel>(); lbltext.Text = "I'm visible, i want an ice-cream"; lbltext.Visible = false; stack.Children.Add(lbltext); // Create another button with a specific text with your event click and adds it to the stack IButton cmdClose = Platform.Current.Create<IButton>(); cmdClose.Text = "Close"; cmdClose.Click += CmdClose_Click; stack.Children.Add(cmdClose); // Establishes the content and title of the page Platform.Current.Page.Title = "Test label"; Platform.Current.Page.Content = stack; }
private void Start() { if (HighLogic.LoadedSceneIsEditor || HighLogic.LoadedSceneIsFlight) { this.button = ToolbarManager.Instance.add("KER", "engineerButton"); this.button.ToolTip = "Kerbal Engineer Redux"; if (HighLogic.LoadedSceneIsEditor) { SetButtonState(BuildEngineer.isVisible); this.button.OnClick += (e) => { TogglePluginVisibility(ref BuildEngineer.isVisible); }; } else if (HighLogic.LoadedSceneIsFlight) { SetButtonState(FlightEngineer.isVisible); this.button.OnClick += (e) => { TogglePluginVisibility(ref FlightEngineer.isVisible); }; } } }
//Called once everything else is loaded, just before the first execution tick public void Awake() { //DontDestroyOnLoad(this); Debug.Log("Awakening ExplorerTrackBehaviour"); GUIResources.LoadAssets(); //mainWindowOpen = false; //Load config //KSP.IO.PluginConfiguration configfile = KSP.IO.PluginConfiguration.CreateForType<ExplorerTrackBehaviour>(); //configfile.load(); //trackManager.restoreTracksFromFile(); setupRepeatingUpdate(recordingInterval); lastReferencePos = new Vector3(0,0,0); InvokeRepeating("checkGPS", 1, 1); //Cancel with CancelInvoke mainWindowButton = ToolbarManager.Instance.add("PersistentTrails", "mainWindowButton"); mainWindowButton.TexturePath = "PersistentTrails/Icons/Main-NoRecording";// GUIResources.IconNoRecordingPath; mainWindowButton.ToolTip = "Persistent Trails"; mainWindowButton.Visibility = new GameScenesVisibility(GameScenes.FLIGHT); mainWindowButton.OnClick += (e) => { Debug.Log("button1 clicked, mouseButton: " + e.MouseButton); mainWindow.ToggleVisible(); }; }
/// <summary>Constructor.</summary> /// <param name="model">The logical model of the button</param> /// <param name="container">The HTML container of the button.</param> protected ButtonView(IButton model, jQueryObject container) : base(InitContainer(container)) { // Setup initial conditions. if (Script.IsNullOrUndefined(model)) model = new ButtonBase(); this.model = model; Focus.BrowserHighlighting = false; // Setup CSS. Css.InsertLink(Css.Urls.CoreButtons); Container.AddClass(ClassButton); Container.AddClass(Css.Classes.NoSelect); // Insert the content and mask containers. divContent = CreateContainer("buttonContent"); // Create child controllers. eventController = new ButtonEventController(this); contentController = new ButtonContentController(this, divContent); // Wire up events. Model.LayoutInvalidated += OnLayoutInvalidated; Helper.ListenPropertyChanged(Model, OnModelPropertyChanged); eventController.PropertyChanged += OnEventControllerPropertyChanged; GotFocus += delegate { UpdateLayout(); }; LostFocus += delegate { UpdateLayout(); }; IsEnabledChanged += delegate { UpdateLayout(); }; Container.Keydown(delegate(jQueryEvent e) { OnKeyPress(Int32.Parse(e.Which)); }); // Finish up. SyncCanFocus(); }
protected override void AttachChildControls() { this.txtRealName = (TextBox) this.FindControl("txtRealName"); this.txtEmail = (TextBox) this.FindControl("txtEmail"); this.dropRegionsSelect = (RegionSelector) this.FindControl("dropRegions"); this.gender = (GenderRadioButtonList) this.FindControl("gender"); this.calendDate = (WebCalendar) this.FindControl("calendDate"); this.txtAddress = (TextBox) this.FindControl("txtAddress"); this.txtQQ = (TextBox) this.FindControl("txtQQ"); this.txtMSN = (TextBox) this.FindControl("txtMSN"); this.txtTel = (TextBox) this.FindControl("txtTel"); this.txtHandSet = (TextBox) this.FindControl("txtHandSet"); this.btnOK1 = ButtonManager.Create(this.FindControl("btnOK1")); this.Statuses = (SmallStatusMessage) this.FindControl("Statuses"); this.btnOK1.Click += new EventHandler(this.btnOK1_Click); PageTitle.AddSiteNameTitle("个人信息", HiContext.Current.Context); if (!this.Page.IsPostBack) { Member user = HiContext.Current.User as Member; if (user != null) { this.BindData(user); } } }
protected override void AttachChildControls() { int.TryParse(this.Page.Request.QueryString["modeId"], out this.paymentModeId); decimal.TryParse(this.Page.Request.QueryString["blance"], out this.balance); this.litUserName = (Literal) this.FindControl("litUserName"); this.lblPaymentName = (Literal) this.FindControl("lblPaymentName"); this.imgPayment = (HiImage) this.FindControl("imgPayment"); this.lblBlance = (FormatedMoneyLabel) this.FindControl("lblBlance"); this.litPayCharge = (Literal) this.FindControl("litPayCharge"); this.btnConfirm = ButtonManager.Create(this.FindControl("btnConfirm")); PageTitle.AddSiteNameTitle("充值确认", HiContext.Current.Context); this.btnConfirm.Click += new EventHandler(this.btnConfirm_Click); if (!this.Page.IsPostBack) { if ((this.paymentModeId == 0) || (this.balance == 0M)) { this.Page.Response.Redirect(Globals.GetSiteUrls().UrlData.FormatUrl("user_InpourRequest")); } else { PaymentModeInfo paymentMode = TradeHelper.GetPaymentMode(this.paymentModeId); this.litUserName.Text = HiContext.Current.User.Username; if (paymentMode != null) { this.lblPaymentName.Text = paymentMode.Name; this.lblBlance.Money = this.balance; this.ViewState["PayCharge"] = paymentMode.CalcPayCharge(this.balance); this.litPayCharge.Text = Globals.FormatMoney(paymentMode.CalcPayCharge(this.balance)); } } } }
protected override void AttachChildControls() { this.favorites = (Common_Favorite_ProductList) this.FindControl("list_Common_Favorite_ProList"); this.btnSearch = ButtonManager.Create(this.FindControl("btnSearch")); this.txtKeyWord = (TextBox) this.FindControl("txtKeyWord"); this.pager = (Pager) this.FindControl("pager"); this.btnDeleteSelect = (LinkButton) this.FindControl("btnDeleteSelect"); this.btnSearch.Click += new EventHandler(this.btnSearch_Click); this.favorites.ItemCommand += new Common_Favorite_ProductList.CommandEventHandler(this.favorites_ItemCommand); this.btnDeleteSelect.Click += new EventHandler(this.btnDeleteSelect_Click); PageTitle.AddSiteNameTitle("商品收藏夹", HiContext.Current.Context); if (!this.Page.IsPostBack) { if (!string.IsNullOrEmpty(this.Page.Request.QueryString["ProductId"])) { int result = 0; int.TryParse(this.Page.Request.QueryString["ProductId"], out result); if (!CommentsHelper.ExistsProduct(result) && !CommentsHelper.AddProductToFavorite(result)) { this.ShowMessage("添加商品到收藏夹失败", false); } } this.BindList(); } }
public void OnDestroy() { if ( toolbarButton != null ) { toolbarButton.Destroy(); toolbarButton = null; } }
public void Start() { // Register toolbar button toolbarButton = ToolbarManager.Instance.add("MinimalAmbientLight", "Adjust"); toolbarButton.Text = "Adjust Minimal Ambient Light"; toolbarButton.TexturePath = "MinimalAmbientLight/MinimalAmbientLight24"; toolbarButton.ToolTip = "Lightning: LMB: Next; MMB: Default, RMB: Adjust"; toolbarButton.Visibility = new GameScenesVisibility(GameScenes.FLIGHT); toolbarButton.OnClick += (e) => { switch (e.MouseButton) { case 0: // LMB nextSetting(); break; case 2: // MMB resetDefault(); break; case 1: // RMB toggleToolbarConfig(); break; default: nextSetting(); break; } }; // TODO: Register applauncher button loadSettings(); }
public static void WriteButtonModel(IButton button) { Log.Info("IsEnabled: " + button.IsEnabled); Log.Info("IsPressed: " + button.IsPressed); Log.Info("CanToggle: " + button.CanToggle); Log.Info("CanFocus: " + button.CanFocus); }
internal TestButtons() { // button that toggles its icon when clicked bool state1 = false; button1 = ToolbarManager.Instance.add("test", "button1"); button1.TexturePath = "000_Toolbar/img_buttonTypeMNode"; button1.ToolTip = "Toggle This Button's Icon"; button1.OnClick += (e) => { Debug.Log("button1 clicked, mouseButton: " + e.MouseButton); button1.TexturePath = state1 ? "000_Toolbar/img_buttonTypeMNode" : "000_Toolbar/icon"; state1 = !state1; }; // disabled button button2 = ToolbarManager.Instance.add("test", "button2"); button2.TexturePath = "000_Toolbar/img_buttonTypeMNode"; button2.ToolTip = "Disabled Button"; button2.Enabled = false; button2.OnClick += (e) => Debug.Log("button2 clicked"); // important button button3 = ToolbarManager.Instance.add("test", "button3"); button3.TexturePath = "000_Toolbar/img_buttonTypeMNode"; button3.ToolTip = "Toggle This Button's Importance"; button3.Important = true; button3.OnClick += (e) => { Debug.Log("button3 clicked"); button3.Important = !button3.Important; }; // regular button button4 = ToolbarManager.Instance.add("test", "button4"); button4.TexturePath = "000_Toolbar/img_buttonTypeMNode"; button4.ToolTip = "Regular Button"; button4.OnClick += (e) => Debug.Log("button4 clicked"); button4.OnMouseEnter += (e) => Debug.Log("button4 mouse enter"); button4.OnMouseLeave += (e) => Debug.Log("button4 mouse leave"); // button that toggles visibility of the previous button button5 = ToolbarManager.Instance.add("test", "button5"); button5.TexturePath = "000_Toolbar/icon"; button5.ToolTip = "Toggle Previous Button's Visibility"; button5.OnClick += (e) => button4.Visible = !button4.Visible; button5.OnClick += (e) => Debug.Log("button5 clicked"); // button that is only visible in the editors button6 = ToolbarManager.Instance.add("test", "button6"); button6.TexturePath = "000_Toolbar/img_buttonTypeMNode"; button6.ToolTip = "Button Visible Only in Editors"; button6.Visibility = new GameScenesVisibility(GameScenes.EDITOR, GameScenes.SPH); button6.OnClick += (e) => Debug.Log("button6 clicked"); // button that is only visible in the flight scene button7 = ToolbarManager.Instance.add("test", "button7"); button7.TexturePath = "000_Toolbar/icon"; button7.ToolTip = "Button Visible Only in Flight Scene"; button7.Visibility = new GameScenesVisibility(GameScenes.FLIGHT); button7.OnClick += (e) => Debug.Log("button7 clicked"); }
internal void Destroy() { if (!isAvailable || Button == null) { return; } Button.Destroy (); Button = null; }
private void toggleMenu ( IButton menu ) { if (!ToolbarManager.ToolbarAvailable) return; // bail if we don't have a toolbar if (menu.Drawable == null) createMenu (menu); else destroyMenu (menu); }
public LowLevelView() { InitializeComponent(); txtAddressWrapped = new ToolStripTextBoxWrapper(txtAddress); btnBackWrapped = new ToolStripButtonWrapper(btnBack); btnFwdWrapped = new ToolStripButtonWrapper(btnForward); btnGoWrapped = new ToolStripButtonWrapper(btnGo); }
internal void Destroy() { if (!isAvailable) { return; } if (Button != null) { Button.Destroy(); Button = null; } if (ButtonConf != null) { ButtonConf.Destroy(); ButtonConf = null; } if (ButtonMain != null) { ButtonMain.Destroy(); ButtonMain = null; } if (ButtonSett != null) { ButtonSett.Destroy(); ButtonSett = null; } if (ButtonSC != null) { ButtonSC.Destroy(); ButtonSC = null; } if (ButtonVAB != null) { ButtonVAB.Destroy(); ButtonVAB = null; } if (ButtonSPH != null) { ButtonSPH.Destroy(); ButtonSPH = null; } if (ButtonTS != null) { ButtonTS.Destroy(); ButtonTS = null; } if (ButtonMI != null) { ButtonMI.Destroy(); ButtonMI = null; } if (ButtonAstr != null) { ButtonAstr.Destroy(); ButtonAstr = null; } if (ButtonAdmi != null) { ButtonAdmi.Destroy(); ButtonAdmi = null; } if (ButtonRnD != null) { ButtonRnD.Destroy(); ButtonRnD = null; } if (ButtonRv != null) { ButtonRv.Destroy(); ButtonRv = null; } if (ButtonRvED != null) { ButtonRvED.Destroy(); ButtonRvED = null; } if (ButtonRvSC != null) { ButtonRvSC.Destroy(); ButtonRvSC = null; } if (ButtonRc != null) { ButtonRc.Destroy(); ButtonRc = null; } if (ButtonLves != null) { ButtonLves.Destroy(); ButtonLves = null; } StopEach(); QuickGoTo.Log("Destroy", "QBlizzyToolbar"); }
public string AnotherUsefulFunctionCheckbox(IButton _Button) { var result = _Button.UsefullFunctionButton(); return($"The result of the Mac Checkbox with the ({result})"); }
public Task ButtonClickAfterRepositoryActionAsync(IButton button, FormEditContext editContext, ButtonContext context) { return(Task.CompletedTask); }
public Application(IGUIFactory factory) { IButton button = factory.CreateButton(); button.Paint(); }
internal MouseEnterEvent(IButton button) : base(button) { }
protected virtual void OnButtonPressed(IButton button, ButtonPressedDuration duration) { }
public static void UpdateColor(this UIButton nativeButton, IButton button) => nativeButton.UpdateColor(button.Color, nativeButton.TitleColor(UIControlState.Normal).ToColor());
public void Init(ITextDisplay display, IButton buttonNext, IButton buttonPrevious, IButton buttonSelect) { _display = display; _buttonSelect = buttonSelect; _buttonNext = buttonNext; _buttonPrevious = buttonPrevious; _isInit = true; }
/// <summary> /// Constructs the <see cref="DefaultBOEditorFormWin"/> class with /// the specified businessObject, uiDefName and post edit action. /// </summary> /// <param name="bo">The business object to represent</param> /// <param name="uiDefName">The name of the ui def to use.</param> /// <param name="controlFactory">The <see cref="IControlFactory"/> to use for creating the Editor form controls</param> /// <param name="creator">The Creator used to Create the Group Control.</param> public DefaultBOEditorFormWin(BusinessObject bo, string uiDefName, IControlFactory controlFactory, GroupControlCreator creator) { _bo = bo; _controlFactory = controlFactory; GroupControlCreator = creator; _uiDefName = uiDefName; BOMapper mapper = new BOMapper(bo); IUIForm def; if (_uiDefName.Length > 0) { IUIDef uiMapper = mapper.GetUIDef(_uiDefName); if (uiMapper == null) { throw new NullReferenceException("An error occurred while " + "attempting to load an object editing form. A possible " + "cause is that the class definitions do not have a " + "'form' section for the class, under the 'ui' " + "with the name '" + _uiDefName + "'."); } def = uiMapper.UIForm; } else { IUIDef uiMapper = mapper.GetUIDef(); if (uiMapper == null) { throw new NullReferenceException("An error occurred while " + "attempting to load an object editing form. A possible " + "cause is that the class definitions do not have a " + "'form' section for the class."); } def = uiMapper.UIForm; } if (def == null) { throw new NullReferenceException("An error occurred while " + "attempting to load an object editing form. A possible " + "cause is that the class definitions do not have a " + "'form' section for the class."); } PanelBuilder panelBuilder = new PanelBuilder(_controlFactory); //_panelInfo = panelBuilder.BuildPanelForForm(_bo.ClassDef.UIDefCol["default"].UIForm); //_panelInfo = panelBuilder.BuildPanelForForm(_bo.ClassDef.UIDefCol[uiDefName].UIForm, this.GroupControlCreator); _panelInfo = panelBuilder.BuildPanelForForm(def, this.GroupControlCreator); _panelInfo.BusinessObject = _bo; _boPanel = _panelInfo.Panel; _buttons = _controlFactory.CreateButtonGroupControl(); _buttons.AddButton("Cancel", CancelButtonHandler); IButton okbutton = _buttons.AddButton("OK", OkButtonHandler); okbutton.NotifyDefault(true); this.AcceptButton = (ButtonWin)okbutton; this.Load += delegate { FocusOnFirstControl(); }; this.FormClosing += OnFormClosing; this.Text = def.Title; SetupFormSize(def); MinimizeBox = false; MaximizeBox = false; //this.ControlBox = false; this.StartPosition = FormStartPosition.CenterScreen; CreateLayout(); OnResize(new EventArgs()); }
public IComboBox GetComboBox(string id, IButton dropDownButton = null, ITextBox textBox = null, Func <string, IButton> itemButtonFactory = null, IObject parent = null, bool addToUi = true, float defaultWidth = 500f, float defaultHeight = 40f) { TypedParameter idParam = new TypedParameter(typeof(string), id); IComboBox comboBox = _resolver.Container.Resolve <IComboBox>(idParam); if (parent != null) { comboBox.RenderLayer = parent.RenderLayer; } defaultHeight = dropDownButton?.Height ?? textBox?.Height ?? defaultHeight; float itemWidth = textBox?.Width ?? defaultWidth; if (textBox == null) { textBox = GetTextBox(id + "_TextBox", 0f, 0f, comboBox, "", new AGSTextConfig(alignment: Alignment.MiddleCenter, autoFit: AutoFit.TextShouldFitLabel), false, itemWidth, defaultHeight); textBox.Border = AGSBorders.SolidColor(Colors.WhiteSmoke, 3f); textBox.Tint = Colors.Transparent; } else { setParent(textBox, comboBox); } textBox.RenderLayer = comboBox.RenderLayer; textBox.Enabled = false; if (dropDownButton == null) { var whiteArrow = AGSBorders.Multiple(AGSBorders.SolidColor(Colors.WhiteSmoke, 3f), _graphics.Icons.GetArrowIcon(ArrowDirection.Down, Colors.WhiteSmoke)); var yellowArrow = AGSBorders.Multiple(AGSBorders.SolidColor(Colors.Yellow, 3f), _graphics.Icons.GetArrowIcon(ArrowDirection.Down, Colors.Yellow)); dropDownButton = GetButton(id + "_DropDownButton", new ButtonAnimation(whiteArrow, null, Colors.Transparent), new ButtonAnimation(yellowArrow, null, Colors.Transparent), new ButtonAnimation(yellowArrow, null, Colors.White.WithAlpha(100)), 0f, 0f, comboBox, "", null, false, 30f, defaultHeight); dropDownButton.Border = whiteArrow; } else { setParent(dropDownButton, comboBox); } dropDownButton.RenderLayer = comboBox.RenderLayer; dropDownButton.Z = textBox.Z - 1; dropDownButton.SkinTags.Add(AGSSkin.DropDownButtonTag); dropDownButton.Skin?.Apply(dropDownButton); var dropDownPanelLayer = new AGSRenderLayer(comboBox.RenderLayer.Z - 1, comboBox.RenderLayer.ParallaxSpeed, comboBox.RenderLayer.IndependentResolution); //Making sure that the drop-down layer is rendered before the combobox layer, so that it will appear in front of other ui elements that may be below. if (itemButtonFactory == null) { var yellowBrush = _graphics.Brushes.LoadSolidBrush(Colors.Yellow); var whiteBrush = _graphics.Brushes.LoadSolidBrush(Colors.White); itemButtonFactory = text => { var button = GetButton(id + "_" + text, new ButtonAnimation(null, new AGSTextConfig(whiteBrush, autoFit: AutoFit.LabelShouldFitText), null), new ButtonAnimation(null, new AGSTextConfig(yellowBrush, autoFit: AutoFit.LabelShouldFitText), null), new ButtonAnimation(null, new AGSTextConfig(yellowBrush, outlineBrush: whiteBrush, outlineWidth: 0.5f, autoFit: AutoFit.LabelShouldFitText), null), 0f, 0f, width: itemWidth, height: defaultHeight); button.Pivot = new PointF(0f, 1f); button.RenderLayer = dropDownPanelLayer; return(button); }; } var dropDownPanel = GetPanel(id + "_DropDownPanel", new EmptyImage(1f, 1f), 0f, 0f, comboBox); dropDownPanel.AddComponent <IBoundingBoxWithChildrenComponent>(); dropDownPanel.AddComponent <IStackLayoutComponent>(); dropDownPanel.Border = AGSBorders.SolidColor(Colors.White, 3f); dropDownPanel.Tint = Colors.Black; dropDownPanel.RenderLayer = dropDownPanelLayer; var listBox = dropDownPanel.AddComponent <IListboxComponent>(); listBox.ItemButtonFactory = itemButtonFactory; listBox.MaxHeight = 300f; CreateScrollingPanel(dropDownPanel); comboBox.DropDownButton = dropDownButton; comboBox.TextBox = textBox; comboBox.DropDownPanel = dropDownPanel; setParent(comboBox, parent); if (addToUi) { _gameState.UI.Add(textBox); _gameState.UI.Add(dropDownButton); _gameState.UI.Add(comboBox); } return(comboBox); }
internal MouseMoveEvent(IButton button) { this.button = button; }
public MakeCoffeeButton(IButton hardware) { _hardware = hardware; _hardware.ButtonPressed += OnButtonPress; }
private void DebugAndDataTab(GUIStyle thisStyle) { GUILayout.BeginHorizontal(); GUILayout.BeginVertical(GUILayout.Width(250)); GUILayout.Label("Debug / Cheat Options"); FARDebugValues.allowStructuralFailures = GUILayout.Toggle(FARDebugValues.allowStructuralFailures, "Allow Aero-structural Failures", thisStyle); GUILayout.Label("Editor GUI Graph Colors"); Color tmpColor = GUIColors.Instance[0]; ChangeColor("Cl", ref tmpColor, ref cLTexture); GUIColors.Instance[0] = tmpColor; tmpColor = GUIColors.Instance[1]; ChangeColor("Cd", ref tmpColor, ref cDTexture); GUIColors.Instance[1] = tmpColor; tmpColor = GUIColors.Instance[2]; ChangeColor("Cm", ref tmpColor, ref cMTexture); GUIColors.Instance[2] = tmpColor; tmpColor = GUIColors.Instance[3]; ChangeColor("L_D", ref tmpColor, ref l_DTexture); GUIColors.Instance[3] = tmpColor; FARActionGroupConfiguration.DrawGUI(); GUILayout.Label("Other Options"); // DaMichel: put it above the toolbar toggle FARDebugValues.aeroFailureExplosions = GUILayout.Toggle(FARDebugValues.aeroFailureExplosions, "Aero Failures Create Explosions", thisStyle); FARDebugValues.showMomentArrows = GUILayout.Toggle(FARDebugValues.showMomentArrows, "Show Torque Arrows in Aero Overlay", thisStyle); if (ToolbarManager.ToolbarAvailable) { FARDebugValues.useBlizzyToolbar = GUILayout.Toggle(FARDebugValues.useBlizzyToolbar, "Use Blizzy78 Toolbar instead of Stock AppManager", thisStyle); bool tmp = FARDebugValues.useBlizzyToolbar; if (tmp != FARDebugValues.useBlizzyToolbar) { if (FARDebugButtonStock != null) { ApplicationLauncher.Instance.RemoveModApplication(FARDebugButtonStock); } if (FARDebugButtonBlizzy != null) { FARDebugButtonBlizzy.Destroy(); } if (FARDebugValues.useBlizzyToolbar) { FARDebugButtonBlizzy = ToolbarManager.Instance.add("ferram4", "FARDebugButtonBlizzy"); FARDebugButtonBlizzy.TexturePath = "FerramAerospaceResearch/Textures/icon_button_blizzy"; FARDebugButtonBlizzy.ToolTip = "FAR Debug Options"; FARDebugButtonBlizzy.OnClick += (e) => debugMenu = !debugMenu; } else { GameEvents.onGUIApplicationLauncherReady.Add(OnGUIAppLauncherReady); } } } GUILayout.EndVertical(); GUILayout.BeginVertical(); FARSettingsScenarioModule.Instance.DisplaySelection(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); }
public static void UpdateColor(this UIButton nativeButton, IButton button) { // appCompatButton.SetTextColor(button.Color.ToNative()); }
public static void UpdateText(this UIButton nativeButton, IButton button) => nativeButton.SetText(button.Text);
public static void UpdateColor(this UIButton nativeButton, IButton button, Color defaultColor) => nativeButton.UpdateColor(button.Color, defaultColor);
public override bool OnStart(IScriptEngine se) { context.State = "Configuring..."; Game.Sync(() => { var screenSize = Game.ScreenSize; primaryPanel = Factories.CreateGuiPanel(); GuiScene.Add(primaryPanel); primaryPanel.SetSize(300, 320); primaryPanel.SetPosition(155, (screenSize.Y / 2), 0); primaryPanel.SetAnchor(new Vector2f(0.0f, 0.0f), new Vector2f(0.0f, 0.0f)); primaryPanel.SetPivot(new Vector2f(0.5f, 0.5f)); tierLabel = Factories.CreateGuiLabel(); primaryPanel.Add(tierLabel); tierLabel.SetPosition(-60, 145, 0); tierLabel.SetSize(100, 25); tierLabel.SetText("Tier"); harvestWoodInput = Factories.CreateGuiInputField(); primaryPanel.Add(harvestWoodInput); harvestWoodInput.SetPosition(-70, 125, 0); harvestWoodInput.SetSize(120, 25); harvestWoodCheckBox = Factories.CreateGuiCheckBox(); primaryPanel.Add(harvestWoodCheckBox); harvestWoodCheckBox.SetPosition(60, 125, 0); harvestWoodCheckBox.SetSize(100, 25); harvestWoodCheckBox.SetText("Harvest Wood"); harvestWoodCheckBox.SetSelected(true); harvestOreInput = Factories.CreateGuiInputField(); primaryPanel.Add(harvestOreInput); harvestOreInput.SetPosition(-70, 100, 0); harvestOreInput.SetSize(120, 25); harvestOreCheckBox = Factories.CreateGuiCheckBox(); primaryPanel.Add(harvestOreCheckBox); harvestOreCheckBox.SetPosition(60, 100, 0); harvestOreCheckBox.SetSize(100, 25); harvestOreCheckBox.SetText("Harvest Ore"); harvestOreCheckBox.SetSelected(true); harvestFiberInput = Factories.CreateGuiInputField(); primaryPanel.Add(harvestFiberInput); harvestFiberInput.SetPosition(-70, 75, 0); harvestFiberInput.SetSize(120, 25); harvestFiberCheckBox = Factories.CreateGuiCheckBox(); primaryPanel.Add(harvestFiberCheckBox); harvestFiberCheckBox.SetPosition(60, 75, 0); harvestFiberCheckBox.SetSize(100, 25); harvestFiberCheckBox.SetText("Harvest Fiber"); harvestFiberCheckBox.SetSelected(true); harvestHideInput = Factories.CreateGuiInputField(); primaryPanel.Add(harvestHideInput); harvestHideInput.SetPosition(-70, 50, 0); harvestHideInput.SetSize(120, 25); harvestHideCheckBox = Factories.CreateGuiCheckBox(); primaryPanel.Add(harvestHideCheckBox); harvestHideCheckBox.SetPosition(60, 50, 0); harvestHideCheckBox.SetSize(100, 25); harvestHideCheckBox.SetText("Harvest Hide"); harvestHideCheckBox.SetSelected(true); harvestStoneInput = Factories.CreateGuiInputField(); primaryPanel.Add(harvestStoneInput); harvestStoneInput.SetPosition(-70, 25, 0); harvestStoneInput.SetSize(120, 25); harvestStoneCheckBox = Factories.CreateGuiCheckBox(); primaryPanel.Add(harvestStoneCheckBox); harvestStoneCheckBox.SetPosition(60, 25, 0); harvestStoneCheckBox.SetSize(100, 25); harvestStoneCheckBox.SetText("Harvest Stone"); harvestStoneCheckBox.SetSelected(true); killMobsCheckBox = Factories.CreateGuiCheckBox(); primaryPanel.Add(killMobsCheckBox); killMobsCheckBox.SetPosition(-70, -5, 0); killMobsCheckBox.SetSize(125, 25); killMobsCheckBox.SetText("Kill Mobs"); killMobsCheckBox.SetSelected(true); autoLoginCheckbox = Factories.CreateGuiCheckBox(); primaryPanel.Add(autoLoginCheckbox); autoLoginCheckbox.SetPosition(60, -5, 0); autoLoginCheckbox.SetSize(125, 25); autoLoginCheckbox.SetText("Auto Relogin"); autoLoginCheckbox.SetSelected(true); characterNameLabel = Factories.CreateGuiLabel(); primaryPanel.Add(characterNameLabel); characterNameLabel.SetPosition(70, -35, 0); characterNameLabel.SetSize(125, 25); characterNameLabel.SetText("Character Name"); characterNameInput = Factories.CreateGuiInputField(); primaryPanel.Add(characterNameInput); characterNameInput.SetPosition(70, -55, 0); characterNameInput.SetSize(125, 25); setVaultAreaButton = Factories.CreateGuiButton(); primaryPanel.Add(setVaultAreaButton); setVaultAreaButton.SetPosition(-70, -35, 0); setVaultAreaButton.SetSize(125, 25); setVaultAreaButton.SetText("Set Vault Loc."); setVaultAreaButton.AddActionListener((e) => { var local = Players.LocalPlayer; if (local != null) { var loc = local.ThreadSafeLocation; var area = loc.Expand(4, 2, 4); Logging.Log("Set vault loc to " + loc.X + " " + loc.Y + " " + loc.Z); config.VaultClusterName = Game.ClusterName; config.VaultDest = new SafeVector3(new Vector3f(loc.X, loc.Y, loc.Z)); config.VaultArea = new SafeMapArea(Game.Cluster.Name, new Area(area.Start, area.End)); } }); setRepairAreaButton = Factories.CreateGuiButton(); primaryPanel.Add(setRepairAreaButton); setRepairAreaButton.SetPosition(-70, -65, 0); setRepairAreaButton.SetSize(125, 25); setRepairAreaButton.SetText("Set Repair Loc."); setRepairAreaButton.AddActionListener((e) => { var local = Players.LocalPlayer; if (local != null) { var loc = local.ThreadSafeLocation; var area = loc.Expand(4, 2, 4); Logging.Log("Set repair loc to " + loc.X + " " + loc.Y + " " + loc.Z); config.RepairClusterName = Game.ClusterName; config.RepairDest = new SafeVector3(new Vector3f(loc.X, loc.Y, loc.Z)); config.RepairArea = new SafeMapArea(Game.ClusterName, new Area(area.Start, area.End)); } }); addRoamPointButton = Factories.CreateGuiButton(); primaryPanel.Add(addRoamPointButton); addRoamPointButton.SetPosition(-70, -95, 0); addRoamPointButton.SetSize(125, 25); addRoamPointButton.SetText("Add Roam Point"); addRoamPointButton.AddActionListener((e) => { var local = Players.LocalPlayer; if (local != null) { var loc = local.ThreadSafeLocation; Logging.Log("Add roam point " + loc.X + " " + loc.Y + " " + loc.Z); config.ResourceClusterName = Game.ClusterName; config.RoamPoints.Add(new SafeVector3(new Vector3f(loc.X, loc.Y, loc.Z))); } }); removeRoamPointButton = Factories.CreateGuiButton(); primaryPanel.Add(removeRoamPointButton); removeRoamPointButton.SetPosition(60, -95, 0); removeRoamPointButton.SetSize(125, 25); removeRoamPointButton.SetText("Del Roam Point"); removeRoamPointButton.AddActionListener((e) => { var local = Players.LocalPlayer; if (local != null) { var loc = local.ThreadSafeLocation; Logging.Log("Delete roam point " + loc.X + " " + loc.Y + " " + loc.Z); for (var i = 0; i < config.RoamPoints.Count; i++) { if (config.RoamPoints[i].RealVector3().Expand(3, 3, 3).Contains(loc)) { config.RoamPoints.RemoveAt(i); i -= 1; } } } }); runButton = Factories.CreateGuiButton(); primaryPanel.Add(runButton); runButton.SetPosition(0, -140, 0); runButton.SetSize(125, 25); runButton.SetText("Run"); runButton.AddActionListener((e) => { if (config.VaultDest == null) { context.State = "No vault area set!"; return; } if (config.RoamPoints.Count == 0) { context.State = "No roam points added!"; return; } SelectedStart(); }); UpdateForConfig(); }); return(true); }
public static void UpdateText(this UIButton view, IButton button) => view.UpdateText(button.Text);
public override Task <CrudType> ButtonClickBeforeRepositoryActionAsync(IButton button, FormEditContext editContext, ButtonContext context) => _mediator.NotifyEventAsync(this, new PaneRequestEventArgs(typeof(TSidePane), editContext, context));
internal MouseLeaveEvent(IButton button) : base(button) { }
public void Run(IBrowser browser) { using (browser) { foreach (Command command in commands) { bool result = false; switch (command.Action) { case "open": { string url = string.Format("{0}{1}.aspx", FairyTalesUrl, command.Subject); browser.GoTo(url); result = browser.Url == url; } break; case "check": { if (command.Subject == "ActiveProject") { ISpan span = browser.Span("ctl00_ContentPlaceHolder1_activeProject"); if (span.Exists) { result = span.Text == command.Argument.Replace("\"", ""); } } } break; case "enter": { if (command.Subject == "ProjectInput") { string input = command.Argument.Replace("\"", ""); ITextField projectInput = browser.TextField("ctl00_ContentPlaceHolder1_projectInput"); if (projectInput.Exists) { projectInput.Value = input; result = projectInput.Value == input; } } } break; case "press": { if (command.Subject == "AddProject") { IButton button = browser.Button("ctl00_ContentPlaceHolder1_addProjectButton"); if (button.Exists) { button.Click(); result = true; } } } break; } results.Add(command.ToString(), result); } } results["close"] = true; }
private static void ClearBlizzyToolbarButton() { blizzyFlightGUIButton.Destroy(); blizzyFlightGUIButton = null; }
internal override void OnAwake() { LogFormatted("Awakening the TransferWindowPlanner (TWP)"); LogFormatted("Checking for PluginData folder"); if (!System.IO.Directory.Exists(Resources.PathPlugin + "/PluginData")) { System.IO.Directory.CreateDirectory(Resources.PathPlugin + "/PluginData"); } LogFormatted("Loading Settings"); settings = new Settings("PluginData/settings.cfg"); Boolean blnSettingsLoaded = settings.Load(); if (!blnSettingsLoaded) { settings = new Settings("settings.cfg"); blnSettingsLoaded = settings.Load(); if (blnSettingsLoaded) { settings.FilePath = "PluginData/settings.cfg"; System.IO.File.Move(Resources.PathPlugin + "/settings.cfg", Resources.PathPlugin + "/PluginData/settings.cfg"); } } if (!blnSettingsLoaded) { settings.FilePath = "PluginData/settings.cfg"; LogFormatted("Settings Load Failed"); } InitWindows(); if (settings.SelectedCalendar == CalendarTypeEnum.Earth) { KSPDateStructure.SetEarthCalendar(settings.EarthEpoch); windowSettings.ddlSettingsCalendar.SelectedIndex = (Int32)settings.SelectedCalendar; } KSPDateStructure.UseStockDateFormatters = settings.UseStockDateFormatters; //plug us in to the draw queue and start the worker //Rem out for unity5 //RenderingManager.AddToPostDrawQueue(1, DrawGUI); //Get whether the toolbar is there settings.BlizzyToolbarIsAvailable = ToolbarManager.ToolbarAvailable; //setup the Toolbar button if necessary if (settings.ButtonStyleToDisplay == Settings.ButtonStyleEnum.Toolbar) { btnToolbar = InitToolbarButton(); } //Hook the App Launcher GameEvents.onGUIApplicationLauncherReady.Add(OnGUIAppLauncherReady); GameEvents.onGUIApplicationLauncherDestroyed.Add(DestroyAppLauncherButton); GameEvents.onGameSceneLoadRequested.Add(OnGameSceneLoadRequestedForAppLauncher); // Need this one to handle the hideUI cancelling via pause menu GameEvents.onGameUnpause.Add(OnUnpause); //Hook the Angle renderers if (lstScenesForAngles.Contains(HighLogic.LoadedScene)) { PhaseAngle = MapView.MapCamera.gameObject.AddComponent <AngleRenderPhase>(); EjectAngle = MapView.MapCamera.gameObject.AddComponent <AngleRenderEject>(); } //do the daily version check if required if (settings.DailyVersionCheck) { settings.VersionCheck(this, false); } }
public void Verify_CounterShowsNumberOfButtonClicks() { int numOfClicks = 10; // Launch the browser and navigate to site. var browser = BrowserFactory.Launch(BrowserType.Chrome); browser.Navigate("http://shaharbehagenmail.wix.com/tutoring-company"); // Wait for the browser to complete the navigation. browser.Sync(); try { IFrame frame = browser.Describe <IFrame>(new FrameDescription { Id = string.Empty, Name = string.Empty, Index = 2 }); IButton butt = frame.Describe <IButton>(new ButtonDescription { ButtonType = @"button", TagName = @"BUTTON", Name = @"Click Me" }); IWebElement counter = frame.Describe <IWebElement>(new WebElementDescription { TagName = @"H1", // InnerText = @"1" // Cannot use InnerText to describe object, since changes during the test. }); // Give it a few good Buttkicks! for (int i = 0; i < numOfClicks; i++) { butt.Click(); } // (Is this necessary here?) browser.Sync(); // Verify that the web page counter shows the number of clicks we just clicked. int presentedCounter = Int32.Parse(counter.InnerText); Assert.AreEqual(numOfClicks, presentedCounter); Reporter.ReportEvent("Verify_CounterShowsNumberOfButtonClicks", "Passed validation", Status.Passed); } catch (AssertFailedException e) //catch (AssertionException e) // Add a log message to the results report on failure. { Reporter.ReportEvent("Verify_CounterShowsNumberOfButtonClicks", "Failed during validation", Status.Failed, e); throw; } finally { browser.Close(); } }
public void createUI() { this.button = this.guiFactory.createButton(); }
internal TestButtons() { // button that toggles its icon when clicked bool state1 = false; button1 = ToolbarManager.Instance.add("test", "button1"); button1.TexturePath = "000_Toolbar/img_buttonTypeMNode"; button1.ToolTip = "Toggle This Button's Icon"; button1.OnClick += (e) => { //Debug.Log("button1 clicked, mouseButton: " + e.MouseButton); button1.TexturePath = state1 ? "000_Toolbar/img_buttonTypeMNode" : "000_Toolbar/icon"; state1 = !state1; }; // disabled button button2 = ToolbarManager.Instance.add("test", "button2"); button2.TexturePath = "000_Toolbar/img_buttonTypeMNode"; button2.ToolTip = "Disabled Button"; button2.Enabled = false; //button2.OnClick += (e) => Debug.Log("button2 clicked"); // important button button3 = ToolbarManager.Instance.add("test", "button3"); button3.TexturePath = "000_Toolbar/img_buttonTypeMNode"; button3.ToolTip = "Toggle This Button's Importance"; button3.Important = true; button3.OnClick += (e) => { //Debug.Log("button3 clicked"); button3.Important = !button3.Important; }; // regular button button4 = ToolbarManager.Instance.add("test", "button4"); button4.TexturePath = "000_Toolbar/img_buttonTypeMNode"; button4.ToolTip = "Regular Button"; //button4.OnClick += (e) => Debug.Log("button4 clicked"); //button4.OnMouseEnter += (e) => Debug.Log("button4 mouse enter"); //button4.OnMouseLeave += (e) => Debug.Log("button4 mouse leave"); // button that toggles visibility of the previous button button5 = ToolbarManager.Instance.add("test", "button5"); button5.TexturePath = "000_Toolbar/icon"; button5.ToolTip = "Toggle Previous Button's Visibility"; button5.OnClick += (e) => button4.Visible = !button4.Visible; //button5.OnClick += (e) => Debug.Log("button5 clicked"); // button that is only visible in the editors button6 = ToolbarManager.Instance.add("test", "button6"); button6.TexturePath = "000_Toolbar/img_buttonTypeMNode"; button6.ToolTip = "Button Visible Only in Editors"; button6.Visibility = new GameScenesVisibility(GameScenes.EDITOR); //button6.OnClick += (e) => Debug.Log("button6 clicked"); // button that is only visible in the flight scene and flight map button7 = ToolbarManager.Instance.add("test", "button7"); button7.TexturePath = "000_Toolbar/icon"; button7.ToolTip = "Button Visible Only in Flight Scene"; button7.Visibility = new GameScenesVisibility(GameScenes.FLIGHT); //button7.OnClick += (e) => Debug.Log("button7 clicked"); // button that is only visible in the flight map button8 = ToolbarManager.Instance.add("test", "button8"); button8.TexturePath = "000_Toolbar/icon"; button8.ToolTip = "Button Visible Only in Flight Map"; button8.Visibility = FlightMapVisibility.Instance; //button8.OnClick += (e) => Debug.Log("button8 clicked"); // button that opens a popup menu on click button9 = ToolbarManager.Instance.add("test", "button9"); button9.TexturePath = "000_Toolbar/img_buttonTypeMNode"; button9.ToolTip = "Menu Button (Click)"; button9.OnClick += (e) => togglePopupMenu(button9); // button that opens an informative window on hover bool drawableVisible = false; button10 = ToolbarManager.Instance.add("test", "button10"); button10.TexturePath = "000_Toolbar/img_buttonTypeMNode"; button10.ToolTip = "Info Button (Hover)"; button10.OnMouseEnter += (e) => { if (!drawableVisible) { button10.Drawable = new BoxDrawable(); } }; button10.OnMouseLeave += (e) => { button10.Drawable = null; }; // button that opens an informative window on click bool drawable2Visible = false; button11 = ToolbarManager.Instance.add("test", "button11"); button11.TexturePath = "000_Toolbar/img_buttonTypeMNode"; button11.ToolTip = "Info Button (Click)"; button11.OnClick += (e) => { switch (e.MouseButton) { case 0: if (!drawable2Visible) { boxDrawable = new BoxDrawable(); button11.Drawable = boxDrawable; } else { boxDrawable = null; button11.Drawable = null; } drawable2Visible = !drawable2Visible; break; case 1: if (boxDrawable != null) { boxDrawable.changeSize(); } break; } }; // button that has a nonexistent texture (plugin installed incorrectly etc.) button12 = ToolbarManager.Instance.add("test", "button12"); button12.TexturePath = "000_Toolbar/nonexistent"; button12.ToolTip = "Broken Button"; }
internal void Init() { if (!HighLogic.LoadedSceneIsGame || !isAvailable || !Enabled) { return; } if (Button != null) { Button = ToolbarManager.Instance.add(QuickGoTo.MOD, QuickGoTo.MOD); Button.TexturePath = TexturePath; Button.ToolTip = QuickGoTo.MOD; Button.OnClick += (e) => OnClick(); } if ((QSettings.Instance.EnableSettings || HighLogic.LoadedScene == GameScenes.SPACECENTER) && ButtonConf == null) { ButtonConf = ToolbarManager.Instance.add(QuickGoTo.MOD + "Conf", QuickGoTo.MOD + "Conf"); ButtonConf.TexturePath = Conf_TexturePath; ButtonConf.ToolTip = QGoTo.Instance.GetText(QGoTo.GoTo.Configurations); ButtonConf.OnClick += (e) => QGoTo.Instance.Settings(); } if (QSettings.Instance.EnableGoToMainMenu && ButtonMain == null) { ButtonMain = ToolbarManager.Instance.add(QuickGoTo.MOD + "Main", QuickGoTo.MOD + "Main"); ButtonMain.TexturePath = Main_TexturePath; ButtonMain.ToolTip = QGoTo.Instance.GetText(QGoTo.GoTo.MainMenu); ButtonMain.OnClick += (e) => QGoTo.Instance.mainMenu(); } if (QSettings.Instance.EnableGoToSettings && ButtonSett == null) { ButtonSett = ToolbarManager.Instance.add(QuickGoTo.MOD + "Sett", QuickGoTo.MOD + "Sett"); ButtonSett.TexturePath = Sett_TexturePath; ButtonSett.ToolTip = QGoTo.Instance.GetText(QGoTo.GoTo.Settings); ButtonSett.OnClick += (e) => QGoTo.Instance.settings(); } if (QSettings.Instance.EnableGoToSpaceCenter && ButtonSC == null) { ButtonSC = ToolbarManager.Instance.add(QuickGoTo.MOD + "SC", QuickGoTo.MOD + "SC"); ButtonSC.TexturePath = SC_TexturePath; ButtonSC.ToolTip = QGoTo.Instance.GetText(QGoTo.GoTo.SpaceCenter); ButtonSC.Enabled = HighLogic.LoadedScene != GameScenes.SPACECENTER; ButtonSC.OnClick += (e) => QGoTo.Instance.spaceCenter(); } if (QSettings.Instance.EnableGoToVAB && ButtonVAB == null) { ButtonVAB = ToolbarManager.Instance.add(QuickGoTo.MOD + "VAB", QuickGoTo.MOD + "VAB"); ButtonVAB.TexturePath = VAB_TexturePath; ButtonVAB.ToolTip = QGoTo.Instance.GetText(QGoTo.GoTo.VAB); ButtonVAB.OnClick += (e) => QGoTo.Instance.VAB(); } if (QSettings.Instance.EnableGoToSPH && ButtonSPH == null) { ButtonSPH = ToolbarManager.Instance.add(QuickGoTo.MOD + "SPH", QuickGoTo.MOD + "SPH"); ButtonSPH.TexturePath = SPH_TexturePath; ButtonSPH.ToolTip = QGoTo.Instance.GetText(QGoTo.GoTo.SPH); ButtonSPH.OnClick += (e) => QGoTo.Instance.SPH(); } if (QSettings.Instance.EnableGoToTrackingStation && ButtonTS == null) { ButtonTS = ToolbarManager.Instance.add(QuickGoTo.MOD + "TS", QuickGoTo.MOD + "TS"); ButtonTS.TexturePath = TS_TexturePath; ButtonTS.ToolTip = QGoTo.Instance.GetText(QGoTo.GoTo.TrackingStation); ButtonTS.Enabled = HighLogic.LoadedScene != GameScenes.TRACKSTATION; ButtonTS.OnClick += (e) => QGoTo.Instance.trackingStation(); } if (QSettings.Instance.EnableGoToRevert && ButtonRv == null) { ButtonRv = ToolbarManager.Instance.add(QuickGoTo.MOD + "Rv", QuickGoTo.MOD + "Rv"); ButtonRv.TexturePath = Rv_TexturePath; ButtonRv.ToolTip = QGoTo.Instance.GetText(QGoTo.GoTo.Revert); ButtonRv.Visibility = new GameScenesVisibility(GameScenes.FLIGHT); ButtonRv.OnClick += (e) => QGoTo.Instance.Revert(); } if (QSettings.Instance.EnableGoToRevertToEditor && ButtonRvED == null) { ButtonRvED = ToolbarManager.Instance.add(QuickGoTo.MOD + "RvED", QuickGoTo.MOD + "RvED"); ButtonRvED.TexturePath = RvED_TexturePath; ButtonRvED.ToolTip = QGoTo.Instance.GetText(QGoTo.GoTo.RevertToEditor); ButtonRvED.Visibility = new GameScenesVisibility(GameScenes.FLIGHT); ButtonRvED.OnClick += (e) => QGoTo.Instance.RevertToEditor(); } if (QSettings.Instance.EnableGoToRevertToSpaceCenter && ButtonRvSC == null) { ButtonRvSC = ToolbarManager.Instance.add(QuickGoTo.MOD + "RvSC", QuickGoTo.MOD + "RvSC"); ButtonRvSC.TexturePath = RvSC_TexturePath; ButtonRvSC.ToolTip = QGoTo.Instance.GetText(QGoTo.GoTo.RevertToSpaceCenter); ButtonRvSC.Visibility = new GameScenesVisibility(GameScenes.FLIGHT); ButtonRvSC.OnClick += (e) => QGoTo.Instance.RevertToSpaceCenter(); } if (QSettings.Instance.EnableGoToRevert && ButtonRc == null) { ButtonRc = ToolbarManager.Instance.add(QuickGoTo.MOD + "Rc", QuickGoTo.MOD + "Rc"); ButtonRc.TexturePath = Rc_TexturePath; ButtonRc.ToolTip = QGoTo.Instance.GetText(QGoTo.GoTo.Recover); ButtonRc.Visibility = new GameScenesVisibility(GameScenes.FLIGHT); ButtonRc.OnClick += (e) => QGoTo.Instance.Recover(); } if (QSettings.Instance.EnableGoToRnD && ButtonRnD == null) { ButtonRnD = ToolbarManager.Instance.add(QuickGoTo.MOD + "RnD", QuickGoTo.MOD + "RnD"); ButtonRnD.TexturePath = RnD_TexturePath; ButtonRnD.ToolTip = QGoTo.Instance.GetText(QGoTo.GoTo.RnD); ButtonRnD.Visible = QGoTo.Instance.CanScienceBuilding; ButtonRnD.OnClick += (e) => QGoTo.Instance.RnD(); } if (QSettings.Instance.EnableGoToMissionControl && ButtonMI == null) { ButtonMI = ToolbarManager.Instance.add(QuickGoTo.MOD + "MI", QuickGoTo.MOD + "MI"); ButtonMI.TexturePath = MI_TexturePath; ButtonMI.ToolTip = QGoTo.Instance.GetText(QGoTo.GoTo.MissionControl); ButtonMI.Visible = QGoTo.Instance.CanFundBuilding; ButtonMI.OnClick += (e) => QGoTo.Instance.missionControl(); } if (QSettings.Instance.EnableGoToAstronautComplex && ButtonAstr == null) { ButtonAstr = ToolbarManager.Instance.add(QuickGoTo.MOD + "Astr", QuickGoTo.MOD + "Astr"); ButtonAstr.TexturePath = Astr_TexturePath; ButtonAstr.ToolTip = QGoTo.Instance.GetText(QGoTo.GoTo.AstronautComplex); ButtonAstr.OnClick += (e) => QGoTo.Instance.astronautComplex(); } if (QSettings.Instance.EnableGoToAdministration && ButtonAdmi == null) { ButtonAdmi = ToolbarManager.Instance.add(QuickGoTo.MOD + "Admi", QuickGoTo.MOD + "Admi"); ButtonAdmi.TexturePath = Admi_TexturePath; ButtonAdmi.ToolTip = QGoTo.Instance.GetText(QGoTo.GoTo.Administration); ButtonAdmi.Visible = QGoTo.Instance.CanFundBuilding; ButtonAdmi.OnClick += (e) => QGoTo.Instance.administration(); } if (QSettings.Instance.EnableGoToLastVessel && ButtonLves == null) { ButtonLves = ToolbarManager.Instance.add(QuickGoTo.MOD + "Lves", QuickGoTo.MOD + "Lves"); ButtonLves.TexturePath = Lves_TexturePath; ButtonLves.ToolTip = QGoTo.Instance.GetText(QGoTo.GoTo.LastVessel); ButtonLves.OnClick += (e) => QGoTo.Instance.LastVessel(); } if (HighLogic.LoadedSceneIsFlight) { StartEach(); } QuickGoTo.Log("Init", "QBlizzyToolbar"); }
public Menu(ITextDisplay display, IRotaryEncoder encoder, IButton buttonSelect, byte[] menuResource, bool showBackOnRoot = false) { _showBackOnRoot = showBackOnRoot; Init(display, encoder, null, null, buttonSelect, ParseMenuData(menuResource)); }
protected override void AttachChildControls() { this.hidErrorMsg = (HtmlInputHidden)this.FindControl("hidErrorMsg"); this.txtOrderId = (HtmlInputHidden)this.FindControl("txtOrderId"); this.litOrderIds = (Literal)this.FindControl("litOrderIds"); this.txtSkuId = (HtmlInputHidden)this.FindControl("txtSkuId"); this.txtRemark = (TextBox)this.FindControl("txtRemark"); this.litRefundMoney = (Literal)this.FindControl("litRefundMoney"); this.dropRefundType = (WapRefundTypeDropDownList)this.FindControl("dropRefundType"); this.DropRefundReason = (WapAfterSalesReasonDropDownList)this.FindControl("RefundReasonDropDownList"); this.btnRefund = ButtonManager.Create(this.FindControl("btnRefund")); this.groupbuyPanel = (HtmlGenericControl)this.FindControl("groupbuyPanel"); this.txtOrderId.Value = this.OrderId; this.litOrderIds.Text = this.OrderId; this.txtSkuId.Value = this.SkuId; this.order = TradeHelper.GetOrderInfo(this.OrderId); if (this.order == null) { this.ShowError("错误的订单信息!"); } else { if (this.order.FightGroupId > 0) { FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.order.FightGroupId); if (fightGroup.Status != FightGroupStatus.FightGroupSuccess) { this.ShowError("火拼团订单成团之前不能进行退款操作!"); return; } } if (TradeHelper.IsOnlyOneSku(this.order)) { this.SkuId = ""; } if (!string.IsNullOrEmpty(this.SkuId) && !this.order.LineItems.ContainsKey(this.SkuId)) { this.ShowError("错误的商品信息!"); } else if (!TradeHelper.CanRefund(this.order, this.SkuId)) { this.ShowError("订单状态不正确或者已有未处理完成的退款/退货申请!"); } else { if (this.order.LineItems.ContainsKey(this.SkuId)) { this.RefundItem = this.order.LineItems[this.SkuId]; } GroupBuyInfo groupBuyInfo = null; if (this.order.GroupBuyId > 0) { groupBuyInfo = ProductBrowser.GetGroupBuy(this.order.GroupBuyId); if (groupBuyInfo != null) { if (this.groupbuyPanel != null && groupBuyInfo.Status != GroupBuyStatus.Failed) { this.groupbuyPanel.Visible = true; } if (groupBuyInfo.NeedPrice > this.order.GetTotal(false) && groupBuyInfo.Status != GroupBuyStatus.Failed) { this.ShowError("团购违约金大于订单总金额,不能进行退款申请!"); return; } } } decimal canRefundAmount = this.order.GetCanRefundAmount(this.SkuId, groupBuyInfo, 0); if (canRefundAmount < decimal.Zero) { this.ShowError("订单中已申请的退款金额超过了订单总额!"); } else { this.litRefundMoney.Text = canRefundAmount.F2ToString("f2"); PageTitle.AddSiteNameTitle("申请退款"); if (!this.Page.IsPostBack) { this.DropRefundReason.IsRefund = true; this.dropRefundType.preSaleId = this.order.PreSaleId; string enumDescription = EnumDescription.GetEnumDescription((Enum)(object)EnumPaymentType.AdvancePay, 1); this.dropRefundType.BalanceAmount = this.order.BalanceAmount; this.dropRefundType.OrderGateWay = ((this.order.PreSaleId > 0 && this.order.DepositGatewayOrderId.ToNullString().ToLower() == enumDescription) ? enumDescription : this.order.Gateway); } } } } }
public void registerToolbarButton(IButton button, String textureOn, String textureOff) { this.toolbarButton = button; this.toolbarButtonTextureOn = textureOn; this.toolbarButtonTextureOff = textureOff; }