activating and deactivating popup player control by mouse

This commit is contained in:
Alexander Eckart committed 2012-03-02 17:12:04 +01:00
1 parent 917c81a6ae
commit 82fd878975
3 files changed
+29 -3

No files matched your search

+14 -3
View File
@@ -443,6 +443,9 @@ namespace Vocaluxe.Menu
KeyEvent KeyEvent = new KeyEvent();
MouseEvent MouseEvent = new MouseEvent();
bool PopupPlayerControlAllowed = _CurrentScreen != EScreens.ScreenOptionsRecord && _CurrentScreen != EScreens.ScreenSing && _CurrentScreen != EScreens.ScreenNames
&& _CurrentScreen != EScreens.ScreenSong;
bool Resume = true;
while (keys.PollEvent(ref KeyEvent))
{
@@ -452,9 +455,7 @@ namespace Vocaluxe.Menu
_Cursor.FadeOut();
}
if (_CurrentScreen != EScreens.ScreenOptionsRecord && _CurrentScreen != EScreens.ScreenSing && _CurrentScreen != EScreens.ScreenNames
&& _CurrentScreen != EScreens.ScreenSong &&
KeyEvent.Key == Keys.Tab)
if (PopupPlayerControlAllowed && KeyEvent.Key == Keys.Tab)
{
if (_CurrentPopupScreen == EPopupScreens.NoPopup)
ShowPopup(EPopupScreens.PopupPlayerControl);
@@ -498,6 +499,16 @@ namespace Vocaluxe.Menu
UpdateMousePosition(MouseEvent.X, MouseEvent.Y);
bool isOverPopupPlayerControl = CHelper.IsInBounds(_PopupScreens[(int)EPopupScreens.PopupPlayerControl].ScreenArea, MouseEvent);
if (PopupPlayerControlAllowed && isOverPopupPlayerControl)
{
if (_CurrentPopupScreen == EPopupScreens.NoPopup)
ShowPopup(EPopupScreens.PopupPlayerControl);
}
if (!isOverPopupPlayerControl && _CurrentPopupScreen == EPopupScreens.PopupPlayerControl)
HidePopup(EPopupScreens.PopupPlayerControl);
bool handled = false;
if (_CurrentPopupScreen != EPopupScreens.NoPopup)
handled = !_PopupScreens[(int)_CurrentPopupScreen].HandleMouse(MouseEvent);
+8
View File
@@ -59,6 +59,13 @@ namespace Vocaluxe.Menu
protected string[] _ThemeSelectSlides;
protected string[] _ThemeSingNotes;
protected SRectF _ScreenArea;
public SRectF ScreenArea
{
get { return _ScreenArea; }
}
public int ThemeScreenVersion
{
get { return _ScreenVersion; }
@@ -99,6 +106,7 @@ namespace Vocaluxe.Menu
_MouseDY = 0;
_Active = false;
_ScreenArea = new SRectF(0f, 0f, CSettings.iRenderW, CSettings.iRenderH, 0f);
_ThemeName = String.Empty;
_ThemeBackgrounds = null;
@@ -38,6 +38,13 @@ namespace Vocaluxe.Screens
_ThemeButtons = buttons.ToArray();
}
public override void LoadTheme()
{
base.LoadTheme();
_ScreenArea = Statics[htStatics(StaticBG)].Rect;
}
public override bool HandleInput(KeyEvent KeyEvent)
{
if (KeyEvent.KeyPressed && !Char.IsControl(KeyEvent.Unicode))