From becc1c6ee6eac449405a54b57c7d3a23700b86f9 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 16 Dec 2012 11:48:35 +0100 Subject: [PATCH 1/2] allow access to Base in CMenu.cs --- VocaluxeLib/Menu/CMenu.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VocaluxeLib/Menu/CMenu.cs b/VocaluxeLib/Menu/CMenu.cs index 0d0b3f8b..489a339c 100644 --- a/VocaluxeLib/Menu/CMenu.cs +++ b/VocaluxeLib/Menu/CMenu.cs @@ -75,7 +75,7 @@ namespace Vocaluxe.Menu protected string[] _ThemePlaylists; protected SRectF _ScreenArea; - private Basic _Base; + protected Basic _Base; public SRectF ScreenArea { From ce8b56d7aae3d8d2e4960a1c92fae0b37bf3e209 Mon Sep 17 00:00:00 2001 From: Alexander Eckart Date: Sun, 16 Dec 2012 12:07:35 +0100 Subject: [PATCH 2/2] added button cloning --- VocaluxeLib/Menu/CButton.cs | 26 ++++++++++++++++++++++++++ VocaluxeLib/Menu/CMenu.cs | 20 ++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/VocaluxeLib/Menu/CButton.cs b/VocaluxeLib/Menu/CButton.cs index a6dbf7ad..e96e77a5 100644 --- a/VocaluxeLib/Menu/CButton.cs +++ b/VocaluxeLib/Menu/CButton.cs @@ -95,6 +95,32 @@ namespace Vocaluxe.Menu SReflectionHeight = 0f; } + public CButton(CButton button) + { + _PartyModeID = button._PartyModeID; + _Base = button._Base; + _Theme = new SThemeButton(); + Rect = new SRectF(button.Rect); + Color = new SColorF(button.Color); + SColor = new SColorF(button.Color); + + SelText = false; + Text = new CText(button.Text); + SText = new CText(button.SText); + Selected = false; + Visible = true; + EditMode = false; + _ThemeLoaded = false; + + Reflection = button.Reflection; + ReflectionHeight = button.ReflectionHeight; + ReflectionSpace = button.ReflectionSpace; + + SReflection = button.SReflection; + SReflectionHeight = button.SReflectionHeight; + SReflectionSpace = button.SReflectionSpace; + } + public bool LoadTheme(string XmlPath, string ElementName, XPathNavigator navigator, int SkinIndex) { string item = XmlPath + "/" + ElementName; diff --git a/VocaluxeLib/Menu/CMenu.cs b/VocaluxeLib/Menu/CMenu.cs index 489a339c..c5f589ef 100644 --- a/VocaluxeLib/Menu/CMenu.cs +++ b/VocaluxeLib/Menu/CMenu.cs @@ -663,11 +663,21 @@ namespace Vocaluxe.Menu return new CButton(_Base, _PartyModeID); } + public CButton GetNewButton(CButton button) + { + return new CButton(button); + } + public CText GetNewText() { return new CText(_Base, _PartyModeID); } + public CText GetNewText(CText text) + { + return new CText(text); + } + public CText GetNewText(float x, float y, float z, float h, float mw, EAlignment align, EStyle style, string font, SColorF col, string text) { return new CText(_Base, x, y, z, h, mw, align, style, font, col, text); @@ -684,6 +694,11 @@ namespace Vocaluxe.Menu return new CStatic(_Base, _PartyModeID); } + public CStatic GetNewStatic(CStatic Static) + { + return new CStatic(Static); + } + public CStatic GetNewStatic(STexture Texture, SColorF Color, SRectF Rect) { return new CStatic(_Base, _PartyModeID, Texture, Color, Rect); @@ -694,6 +709,11 @@ namespace Vocaluxe.Menu return new CSelectSlide(_Base, _PartyModeID); } + public CSelectSlide GetNewSelectSlide(CSelectSlide slide) + { + return new CSelectSlide(slide); + } + public CSongMenu GetNewSongMenu() { return new CSongMenu(_Base, _PartyModeID);