public ImageTextButton(ImageTextButtonStyle style) { InternalChild = new Grid(); InternalChild.ColumnsProportions.Add(new Grid.Proportion()); InternalChild.ColumnsProportions.Add(new Grid.Proportion()); _image = new Image { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center }; InternalChild.Widgets.Add(_image); _textBlock = new TextBlock(style != null ? style.LabelStyle : null) { HorizontalAlignment = HorizontalAlignment.Stretch, GridColumn = 1, Wrap = true }; InternalChild.Widgets.Add(_textBlock); if (style != null) { ApplyImageTextButtonStyle(style); } }
public ListButton(ImageTextButtonStyle bs, ISelector selector) : base(null) { _selector = selector; Toggleable = true; ApplyImageTextButtonStyle(bs); }
internal TileSelectionButton(string tileName, ImageTextButtonStyle style) : base(tileName, style) { this.Left().Pad(TileSelectionButton.pad); this.GetLabelCell().SetPadLeft(3); this.GetImage().SetScale(2); this.Pack(); }
TileSelectionButton CreateTileSelectionButton(TileType tileType) { var style = new ImageTextButtonStyle(); style.ImageUp = new SpriteDrawable(TilesetSpriteManager.Instance.GetSprite(tileType)); var button = new TileSelectionButton(tileType, style); button.OnClicked += this.SelectTile; return(button); }
TileSelectionButton AddRedoButton() { var style = new ImageTextButtonStyle(); style.ImageUp = new SpriteDrawable(TilesetSpriteManager.Instance.GetSprite("redo")); var button = new TileSelectionButton("Redo", style); button.OnClicked += this.Redo; this.window.Add(button).GrowX(); return(button); }
public void ApplyImageTextButtonStyle(ImageTextButtonStyle style) { ApplyButtonStyle(style); if (style.ImageStyle != null) { _image.ApplyPressableImageStyle(style.ImageStyle); } if (style.LabelStyle != null) { _textBlock.ApplyLabelStyle(style.LabelStyle); } ImageTextSpacing = style.ImageTextSpacing; }
public void ApplyComboBoxStyle(ComboBoxStyle style) { if (style.ItemsContainerStyle != null) { _itemsContainer.ApplyWidgetStyle(style.ItemsContainerStyle); } _dropDownItemStyle = style.ListItemStyle; foreach (var item in Items) { var button = (ImageTextButton)item.Widget; button.ApplyImageTextButtonStyle(_dropDownItemStyle); if (item.Color != null) { button.TextColor = item.Color.Value; } } InternalChild.ApplyImageTextButtonStyle(style); }
public void ApplyImageTextButtonStyle(ImageTextButtonStyle style) { ApplyButtonStyle(style); if (style.LabelStyle != null) { _textBlock.ApplyTextBlockStyle(style.LabelStyle); } if (style.ImageStyle != null) { var imageStyle = style.ImageStyle; _image.ApplyWidgetStyle(imageStyle); Image = imageStyle.Image; OverImage = imageStyle.OverImage; PressedImage = imageStyle.PressedImage; } ImageTextSpacing = style.ImageTextSpacing; }
public RadioButton(ImageTextButtonStyle bs) : base(bs) { Toggleable = true; }
internal TileSelectionButton(TileType tileType, ImageTextButtonStyle style) : this(Tile.BaseTileType(tileType), style) { this.TileType = tileType; }
public CheckBox(ImageTextButtonStyle bs) : base(bs) { Toggleable = true; }
public ImageTextButtonStyle(ImageTextButtonStyle style) : base(style) { ImageStyle = style.ImageStyle != null ? new PressableImageStyle(style.ImageStyle) : null; }
public DialogStyle(DialogStyle style) : base(style) { OkButtonStyle = style.OkButtonStyle != null ? new ImageTextButtonStyle(style.OkButtonStyle) : null; CancelButtonStyle = style.CancelButtonStyle != null ? new ImageTextButtonStyle(style.CancelButtonStyle) : null; }
public ComboBoxStyle(ComboBoxStyle style) : base(style) { ItemsContainerStyle = style.ItemsContainerStyle != null ? new WidgetStyle(style.ItemsContainerStyle) : null; ListItemStyle = style.ListItemStyle != null ? new ImageTextButtonStyle(style.ListItemStyle) : null; }
public ImageTextButtonStyle(ImageTextButtonStyle style) : base(style) { LabelStyle = style.LabelStyle != null ? new TextBlockStyle(style.LabelStyle) : null; ImageStyle = style.ImageStyle != null ? new PressableImageStyle(style.ImageStyle) : null; }