change every IntPtr<->int cast to IntPtr<->long. we got 64 bit integers with lua now, and a pointer is 64 bits, so might avoid some dumb bug due to truncations and some ungodly amount of ram being used
TODO: see if we can skip this cast nonsense. the lua tests indicate IntPtr should pass through fine, being considered "userdata", probably better so the user can't just pass raw numbers for the handle.
This commit is contained in:
parent
bc79664461
commit
b687dea1b0
|
@ -33,7 +33,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (i is not -1) _luaForms.RemoveAt(i);
|
||||
}
|
||||
|
||||
private LuaWinform GetForm(int formHandle)
|
||||
private LuaWinform GetForm(long formHandle)
|
||||
{
|
||||
var ptr = new IntPtr(formHandle);
|
||||
return _luaForms.Find(form => form.Handle == ptr);
|
||||
|
@ -50,7 +50,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
[LuaMethodExample("forms.addclick( 332, function()\r\n\tconsole.log( \"adds the given lua function as a click event to the given control\" );\r\nend );")]
|
||||
[LuaMethod("addclick", "adds the given lua function as a click event to the given control")]
|
||||
public void AddClick(int handle, LuaFunction clickEvent)
|
||||
public void AddClick(long handle, LuaFunction clickEvent)
|
||||
{
|
||||
var ptr = new IntPtr(handle);
|
||||
foreach (var form in _luaForms)
|
||||
|
@ -68,8 +68,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethodExample("local inforbut = forms.button( 333, \"Caption\", function()\r\n\tconsole.log( \"Creates a button control on the given form. The caption property will be the text value on the button. clickEvent is the name of a Lua function that will be invoked when the button is clicked. x, and y are the optional location parameters for the position of the button within the given form. The function returns the handle of the created button. Width and Height are optional, if not specified they will be a default size\" );\r\nend, 2, 48, 18, 24 );")]
|
||||
[LuaMethod(
|
||||
"button", "Creates a button control on the given form. The caption property will be the text value on the button. clickEvent is the name of a Lua function that will be invoked when the button is clicked. x, and y are the optional location parameters for the position of the button within the given form. The function returns the handle of the created button. Width and Height are optional, if not specified they will be a default size")]
|
||||
public int Button(
|
||||
int formHandle,
|
||||
public long Button(
|
||||
long formHandle,
|
||||
[LuaArbitraryStringParam] string caption,
|
||||
LuaFunction clickEvent,
|
||||
int? x = null,
|
||||
|
@ -98,13 +98,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
SetSize(button, width.Value, height.Value);
|
||||
}
|
||||
|
||||
return (int)button.Handle;
|
||||
return (long)button.Handle;
|
||||
}
|
||||
|
||||
[LuaMethodExample("local inforche = forms.checkbox( 333, \"Caption\", 2, 48 );")]
|
||||
[LuaMethod(
|
||||
"checkbox", "Creates a checkbox control on the given form. The caption property will be the text of the checkbox. x and y are the optional location parameters for the position of the checkbox within the form")]
|
||||
public int Checkbox(int formHandle, [LuaArbitraryStringParam] string caption, int? x = null, int? y = null)
|
||||
public long Checkbox(long formHandle, [LuaArbitraryStringParam] string caption, int? x = null, int? y = null)
|
||||
{
|
||||
var form = GetForm(formHandle);
|
||||
if (form == null)
|
||||
|
@ -121,12 +121,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
SetLocation(checkbox, x.Value, y.Value);
|
||||
}
|
||||
|
||||
return (int)checkbox.Handle;
|
||||
return (long)checkbox.Handle;
|
||||
}
|
||||
|
||||
[LuaMethodExample("forms.clearclicks( 332 );")]
|
||||
[LuaMethod("clearclicks", "Removes all click events from the given widget at the specified handle")]
|
||||
public void ClearClicks(int handle)
|
||||
public void ClearClicks(long handle)
|
||||
{
|
||||
var ptr = new IntPtr(handle);
|
||||
foreach (var form in _luaForms)
|
||||
|
@ -143,7 +143,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
[LuaMethodExample("if ( forms.destroy( 332 ) ) then\r\n\tconsole.log( \"Closes and removes a Lua created form with the specified handle. If a dialog was found and removed true is returned, else false\" );\r\nend;")]
|
||||
[LuaMethod("destroy", "Closes and removes a Lua created form with the specified handle. If a dialog was found and removed true is returned, else false")]
|
||||
public bool Destroy(int handle)
|
||||
public bool Destroy(long handle)
|
||||
{
|
||||
var ptr = new IntPtr(handle);
|
||||
foreach (var form in _luaForms)
|
||||
|
@ -172,8 +172,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethodExample("local infordro = forms.dropdown(333, { \"item 1\", \"item2\" }, 2, 48, 18, 24);")]
|
||||
[LuaMethod(
|
||||
"dropdown", "Creates a dropdown (with a ComboBoxStyle of DropDownList) control on the given form. Dropdown items are passed via a lua table. Only the values will be pulled for the dropdown items, the keys are irrelevant. Items will be sorted alphabetically. x and y are the optional location parameters, and width and height are the optional size parameters.")]
|
||||
public int Dropdown(
|
||||
int formHandle,
|
||||
public long Dropdown(
|
||||
long formHandle,
|
||||
[LuaArbitraryStringParam] LuaTable items,
|
||||
int? x = null,
|
||||
int? y = null,
|
||||
|
@ -202,13 +202,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
SetSize(dropdown, width.Value, height.Value);
|
||||
}
|
||||
|
||||
return (int)dropdown.Handle;
|
||||
return (long)dropdown.Handle;
|
||||
}
|
||||
|
||||
[LuaMethodExample("local stforget = forms.getproperty(332, \"Property\");")]
|
||||
[LuaMethod("getproperty", "returns a string representation of the value of a property of the widget at the given handle")]
|
||||
[return: LuaArbitraryStringParam]
|
||||
public string GetProperty(int handle, [LuaASCIIStringParam] string property)
|
||||
public string GetProperty(long handle, [LuaASCIIStringParam] string property)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -240,7 +240,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethodExample("local stforget = forms.gettext(332);")]
|
||||
[LuaMethod("gettext", "Returns the text property of a given form or control")]
|
||||
[return: LuaArbitraryStringParam]
|
||||
public string GetText(int handle)
|
||||
public string GetText(long handle)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -271,7 +271,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
[LuaMethodExample("if ( forms.ischecked( 332 ) ) then\r\n\tconsole.log( \"Returns the given checkbox's checked property\" );\r\nend;")]
|
||||
[LuaMethod("ischecked", "Returns the given checkbox's checked property")]
|
||||
public bool IsChecked(int handle)
|
||||
public bool IsChecked(long handle)
|
||||
{
|
||||
var ptr = new IntPtr(handle);
|
||||
foreach (var form in _luaForms)
|
||||
|
@ -301,8 +301,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethodExample("local inforlab = forms.label( 333, \"Caption\", 2, 48, 18, 24, false );")]
|
||||
[LuaMethod(
|
||||
"label", "Creates a label control on the given form. The caption property is the text of the label. x, and y are the optional location parameters for the position of the label within the given form. The function returns the handle of the created label. Width and Height are optional, if not specified they will be a default size.")]
|
||||
public int Label(
|
||||
int formHandle,
|
||||
public long Label(
|
||||
long formHandle,
|
||||
[LuaArbitraryStringParam] string caption,
|
||||
int? x = null,
|
||||
int? y = null,
|
||||
|
@ -335,13 +335,13 @@ namespace BizHawk.Client.EmuHawk
|
|||
SetSize(label, width.Value, height.Value);
|
||||
}
|
||||
|
||||
return (int)label.Handle;
|
||||
return (long)label.Handle;
|
||||
}
|
||||
|
||||
[LuaMethodExample("local infornew = forms.newform( 18, 24, \"Title\", function()\r\n\tconsole.log( \"creates a new default dialog, if both width and height are specified it will create a dialog of the specified size. If title is specified it will be the caption of the dialog, else the dialog caption will be 'Lua Dialog'. The function will return an int representing the handle of the dialog created.\" );\r\nend );")]
|
||||
[LuaMethod(
|
||||
"newform", "creates a new default dialog, if both width and height are specified it will create a dialog of the specified size. If title is specified it will be the caption of the dialog, else the dialog caption will be 'Lua Dialog'. The function will return an int representing the handle of the dialog created.")]
|
||||
public int NewForm(
|
||||
public long NewForm(
|
||||
int? width = null,
|
||||
int? height = null,
|
||||
[LuaArbitraryStringParam] string title = null,
|
||||
|
@ -376,7 +376,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
};
|
||||
|
||||
return (int)form.Handle;
|
||||
return (long)form.Handle;
|
||||
}
|
||||
|
||||
[LuaMethodExample(@"local filename = forms.openfile(""C:\filename.bin"", ""C:\"", ""Raster Images (*.bmp;*.gif;*.jpg;*.png)|*.bmp;*.gif;*.jpg;*.png|All Files (*.*)|*.*"")")]
|
||||
|
@ -400,7 +400,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethod(
|
||||
"pictureBox",
|
||||
"Creates a new drawing area in the form. Optionally the location in the form as well as the size of the drawing area can be specified. Returns the handle the component can be refered to with.")]
|
||||
public int PictureBox(int formHandle, int? x = null, int? y = null, int? width = null, int? height = null)
|
||||
public long PictureBox(long formHandle, int? x = null, int? y = null, int? width = null, int? height = null)
|
||||
{
|
||||
var form = GetForm(formHandle);
|
||||
if (form == null)
|
||||
|
@ -423,14 +423,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
SetSize(pictureBox, width.Value, height.Value);
|
||||
|
||||
return (int)pictureBox.Handle;
|
||||
return (long)pictureBox.Handle;
|
||||
}
|
||||
|
||||
[LuaMethodExample("forms.clear( 334, 0x000000FF );")]
|
||||
[LuaMethod(
|
||||
"clear",
|
||||
"Clears the canvas")]
|
||||
public void Clear(int componentHandle, [LuaColorParam] object color)
|
||||
public void Clear(long componentHandle, [LuaColorParam] object color)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -462,7 +462,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethod(
|
||||
"refresh",
|
||||
"Redraws the canvas")]
|
||||
public void Refresh(int componentHandle)
|
||||
public void Refresh(long componentHandle)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -493,7 +493,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethod(
|
||||
"setDefaultForegroundColor",
|
||||
"Sets the default foreground color to use in drawing methods, white by default")]
|
||||
public void SetDefaultForegroundColor(int componentHandle, [LuaColorParam] object color)
|
||||
public void SetDefaultForegroundColor(long componentHandle, [LuaColorParam] object color)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -525,7 +525,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethod(
|
||||
"setDefaultBackgroundColor",
|
||||
"Sets the default background color to use in drawing methods, transparent by default")]
|
||||
public void SetDefaultBackgroundColor(int componentHandle, [LuaColorParam] object color)
|
||||
public void SetDefaultBackgroundColor(long componentHandle, [LuaColorParam] object color)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -557,7 +557,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethod(
|
||||
"setDefaultTextBackground",
|
||||
"Sets the default backgroiund color to use in text drawing methods, half-transparent black by default")]
|
||||
public void SetDefaultTextBackground(int componentHandle, [LuaColorParam] object color)
|
||||
public void SetDefaultTextBackground(long componentHandle, [LuaColorParam] object color)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -589,7 +589,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethod(
|
||||
"drawBezier",
|
||||
"Draws a Bezier curve using the table of coordinates provided in the given color")]
|
||||
public void DrawBezier(int componentHandle, LuaTable points, [LuaColorParam] object color)
|
||||
public void DrawBezier(long componentHandle, LuaTable points, [LuaColorParam] object color)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -622,7 +622,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"drawBox",
|
||||
"Draws a rectangle on screen from x1/y1 to x2/y2. Same as drawRectangle except it receives two points intead of a point and width/height")]
|
||||
public void DrawBox(
|
||||
int componentHandle,
|
||||
long componentHandle,
|
||||
int x,
|
||||
int y,
|
||||
int x2,
|
||||
|
@ -662,7 +662,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"drawEllipse",
|
||||
"Draws an ellipse at the given coordinates and the given width and height. Line is the color of the ellipse. Background is the optional fill color")]
|
||||
public void DrawEllipse(
|
||||
int componentHandle,
|
||||
long componentHandle,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
|
@ -702,7 +702,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"drawIcon",
|
||||
"draws an Icon (.ico) file from the given path at the given coordinate. width and height are optional. If specified, it will resize the image accordingly")]
|
||||
public void DrawIcon(
|
||||
int componentHandle,
|
||||
long componentHandle,
|
||||
[LuaArbitraryStringParam] string path,
|
||||
int x,
|
||||
int y,
|
||||
|
@ -744,7 +744,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"drawImage",
|
||||
"draws an image file from the given path at the given coordinate. width and height are optional. If specified, it will resize the image accordingly")]
|
||||
public void DrawImage(
|
||||
int componentHandle,
|
||||
long componentHandle,
|
||||
[LuaArbitraryStringParam] string path,
|
||||
int x,
|
||||
int y,
|
||||
|
@ -786,7 +786,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethod(
|
||||
"clearImageCache",
|
||||
"clears the image cache that is built up by using gui.drawImage, also releases the file handle for cached images")]
|
||||
public void ClearImageCache(int componentHandle)
|
||||
public void ClearImageCache(long componentHandle)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -818,7 +818,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"drawImageRegion",
|
||||
"Draws a region of the given image file at the given location on the canvas, and optionally resizes it before drawing. On the TASVideos Wiki, consult this diagram to see its usage: [https://user-images.githubusercontent.com/13409956/198868522-55dc1e5f-ae67-4ebb-a75f-558656cb4468.png|alt=Diagram showing how to use forms.drawImageRegion]")]
|
||||
public void DrawImageRegion(
|
||||
int componentHandle,
|
||||
long componentHandle,
|
||||
[LuaArbitraryStringParam] string path,
|
||||
int source_x,
|
||||
int source_y,
|
||||
|
@ -863,7 +863,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethod(
|
||||
"drawLine",
|
||||
"Draws a line from the first coordinate pair to the 2nd. Color is optional (if not specified it will be drawn black)")]
|
||||
public void DrawLine(int componentHandle, int x1, int y1, int x2, int y2, [LuaColorParam] object color = null)
|
||||
public void DrawLine(long componentHandle, int x1, int y1, int x2, int y2, [LuaColorParam] object color = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -895,7 +895,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethod(
|
||||
"drawAxis",
|
||||
"Draws an axis of the specified size at the coordinate pair.)")]
|
||||
public void DrawAxis(int componentHandle, int x, int y, int size, [LuaColorParam] object color = null)
|
||||
public void DrawAxis(long componentHandle, int x, int y, int size, [LuaColorParam] object color = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -929,7 +929,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"draws a Arc shape at the given coordinates and the given width and height"
|
||||
)]
|
||||
public void DrawArc(
|
||||
int componentHandle,
|
||||
long componentHandle,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
|
@ -969,7 +969,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"drawPie",
|
||||
"draws a Pie shape at the given coordinates and the given width and height")]
|
||||
public void DrawPie(
|
||||
int componentHandle,
|
||||
long componentHandle,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
|
@ -1010,7 +1010,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethod(
|
||||
"drawPixel",
|
||||
"Draws a single pixel at the given coordinates in the given color. Color is optional (if not specified it will be drawn black)")]
|
||||
public void DrawPixel(int componentHandle, int x, int y, [LuaColorParam] object color = null)
|
||||
public void DrawPixel(long componentHandle, int x, int y, [LuaColorParam] object color = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -1043,7 +1043,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"drawPolygon",
|
||||
"Draws a polygon using the table of coordinates specified in points. This should be a table of tables(each of size 2). If x or y is passed, the polygon will be translated by the passed coordinate pair. Line is the color of the polygon. Background is the optional fill color")]
|
||||
public void DrawPolygon(
|
||||
int componentHandle,
|
||||
long componentHandle,
|
||||
LuaTable points,
|
||||
int? x = null,
|
||||
int? y = null,
|
||||
|
@ -1083,7 +1083,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"drawRectangle",
|
||||
"Draws a rectangle at the given coordinate and the given width and height. Line is the color of the box. Background is the optional fill color")]
|
||||
public void DrawRectangle(
|
||||
int componentHandle,
|
||||
long componentHandle,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
|
@ -1123,7 +1123,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"drawString",
|
||||
"Alias of DrawText()")]
|
||||
public void DrawString(
|
||||
int componentHandle,
|
||||
long componentHandle,
|
||||
int x,
|
||||
int y,
|
||||
[LuaArbitraryStringParam] string message,
|
||||
|
@ -1167,7 +1167,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"drawText",
|
||||
"Draws the given message at the given x,y coordinates and the given color. The default color is white. A fontfamily can be specified and is monospace generic if none is specified (font family options are the same as the .NET FontFamily class). The fontsize default is 12. The default font style is regular. Font style options are regular, bold, italic, strikethrough, underline. Horizontal alignment options are left (default), center, or right. Vertical alignment options are bottom (default), middle, or top. Alignment options specify which ends of the text will be drawn at the x and y coordinates.")]
|
||||
public void DrawText(
|
||||
int componentHandle,
|
||||
long componentHandle,
|
||||
int x,
|
||||
int y,
|
||||
[LuaArbitraryStringParam] string message,
|
||||
|
@ -1211,7 +1211,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethod(
|
||||
"getMouseX",
|
||||
"Returns an integer representation of the mouse X coordinate relative to the PictureBox.")]
|
||||
public int GetMouseX(int componentHandle)
|
||||
public int GetMouseX(long componentHandle)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -1244,7 +1244,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethod(
|
||||
"getMouseY",
|
||||
"Returns an integer representation of the mouse Y coordinate relative to the PictureBox.")]
|
||||
public int GetMouseY(int componentHandle)
|
||||
public int GetMouseY(long componentHandle)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -1275,7 +1275,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
[LuaMethodExample("forms.setdropdownitems(dropdown_handle, { \"item1\", \"item2\" });")]
|
||||
[LuaMethod("setdropdownitems", "Updates the item list of a dropdown menu. The optional third parameter toggles alphabetical sorting of items, pass false to skip sorting.")]
|
||||
public void SetDropdownItems(int handle, [LuaArbitraryStringParam] LuaTable items, bool alphabetize = true)
|
||||
public void SetDropdownItems(long handle, [LuaArbitraryStringParam] LuaTable items, bool alphabetize = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -1310,7 +1310,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
[LuaMethodExample("forms.setlocation( 332, 16, 32 );")]
|
||||
[LuaMethod("setlocation", "Sets the location of a control or form by passing in the handle of the created object")]
|
||||
public void SetLocation(int handle, int x, int y)
|
||||
public void SetLocation(long handle, int x, int y)
|
||||
{
|
||||
var ptr = new IntPtr(handle);
|
||||
foreach (var form in _luaForms)
|
||||
|
@ -1338,7 +1338,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// </exception>
|
||||
[LuaMethodExample("forms.setproperty( 332, \"Property\", \"Property value\" );")]
|
||||
[LuaMethod("setproperty", "Attempts to set the given property of the widget with the given value. Note: not all properties will be able to be represented for the control to accept")]
|
||||
public void SetProperty(int handle, [LuaASCIIStringParam] string property, object value)
|
||||
public void SetProperty(long handle, [LuaASCIIStringParam] string property, object value)
|
||||
{
|
||||
// relying on exceptions for error handling here
|
||||
void ParseAndSet(Control c)
|
||||
|
@ -1381,7 +1381,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
[LuaMethodExample("forms.setsize( 332, 77, 99 );")]
|
||||
[LuaMethod("setsize", "TODO")]
|
||||
public void SetSize(int handle, int width, int height)
|
||||
public void SetSize(long handle, int width, int height)
|
||||
{
|
||||
var ptr = new IntPtr(handle);
|
||||
foreach (var form in _luaForms)
|
||||
|
@ -1405,7 +1405,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
[LuaMethodExample("forms.settext( 332, \"Caption\" );")]
|
||||
[LuaMethod("settext", "Sets the text property of a control or form by passing in the handle of the created object")]
|
||||
public void Settext(int handle, [LuaArbitraryStringParam] string caption)
|
||||
public void Settext(long handle, [LuaArbitraryStringParam] string caption)
|
||||
{
|
||||
var ptr = new IntPtr(handle);
|
||||
foreach (var form in _luaForms)
|
||||
|
@ -1430,8 +1430,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
[LuaMethodExample("local infortex = forms.textbox( 333, \"Caption\", 18, 24, \"HEX\", 2, 48, true, false, \"Both\" );")]
|
||||
[LuaMethod(
|
||||
"textbox", "Creates a textbox control on the given form. The caption property will be the initial value of the textbox (default is empty). Width and Height are option, if not specified they will be a default size of 100, 20. Type is an optional property to restrict the textbox input. The available options are HEX, SIGNED, and UNSIGNED. Passing it null or any other value will set it to no restriction. x, and y are the optional location parameters for the position of the textbox within the given form. The function returns the handle of the created textbox. If true, the multiline will enable the standard winform multi-line property. If true, the fixedWidth options will create a fixed width font. Scrollbars is an optional property to specify which scrollbars to display. The available options are Vertical, Horizontal, Both, and None. Scrollbars are only shown on a multiline textbox")]
|
||||
public int Textbox(
|
||||
int formHandle,
|
||||
public long Textbox(
|
||||
long formHandle,
|
||||
[LuaArbitraryStringParam] string caption = null,
|
||||
int? width = null,
|
||||
int? height = null,
|
||||
|
@ -1510,7 +1510,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
form.Controls.Add(textbox);
|
||||
return (int)textbox.Handle;
|
||||
return (long)textbox.Handle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue