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);
        }
Ejemplo n.º 2
0
 internal void RaiseIconClick(CollapseItem collapseItem, ListBoxBase listBoxBase)
 {
     if (IconClick != null)
     {
         IconClick(collapseItem, listBoxBase, this);
     }
 }
Ejemplo n.º 3
0
 /// <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();
     }
 }
Ejemplo n.º 4
0
        public void LoadLocalFilter(string localName, ListBoxBase listBox)
        {
            var filter = this[localName];

            if (filter != null)
            {
                listBox.SetSelectedIndexes((List <int>)filter);
            }
        }
Ejemplo n.º 5
0
        private void JointSpriteListClick(Window callingWindow)
        {
            ListBoxBase asListDisplayWindow = callingWindow as ListBoxBase;

            if (SelectJointSprite != null)
            {
                SelectJointSprite(asListDisplayWindow.GetFirstHighlightedObject() as Sprite);
            }
        }
Ejemplo n.º 6
0
 void IconClick(CollapseItem collapseItem, ListBoxBase listBoxBase, ListBoxIcon listBoxIcon)
 {
     if (listBoxIcon.Texture == mCopyLocallyTexture)
     {
         listBoxIcon.Texture = mMakeRelativeTexture;
     }
     else
     {
         listBoxIcon.Texture = mCopyLocallyTexture;
     }
 }
Ejemplo n.º 7
0
        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);
            }
        }
Ejemplo n.º 8
0
        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;
        }
Ejemplo n.º 9
0
 private string GetHeroStatistics(ListBoxBase<ActorDefinition> listBox)
 {
     var actor = listBox.SelectedItem;
     if (actor != null)
         return GetStatisticsString(actor.BaseStatistics, actor.ResourceType);
     else
         return "No hero selected.";
 }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
        public void EmitterArrayListBoxClick(FlatRedBall.Gui.Window callingWindow)
        {
            ListBoxBase asListBoxBase = callingWindow as ListBoxBase;

            EditorData.SelectEmitter((Emitter)asListBoxBase.GetFirstHighlightedObject());
        }
Ejemplo n.º 12
0
 public SelectedItemCollection(ListBoxBase <T> owner)
 {
     this.owner = owner;
 }