/[RomCheater]/trunk/RomCheater.RVACalculator/RVACalculatorDockControl.cs
ViewVC logotype

Diff of /trunk/RomCheater.RVACalculator/RVACalculatorDockControl.cs

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

revision 659 by william, Mon Jun 17 02:21:49 2013 UTC revision 667 by william, Mon Jun 17 03:32:25 2013 UTC
# Line 44  namespace RomCheater.RVACalculator Line 44  namespace RomCheater.RVACalculator
44    
45              name = Microsoft.VisualBasic.Interaction.InputBox("Input Dialog", "Enter the cheat name", string.Empty);              name = Microsoft.VisualBasic.Interaction.InputBox("Input Dialog", "Enter the cheat name", string.Empty);
46              address = Microsoft.VisualBasic.Interaction.InputBox("Input Dialog", "Enter the cheat address (in hex : 0xXXXXXXXX)", string.Empty);              address = Microsoft.VisualBasic.Interaction.InputBox("Input Dialog", "Enter the cheat address (in hex : 0xXXXXXXXX)", string.Empty);
47              uint physical = Convert.ToUInt32(address) + txtRVA.ToUInt32();              uint physical = Convert.ToUInt32(address, 16) + txtRVA.ToUInt32();
48              ListViewItem li = new ListViewItem(name);              ListViewItem li = new ListViewItem(name);
49              li.SubItems.Add(new ListViewItem.ListViewSubItem(li, string.Format("0x{0:x8}", Convert.ToUInt32(address))));              li.SubItems.Add(new ListViewItem.ListViewSubItem(li, string.Format("0x{0:x8}", Convert.ToUInt32(address, 16))));
50              li.SubItems.Add(new ListViewItem.ListViewSubItem(li, string.Format("0x{0:x8}", physical)));              li.SubItems.Add(new ListViewItem.ListViewSubItem(li, string.Format("0x{0:x8}", physical)));
51              lstCheats.Items.Add(li);              lstCheats.Items.Add(li);
52          }          }
# Line 68  namespace RomCheater.RVACalculator Line 68  namespace RomCheater.RVACalculator
68    
69              name = Microsoft.VisualBasic.Interaction.InputBox("Input Dialog", "Enter the cheat name", name);              name = Microsoft.VisualBasic.Interaction.InputBox("Input Dialog", "Enter the cheat name", name);
70              address = Microsoft.VisualBasic.Interaction.InputBox("Input Dialog", "Enter the cheat address (in hex : 0xXXXXXXXX)", address);              address = Microsoft.VisualBasic.Interaction.InputBox("Input Dialog", "Enter the cheat address (in hex : 0xXXXXXXXX)", address);
71              uint physical = Convert.ToUInt32(address) + txtRVA.ToUInt32();              uint physical = Convert.ToUInt32(address, 16) + txtRVA.ToUInt32();
72              li.Text = name;              li.Text = name;
73              li.SubItems[1].Text = string.Format("0x{0:x8}", Convert.ToUInt32(address));              li.SubItems[1].Text = string.Format("0x{0:x8}", Convert.ToUInt32(address, 16));
74              li.SubItems[2].Text = string.Format("0x{0:x8}", physical);              li.SubItems[2].Text = string.Format("0x{0:x8}", physical);
75              lstCheats.Items[index] = li;                          lstCheats.Items[index] = li;            
76          }          }
77    
78          private void btnCopy_Click(object sender, EventArgs e)          private void btnCopy_Click(object sender, EventArgs e)
79          {          {
80              string name = string.Empty;              if (lstCheats.SelectedItems.Count == 0 || lstCheats.SelectedItems.Count > 1) { return; }
81              string address = string.Empty;              var li = lstCheats.SelectedItems[0];
82                string physical = li.SubItems[2].Text;
83                Clipboard.SetText(physical);
84          }          }
85    
86          private void btnSave_Click(object sender, EventArgs e)          private void btnSave_Click(object sender, EventArgs e)
# Line 98  namespace RomCheater.RVACalculator Line 100  namespace RomCheater.RVACalculator
100              {              {
101                  string name = li.Text;                  string name = li.Text;
102                  string address = li.SubItems[1].Text;                  string address = li.SubItems[1].Text;
103                  uint physical = Convert.ToUInt32(address) + txtRVA.ToUInt32();                  uint physical = Convert.ToUInt32(address, 16) + txtRVA.ToUInt32();
104                  li.SubItems[2].Text = string.Format("0x{0:x8}", physical);                                  li.SubItems[2].Text = string.Format("0x{0:x8}", physical);                
105                  lstCheats.Items[index] = li;                  lstCheats.Items[index] = li;
106                  index++;                  index++;
# Line 107  namespace RomCheater.RVACalculator Line 109  namespace RomCheater.RVACalculator
109    
110          private void RVACalculatorDockControl_Shown(object sender, EventArgs e)          private void RVACalculatorDockControl_Shown(object sender, EventArgs e)
111          {          {
112              const int t = 100;              //const int t = 100;
113              //txtRVA.SuspendLayout();              ////txtRVA.SuspendLayout();
114              logger.Debug.WriteLine("txtRva.Width={0}", txtRVA.Width);              //logger.Debug.WriteLine("txtRva.Width={0}", txtRVA.Width);
115              logger.Debug.WriteLine("increasing txtRva.Width to {0}", txtRVA.Width + t);              //logger.Debug.WriteLine("increasing txtRva.Width to {0}", txtRVA.Width + t);
116              txtRVA.Width = txtRVA.Width + t;              //txtRVA.Width = txtRVA.Width + t;
117              logger.Debug.WriteLine("txtRva.Width={0}", txtRVA.Width);              //logger.Debug.WriteLine("txtRva.Width={0}", txtRVA.Width);
118              //txtRVA.ResumeLayout();              ////txtRVA.ResumeLayout();
119          }          }
120    
121    

Legend:
Removed from v.659  
changed lines
  Added in v.667

  ViewVC Help
Powered by ViewVC 1.1.22