Lua - fix forms.newForm()

This commit is contained in:
adelikat 2014-02-23 22:47:45 +00:00
parent d7371fcf42
commit 33fdf03af6
1 changed files with 23 additions and 35 deletions

View File

@ -241,8 +241,7 @@ namespace BizHawk.Client.EmuHawk
{
return form.GetType().GetProperty(property).GetValue(form, null).ToString();
}
else
{
foreach (Control control in form.Controls)
{
if (control.Handle == ptr)
@ -252,13 +251,12 @@ namespace BizHawk.Client.EmuHawk
}
}
}
}
catch (Exception ex)
{
ConsoleLuaLibrary.Log(ex.Message);
}
return String.Empty;
return string.Empty;
}
[LuaMethodAttributes(
@ -276,8 +274,7 @@ namespace BizHawk.Client.EmuHawk
{
return form.Text;
}
else
{
foreach (Control control in form.Controls)
{
if (control.Handle == ptr)
@ -286,21 +283,18 @@ namespace BizHawk.Client.EmuHawk
{
return (control as LuaDropDown).SelectedItem.ToString();
}
else
{
return control.Text;
}
}
}
}
}
}
catch (Exception ex)
{
ConsoleLuaLibrary.Log(ex.Message);
}
return String.Empty;
return string.Empty;
}
[LuaMethodAttributes(
@ -316,8 +310,7 @@ namespace BizHawk.Client.EmuHawk
{
return false;
}
else
{
foreach (Control control in form.Controls)
{
if (control.Handle == ptr)
@ -326,14 +319,11 @@ namespace BizHawk.Client.EmuHawk
{
return (control as LuaCheckbox).Checked;
}
else
{
return false;
}
}
}
}
}
return false;
}
@ -383,7 +373,7 @@ namespace BizHawk.Client.EmuHawk
_luaForms.Add(form);
if (width.HasValue && height.HasValue)
{
form.Size = new Size(LuaInt(width), LuaInt(height));
form.Size = new Size(width.Value, height.Value);
}
form.Text = title;
@ -419,10 +409,8 @@ namespace BizHawk.Client.EmuHawk
{
return openFileDialog1.FileName;
}
else
{
return String.Empty;
}
return string.Empty;
}
[LuaMethodAttributes(