コード例 #1
0
 public void scheduleRedraw(RTControl r)
 {
     if (!redrawControls.Contains(r))
     {
         redrawControls.Add(r);
     }
 }
コード例 #2
0
ファイル: RTForm.cs プロジェクト: 101010b/AudioProcessor2
        public void updateFromRoot()
        {
            SystemPanel p = owner;

            if (p == null)
            {
                return;
            }
            RectangleF rf;

            if (_shrinked)
            {
                Vector dimS = Vector.V(_shrinkSize.Width, _shrinkSize.Height);
                rf = p.toScreenRF(center - dimS / 2, dimS);
            }
            else
            {
                rf = p.toScreenRF(center - dim / 2, dim);
            }
            Point loc = new Point((int)Math.Floor(rf.Left + 0.5), (int)Math.Floor(rf.Top + 0.5));

            scale    = p.scale;
            Width    = (int)Math.Floor(rf.Width + 0.5);
            Height   = (int)Math.Floor(rf.Height + 0.5);
            Location = loc;
            foreach (Control c in Controls)
            {
                if ((c.GetType()).IsSubclassOf(typeof(RTControl)))
                {
                    RTControl cc = (RTControl)c;
                    cc.rescaleFromRoot(scale);
                }
            }
            Invalidate();
        }
コード例 #3
0
ファイル: RTForm.cs プロジェクト: 101010b/AudioProcessor2
 public void storePosData()
 {
     center   = Vector.V(0, 0);
     dim      = Vector.V(Width, Height);
     _orgSize = new Size(Width, Height);
     foreach (Control c in Controls)
     {
         if (c is RTControl)
         {
             RTControl cc = (RTControl)c;
             cc.setOrg();
         }
     }
 }
コード例 #4
0
ファイル: RTForm.cs プロジェクト: 101010b/AudioProcessor2
 private void setShrinkMode(bool _shrink)
 {
     if (_shrink == _shrinked)
     {
         return;
     }
     _shrinked = _shrink;
     if (_shrinked)
     {
         foreach (Control ct in Controls)
         {
             // if ((ct is RTControl) && !(ct is RTIO))
             if ((ct is RTControl) && (((RTControl)ct).hideOnShrink))
             {
                 RTControl c = (RTControl)ct;
                 c.Shrink(true);
             }
         }
         int w = (int)Math.Floor(_shrinkSize.Width * scale + 0.5);
         int h = (int)Math.Floor(_shrinkSize.Height * scale + 0.5);
         if (w < 1)
         {
             w = 1;
         }
         if (h < 1)
         {
             h = 1;
         }
         int ofsx = (Width - w) / 2;
         int ofsy = (Height - h) / 2;
         Width  = w;
         Height = h;
         Point newp = new Point(Location.X + ofsx, Location.Y + ofsy);
         Location = newp;
         Invalidate();
         owner?.Invalidate();
     }
     else
     {
         foreach (Control ct in Controls)
         {
             // if ((ct is RTControl) && !(ct is RTIO))
             if ((ct is RTControl) && (((RTControl)ct).hideOnShrink))
             {
                 RTControl c = (RTControl)ct;
                 c.Shrink(false);
             }
         }
         int w = (int)Math.Floor(dim.x * scale + 0.5);
         int h = (int)Math.Floor(dim.y * scale + 0.5);
         if (w < 1)
         {
             w = 1;
         }
         if (h < 1)
         {
             h = 1;
         }
         int ofsx = (Width - w) / 2;
         int ofsy = (Height - h) / 2;
         Width  = w;
         Height = h;
         Point newp = new Point(Location.X + ofsx, Location.Y + ofsy);
         Location = newp;
         Invalidate();
         owner?.Invalidate();
     }
 }