public Distance(Control c, DistanceOrientation o, DistanceUnits u, double v) { this.control = c; this.orientation = o; this.units = u; this.val = v; }
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(); } } }
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; }
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; }
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(); }
public override void InitControl(Control c) { c.ThemerData = ""; // Needs to be non-null to know its been initialized }
public override void SetStyle(Control c, string style) { }
public override bool StealChildMouse(Control child, Distance X, Distance Y) { return true; }
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; }
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; }
public virtual void RenderControl(Control c, IGraphics g) { }
public virtual void InitControl(Control c) { }
public void Save(Control ctl, XmlElement parentNode) { }
public virtual bool StealChildMouse(Control child, Distance X, Distance Y) { return false; }
public virtual void OnParented(Control parent) { if (this.Window != null) { if (this.CanActivate() && (this.Window.ActiveControl == null)) this.Window.ActiveControl = this; } PositionChildren(); }
public virtual void OnChildRemoved(Control child) { PositionChildren(); }
public virtual void SetStyle(Control c, string style) { }
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; } }
public virtual string[] GetStyles(Control c) { return new string[0]; }