public int NewForm(int?width = null, int?height = null, string title = null, LuaFunction onClose = null)
        {
            var form = new LuaWinform(CurrentThread);

            _luaForms.Add(form);
            if (width.HasValue && height.HasValue)
            {
                form.Size = new Size(width.Value, height.Value);
            }

            form.Text            = title;
            form.MaximizeBox     = false;
            form.FormBorderStyle = FormBorderStyle.FixedDialog;
            form.Icon            = SystemIcons.Application;
            form.Show();

            form.FormClosed += (o, e) =>
            {
                if (onClose != null)
                {
                    try
                    {
                        onClose.Call();
                    }
                    catch (Exception ex)
                    {
                        Log(ex.ToString());
                    }
                }
            };

            return((int)form.Handle);
        }
Exemplo n.º 2
0
        private void DoLuaClick(object sender, EventArgs e)
        {
            LuaWinform parent = Parent as LuaWinform;

            if (parent != null)
            {
                parent.DoLuaEvent(Handle);
            }
        }
Exemplo n.º 3
0
        public int NewForm(int?width = null, int?height = null, string title = null, LuaFunction onClose = null)
        {
            var form = new LuaWinform(CurrentThread);

            form.BackColor = Color.LightSteelBlue;
            FontFamily sans = FontFamily.GenericSansSerif;

            form.Font = new Font("sans-serif", 10);
            Form1 f = new Form1();

            f.BackColor = Color.White;
            f.Show();
            f.ControlBox      = false;
            f.FormBorderStyle = FormBorderStyle.None;
            f.Dock            = DockStyle.Bottom;
            f.TopLevel        = false;
            form.Controls.Add(f);

            _luaForms.Add(form);
            if (width.HasValue && height.HasValue)
            {
                form.Size = new Size(width.Value, height.Value);
            }

            form.Text            = title;
            form.MaximizeBox     = false;
            form.FormBorderStyle = FormBorderStyle.FixedSingle;
            form.Icon            = SystemIcons.Application;
            form.Show();

            form.FormClosed += (o, e) =>
            {
                if (onClose != null)
                {
                    try
                    {
                        f.Close();
                        onClose.Call();
                    }
                    catch (Exception ex)
                    {
                        Log(ex.ToString());
                    }
                }
            };

            return((int)form.Handle);
        }
Exemplo n.º 4
0
        public int NewForm(int?width = null, int?height = null, string title = null)
        {
            var form = new LuaWinform();

            _luaForms.Add(form);
            if (width.HasValue && height.HasValue)
            {
                form.Size = new Size(width.Value, height.Value);
            }

            form.Text            = title;
            form.MaximizeBox     = false;
            form.FormBorderStyle = FormBorderStyle.FixedDialog;
            form.Icon            = SystemIcons.Application;
            form.Show();
            return((int)form.Handle);
        }
Exemplo n.º 5
0
		public int NewForm(int? width = null, int? height = null, string title = null)
		{
			var form = new LuaWinform();
			_luaForms.Add(form);
			if (width.HasValue && height.HasValue)
			{
				form.Size = new Size(width.Value, height.Value);
			}

			form.Text = title;
            form.MaximizeBox = false;
            form.FormBorderStyle = FormBorderStyle.FixedDialog;
            form.Icon = SystemIcons.Application;
			form.Show();
			return (int)form.Handle;
		}
Exemplo n.º 6
0
        private void DoLuaClick(object sender, EventArgs e)
        {
            LuaWinform parent = Parent as LuaWinform;

            parent?.DoLuaEvent(Handle);
        }
Exemplo n.º 7
0
		public int NewForm(int? width = null, int? height = null, string title = null, LuaFunction onClose = null)
		{
			var form = new LuaWinform();
			_luaForms.Add(form);
			if (width.HasValue && height.HasValue)
			{
				form.Size = new Size(width.Value, height.Value);
			}

			form.Text = title;
			form.MaximizeBox = false;
			form.FormBorderStyle = FormBorderStyle.FixedDialog;
			form.Icon = SystemIcons.Application;
			form.Show();

			form.FormClosed += (o, e) =>
			{
				if (onClose != null)
				{
					try
					{
						onClose.Call();
					}
					catch (Exception ex)
					{
						Log(ex.ToString());
					}
				}
			};

			return (int)form.Handle;
		}