Engines/FlatRedBallXNA/FlatRedBall/Gui/ComboBox.cs
/// <summary>
/// Event clicked when the dropDownButton is clicked.  If the ListBox is not visible
/// it will appear.
/// </summary>
/// <param name="callingWindow"></param>
Event clicked when the dropDownButton is clicked.  If the ListBox is not visible
it will appear.
Event clicked when the dropDownButton is clicked . If the ListBox is not visible it will appear .
void OnDropDownButtonClick(Window callingWindow)
        {
            if (mListBox.Visible)
                return;
            GuiManager.AddPerishableWindow(mListBox);
            mListBox.Visible = true;
            if (mListBox.SpriteFrame != null)
            {
                SpriteManager.AddSpriteFrame(mListBox.SpriteFrame);
            }
            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);
        }
void OnDropDownButtonClick ( Window callingWindow ) { if ( mListBox . Visible ) return ; GuiManager . AddPerishableWindow ( mListBox ) ; mListBox . Visible = true ; if ( mListBox . SpriteFrame != null ) { SpriteManager . AddSpriteFrame ( mListBox . SpriteFrame ) ; } 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 ) ; }
Event clicked when the dropDownButton is clicked.
Event clicked when the dropDownButton is clicked .
// The ListBox is not visible, so "expand" it. //                listBox.SetPositionTL(ScaleX, ScaleY + 4);
callingWindow
Window
None