private void Start() { StudentNumIn = GameObject.FindGameObjectWithTag("StudentNumInput"); MajorIn = GameObject.FindGameObjectWithTag("MajorInput"); PasswordIn = GameObject.FindGameObjectWithTag("PasswordInput"); BS = gameObject.GetComponent <ButtonSettings>(); }
static HxDropdownToggleButton() { Defaults = HxButton.Defaults with { Color = ThemeColor.Link }; }
public Button Button(string text, ButtonSettings settings = null) { var button = new Button(text, settings); button.Attrs["class"] += "navbar-btn"; return(button); }
void ReleaseDesignerOutlets() { if (ButtonSettings != null) { ButtonSettings.Dispose(); ButtonSettings = null; } if (ButtonSpeedAdvisory != null) { ButtonSpeedAdvisory.Dispose(); ButtonSpeedAdvisory = null; } if (LabelAppVersion != null) { LabelAppVersion.Dispose(); LabelAppVersion = null; } if (LabelLocationPermission != null) { LabelLocationPermission.Dispose(); LabelLocationPermission = null; } }
public CustomButton() { // initialize your settings Normal = new ButtonSettings(); Hovered = new ButtonSettings(); Pressed = new ButtonSettings(); Inactive = new ButtonSettings(); State = ButtonState.Normal; }
private MainWidget(Builder builder) : base(builder.GetObject(typeof(MainWidget).Name).Handle) { builder.Autoconnect(this); //_mvButton1.Clicked += new EventHandler((o, e) => ButtonPlay?.Invoke(this, e)); _mvButton2.Clicked += new EventHandler((o, e) => ButtonConnect?.Invoke(this, e)); _mvButton3.Clicked += new EventHandler((o, e) => ButtonCreate?.Invoke(this, e)); _mvButton4.Clicked += new EventHandler((o, e) => ButtonSettings?.Invoke(this, e)); _mvButton5.Clicked += new EventHandler((o, e) => ButtonQuit?.Invoke(this, e)); }
public void ButtonSettings(ButtonSettings parent) { parentSettings = parent; if (parent == null) { // initialize default values TextAlign = TextAlign.Left; // ... } }
static HxButton() { Defaults = new ButtonSettings() { Size = ButtonSize.Regular, IconPlacement = ButtonIconPlacement.Start, Color = ThemeColor.None, CssClass = null, Outline = false, Icon = null }; }
public void Open(MapItem p_object) { _nodeClose?.Cancel(); foreach (GameObject __child in _menuPanel.GetComponentsInChildren <Button>().Select(c => c.gameObject)) { Destroy(__child); } Vector2 __point; RectTransformUtility.ScreenPointToLocalPointInRectangle(_menuCanvas, Input.mousePosition, _view, out __point); IInteractable __actions = p_object as IInteractable; Vector2 __buttonSize = _menuButton.GetComponent <RectTransform>().sizeDelta; _menuPanel.sizeDelta = new Vector2(_menuPanel.sizeDelta.x, 26f + __buttonSize.y * __actions.ListAction.Count + 3 * __actions.ListAction.Count); _menuPanel.position = _menuCanvas.TransformPoint(__point); _menuText.text = p_object.ItemName; __actions.ListAction.Select(p_objectAction => { RectTransform __actionButton = Instantiate(_menuButton).GetComponent <RectTransform>(); ButtonSettings __settings = __actionButton.GetComponent <ButtonSettings>(); __settings.Text = p_objectAction.GetDescription(); __settings.ClickAction = () => { ActivateContextMenu(false); onClickAction?.Invoke(null, new OnClickActionEventArgs(p_objectAction, p_object)); }; return(__actionButton); }).ToList().ForEach(b => { b.SetParent(_menuPanel); b.localScale = Vector3.one; b.localRotation = Quaternion.identity; b.localPosition = Vector3.zero; b.offsetMax = Vector2.down * 12 * (_menuPanel.childCount - 1); b.offsetMin = Vector2.down * 12 * _menuPanel.childCount; b.sizeDelta = new Vector2(90f, 15f); }); ActivateContextMenu(true); _nodeClose = Timer.WaitSeconds(2f, () => ActivateContextMenu(false)); }
/// <summary> 設定Button </summary> /// <param name="settings"></param> /// <param name="type"></param> public static void SetButtonSetting(ButtonSettings settings, BtnType type) { settings.Text = GetButtonText(type); var image = GetButtonIcon(type); if (type == BtnType.Search) { settings.Images.Image.Url = image; } else { settings.Images.Image.IconID = image; } }
private static void DrawSystemButtonFace(BidiGraphics graphics, bool DropDownContextMenuUserInterface, bool contextMenuShowing, Rectangle VirtualClientRectangle, bool isLargeButton, ButtonSettings settings) { // calculate bitmaps Bitmap hoverButtonFace = isLargeButton ? buttonFaceBitmapLarge : buttonFaceBitmap; Bitmap pressedButtonFace = isLargeButton ? buttonFacePushedBitmapLarge : buttonFacePushedBitmap; // draw button face DrawSystemButtonFace(graphics, DropDownContextMenuUserInterface, VirtualClientRectangle, hoverButtonFace, contextMenuShowing ? pressedButtonFace : hoverButtonFace, isLargeButton, settings); }
static HxMessageBox() { Defaults = new MessageBoxSettings() { PrimaryButtonSettings = new ButtonSettings() { Color = ThemeColor.Primary, }, SecondaryButtonSettings = new ButtonSettings() { Color = ThemeColor.Secondary, }, ModalSettings = new() }; }
public DocumentSwitchWindow(MainWindow window) { InitializeComponent(); mMainWindow = window; mSelectedContent = null; //SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); mButtonSettings = new ButtonSettings(); mButtonSettings.mLabelBrush = new SolidBrush(Button.DefaultForeColor); mButtonSettings.mLabelFormat = new StringFormat(StringFormatFlags.NoWrap); mButtonSettings.mLabelFormat.Trimming = StringTrimming.EllipsisCharacter; mButtonSettings.mLabelFormat.Alignment = StringAlignment.Near; mButtonSettings.mLabelFormat.LineAlignment = StringAlignment.Center; }
void Post_Serving(object sender, ServingEventArgs e) { if (e.Location == ServingLocation.Feed) return; bool ShowPostList = Convert.ToBoolean(_extensionSettings.GetSingleValue("ShowPostList")); if (e.Location == ServingLocation.PostList && !ShowPostList) return; Post post = sender as Post; ButtonSettings bSettings = new ButtonSettings(); StringBuilder sBuild = new StringBuilder(); sBuild.AppendLine("<div class=\"FacebookLike\">"); string likeScript = string.Format("<iframe src=\"http://www.facebook.com/plugins/like.php?href={0}&layout={1}&show_faces={2}&width={3}&action={4}&font&colorscheme={5}&height=80\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:450px; height:80px;\" allowTransparency=\"true\"></iframe>", post.AbsoluteLink.AbsoluteUri, bSettings.Layout, bSettings.ShowFaces, bSettings.Width, bSettings.Action, bSettings.ColorScheme); sBuild.AppendLine(likeScript); sBuild.AppendLine("</div>"); e.Body += sBuild.ToString(); }
public static void Render_Button(ButtonSettings buttonSettings, string controlName, string caption, string imagePath, bool useSubmit, string clickHandler, int width = 0) //================================================================================================================ // This routine generates code to build a DevExpress button. // // Parameters // buttonSettings: Reference to a button control settings object // controlName: Unique name for this control // caption: Button text // controlWidth: Width of the button // imagePath: Absolute path to the image // useSubmit: Flag indicating if the button should use submit behavior // clickHandler: Name of the click handler routine if the buuton is not using submit //================================================================================================================ { // General Settings buttonSettings.Name = controlName; buttonSettings.Text = caption; if (width != 0) { buttonSettings.Width = Unit.Pixel(80); } // Does this button have an image? if (imagePath != "") { // Assign the image buttonSettings.Images.Image.Url = imagePath; buttonSettings.ImagePosition = ImagePosition.Left; // Apply the image button style buttonSettings.ControlStyle.CssClass = "ssc_ImageButton"; } else { // Apply the standard button style buttonSettings.ControlStyle.CssClass = "ssc_FormButton"; } // Submit or click event buttonSettings.UseSubmitBehavior = useSubmit; if (!useSubmit) { buttonSettings.ClientSideEvents.Click = clickHandler; } }
public bool CheckComplete(Transform robot) { if (robot.position.x == completePosition.x && robot.position.z == completePosition.y) { ButtonSettings bs = GameObject.Find("Level Lock").GetComponent <ButtonSettings>(); if (bs.releasedLevel <= SceneManager.GetActiveScene().buildIndex - 1) { bs.UnlockLevel(); } uiControl.Congratulations(); return(true); } else { return(false); } }
private static void DrawSystemButtonFace(BidiGraphics graphics, bool DropDownContextMenuUserInterface, Rectangle clientRectangle, Image buttonBitmap, Image contextMenuButtonBitmap, bool isLargeButton, ButtonSettings settings) { // get rectangles Rectangle leftRectangle = isLargeButton ? buttonFaceLeftRectangleLarge : buttonFaceLeftRectangle; Rectangle centerRectangle = isLargeButton ? buttonFaceCenterRectangleLarge : buttonFaceCenterRectangle; Rectangle rightRectangle = isLargeButton ? buttonFaceRightRectangleLarge : buttonFaceRightRectangle; // determine height int height = isLargeButton ? LARGE_BUTTON_TOTAL_SIZE : clientRectangle.Height; // Compute the button face rectangle. Rectangle buttonRectangle = new Rectangle(clientRectangle.X, clientRectangle.Y, clientRectangle.Width, height); if (DropDownContextMenuUserInterface) { // Compute the drop-down rectangle. Rectangle dropDownRectangle = new Rectangle(clientRectangle.Right - settings.DROP_DOWN_BUTTON_WIDTH, clientRectangle.Y, settings.DROP_DOWN_BUTTON_WIDTH, height); GraphicsHelper.DrawLeftCenterRightImageBorder(graphics, dropDownRectangle, contextMenuButtonBitmap, leftRectangle, centerRectangle, rightRectangle); buttonRectangle.Width -= dropDownRectangle.Width - 1; } // Draw the border. GraphicsHelper.DrawLeftCenterRightImageBorder(graphics, buttonRectangle, buttonBitmap, leftRectangle, centerRectangle, rightRectangle); }
public static void SetUpUpdateDocStateButton(ButtonSettings buttonSettings, string documentName, string gridName, object dataItem, UrlHelper helper) { var id = (Guid)DataBinder.Eval(dataItem, documentName + "ID"); buttonSettings.Name = "Process" + documentName + "Button" + id.EscapeForHtml(); buttonSettings.RenderMode = ButtonRenderMode.Link; var isProcessed = (bool)DataBinder.Eval(dataItem, "IsProcessed"); var action = "StartProcess" + documentName; if (isProcessed) { buttonSettings.Text = "Отменить"; buttonSettings.Images.Image.IconID = IconID.ActionsCancel16x16; action = "StartUnProcess" + documentName; } else { buttonSettings.Text = "Провести"; buttonSettings.Images.Image.IconID = IconID.SaveSave16x16; } buttonSettings.ImagePosition = ImagePosition.Right; buttonSettings.ClientSideEvents.Click = string.Format(ProcessDocItemClickJS, gridName, id, helper.Action(action, Remontinka.Server.WebPortal.Controllers.WarehouseDocsController.ControllerName)); }
private static void DrawSystemButtonFacePushed(BidiGraphics graphics, bool DropDownContextMenuUserInterface, Rectangle clientRectangle, bool isLargeButton, ButtonSettings settings) { Bitmap pressedButtonFace = isLargeButton ? buttonFacePushedBitmapLarge : buttonFacePushedBitmap; DrawSystemButtonFace(graphics, DropDownContextMenuUserInterface, clientRectangle, pressedButtonFace, pressedButtonFace, isLargeButton, settings); }
public void ShowSettingsButton(bool on) { ButtonSettings.SetActive(on); }
public Button(ButtonSettings settings) : base(settings.properties) { }
public Button(ButtonSettings settings, ViewContext context, IViewDataContainer viewDataContainer) : base(settings, context, viewDataContainer) { }
public Button(ButtonSettings settings) : base(settings) { }
public static void DrawButton(ButtonSettings buttonSettings, GUIStyle style = null) { DrawButton(buttonSettings.Text, buttonSettings.Action, buttonSettings.Style); }
public FileButton(ButtonSettings settings) { mButtonSettings = settings; this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); }