private void CreateControls() { this.lblCategory = new ToolbarLabel(0, "lblCategory", "lbl_category"); this.lblTypes = new ToolbarLabel(1, "lblTypes", "lbl_types"); this.btnAddType = new TaxDataStore.Presentation.Controls.FlatButton(2, "btnAdd", "add", "add"); this.btnDeleteType = new TaxDataStore.Presentation.Controls.FlatButton(3, "btnDelete", "delete", "delete"); this.tlpButtons.Controls.Add(this.btnDeleteType, 2, 0); this.tlpButtons.Controls.Add(this.btnAddType, 1, 0); this.tlpToolbar.Controls.Add(this.lblCategory, 0, 0); this.tlpButtons.Controls.Add(this.lblTypes, 0, 0); this.flvclasses = new FlatGridView(); this.flvclasses.ColumnHeadersVisible = false; this.flvclasses.Margin = new Padding(0, 0, 0, 0); this.flvclasses.DataSource = DomainModel.Categories.GetAll(); this.clvTypes = new CategoryListView(); this.btnAddType.Click += new System.EventHandler(btnAddType_Click); this.btnDeleteType.Click += new System.EventHandler(btnDeleteType_Click); }
private void CreateControls() { this.lblRoleName = new FormLabel(0, "lblRoleName", true, "role_name"); this.lblLanguage = new FormLabel(1, "lblLanguage", true, "language"); this.lblName = new FormLabel(2, "lblName", true, "name"); this.lblIsEnabled = new FormLabel(3, "lblIsEnabled", true, "select_user"); this.lblUsers = new ToolbarLabel(4, "lblUsers", "users"); this.lblDetails = new ToolbarLabel(5, "lblDetails", "details"); this.btnAddUser = new FlatButton(6, "btnAdd", "add", "add"); this.btnEditUser = new FlatButton(7, "btnEdit", "pencil", "edit"); this.btnDeleteUser = new FlatButton(8, "btnDelete", "delete", "delete"); this.btnEnableUser = new FlatButton(9, "disable", "closed_lock", "disable"); this.tlpButtons.Controls.Add(this.btnAddUser, 1, 0); this.tlpButtons.Controls.Add(this.btnEditUser, 2, 0); this.tlpButtons.Controls.Add(this.btnDeleteUser, 3, 0); this.tlpButtons.Controls.Add(this.btnEnableUser, 4, 0); this.tlpDetails.Controls.Add(this.lblRoleName, 0, 3); this.tlpDetails.Controls.Add(this.lblLanguage, 0, 2); this.tlpDetails.Controls.Add(this.lblName, 0, 1); this.tlpDetails.Controls.Add(this.lblIsEnabled, 0, 0); this.tlpButtons.Controls.Add(this.lblUsers, 0, 0); this.tlpMain.Controls.Add(this.lblDetails, 1, 0); this.lblIsEnabled.ForeColor = Color.Red; }
private void CreateControls() { this.lblRuleName = new FormLabel(0, "lblRuleName", false, "lbl_rule_name"); this.lblFormula = new FormLabel(1, "lblFormula", false, "lbl_formula"); this.lblConstraints = new ToolbarLabel(2, "lblConstraints", "lbl_constraints"); this.btnConstraintsEdit = new FlatButton(3, "edit", "pencil", "edit"); this.btnConstraintsAdd = new FlatButton(4, "add", "add", "add"); this.btnConstraintsDelete = new FlatButton(5, "delete", "delete", "delete"); this.tlpConstraintButtons.Controls.Add(this.btnConstraintsAdd, 1, 0); this.tlpConstraintButtons.Controls.Add(this.btnConstraintsEdit, 2, 0); this.tlpConstraintButtons.Controls.Add(this.btnConstraintsDelete, 3, 0); this.tlpConstraintButtons.Controls.Add(this.lblConstraints, 0, 0); this.tlpMain.Controls.Add(this.lblRuleName, 0, 0); this.tlpMain.Controls.Add(this.lblFormula, 0, 1); }
private void CreateControls() { this.lblDate = new FormLabel(0, "lblDate", false, "date"); this.lblTours = new ToolbarLabel(6, "lblTours", "lbl_tours"); this.btnAddTour = new FlatButton(7, "btnAdd", "add", "add"); this.btnEditTour = new FlatButton(8, "btnEdit", "pencil", "edit"); this.btnDeleteTour = new FlatButton(9, "btnDelete", "delete", "delete"); this.btnAddTour.Click += new EventHandler(btnAddTour_Click); this.btnDeleteTour.Click += new EventHandler(btnDeleteTour_Click); this.tlpButtons.Controls.Add(this.btnAddTour, 0, 0); this.tlpButtons.Controls.Add(this.btnEditTour, 1, 0); this.tlpButtons.Controls.Add(this.btnDeleteTour, 2, 0); this.tlpToursToolbar.Controls.Add(this.lblTours, 0, 0); this.tlpDate.Controls.Add(this.lblDate, 0, 0); }
private void CreateControls() { this.lblComment = new FormLabel(0, "lblComment", false, "select_role"); this.lblRoles = new ToolbarLabel(1, "lblRoles", "lbl_roles"); this.lblTasks = new ToolbarLabel(2, "lblTasks", "lbl_tasks"); this.btnAddRole = new FlatButton(3, "add", "add", "add"); this.btnEditRole = new FlatButton(4, "edit", "pencil", "edit"); this.btnDeleteRole = new FlatButton(5, "delete", "delete", "delete"); this.tlpButtons.Controls.Add(this.btnAddRole, 1, 0); this.tlpButtons.Controls.Add(this.btnEditRole, 2, 0); this.tlpButtons.Controls.Add(this.btnDeleteRole, 3, 0); this.tlpMain.Controls.Add(this.lblTasks, 1, 0); this.tlpButtons.Controls.Add(this.lblRoles, 0, 0); this.panelTasks.Controls.Add(this.lblComment); }
private void CreateControls() { this.lblTitle = new FormLabel(0, "lblTitle", false, "lbl_title"); this.lblFirstName = new FormLabel(2, "lblFirstName", false, "lbl_first_name"); this.lblLastName = new FormLabel(4, "lblLastName", false, "lbl_last_name"); this.lblContacts = new ToolbarLabel(6, "lblContacts", "lbl_contacts"); this.btnAddContact = new FlatButton(8, "btnAdd", "add", "add"); this.btnRemoveContact = new FlatButton(9, "btnDelete", "delete", "delete"); this.tlpContacts.Controls.Add(this.btnAddContact, 1, 0); this.tlpContacts.Controls.Add(this.btnRemoveContact, 2, 0); this.tlpMain.Controls.Add(this.lblTitle, 0, 1); this.tlpMain.Controls.Add(this.lblFirstName, 0, 2); this.tlpMain.Controls.Add(this.lblLastName, 0, 3); this.tlpContacts.Controls.Add(this.lblContacts, 0, 0); this.btnAddContact.Click += new EventHandler(btnAddContact_Click); this.btnRemoveContact.Click += new EventHandler(btnRemoveContact_Click); }
private void SetupControls() { this.Name = "EditToolbar"; this.lblTitle = new ToolbarLabel(0, "lblTitle", "title"); this.btnAdd = new FlatButton(1, "btnAdd", "add", ""); this.btnEdit = new FlatButton(2, "btnEdit", "pencil", ""); this.btnDelete = new FlatButton(3, "btnDelete", "delete", ""); this.tlpMain.Controls.Add(this.lblTitle, 0, 0); this.tlpMain.Controls.Add(this.btnAdd, 1, 0); this.tlpMain.Controls.Add(this.btnEdit, 2, 0); this.tlpMain.Controls.Add(this.btnDelete, 3, 0); this.AutoSize = true; this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.tlpMain.AutoSize = true; this.tlpMain.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.lblTitle.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom; this.lblTitle.TextAlign = ContentAlignment.MiddleLeft; if (Presentation.View.Theme != null) { this.lblTitle.ForeColor = Presentation.View.Theme.TourForeColor; } ShowEditOptions(false); this.PerformLayout(); this.btnAdd.Click += new EventHandler(OnButtonClick); this.btnDelete.Click += new EventHandler(OnButtonClick); this.btnEdit.Click += new EventHandler(OnButtonClick); this.Disposed += new EventHandler(EditToolbar_Disposed); AttachMouseEvents(this); }
/// <summary> /// Raises the DataBinding event. This notifies a control to perform any data binding logic that is associated with it. /// </summary> /// <param name="e">An EventArgs object that contains the event data.</param> protected override void OnDataBinding(EventArgs e) { base.OnDataBinding(e); if (_DataSource != null) { Items.Clear(); _ClearChildViewState = true; string szCurGroup = String.Empty; ToolbarCheckGroup group = null; foreach (Object dataItem in _DataSource) { String type = null; String text = null; String imageUrl = null; String selected = null; String groupname = null; if (DataTypeField != String.Empty) { type = DataBinder.GetPropertyValue(dataItem, DataTypeField, null); } if (DataTextField != String.Empty) { text = DataBinder.GetPropertyValue(dataItem, DataTextField, null); } if (DataImageUrlField != String.Empty) { imageUrl = DataBinder.GetPropertyValue(dataItem, DataImageUrlField, null); } if (DataSelectedField != String.Empty) { selected = DataBinder.GetPropertyValue(dataItem, DataSelectedField, null); } if (DataGroupnameField != String.Empty) { groupname = DataBinder.GetPropertyValue(dataItem, DataGroupnameField, null); } ToolbarItem item = MakeToolbarItem(type); if (item == null) { continue; } bool bEndPrevGroup = (group != null); bool bMakeNewGroup = false; if (item is ToolbarCheckButton) { bEndPrevGroup = (group != null) && ((groupname == null) || (groupname != szCurGroup)); bMakeNewGroup = ((groupname != null) && (groupname != szCurGroup)); } if (bEndPrevGroup) { group = null; szCurGroup = String.Empty; } if (bMakeNewGroup) { group = new ToolbarCheckGroup(); Items.Add(group); szCurGroup = groupname; } if (group != null) { group.Items.Add((ToolbarCheckButton)item); } else { Items.Add(item); } if (item is ToolbarButton) { ToolbarButton btn = (ToolbarButton)item; if (text != null) { btn.Text = text; } if (imageUrl != null) { btn.ImageUrl = imageUrl; } } if (item is ToolbarLabel) { ToolbarLabel label = (ToolbarLabel)item; if (text != null) { label.Text = text; } if (imageUrl != null) { label.ImageUrl = imageUrl; } } if (item is ToolbarCheckButton) { ToolbarCheckButton btn = (ToolbarCheckButton)item; if (selected != null) { btn.SetSelected(selected.ToLower() == "true"); } } } } }