Exemplo n.º 1
0
 public Distance(Control c, DistanceOrientation o, DistanceUnits u, double v)
 {
     this.control = c;
     this.orientation = o;
     this.units = u;
     this.val = v;
 }
Exemplo n.º 2
0
        public override void RenderControl(Control c, IGraphics g)
        {
            for (int i = 0; i < styleNames.Count; i++)
            {
                List<Location> locs = styleLocations[i];
                List<Path> paths = stylePaths[i];

                if (styleNames[i] != (string)c.Style)
                    continue;
                if (styleTypes[i] != c.GetType())
                {
                    if ((c.GetType().Assembly == Assembly.GetExecutingAssembly()) || !c.GetType().IsSubclassOf(styleTypes[i]))
                        continue;
                }
                if ((styleStates[i] & c.State) != styleStates[i])
                    continue;

                PatternList plist = styleOperations[i];

                for (int j = 0; j < plist.Count; j++)
                {
                    g.Save();

                    Path path = (paths[j] != null) ? paths[j].Clone() : c.Path.Clone();
                    path.Control = c;

                    if (locs[j] != null)
                    {
                        // This is a little hackish, but I can't think of a better way
                        // Without reworking major chunks of the geometry classes

                        Control tmp = new Control();
                        tmp.Path = path;
                        tmp.Parent = c;
                        path.Control = tmp;

                        Location loc = locs[j].Clone();
                        loc.Control = tmp;

                        g.Translate(loc.RealL, loc.RealT);
                        loc.HandleRel();

                        path = tmp.Path.ClonePixels();
                        tmp.Parent = null;
                    }

                    path.Apply(g);

                    plist[j].Apply(g, path.W, path.H);

                    if (plist[j].Type == PatternType.Fill)
                        g.Fill();
                    else
                        g.Stroke();

                    g.Restore();
                }
            }
        }
Exemplo n.º 3
0
 public Padding(Control C, Distance L, Distance T, Distance R, Distance B)
 {
     this.control = C;
     this.l = L;
     this.t = T;
     this.r = R;
     this.b = B;
 }
Exemplo n.º 4
0
 public Margin(Control C, Distance L, Distance T, Distance R, Distance B)
 {
     this.control = C;
     this.l = L;
     this.t = T;
     this.r = R;
     this.b = B;
 }
Exemplo n.º 5
0
        public override string[] GetStyles(Control c)
        {
            List<string> styles = new List<string>();

            for (int i = 0; i < styleNames.Count; i++)
            {
                if (styleTypes[i] == c.GetType())
                    styles.Add(styleNames[i]);

                if ((c.GetType().Assembly != Assembly.GetExecutingAssembly()) && c.GetType().IsSubclassOf(styleTypes[i]))
                    styles.Add(styleNames[i]);
            }

            return styles.ToArray();
        }
Exemplo n.º 6
0
 public override void InitControl(Control c)
 {
     c.ThemerData = ""; // Needs to be non-null to know its been initialized
 }
Exemplo n.º 7
0
 public override void SetStyle(Control c, string style)
 {
 }
Exemplo n.º 8
0
 public override bool StealChildMouse(Control child, Distance X, Distance Y)
 {
     return true;
 }
Exemplo n.º 9
0
        Control _GetControlByIDRecursive(string id, Control c)
        {
            if (c.ID == id)
                return c;

            foreach (Control child in c.Children)
            {
                Control tmp = _GetControlByIDRecursive(id, child);

                if (tmp != null)
                    return tmp;
            }

            return null;
        }
Exemplo n.º 10
0
        bool _MouseMoveRecursive(Control c, double X, double Y)
        {
            if (!c.Visible)
                return false;

            if (c.Path.Contains(X, Y))
            {
                bool overchild = false;

                foreach (Control child in c.Children)
                {
                    bool cr = _MouseMoveRecursive(child, X - child.renderLocation.RealL, Y - child.renderLocation.RealT);

                    if (cr)
                        cr &= !c.StealChildMouse(child, X, Y);

                    overchild |= cr;
                }

                if (!overchild)
                    mouseOverControl = c;

                return true;
            }

            return false;
        }
Exemplo n.º 11
0
 public virtual void RenderControl(Control c, IGraphics g)
 {
 }
Exemplo n.º 12
0
 public virtual void InitControl(Control c)
 {
 }
Exemplo n.º 13
0
 public void Save(Control ctl, XmlElement parentNode)
 {
 }
Exemplo n.º 14
0
 public virtual bool StealChildMouse(Control child, Distance X, Distance Y)
 {
     return false;
 }
Exemplo n.º 15
0
        public virtual void OnParented(Control parent)
        {
            if (this.Window != null)
            {
                if (this.CanActivate() && (this.Window.ActiveControl == null))
                    this.Window.ActiveControl = this;
            }

            PositionChildren();
        }
Exemplo n.º 16
0
 public virtual void OnChildRemoved(Control child)
 {
     PositionChildren();
 }
Exemplo n.º 17
0
 public virtual void SetStyle(Control c, string style)
 {
 }
Exemplo n.º 18
0
 void backendMouseRelease(object sender, MouseEventArgs e)
 {
     if (mouseDownControl != null)
     {
         mouseDownControl.OnMouseRelease(new MouseEventArgs(e.Button, e.X - mouseDownControl.OffsetLocation.RealL, e.Y - mouseOverControl.OffsetLocation.RealT));
         mouseDownControl = null;
     }
 }
Exemplo n.º 19
0
 public virtual string[] GetStyles(Control c)
 {
     return new string[0];
 }