// Alustaa viitteenä saadun scroll buttonin. private void InitializeScrollButton(ref Button button, GuiEventHandler <GuiButtonEventArgs> pressEvent) { button = new Button(game); button.ButtonPressed += pressEvent; button.ButtonDown += pressEvent; childs.AddChild(button); button.SetParent(this); }
/// <summary> /// Lisää kontrollin containeriin ja luo näiden välille siteen. /// </summary> public virtual void Add(Control control) { childs.AddChild(control); control.SetParent(this); GuiLayoutEventArgs guiLayoutEventArgs = new GuiLayoutEventArgs(control, true); OnControlAdded(new GuiParentEventArgs(this, control), this); UpdateLayout(guiLayoutEventArgs); }
public ScrollBar(Microsoft.Xna.Framework.Game game, ScrollbarType type) : base(game) { this.type = type; childs = new ChildCollection(this); renderer = new BasicScrollbarRenderer(game, this); focusable = false; value = 0; thumb = new ScrollThumb(game, type); childs.AddChild(thumb); thumb.SetParent(this); }