private void OnRightClick(Window callingWindow) { if (ShowExpandCollapseAllOption) { GuiManager.AddPerishableWindow(mListBox); mListBox.Visible = true; GuiManager.PositionTopLeftToCursor(mListBox); } }
/// <summary> /// Event clicked when the dropDownButton is clicked. If the ListBox is not visible /// it will appear. /// </summary> /// <param name="callingWindow"></param> void OnDropDownButtonClick(Window callingWindow) { if (mListBox.Visible) { return; } // The ListBox is not visible, so "expand" it. GuiManager.AddPerishableWindow(mListBox); mListBox.Visible = true; if (mListBox.SpriteFrame != null) { SpriteManager.AddSpriteFrame(mListBox.SpriteFrame); } // listBox.SetPositionTL(ScaleX, ScaleY + 4); mListBox.SetScaleToContents(ScaleX); mListBox.SetPositionTL(ScaleX, ScaleY + mListBox.ScaleY + 1); mListBox.HighlightOnRollOver = true; mListBox.UpdateDependencies(); float maximumScale = GuiManager.YEdge - (MenuStrip.MenuStripHeight / 2.0f); if (mListBox.ScaleY > maximumScale) { mListBox.ScrollBarVisible = true; mListBox.ScaleY = maximumScale; } if (mListBox.WorldUnitY - mListBox.ScaleY < -GuiManager.Camera.YEdge) { mListBox.Y -= -GuiManager.Camera.YEdge - (mListBox.WorldUnitY - mListBox.ScaleY); } if (mListBox.WorldUnitX + mListBox.ScaleX > GuiManager.Camera.XEdge) { mListBox.X -= (mListBox.WorldUnitX + mListBox.ScaleX) - GuiManager.Camera.XEdge; } if (mListBox.WorldUnitX - mListBox.ScaleX < -GuiManager.Camera.XEdge) { mListBox.X += -GuiManager.Camera.XEdge - (mListBox.WorldUnitX - mListBox.ScaleX); } mListBox.HighlightItem(mSelectionDisplay.Text); }