void PushRect(IntPtr L, Rect rt) { LuaDLL.lua_getref(L, NewRect.GetReference()); LuaDLL.lua_pushnumber(L, rt.xMin); LuaDLL.lua_pushnumber(L, rt.yMin); LuaDLL.lua_pushnumber(L, rt.width); LuaDLL.lua_pushnumber(L, rt.height); LuaDLL.lua_call(L, 4, 1); }
protected bool DetectionMousePoint(Point point) { //Thread.Sleep(10); CurrentClickType = BtnClickType.None; SelectRect.Width = 0; if (CloseRect.Contains(point)) { CurrentClickType = BtnClickType.Close; SelectRect = CloseRect; } else if (MaxRect.Contains(point)) { CurrentClickType = BtnClickType.Max; SelectRect = MaxRect; } else if (MinRect.Contains(point)) { CurrentClickType = BtnClickType.Min; SelectRect = MinRect; } else if (OpenRect.Contains(point)) { CurrentClickType = BtnClickType.Open; SelectRect = OpenRect; } else if (SaveRect.Contains(point)) { CurrentClickType = BtnClickType.Save; SelectRect = SaveRect; } else if (NewRect.Contains(point)) { CurrentClickType = BtnClickType.New; SelectRect = NewRect; } if (SelectRect.Width > 0) { SelectRect.Inflate(5, 5); } return(CurrentClickType != BtnClickType.None); }