public void SetupChildControls() { this.imagePropertyTypePicker = new propertyTypePicker() { ID = "imagePropertyTypePicker" }; this.imagePropertyRequiredFieldValidator = new RequiredFieldValidator() { ID = "imagePropertyRequiredFieldValidator", Text = " Required", InitialValue = string.Empty, ControlToValidate = this.imagePropertyTypePicker.ID }; chkGenerateCrops = new CheckBox { ID = "generateimg", AutoPostBack = true }; litQuality = new Literal { ID = "qualityLiteral", Text = " Quality ", Visible = false }; txtQuality = new TextBox { ID = "quality", Width = Unit.Pixel(30), Visible = false }; chkShowLabel = new CheckBox { ID = "label" }; slbPresets = new SmartListBox { ID = "presets", SelectionMode = ListSelectionMode.Multiple, Height = Unit.Pixel(123), Width = Unit.Pixel(350) }; txtCropName = new TextBox { ID = "presetname", Width = Unit.Pixel(100) }; txtTargetWidth = new TextBox { ID = "presetw", Width = Unit.Pixel(50) }; txtTargetHeight = new TextBox { ID = "preseth", Width = Unit.Pixel(50) }; chkKeepAspect = new CheckBox { ID = "aspect", Checked = true }; ddlDefaultPosH = new DropDownList { ID = "posh" }; ddlDefaultPosH.Items.Add(new ListItem("Left", "L")); ddlDefaultPosH.Items.Add(new ListItem("Center", "C")); ddlDefaultPosH.Items.Add(new ListItem("Right", "R")); ddlDefaultPosV = new DropDownList { ID = "posv" }; ddlDefaultPosV.Items.Add(new ListItem("Top", "T")); ddlDefaultPosV.Items.Add(new ListItem("Middle", "M")); ddlDefaultPosV.Items.Add(new ListItem("Bottom", "B")); btnUp = new Button { ID = "up", Text = "Up", Width = Unit.Pixel(60) }; btnDown = new Button { ID = "down", Text = "Down", Width = Unit.Pixel(60) }; btnAdd = new Button { ID = "add", Text = "Add", Width = Unit.Pixel(60) }; btnRemove = new Button { ID = "remove", Text = "Remove", Width = Unit.Pixel(60) }; btnGenerate = new Button { ID = "generate", Text = "Generate", Width = Unit.Pixel(60) }; //vsErrors = new ValidationSummary {ID = "summary", ValidationGroup = "cropper"}; //rqfName = new RequiredFieldValidator {ID = "namevalidator", ValidationGroup = "cropper", ControlToValidate = txtCropName.ClientID, ErrorMessage = "Crop name missing", Text="*" }; //revName = new RegularExpressionValidator // { // ID = "namevalidator", // ValidationExpression = ".*[a-zA-Z0-9-_ ].*", // ValidationGroup = "cropper", // ErrorMessage = "Invalid name. Alphanumerical only please as this will be the filename", // AssociatedControlID = txtCropName.ID // }; Controls.Add(this.imagePropertyTypePicker); Controls.Add(this.imagePropertyRequiredFieldValidator); Controls.Add(chkGenerateCrops); Controls.Add(litQuality); Controls.Add(txtQuality); Controls.Add(chkShowLabel); Controls.Add(slbPresets); Controls.Add(txtCropName); Controls.Add(txtTargetWidth); Controls.Add(txtTargetHeight); Controls.Add(chkKeepAspect); Controls.Add(ddlDefaultPosH); Controls.Add(ddlDefaultPosV); Controls.Add(btnUp); Controls.Add(btnDown); Controls.Add(btnAdd); Controls.Add(btnRemove); Controls.Add(btnGenerate); //Controls.Add(vsErrors); //Controls.Add(rqfName); //Controls.Add(revName); btnUp.Click += _upButton_Click; btnDown.Click += _downButton_Click; btnAdd.Click += _addButton_Click; btnRemove.Click += _removeButton_Click; //btnGenerate.Click += _generateButton_Click; chkGenerateCrops.CheckedChanged += _generateImagesCheckBox_CheckedChanged; }
public void SetupChildControls() { this.imagePropertyTypePicker = new propertyTypePicker() { ID = "imagePropertyTypePicker" }; this.imagePropertyRequiredFieldValidator = new RequiredFieldValidator() { ID = "imagePropertyRequiredFieldValidator", Text = " Required", InitialValue = string.Empty, ControlToValidate = this.imagePropertyTypePicker.ID }; chkGenerateCrops = new CheckBox {ID = "generateimg", AutoPostBack = true}; litQuality = new Literal {ID = "qualityLiteral", Text = " Quality ", Visible = false}; txtQuality = new TextBox {ID = "quality", Width = Unit.Pixel(30), Visible = false}; chkShowLabel = new CheckBox {ID = "label"}; slbPresets = new SmartListBox { ID = "presets", SelectionMode = ListSelectionMode.Multiple, Height = Unit.Pixel(123), Width = Unit.Pixel(350) }; txtCropName = new TextBox {ID = "presetname", Width = Unit.Pixel(100)}; txtTargetWidth = new TextBox {ID = "presetw", Width = Unit.Pixel(50)}; txtTargetHeight = new TextBox {ID = "preseth", Width = Unit.Pixel(50)}; chkKeepAspect = new CheckBox {ID = "aspect", Checked = true}; ddlDefaultPosH = new DropDownList {ID = "posh"}; ddlDefaultPosH.Items.Add(new ListItem("Left", "L")); ddlDefaultPosH.Items.Add(new ListItem("Center", "C")); ddlDefaultPosH.Items.Add(new ListItem("Right", "R")); ddlDefaultPosV = new DropDownList {ID = "posv"}; ddlDefaultPosV.Items.Add(new ListItem("Top", "T")); ddlDefaultPosV.Items.Add(new ListItem("Middle", "M")); ddlDefaultPosV.Items.Add(new ListItem("Bottom", "B")); btnUp = new Button {ID = "up", Text = "Up", Width = Unit.Pixel(60)}; btnDown = new Button {ID = "down", Text = "Down", Width = Unit.Pixel(60)}; btnAdd = new Button {ID = "add", Text = "Add", Width = Unit.Pixel(60)}; btnRemove = new Button {ID = "remove", Text = "Remove", Width = Unit.Pixel(60)}; btnGenerate = new Button {ID = "generate", Text = "Generate", Width = Unit.Pixel(60)}; //vsErrors = new ValidationSummary {ID = "summary", ValidationGroup = "cropper"}; //rqfName = new RequiredFieldValidator {ID = "namevalidator", ValidationGroup = "cropper", ControlToValidate = txtCropName.ClientID, ErrorMessage = "Crop name missing", Text="*" }; //revName = new RegularExpressionValidator // { // ID = "namevalidator", // ValidationExpression = ".*[a-zA-Z0-9-_ ].*", // ValidationGroup = "cropper", // ErrorMessage = "Invalid name. Alphanumerical only please as this will be the filename", // AssociatedControlID = txtCropName.ID // }; Controls.Add(this.imagePropertyTypePicker); Controls.Add(this.imagePropertyRequiredFieldValidator); Controls.Add(chkGenerateCrops); Controls.Add(litQuality); Controls.Add(txtQuality); Controls.Add(chkShowLabel); Controls.Add(slbPresets); Controls.Add(txtCropName); Controls.Add(txtTargetWidth); Controls.Add(txtTargetHeight); Controls.Add(chkKeepAspect); Controls.Add(ddlDefaultPosH); Controls.Add(ddlDefaultPosV); Controls.Add(btnUp); Controls.Add(btnDown); Controls.Add(btnAdd); Controls.Add(btnRemove); Controls.Add(btnGenerate); //Controls.Add(vsErrors); //Controls.Add(rqfName); //Controls.Add(revName); btnUp.Click += _upButton_Click; btnDown.Click += _downButton_Click; btnAdd.Click += _addButton_Click; btnRemove.Click += _removeButton_Click; //btnGenerate.Click += _generateButton_Click; chkGenerateCrops.CheckedChanged += _generateImagesCheckBox_CheckedChanged; }