Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed/Expanded FrameManager's FrameSets.

  • Loading branch information...
commit c80ef844ce30e87f74b2d847b7cabf765d308a4b 1 parent 4fd0c7d
Quit authored
View
52 Examples/Frames/FrameTest/FrameTest.sln
@@ -1,26 +1,26 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FrameTest", "FrameTest.vcxproj", "{EB65A740-3EA8-41AE-8BE6-5B5779B6F77D}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Frames", "..\..\..\Frames\Frames.vcxproj", "{0A206042-1213-4EFB-AF48-1627AF72629E}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {EB65A740-3EA8-41AE-8BE6-5B5779B6F77D}.Debug|Win32.ActiveCfg = Debug|Win32
- {EB65A740-3EA8-41AE-8BE6-5B5779B6F77D}.Debug|Win32.Build.0 = Debug|Win32
- {EB65A740-3EA8-41AE-8BE6-5B5779B6F77D}.Release|Win32.ActiveCfg = Release|Win32
- {EB65A740-3EA8-41AE-8BE6-5B5779B6F77D}.Release|Win32.Build.0 = Release|Win32
- {0A206042-1213-4EFB-AF48-1627AF72629E}.Debug|Win32.ActiveCfg = Debug|Win32
- {0A206042-1213-4EFB-AF48-1627AF72629E}.Debug|Win32.Build.0 = Debug|Win32
- {0A206042-1213-4EFB-AF48-1627AF72629E}.Release|Win32.ActiveCfg = Release|Win32
- {0A206042-1213-4EFB-AF48-1627AF72629E}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FrameTest", "FrameTest.vcxproj", "{EB65A740-3EA8-41AE-8BE6-5B5779B6F77D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Frames", "..\..\..\Frames\Frames.vcxproj", "{0A206042-1213-4EFB-AF48-1627AF72629E}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {EB65A740-3EA8-41AE-8BE6-5B5779B6F77D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EB65A740-3EA8-41AE-8BE6-5B5779B6F77D}.Debug|Win32.Build.0 = Debug|Win32
+ {EB65A740-3EA8-41AE-8BE6-5B5779B6F77D}.Release|Win32.ActiveCfg = Release|Win32
+ {EB65A740-3EA8-41AE-8BE6-5B5779B6F77D}.Release|Win32.Build.0 = Release|Win32
+ {0A206042-1213-4EFB-AF48-1627AF72629E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0A206042-1213-4EFB-AF48-1627AF72629E}.Debug|Win32.Build.0 = Debug|Win32
+ {0A206042-1213-4EFB-AF48-1627AF72629E}.Release|Win32.ActiveCfg = Release|Win32
+ {0A206042-1213-4EFB-AF48-1627AF72629E}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
View
18 Frames/FrameManager.cpp
@@ -252,4 +252,22 @@ void FrameSet::deactivate() {
FrameSet& FrameManager::actualSet() const {
return *pimpl->activatedSet;
+}
+
+void FrameManager::addSet(FrameSet& set) {
+ pimpl->namedSets[set.name()] = &set;
+}
+
+std::wstring FrameSet::name() const {
+ return pimpl->name;
+}
+
+void FrameManager::deleteSet(const std::wstring& name) {
+ pimpl->namedSets.erase(pimpl->namedSets.find(name));
+}
+
+void FrameManager::changeSet(const std::wstring& newSet) {
+ pimpl->activatedSet->deactivate();
+ pimpl->activatedSet = pimpl->namedSets[newSet];
+ pimpl->activatedSet->activate();
}
View
3  Frames/FrameManager.hpp
@@ -60,9 +60,10 @@ namespace GosuEx {
// Call this in ~Window.
static void despawn();
// Sets
- void addSet(FrameSet* newSet);
+ void addSet(FrameSet& newSet);
void deleteSet(const std::wstring& name);
FrameSet& actualSet() const;
+ void changeSet(const std::wstring& newName);
// Adding a widget
void addWidget(Widget* widget);
// Removing a widget, deleting it
Please sign in to comment.
Something went wrong with that request. Please try again.