Exemplo n.º 1
0
 public static void DisableUI(UIControls controls)
 {
     foreach (IControlItem control in controls)
     {
         control.myControl.Enabled = false;
     }
 }
Exemplo n.º 2
0
 ////////////////////////////////////////////////////////
 public static void EnableUI(UIControls controls)
 {
     foreach (ControlItem control in controls)
     {
         control.myControl.Enabled = true;
     }
 }
Exemplo n.º 3
0
 public static void ScaleAllControls(UIControls controls, SizeF factor)
 {
     foreach (IControlItem control in controls as UIControls)
     {
         control.myControl.Scale(factor);
     }
 }
Exemplo n.º 4
0
 public static void EnableUI(CONTROL_PAGE page, UIControls controls)
 {
     foreach (ControlItem control in controls)
     {
         if (control.catogory == page)
         {
             control.myControl.Enabled = true;
         }
     }
 }
Exemplo n.º 5
0
        public static void MoveRelativeToSizeChange(UIControls controls, SizeF change)
        {
            Point newLoc = new Point();

            foreach (IControlItem control in controls as UIControls)
            {
                newLoc.X = (int)(control.myAnchor.X * (float)change.Width);
                newLoc.Y = (int)(control.myAnchor.Y * (float)change.Height);
                control.myControl.Location = newLoc;
            }
        }
Exemplo n.º 6
0
        public static void EnableUI(Type controlType, UIControls controls)
        {
            Type type;

            foreach (ControlItem control in controls)
            {
                type = control.myControl.GetType();
                if (type == controlType)
                {
                    control.myControl.Enabled = true;
                }
            }
        }
Exemplo n.º 7
0
        public static void DisableUI(CONTROL_PAGE page, Type controlType, UIControls controls)
        {
            Type type;

            foreach (IControlItem control in controls)
            {
                type = control.myControl.GetType();
                if (type == controlType && control.catogory == page)
                {
                    control.myControl.Enabled = false;
                }
            }
        }
Exemplo n.º 8
0
        public static void AdjustEverything(UIControls controls, Form form, ref Size formBeforeSize)
        {
            Size formAfterSize = form.Size;

            if (formBeforeSize.Height == 0 || formBeforeSize.Width == 0)
            {
                throw new DivideByZeroException("Attempted to divide by zero");
            }

            float factorHeight = (float)formAfterSize.Height / (float)formBeforeSize.Height;
            float factorWidth  = (float)formAfterSize.Width / (float)formBeforeSize.Width;

            SizeF change = new SizeF(factorWidth, factorHeight);

            ScaleAllControls(controls, change);
            MoveRelativeToSizeChange(controls, change);
        }
Exemplo n.º 9
0
 public static int RemoveControl(UIControls controls, Control controlToRemove, Form form)
 {
     controls.RemoveControl(controlToRemove, form);
     return(controls.Count());
 }