private void InitializeBaseListBox() { this.SuspendLayout(); if (baseListBox != null) { return; } scrollBar = new MetroScrollBar(); baseListBox = new ListBoxBase(); baseListBox.BorderStyle = BorderStyle.None; baseListBox.Location = new Point(3, 3); baseListBox.Size = new Size(Width - 16, Height - 6); scrollBar.Scroll += scrollBar_Scroll; Size = new Size(baseListBox.Width + 16, baseListBox.Height + 6); baseListBox.TabStop = true; scrollBar.Maximum = this.ItemHeight * this.baseListBox.Items.Count; scrollBar.Minimum = 0; scrollBar.LargeChange = scrollBar.Maximum / scrollBar.Height + Height; scrollBar.SmallChange = 15; Controls.Add(scrollBar); Controls.Add(baseListBox); }
internal void RaiseIconClick(CollapseItem collapseItem, ListBoxBase listBoxBase) { if (IconClick != null) { IconClick(collapseItem, listBoxBase, this); } }
/// <summary> /// Inverts the selection for the listBox Items. /// </summary> /// <param name="listBox"></param> protected virtual void ToogleItems(ListBoxBase listBox) { if (listBox.GetSelectedIndices().Length == 0) { listBox.ToogleItems(); } }
public void LoadLocalFilter(string localName, ListBoxBase listBox) { var filter = this[localName]; if (filter != null) { listBox.SetSelectedIndexes((List <int>)filter); } }
private void JointSpriteListClick(Window callingWindow) { ListBoxBase asListDisplayWindow = callingWindow as ListBoxBase; if (SelectJointSprite != null) { SelectJointSprite(asListDisplayWindow.GetFirstHighlightedObject() as Sprite); } }
void IconClick(CollapseItem collapseItem, ListBoxBase listBoxBase, ListBoxIcon listBoxIcon) { if (listBoxIcon.Texture == mCopyLocallyTexture) { listBoxIcon.Texture = mMakeRelativeTexture; } else { listBoxIcon.Texture = mCopyLocallyTexture; } }
private static void SetAnimationChainOnCurrentSprite(Window callingWindow) { ListBoxBase listBoxBase = callingWindow as ListBoxBase; AnimationChain animationChain = listBoxBase.GetFirstHighlightedObject() as AnimationChain; if (GameData.EditorLogic.CurrentSprites.Count != 0) { GameData.EditorLogic.CurrentSprites[0].SetAnimationChain(animationChain); } }
public void Detach() { ListBoxBase listBoxBase = this.mParentBox as ListBoxBase; if (parentItem != null) { parentItem.mItems.Remove(this); parentItem.FixCollapseIcon(); this.parentItem = null; } if (listBoxBase.Items.Contains(this) == false) { listBoxBase.Items.Add(this); } mParentBox = listBoxBase; }
private string GetHeroStatistics(ListBoxBase<ActorDefinition> listBox) { var actor = listBox.SelectedItem; if (actor != null) return GetStatisticsString(actor.BaseStatistics, actor.ResourceType); else return "No hero selected."; }
private void InitializeBaseListBox() { this.SuspendLayout(); if (baseListBox != null) return; scrollBar = new MetroScrollBar(); baseListBox = new ListBoxBase(); baseListBox.BorderStyle = BorderStyle.None; baseListBox.Location = new Point(3, 3); baseListBox.Size = new Size(Width - 16, Height - 6); scrollBar.Scroll += scrollBar_Scroll; Size = new Size(baseListBox.Width + 16, baseListBox.Height + 6); baseListBox.TabStop = true; scrollBar.Maximum = this.ItemHeight * this.baseListBox.Items.Count; scrollBar.Minimum = 0; scrollBar.LargeChange = scrollBar.Maximum / scrollBar.Height + Height; scrollBar.SmallChange = 15; Controls.Add(scrollBar); Controls.Add(baseListBox); }
public void EmitterArrayListBoxClick(FlatRedBall.Gui.Window callingWindow) { ListBoxBase asListBoxBase = callingWindow as ListBoxBase; EditorData.SelectEmitter((Emitter)asListBoxBase.GetFirstHighlightedObject()); }
public SelectedItemCollection(ListBoxBase <T> owner) { this.owner = owner; }