private static void magix_forms_get_style(object sender, ActiveEventArgs e) { Node ip = Ip(e.Params); if (ShouldInspect(ip)) { AppendInspectFromResource( ip["inspect"], "Magix.forms", "Magix.forms.hyperlisp.inspect.hl", "[magix.forms.get-style-dox].value"); AppendCodeFromResource( ip, "Magix.forms", "Magix.forms.hyperlisp.inspect.hl", "[magix.forms.get-style-sample]"); return; } Node dp = Dp(e.Params); BaseWebControl ctrl = FindControl <BaseWebControl>(e.Params); ip["value"].Value = ctrl.Style[Expressions.GetExpressionValue <string>(ip["key"].Get <string>(), dp, ip, false)]; }
private static void magix_forms_set_style(object sender, ActiveEventArgs e) { Node ip = Ip(e.Params); if (ShouldInspect(ip)) { AppendInspectFromResource( ip["inspect"], "Magix.forms", "Magix.forms.hyperlisp.inspect.hl", "[magix.forms.set-style-dox].value"); AppendCodeFromResource( ip, "Magix.forms", "Magix.forms.hyperlisp.inspect.hl", "[magix.forms.set-style-sample]"); return; } Node dp = Dp(e.Params); BaseWebControl ctrl = FindControl <BaseWebControl>(e.Params); string key = Expressions.GetFormattedExpression("key", e.Params, ""); if (string.IsNullOrEmpty(key)) { throw new Exception("no [key] given to [magix.forms.set-style]"); } string value = Expressions.GetFormattedExpression("value", e.Params, ""); ctrl.Style[key] = value; }
protected override string RenderImplementation(bool topLevel, System.Collections.Generic.List <Effect> chainedEffects) { BaseWebControl tmp = this.Control as BaseWebControl; if (tmp != null) { tmp.Style.SetStyleValueViewStateOnly("display", "none"); } return(base.RenderImplementation(topLevel, chainedEffects)); }
protected override string RenderImplementation(bool topLevel, List <Effect> chainedEffects) { BaseWebControl tmp = this.Control as BaseWebControl; if (tmp != null) { tmp.Style.SetStyleValueViewStateOnly("border-style", "dashed"); tmp.Style.SetStyleValueViewStateOnly("border-width", BorderTo + "px"); } return(base.RenderImplementation(topLevel, chainedEffects)); }
protected override string RenderImplementation(bool topLevel, List <Effect> chainedEffects) { BaseWebControl tmp = this.Control as BaseWebControl; if (tmp != null) { tmp.Style.SetStyleValueViewStateOnly("display", "block"); tmp.Style.SetStyleValueViewStateOnly("height", ""); } return(base.RenderImplementation(topLevel, chainedEffects)); }
protected override string RenderImplementation( bool topLevel, List <Effect> chainedEffects) { BaseWebControl ctrl = Control as BaseWebControl; if (ctrl != null) { ctrl.SetViewStateValue("CssClass", _cssClass); } return(base.RenderImplementation(topLevel, chainedEffects)); }
protected override string RenderImplementation(bool topLevel, System.Collections.Generic.List <Effect> chainedEffects) { Control.Visible = true; BaseWebControl tmp = Control as BaseWebControl; if (tmp != null) { tmp.Style.SetStyleValueViewStateOnly("opacity", "1.0"); tmp.Style.SetStyleValueViewStateOnly("display", ""); } return(base.RenderImplementation(topLevel, chainedEffects)); }
protected override string RenderImplementation(bool topLevel, System.Collections.Generic.List <Effect> chainedEffects) { BaseWebControl tmp = this.Control as BaseWebControl; if (tmp != null) { if (_left != -1) { tmp.Style.SetStyleValueViewStateOnly("left", _left.ToString() + "px"); } if (_top != -1) { tmp.Style.SetStyleValueViewStateOnly("top", _top.ToString() + "px"); } } return(base.RenderImplementation(topLevel, chainedEffects)); }
protected override string RenderImplementation(bool topLevel, List <Effect> chainedEffects) { BaseWebControl tmp = this.Control as BaseWebControl; if (tmp != null) { if (_height != -1) { tmp.Style.SetStyleValueViewStateOnly("height", this._height.ToString() + "px"); } if (_width != -1) { tmp.Style.SetStyleValueViewStateOnly("width", this._width.ToString() + "px"); } } return(base.RenderImplementation(topLevel, chainedEffects)); }
private static void magix_forms_set_title(object sender, ActiveEventArgs e) { Node ip = Ip(e.Params); if (ShouldInspect(ip)) { AppendInspectFromResource( ip["inspect"], "Magix.forms", "Magix.forms.hyperlisp.inspect.hl", "[magix.forms.set-title-dox].value"); AppendCodeFromResource( ip, "Magix.forms", "Magix.forms.hyperlisp.inspect.hl", "[magix.forms.set-title-sample]"); return; } BaseWebControl ctrl = FindControl <BaseWebControl>(e.Params); ctrl.Title = Expressions.GetFormattedExpression("value", e.Params, ""); }
private static void magix_forms_get_class(object sender, ActiveEventArgs e) { Node ip = Ip(e.Params); if (ShouldInspect(ip)) { AppendInspectFromResource( ip["inspect"], "Magix.forms", "Magix.forms.hyperlisp.inspect.hl", "[magix.forms.get-class-dox].value"); AppendCodeFromResource( ip, "Magix.forms", "Magix.forms.hyperlisp.inspect.hl", "[magix.forms.get-class-sample]"); return; } BaseWebControl ctrl = FindControl <BaseWebControl>(e.Params); ip["value"].Value = ctrl.Class; }
/* * fills out the stuff from basewebcontrol */ protected override void FillOutParameters(Node pars, BaseControl ctrl) { base.FillOutParameters(pars, ctrl); BaseWebControl that = ctrl as BaseWebControl; Node ip = Ip(pars); Node node = ip["_code"].Get <Node>(); if (node.ContainsValue("class")) { that.Class = node["class"].Get <string>(); } if (node.ContainsValue("dir")) { that.Dir = node["dir"].Get <string>(); } if (node.ContainsValue("tabindex")) { that.TabIndex = node["tabindex"].Get <string>(); } if (node.ContainsValue("title")) { that.Title = node["title"].Get <string>(); } if (node.ContainsValue("style")) { string[] styles = node["style"].Get <string>().Replace("\n", "").Replace("\r", "").Split( new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); foreach (string idxStyle in styles) { that.Style[idxStyle.Split(':')[0]] = idxStyle.Split(':')[1]; } } if (ShouldHandleEvent("onclick", node)) { Node codeNode = node["onclick"].Clone(); that.Click += delegate(object sender, EventArgs e) { FillOutEventInputParameters(codeNode, sender); RaiseActiveEvent( "magix.execute", codeNode); }; } if (ShouldHandleEvent("ondblclick", node)) { Node codeNode = node["ondblclick"].Clone(); that.DblClick += delegate(object sender, EventArgs e) { FillOutEventInputParameters(codeNode, sender); RaiseActiveEvent( "magix.execute", codeNode); }; } if (ShouldHandleEvent("onmousedown", node)) { Node codeNode = node["onmousedown"].Clone(); that.MouseDown += delegate(object sender, EventArgs e) { FillOutEventInputParameters(codeNode, sender); RaiseActiveEvent( "magix.execute", codeNode); }; } if (ShouldHandleEvent("onmouseup", node)) { Node codeNode = node["onmouseup"].Clone(); that.MouseUp += delegate(object sender, EventArgs e) { FillOutEventInputParameters(codeNode, sender); RaiseActiveEvent( "magix.execute", codeNode); }; } if (ShouldHandleEvent("onmouseover", node)) { Node codeNode = node["onmouseover"].Clone(); that.MouseOver += delegate(object sender, EventArgs e) { FillOutEventInputParameters(codeNode, sender); RaiseActiveEvent( "magix.execute", codeNode); }; } if (ShouldHandleEvent("onmouseout", node)) { Node codeNode = node["onmouseout"].Clone(); that.MouseOut += delegate(object sender, EventArgs e) { FillOutEventInputParameters(codeNode, sender); RaiseActiveEvent( "magix.execute", codeNode); }; } if (ShouldHandleEvent("onkeypress", node)) { Node codeNode = node["onkeypress"].Clone(); that.KeyPress += delegate(object sender, EventArgs e) { FillOutEventInputParameters(codeNode, sender); RaiseActiveEvent( "magix.execute", codeNode); }; } if (ShouldHandleEvent("onesc", node)) { Node codeNode = node["onesc"].Clone(); that.Esc += delegate(object sender, EventArgs e) { FillOutEventInputParameters(codeNode, sender); RaiseActiveEvent( "magix.execute", codeNode); }; } }
internal StyleCollection(BaseWebControl control) { _control = control; _control.PreRender += new EventHandler(_control_PreRender); }