ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/Win32/libWin32/Win32/UI/IEEE754FloatConverter.cs
(Generate patch)

Comparing trunk/Win32/libWin32/Win32/UI/IEEE754FloatConverter.cs (file contents):
Revision 367 by william, Wed May 9 20:52:20 2012 UTC vs.
Revision 368 by william, Sun Jun 10 04:03:24 2012 UTC

--- trunk/Win32/libWin32/Win32/UI/IEEE754FloatConverter.cs	2012/06/10 03:39:00	367
+++ trunk/Win32/libWin32/Win32/UI/IEEE754FloatConverter.cs	2012/06/10 04:03:24	368
@@ -22,12 +22,37 @@ namespace System.Windows.Forms
 
         private void btnConvertToFloat_Click(object sender, EventArgs e)
         {
+            CalculateFloat();
+        }
+
+        private void btnConvertToIEEE754Float_Click(object sender, EventArgs e)
+        {
+            CalculateHexFloat();
+        }
+
+        public void SetFloatHexValue(uint value)
+        {
+            txtIEEE754Float.Value = value;
+        }
+        public uint GetFloatHexValue()
+        {
+            return (uint)txtIEEE754Float.Value;
+        }
+        public void SetFloatValue(float value)
+        {
+            txtFloat.Value = value.ToString();
+        }
+        public float GetFloatValue()
+        {
+            return Convert.ToSingle(txtFloat.Value);
+        }
+        public void CalculateFloat()
+        {
             ieee754FloatingPointConverter converter = new ieee754FloatingPointConverter();
             converter.HexFloat = txtIEEE754Float.ToUInt32();
             txtFloat.Text = string.Format("{0:R}", converter.Float);
         }
-
-        private void btnConvertToIEEE754Float_Click(object sender, EventArgs e)
+        public void CalculateHexFloat()
         {
             ieee754FloatingPointConverter converter = new ieee754FloatingPointConverter();
             float f;