changeset 59:63806b850aa5

Rename ProgramPanel to ActionPanel
author koryspansel <koryspansel@bendbroadband.com>
date Fri, 30 Sep 2011 22:48:03 -0700
parents 5e382dee4c70
children b0f642ee22d3
files LightClone/LightClone.vcproj LightClone/Source/ActionPanel.cpp LightClone/Source/ActionPanel.h LightClone/Source/ProgramPanel.cpp LightClone/Source/ProgramPanel.h LightClone/Source/World.cpp LightClone/Source/World.h
diffstat 7 files changed, 236 insertions(+), 236 deletions(-) [+]
line wrap: on
line diff
--- a/LightClone/LightClone.vcproj	Fri Sep 30 22:39:08 2011 -0700
+++ b/LightClone/LightClone.vcproj	Fri Sep 30 22:48:03 2011 -0700
@@ -183,6 +183,10 @@
 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
 			>
 			<File
+				RelativePath=".\Source\ActionPanel.cpp"
+				>
+			</File>
+			<File
 				RelativePath=".\Source\ActionSlot.cpp"
 				>
 			</File>
@@ -219,10 +223,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\Source\ProgramPanel.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\VirtualMachine.cpp"
 				>
 			</File>
@@ -329,6 +329,10 @@
 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
 			>
 			<File
+				RelativePath=".\Source\ActionPanel.h"
+				>
+			</File>
+			<File
 				RelativePath=".\Source\ActionSlot.h"
 				>
 			</File>
@@ -365,10 +369,6 @@
 				>
 			</File>
 			<File
-				RelativePath=".\Source\ProgramPanel.h"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\VirtualMachine.h"
 				>
 			</File>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LightClone/Source/ActionPanel.cpp	Fri Sep 30 22:48:03 2011 -0700
@@ -0,0 +1,115 @@
+/*
+ * ActionPanel
+ */
+
+#include "ActionPanel.h"
+
+/*
+ * EventAction
+ */
+const char* ActionPanel::EventAction = "ActionPanel:EventAction";
+
+/*
+ * ActionPanel
+ */
+ActionPanel::ActionPanel(uint32 nWidth, uint32 nHeight) : GuiImage(), nSizeX(nWidth), nSizeY(nHeight)
+{
+	pSlot = new ActionSlot[nSizeX * nSizeY];
+}
+
+/*
+ * Initialize
+ */
+ErrorCode ActionPanel::Initialize(ResourceManager* pResourceManager)
+{
+	const float fSlotSizeX		= 48.0f;
+	const float fSlotSizeY		= 48.0f;
+	const float fSlotPadding	= 16.0f;
+	const float fSlotSpacing	= 8.0f;
+
+	ErrorCode eCode = GuiImage::Initialize(pResourceManager);
+	if(eCode == Error_Success)
+	{
+		SetDimensions(2.0f * fSlotPadding + (fSlotSizeX + fSlotSpacing) * nSizeX - fSlotSpacing, 2.0f * fSlotPadding + (fSlotSizeY + fSlotSpacing) * nSizeY - fSlotSpacing);
+
+		for(uint32 i = 0; i < nSizeY; ++i)
+		{
+			for(uint32 j = 0; j < nSizeX; ++j)
+			{
+				const uint32 nIndex = i * nSizeX + j;
+
+				pSlot[nIndex].Initialize(pResourceManager);
+				pSlot[nIndex].SetTexture("Data\\Textures\\Slot.tga");
+				pSlot[nIndex].SetDimensions(fSlotSizeX, fSlotSizeY);
+				pSlot[nIndex].SetPosition(fSlotPadding + (fSlotSizeX + fSlotSpacing) * j, fSlotPadding + (fSlotSizeY + fSlotSpacing) * i);
+				pSlot[nIndex].Subscribe(ActionSlot::EventDrop, &ActionPanel::OnActionDropped, this);
+				pSlot[nIndex].SetSlot(nIndex);
+				pSlot[nIndex].SetAction(Action_None);
+
+				Add(&pSlot[nIndex]);
+			}
+		}
+	}
+
+	return eCode;
+}
+
+/*
+ * SetAction
+ */
+void ActionPanel::SetAction(uint32 nIndex, uint32 nAction)
+{
+	pSlot[nIndex].SetAction(nAction);
+}
+
+/*
+ * GetAction
+ */
+uint32 ActionPanel::GetAction(uint32 nIndex) const
+{
+	return pSlot[nIndex].GetAction();
+}
+
+/*
+ * Clear
+ */
+void ActionPanel::Clear()
+{
+	const uint32 nCount = nSizeX * nSizeY;
+
+	for(uint32 i = 0; i < nCount; ++i)
+	{
+		pSlot[i].SetAction(Action_None);
+	}
+}
+
+/*
+ * SetPermanent
+ */
+void ActionPanel::SetPermanent(bool bPermanent)
+{
+	const uint32 nCount = nSizeX * nSizeY;
+
+	for(uint32 i = 0; i < nCount; ++i)
+	{
+		pSlot[i].SetPermanent(bPermanent);
+	}
+}
+
+/*
+ * OnActionDropped
+ */
+void ActionPanel::OnActionDropped(GuiEventArguments& kArguments)
+{
+	ActionSlot* pSlot = (ActionSlot*)kArguments.pSource;
+	//ASSERT(pSlot != NULL);
+
+	const uint32 nIndex = pSlot->GetSlot();
+	//if(nIndex < nActionSlots)
+	{
+		ActionArguments kActionArguments(this, nIndex);
+		Fire(ActionPanel::EventAction, kActionArguments);
+	}
+
+	Fire(ActionPanel::EventDrop, kArguments);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LightClone/Source/ActionPanel.h	Fri Sep 30 22:48:03 2011 -0700
@@ -0,0 +1,103 @@
+/*
+ * ActionPanel
+ */
+
+#ifndef __ACTIONPANEL_H__
+#define __ACTIONPANEL_H__
+
+#include "Core.h"
+#include "ActionSlot.h"
+
+/*
+ * ActionArguments
+ */
+struct ActionArguments : public GuiEventArguments
+{
+	/*
+	 * nSlot
+	 */
+	uint32 nSlot;
+
+	/*
+	 * ActionArguments
+	 */
+	ActionArguments(GuiElement* pSource, uint32 nCodeSlot) : GuiEventArguments(pSource), nSlot(nCodeSlot)
+	{
+	}
+};
+
+/*
+ * ActionPanel
+ */
+class ActionPanel : public GuiImage
+{
+public:
+
+	/*
+	 * EventAction
+	 */
+	static const char* EventAction;
+
+private:
+
+	/*
+	 * pSlot
+	 */
+	ActionSlot* pSlot;
+
+	/*
+	 * nSizeX
+	 */
+	uint32 nSizeX;
+
+	/*
+	 * nSizeY
+	 */
+	uint32 nSizeY;
+
+public:
+
+	/*
+	 * ActionPanel
+	 */
+	ActionPanel(uint32 nWidth, uint32 nHeight);
+
+	/*
+	 * Initialize
+	 */
+	virtual ErrorCode Initialize(ResourceManager* pResourceManager);
+
+	/*
+	 * SetAvailableSlots
+	 */
+	void SetAvailableSlots(uint32 nCount);
+
+	/*
+	 * SetAction
+	 */
+	void SetAction(uint32 nIndex, uint32 nAction);
+
+	/*
+	 * GetAction
+	 */
+	uint32 GetAction(uint32 nIndex) const;
+
+	/*
+	 * Clear
+	 */
+	void Clear();
+
+	/*
+	 * SetPermanent
+	 */
+	void SetPermanent(bool bPermanent);
+
+private:
+
+	/*
+	 * OnActionDropped
+	 */
+	void OnActionDropped(GuiEventArguments& kArguments);
+};
+
+#endif //__ACTIONPANEL_H__
--- a/LightClone/Source/ProgramPanel.cpp	Fri Sep 30 22:39:08 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
- * ProgramPanel
- */
-
-#include "ProgramPanel.h"
-
-/*
- * EventAction
- */
-const char* ProgramPanel::EventAction = "ProgramPanel:EventAction";
-
-/*
- * ProgramPanel
- */
-ProgramPanel::ProgramPanel(uint32 nWidth, uint32 nHeight) : GuiImage(), nSizeX(nWidth), nSizeY(nHeight)
-{
-	pSlot = new ActionSlot[nSizeX * nSizeY];
-}
-
-/*
- * Initialize
- */
-ErrorCode ProgramPanel::Initialize(ResourceManager* pResourceManager)
-{
-	const float fSlotSizeX		= 48.0f;
-	const float fSlotSizeY		= 48.0f;
-	const float fSlotPadding	= 16.0f;
-	const float fSlotSpacing	= 8.0f;
-
-	ErrorCode eCode = GuiImage::Initialize(pResourceManager);
-	if(eCode == Error_Success)
-	{
-		SetDimensions(2.0f * fSlotPadding + (fSlotSizeX + fSlotSpacing) * nSizeX - fSlotSpacing, 2.0f * fSlotPadding + (fSlotSizeY + fSlotSpacing) * nSizeY - fSlotSpacing);
-
-		for(uint32 i = 0; i < nSizeY; ++i)
-		{
-			for(uint32 j = 0; j < nSizeX; ++j)
-			{
-				const uint32 nIndex = i * nSizeX + j;
-
-				pSlot[nIndex].Initialize(pResourceManager);
-				pSlot[nIndex].SetTexture("Data\\Textures\\Slot.tga");
-				pSlot[nIndex].SetDimensions(fSlotSizeX, fSlotSizeY);
-				pSlot[nIndex].SetPosition(fSlotPadding + (fSlotSizeX + fSlotSpacing) * j, fSlotPadding + (fSlotSizeY + fSlotSpacing) * i);
-				pSlot[nIndex].Subscribe(ActionSlot::EventDrop, &ProgramPanel::OnActionDropped, this);
-				pSlot[nIndex].SetSlot(nIndex);
-				pSlot[nIndex].SetAction(Action_None);
-
-				Add(&pSlot[nIndex]);
-			}
-		}
-	}
-
-	return eCode;
-}
-
-/*
- * SetAction
- */
-void ProgramPanel::SetAction(uint32 nIndex, uint32 nAction)
-{
-	pSlot[nIndex].SetAction(nAction);
-}
-
-/*
- * GetAction
- */
-uint32 ProgramPanel::GetAction(uint32 nIndex) const
-{
-	return pSlot[nIndex].GetAction();
-}
-
-/*
- * Clear
- */
-void ProgramPanel::Clear()
-{
-	const uint32 nCount = nSizeX * nSizeY;
-
-	for(uint32 i = 0; i < nCount; ++i)
-	{
-		pSlot[i].SetAction(Action_None);
-	}
-}
-
-/*
- * SetPermanent
- */
-void ProgramPanel::SetPermanent(bool bPermanent)
-{
-	const uint32 nCount = nSizeX * nSizeY;
-
-	for(uint32 i = 0; i < nCount; ++i)
-	{
-		pSlot[i].SetPermanent(bPermanent);
-	}
-}
-
-/*
- * OnActionDropped
- */
-void ProgramPanel::OnActionDropped(GuiEventArguments& kArguments)
-{
-	ActionSlot* pSlot = (ActionSlot*)kArguments.pSource;
-	//ASSERT(pSlot != NULL);
-
-	const uint32 nIndex = pSlot->GetSlot();
-	//if(nIndex < nActionSlots)
-	{
-		ActionArguments kActionArguments(this, nIndex);
-		Fire(ProgramPanel::EventAction, kActionArguments);
-	}
-
-	Fire(ProgramPanel::EventDrop, kArguments);
-}
\ No newline at end of file
--- a/LightClone/Source/ProgramPanel.h	Fri Sep 30 22:39:08 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
- * ProgramPanel
- */
-
-#ifndef __PROGRAMPANEL_H__
-#define __PROGRAMPANEL_H__
-
-#include "Core.h"
-#include "ActionSlot.h"
-
-/*
- * ActionArguments
- */
-struct ActionArguments : public GuiEventArguments
-{
-	/*
-	 * nSlot
-	 */
-	uint32 nSlot;
-
-	/*
-	 * ActionArguments
-	 */
-	ActionArguments(GuiElement* pSource, uint32 nCodeSlot) : GuiEventArguments(pSource), nSlot(nCodeSlot)
-	{
-	}
-};
-
-/*
- * ProgramPanel
- */
-class ProgramPanel : public GuiImage
-{
-public:
-
-	/*
-	 * EventAction
-	 */
-	static const char* EventAction;
-
-private:
-
-	/*
-	 * pSlot
-	 */
-	ActionSlot* pSlot;
-
-	/*
-	 * nSizeX
-	 */
-	uint32 nSizeX;
-
-	/*
-	 * nSizeY
-	 */
-	uint32 nSizeY;
-
-public:
-
-	/*
-	 * ProgramPanel
-	 */
-	ProgramPanel(uint32 nWidth, uint32 nHeight);
-
-	/*
-	 * Initialize
-	 */
-	virtual ErrorCode Initialize(ResourceManager* pResourceManager);
-
-	/*
-	 * SetAvailableSlots
-	 */
-	void SetAvailableSlots(uint32 nCount);
-
-	/*
-	 * SetAction
-	 */
-	void SetAction(uint32 nIndex, uint32 nAction);
-
-	/*
-	 * GetAction
-	 */
-	uint32 GetAction(uint32 nIndex) const;
-
-	/*
-	 * Clear
-	 */
-	void Clear();
-
-	/*
-	 * SetPermanent
-	 */
-	void SetPermanent(bool bPermanent);
-
-private:
-
-	/*
-	 * OnActionDropped
-	 */
-	void OnActionDropped(GuiEventArguments& kArguments);
-};
-
-#endif //__PROGRAMPANEL_H__
--- a/LightClone/Source/World.cpp	Fri Sep 30 22:39:08 2011 -0700
+++ b/LightClone/Source/World.cpp	Fri Sep 30 22:48:03 2011 -0700
@@ -221,7 +221,7 @@
 		pBackground->SetPosition(ScreenSizeX - pBackground->GetWidth(), 0.0f);
 		pBackground->SetDepth(512.0f);
 
-		pToolbar = new ProgramPanel(4, 2);
+		pToolbar = new ActionPanel(4, 2);
 		pToolbar->Initialize(pResourceManager);
 		pToolbar->SetTexture("Data\\Textures\\PanelA.png");
 		pToolbar->SetPosition(16, 16.0f);
@@ -243,11 +243,11 @@
 		pMainLabel->SetPosition(26.0f, 149.0f);
 		pMainLabel->SetDepth(256.0f);
 
-		pCode[0] = new ProgramPanel(4, 3);
+		pCode[0] = new ActionPanel(4, 3);
 		pCode[0]->Initialize(pResourceManager);
 		pCode[0]->SetTexture("Data\\Textures\\PanelB.png");
 		pCode[0]->SetPosition(16.0f, 160.0f);
-		pCode[0]->Subscribe(ProgramPanel::EventAction, &World::OnAction, this);
+		pCode[0]->Subscribe(ActionPanel::EventAction, &World::OnAction, this);
 		pCode[0]->SetDepth(256.0f);
 
 		GuiLabel* pFunctionALabel = new GuiLabel();
@@ -257,11 +257,11 @@
 		pFunctionALabel->SetColor(D3DCOLOR_XRGB(0, 0, 0));
 		pFunctionALabel->SetPosition(26.0f, 349.0f);
 
-		pCode[1] = new ProgramPanel(4, 2);
+		pCode[1] = new ActionPanel(4, 2);
 		pCode[1]->Initialize(pResourceManager);
 		pCode[1]->SetTexture("Data\\Textures\\PanelA.png");
 		pCode[1]->SetPosition(16.0f, 360.0f);
-		pCode[1]->Subscribe(ProgramPanel::EventAction, &World::OnAction, this);
+		pCode[1]->Subscribe(ActionPanel::EventAction, &World::OnAction, this);
 
 		GuiLabel* pFunctionBLabel = new GuiLabel();
 		pFunctionBLabel->Initialize(pResourceManager);
@@ -270,11 +270,11 @@
 		pFunctionBLabel->SetColor(D3DCOLOR_XRGB(0, 0, 0));
 		pFunctionBLabel->SetPosition(26.0f, 493.0f);
 
-		pCode[2] = new ProgramPanel(4, 2);
+		pCode[2] = new ActionPanel(4, 2);
 		pCode[2]->Initialize(pResourceManager);
 		pCode[2]->SetTexture("Data\\Textures\\PanelA.png");
 		pCode[2]->SetPosition(16.0f, 504.0f);
-		pCode[2]->Subscribe(ProgramPanel::EventAction, &World::OnAction, this);
+		pCode[2]->Subscribe(ActionPanel::EventAction, &World::OnAction, this);
 
 		const float fButtonPadding	= 32.0f;
 		const float fButtonSpacing	= 8.0f;
--- a/LightClone/Source/World.h	Fri Sep 30 22:39:08 2011 -0700
+++ b/LightClone/Source/World.h	Fri Sep 30 22:48:03 2011 -0700
@@ -16,7 +16,7 @@
 #include "GuiInterface.h"
 #include "GuiImage.h"
 #include "GuiButton.h"
-#include "ProgramPanel.h"
+#include "ActionPanel.h"
 #include "Program.h"
 #include "Dialog.h"
 
@@ -138,12 +138,12 @@
 	/*
 	 * pToolbar
 	 */
-	ProgramPanel* pToolbar;
+	ActionPanel* pToolbar;
 
 	/*
 	 * pCode
 	 */
-	ProgramPanel* pCode[MaximumFunctionCount];
+	ActionPanel* pCode[MaximumFunctionCount];
 
 	/*
 	 * pMessageDialog