public void MoveToQuadrant(Quadrant quad, bool activeQuad) { //TODO: Move to quadrant /* * int x = quad.X; * int y = quad.Y; * int width = quad.Width; * int height = quad.Height; * * // Make sure table ratio & size doesn't exeed quadrant dimenzions * if (width > MaxTableSize.Width) * width = MaxTableSize.Width; * else if (width < MinTableSize.Width) * width = MinTableSize.Width; * * height = Convert.ToInt32((double)width * GetAspectRatio((int)width)); * * // Save the previous location * if (Quadrant != Settings.ActiveTableQuadrant) * Win32.GetWindowRect(WindowHandle, ref lastLocation); * * // Move the window * Win32.SetWindowPos(WindowHandle, (int)Win32.HWND.NOTOPMOST, x, y, width, height, (uint)Win32.SWP.NOOWNERZORDER); * * // Set the tables quad location * Quadrant = quad.Number; */ }
/// <summary> /// Returns the desired quad, if it does not exist, top left is returned /// </summary> /// <param name="quad"></param> /// <returns></returns> public static Quadrant GetQuad(int quad) { string quadText = GetSetting("Quadrants", "0,0,796,579"); Quadrant q = new Quadrant(); if (!quadText.Contains(",")) { q.X = 0; q.Y = 0; q.Width = 796; q.Height = 579; q.Number = quad; } else { string[] quads = quadText.Split(';'); string[] quadData = quads[quad - 1].Split(','); q.X = Convert.ToInt32(quadData[0]); q.Y = Convert.ToInt32(quadData[1]); q.Width = Convert.ToInt32(quadData[2]); q.Height = Convert.ToInt32(quadData[3]); q.Number = quad; } return(q); }
public void MoveToQuadrant(Quadrant quad, bool activeQuad) { //TODO: Move to quadrant /* int x = quad.X; int y = quad.Y; int width = quad.Width; int height = quad.Height; // Make sure table ratio & size doesn't exeed quadrant dimenzions if (width > MaxTableSize.Width) width = MaxTableSize.Width; else if (width < MinTableSize.Width) width = MinTableSize.Width; height = Convert.ToInt32((double)width * GetAspectRatio((int)width)); // Save the previous location if (Quadrant != Settings.ActiveTableQuadrant) Win32.GetWindowRect(WindowHandle, ref lastLocation); // Move the window Win32.SetWindowPos(WindowHandle, (int)Win32.HWND.NOTOPMOST, x, y, width, height, (uint)Win32.SWP.NOOWNERZORDER); // Set the tables quad location Quadrant = quad.Number; */ }
/// <summary> /// Returns the desired quad, if it does not exist, top left is returned /// </summary> /// <param name="quad"></param> /// <returns></returns> public static Quadrant GetQuad(int quad) { string quadText = GetSetting("Quadrants", "0,0,796,579"); Quadrant q = new Quadrant(); if (!quadText.Contains(",")) { q.X = 0; q.Y = 0; q.Width = 796; q.Height = 579; q.Number = quad; } else { string[] quads = quadText.Split(';'); string[] quadData = quads[quad - 1].Split(','); q.X = Convert.ToInt32(quadData[0]); q.Y = Convert.ToInt32(quadData[1]); q.Width = Convert.ToInt32(quadData[2]); q.Height = Convert.ToInt32(quadData[3]); q.Number = quad; } return q; }