/[Sims3RigEditor]/trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h
ViewVC logotype

Diff of /trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h	2010/08/01 02:15:12	14
+++ trunk/gr2lib_cpp/gr2lib_rigeditor_frm.h	2010/08/01 02:44:09	15
@@ -88,7 +88,9 @@
 		// Log Application Startup
 		LogApplicationStartup();
 
-		propgrid->SelectedObjects = ConvertToManaged();
+		this->GR2LibPropertyWrapper = gcnew GR2LibWrapper();
+		ConvertToManaged();
+		propgrid->SelectedObject = this->GR2LibPropertyWrapper;
 
 	}
 
@@ -142,7 +144,7 @@
 		this->propgrid->Dock = System::Windows::Forms::DockStyle::Fill;
 		this->propgrid->Location = System::Drawing::Point(0, 24);
 		this->propgrid->Name = L"propgrid";
-		this->propgrid->PropertySort = System::Windows::Forms::PropertySort::Categorized;
+		this->propgrid->PropertySort = System::Windows::Forms::PropertySort::NoSort;
 		this->propgrid->Size = System::Drawing::Size(558, 456);
 		this->propgrid->TabIndex = 4;
 		this->propgrid->ToolbarVisible = false;
@@ -208,19 +210,17 @@
 	}
 #pragma endregion
 #pragma region MarshalToMananaged
-	ArtToolInfo^ _ArtToolInfo;
-	ExporterInfo^ _ExporterInfo;
+	//ArtToolInfo^ _ArtToolInfo;
+	//ExporterInfo^ _ExporterInfo;
+	GR2LibWrapper^ GR2LibPropertyWrapper;
 
 #pragma region ManagedNativeParsing
-	array<Object^>^ ConvertToManaged()
+	void ConvertToManaged()
 	{
-		List<Object^> ret = gcnew List<Object^>();
-
 		// Art Tool info
-		ret.Add(ArtToolInfo_ToManaged(_grn_file->GrannyFileInfo->ArtToolInfo));
+		ArtToolInfo_ToManaged(_grn_file->GrannyFileInfo->ArtToolInfo);
 		// Exporter Info
-		ret.Add(ExporterInfo_ToManaged(_grn_file->GrannyFileInfo->ExporterInfo));
-		return ret.ToArray();
+		ExporterInfo_ToManaged(_grn_file->GrannyFileInfo->ExporterInfo);
 	}
 	void ConvertToNative()
 	{
@@ -232,11 +232,11 @@
 #pragma endregion
 
 #pragma region ArtToolInfo_ToManaged
-	ArtToolInfo^ ArtToolInfo_ToManaged(granny_art_tool_info* toolinfo)
+	void ArtToolInfo_ToManaged(granny_art_tool_info* toolinfo)
 	{
-		_ArtToolInfo = gcnew ArtToolInfo();
+		//GR2LibPropertyWrapper->ArtToolInfo = gcnew ArtToolInfo();
 		// Tool Name
-		_ArtToolInfo->FromArtToolName = gcnew String(reinterpret_cast<const char*>(toolinfo->FromArtToolName));
+		GR2LibPropertyWrapper->ArtToolInfo->FromArtToolName = gcnew String(reinterpret_cast<const char*>(toolinfo->FromArtToolName));
 
 		// Tool Vector
 		Vector3* Origin = new Vector3(
@@ -255,28 +255,26 @@
 			toolinfo->BackVector[0],
 			toolinfo->BackVector[1],
 			toolinfo->BackVector[2]);
-		_ArtToolInfo->Vector = gcnew ArtToolInfoVector(*Origin,*Right,*Up,*Back);
+		GR2LibPropertyWrapper->ArtToolInfo->Vector = gcnew ArtToolInfoVector(*Origin,*Right,*Up,*Back);
 
 		// Tool Version
-		_ArtToolInfo->ToolVersion = gcnew ArtToolInfoVersion(toolinfo->ArtToolMajorRevision,toolinfo->ArtToolMinorRevision);
+		GR2LibPropertyWrapper->ArtToolInfo->ToolVersion = gcnew ArtToolInfoVersion(toolinfo->ArtToolMajorRevision,toolinfo->ArtToolMinorRevision);
 		// Tool Units Per Meter
-		_ArtToolInfo->UnitsPerMeter = toolinfo->UnitsPerMeter;
-		return _ArtToolInfo;
+		GR2LibPropertyWrapper->ArtToolInfo->UnitsPerMeter = toolinfo->UnitsPerMeter;
 	}
 #pragma endregion
 #pragma region ExporterInfo_ToManaged
-	ExporterInfo^ ExporterInfo_ToManaged(granny_exporter_info* toolinfo)
-	{
-		_ExporterInfo = gcnew ExporterInfo();
+	void ExporterInfo_ToManaged(granny_exporter_info* toolinfo)
+	{		
+		//GR2LibPropertyWrapper->ExporterInfo = gcnew ExporterInfo();
 		// Tool Name
-		_ExporterInfo->ExporterName = gcnew String(reinterpret_cast<const char*>(toolinfo->ExporterName));
-		_ExporterInfo->Version = gcnew versiontype(
+		GR2LibPropertyWrapper->ExporterInfo->ExporterName = gcnew String(reinterpret_cast<const char*>(toolinfo->ExporterName));
+		GR2LibPropertyWrapper->ExporterInfo->Version = gcnew versiontype(
 			toolinfo->ExporterMajorRevision,
 			toolinfo->ExporterMinorRevision,
 			toolinfo->ExporterCustomization,
 			toolinfo->ExporterBuildNumber);
 		//_ExporterInfo->ExtendedData = new IntPtr(toolinfo->ExtendedData.Object);
-		return _ExporterInfo;
 	}
 #pragma endregion
 
@@ -286,38 +284,38 @@
 	void ArtToolInfo_ToNative()
 	{
 
-		_grn_file->GrannyFileInfo->ArtToolInfo->FromArtToolName = (char*)Marshal::StringToHGlobalAnsi(_ArtToolInfo->FromArtToolName).ToPointer();
-		_grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMajorRevision = _ArtToolInfo->ToolVersion->Major;
-		_grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMinorRevision = _ArtToolInfo->ToolVersion->Minor;
-		_grn_file->GrannyFileInfo->ArtToolInfo->UnitsPerMeter = _ArtToolInfo->UnitsPerMeter;
-
-
-		_grn_file->GrannyFileInfo->ArtToolInfo->Origin[0] = _ArtToolInfo->Vector->Origin.x;
-		_grn_file->GrannyFileInfo->ArtToolInfo->Origin[1] = _ArtToolInfo->Vector->Origin.y;
-		_grn_file->GrannyFileInfo->ArtToolInfo->Origin[2] = _ArtToolInfo->Vector->Origin.z;
-
-		_grn_file->GrannyFileInfo->ArtToolInfo->RightVector[0] = _ArtToolInfo->Vector->Right.x;
-		_grn_file->GrannyFileInfo->ArtToolInfo->RightVector[1] = _ArtToolInfo->Vector->Right.y;
-		_grn_file->GrannyFileInfo->ArtToolInfo->RightVector[2] = _ArtToolInfo->Vector->Right.z;
-
-		_grn_file->GrannyFileInfo->ArtToolInfo->UpVector[0] = _ArtToolInfo->Vector->Up.x;
-		_grn_file->GrannyFileInfo->ArtToolInfo->UpVector[1] = _ArtToolInfo->Vector->Up.y;
-		_grn_file->GrannyFileInfo->ArtToolInfo->UpVector[2] = _ArtToolInfo->Vector->Up.z;
-
-		_grn_file->GrannyFileInfo->ArtToolInfo->BackVector[0] = _ArtToolInfo->Vector->Back.x;
-		_grn_file->GrannyFileInfo->ArtToolInfo->BackVector[1] = _ArtToolInfo->Vector->Back.y;
-		_grn_file->GrannyFileInfo->ArtToolInfo->BackVector[2] = _ArtToolInfo->Vector->Back.z;
+		_grn_file->GrannyFileInfo->ArtToolInfo->FromArtToolName = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->ArtToolInfo->FromArtToolName).ToPointer();
+		_grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMajorRevision = GR2LibPropertyWrapper->ArtToolInfo->ToolVersion->Major;
+		_grn_file->GrannyFileInfo->ArtToolInfo->ArtToolMinorRevision = GR2LibPropertyWrapper->ArtToolInfo->ToolVersion->Minor;
+		_grn_file->GrannyFileInfo->ArtToolInfo->UnitsPerMeter = GR2LibPropertyWrapper->ArtToolInfo->UnitsPerMeter;
+
+
+		_grn_file->GrannyFileInfo->ArtToolInfo->Origin[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.x;
+		_grn_file->GrannyFileInfo->ArtToolInfo->Origin[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.y;
+		_grn_file->GrannyFileInfo->ArtToolInfo->Origin[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Origin.z;
+
+		_grn_file->GrannyFileInfo->ArtToolInfo->RightVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.x;
+		_grn_file->GrannyFileInfo->ArtToolInfo->RightVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.y;
+		_grn_file->GrannyFileInfo->ArtToolInfo->RightVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Right.z;
+
+		_grn_file->GrannyFileInfo->ArtToolInfo->UpVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.x;
+		_grn_file->GrannyFileInfo->ArtToolInfo->UpVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.y;
+		_grn_file->GrannyFileInfo->ArtToolInfo->UpVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Up.z;
+
+		_grn_file->GrannyFileInfo->ArtToolInfo->BackVector[0] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.x;
+		_grn_file->GrannyFileInfo->ArtToolInfo->BackVector[1] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.y;
+		_grn_file->GrannyFileInfo->ArtToolInfo->BackVector[2] = GR2LibPropertyWrapper->ArtToolInfo->Vector->Back.z;
 
 	}
 #pragma endregion
 #pragma region ExporterInfo_ToNative
 	void ExporterInfo_ToNative()
 	{
-		_grn_file->GrannyFileInfo->ExporterInfo->ExporterName = (char*)Marshal::StringToHGlobalAnsi(_ExporterInfo->ExporterName).ToPointer();
-		_grn_file->GrannyFileInfo->ExporterInfo->ExporterMajorRevision = _ExporterInfo->Version->major;
-		_grn_file->GrannyFileInfo->ExporterInfo->ExporterMinorRevision = _ExporterInfo->Version->minor;
-		_grn_file->GrannyFileInfo->ExporterInfo->ExporterCustomization = _ExporterInfo->Version->customization;
-		_grn_file->GrannyFileInfo->ExporterInfo->ExporterBuildNumber = _ExporterInfo->Version->build;
+		_grn_file->GrannyFileInfo->ExporterInfo->ExporterName = (char*)Marshal::StringToHGlobalAnsi(GR2LibPropertyWrapper->ExporterInfo->ExporterName).ToPointer();
+		_grn_file->GrannyFileInfo->ExporterInfo->ExporterMajorRevision = GR2LibPropertyWrapper->ExporterInfo->Version->major;
+		_grn_file->GrannyFileInfo->ExporterInfo->ExporterMinorRevision = GR2LibPropertyWrapper->ExporterInfo->Version->minor;
+		_grn_file->GrannyFileInfo->ExporterInfo->ExporterCustomization = GR2LibPropertyWrapper->ExporterInfo->Version->customization;
+		_grn_file->GrannyFileInfo->ExporterInfo->ExporterBuildNumber = GR2LibPropertyWrapper->ExporterInfo->Version->build;
 		//_grn_file->GrannyFileInfo->ExporterInfo->ExtendedData
 	}
 #pragma endregion
@@ -344,8 +342,9 @@
 			 //_grn_file->_logger->SetLogFileName("c:\\gr2_logs",fn);
 			 _grn_file = new grannyfile(fn);
 
-
-			 propgrid->SelectedObjects = ConvertToManaged();
+			this->GR2LibPropertyWrapper = gcnew GR2LibWrapper();
+			ConvertToManaged();
+			 propgrid->SelectedObject = this->GR2LibPropertyWrapper;
 		 }
 private: System::Void gr2lib_rigeditor_frm_FormClosed(System::Object^  sender, System::Windows::Forms::FormClosedEventArgs^  e) 
 		 {

 

  ViewVC Help
Powered by ViewVC 1.1.22