示例#1
0
		public void ConfigureButton(PushButton btn) {
			btn
				.Rendering
					.SetPrettyRender(true)
				.Finish()
				.Options
					.SetDisabled(this.disabled)
					.SetText(this.text)
					.SetIcons(this.primaryIcon, this.secondaryIcon)
				.Finish()
			;

			if (!string.IsNullOrEmpty(this.renderAs)) {
				Core.ButtonType.eButtonType inputType = Core.ButtonType.StringToButtonType(this.renderAs);
				btn.RenderAs(inputType);
				if (inputType == Core.ButtonType.eButtonType.Hyperlink)
					// just to make things look right
					btn.Href = "#";
			}

			if (this.showEvents) {
				btn.Events
					.SetCreateEvent("createEvent(event, ui);")
					.SetClickEvent("clickEvent();")
				.Finish();
			}
			if (!this.prettyRender)
				btn.Rendering.Compress();
			if (this.renderCSS)
				btn.Rendering.ShowCSS();
		}
示例#2
0
		internal static Fluqi.Widget.jPushButton.PushButton SetupSimpleButtonObject(TextWriter writer) 
		{
			// nothing special, just create a simple dummy tab helper as a starting point 
			// (saves having the same code everywhere!)
			Fluqi.Widget.jPushButton.PushButton btn = new Fluqi.Widget.jPushButton.PushButton(writer, "btn", "my button label");

			return btn;
		}
示例#3
0
		public string CSharpCode(PushButton btn) {
			jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 0);

			sb.AppendTabsLineIf("<%");
			sb.AppendTabsFormatLineIf("Html.CreateButton(\"{0}\", \"{1}\")", btn.ID, this.label);

			string optionsCode = OptionsCSharpCode();
			string showEventsCode = ShowEventsCSharpCode();
			string renderCode = base.RenderCSharpCode();
			bool showOptions = (optionsCode.Length > 0 || showEventsCode.Length > 0 || renderCode.Length > 0);
			
			if (showOptions) {
				sb.IncIndent();

				if (optionsCode.Length > 0) {
					sb.AppendTabsLineIf(".Options");
					sb.IncIndent();
					sb.Append(optionsCode);			
					sb.DecIndent();
					sb.AppendTabsLineIf(".Finish()");
				}	
				if (showEventsCode.Length > 0) {
					sb.AppendTabsLineIf(".Events");
					sb.IncIndent();
					sb.Append(showEventsCode);
					sb.DecIndent();
					sb.AppendTabsLineIf(".Finish()");
				}

				if (renderCode.Length > 0)
					sb.Append(renderCode);
				sb.DecIndent();
			}
			sb.AppendTabsLineIf(".Render();");
			sb.AppendTabsLineIf("%>");

			return sb.ToString();	
		}
示例#4
0
		/// <summary>
		/// Creates a Button control (see http://jqueryui.com/demos/button/ for details) that can be 
		/// later configured and rendered to the page.
		/// </summary>
		/// <param name="page">WebForms page to render the control onto</param>
		/// <param name="id">ID to give to the accordion (must be unique on the page)</param>
		/// <param name="label">Text to appear on the button</param>
		/// <returns>Created Button control</returns>
		public static PushButton CreateButton(this System.Web.UI.Page page, string id, string label) {
			TextWriter writer = page.Response.Output;
			PushButton btn = new PushButton(writer, id, label);

			return btn;
		}
示例#5
0
		/// <summary>
		/// Creates a Button control (see http://jqueryui.com/demos/button/ for details) that can be 
		/// later configured and rendered to the page.
		/// </summary>
		/// <param name="html">Html helper (used to get the HttpResponse object to render onto)</param>
		/// <param name="id">ID to give to the accordion (must be unique on the page)</param>
		/// <param name="label">Text to appear on the button</param>
		/// <returns>Created Button control</returns>
		public static PushButton CreateButton(this HtmlHelper html, string id, string label) {
			TextWriter writer = html.ViewContext.Writer;
			PushButton btn = new PushButton(writer, id, label);

			return btn;
		}
示例#6
0
		public void ConfigureButtons(PushButton back, PushButton next, PushButton finish) {
			back.Rendering.SetAutoScript(false).SetTabDepth(1).Finish().Events.SetClickEvent("stepBack();");
			next.Rendering.SetAutoScript(false).SetTabDepth(1).Finish().Events.SetClickEvent("stepNext();");
			finish.Rendering.SetAutoScript(false).SetTabDepth(1).Finish().Events.SetClickEvent("stepFinish();");
		}
示例#7
0
		public string JavaScriptCode(PushButton btn) {
			btn.Rendering.SetPrettyRender(true);
			return btn.GetStartUpScript();
		}
示例#8
0
文件: Rendering.cs 项目: xuanvu/Fluqi
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="btn">PushButton object to set rendering options of</param>
		public Rendering(PushButton btn)
		 : base()
		{
			this.Button = btn;
		}
示例#9
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="btn">PushButton to configure options of</param>
		public Options(PushButton btn)
		 : base()
		{
			this.Button = btn;
			this.Reset();
		}
示例#10
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="ac">PushButton object to configure events for</param>
		public Events(PushButton ac)
		 : base()
		{
			this.Button = ac;
			this.Reset();
		}
示例#11
0
文件: Methods.cs 项目: akhuang/Fluqi
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="btn">PushButton object to call</param>
		public Methods(PushButton btn) : base(btn)
		{
		}		
示例#12
0
		public string JavaScriptCode(PushButton btn) {
			return btn.GetStartUpScript();
		}