public FaceImageControl( FaceImage Face, FaceImageListControl FaceControlParent ) { this.Face = Face; this.FaceControlParent = FaceControlParent; InitializeComponent(); SetBounds( 0, 0, Face.Face.Width, Face.Face.Height ); List<MenuItem> menuitems = new List<MenuItem>(); MenuItem mi; mi = new MenuItem( "Edit URL" ); mi.Click += new EventHandler( mi_EditURL_Click ); menuitems.Add( mi ); mi = new MenuItem( "Edit Name" ); mi.Click += new EventHandler( mi_EditName_Click ); menuitems.Add( mi ); mi = new MenuItem( "Delete" ); mi.Click += new EventHandler( mi_Delete_Click ); menuitems.Add( mi ); RightClickMenuItems = menuitems.ToArray(); RightClickMenu = new System.Windows.Forms.ContextMenu( RightClickMenuItems ); ImageAttrs = new System.Drawing.Imaging.ImageAttributes(); ColorMatrix = new System.Drawing.Imaging.ColorMatrix(); }
public void LoadXML( FaceXML XML ) { this.XML = XML; this.tabControl1.Controls.Clear(); this.tabPage1.Controls.Clear(); this.tabControl1.Controls.Add( tabPage1 ); int width = tabPage1.Size.Width; int height = tabPage1.Size.Height; FaceImageListControl f = new FaceImageListControl( XML, this ); f.Size = new Size( width, height ); f.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; this.tabPage1.Controls.Add( f ); AllFacesControl = f; FaceControls = new Dictionary<string, FaceImageListControl>(); foreach ( KeyValuePair<String, List<FaceImage>> KVP in XML.Categories ) { TabPage p = new TabPage( KVP.Key ); p.Size = new Size( width, height ); f = new FaceImageListControl( KVP.Key, KVP.Value, AllFacesControl, this ); f.Size = new Size( width, height ); f.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; p.Controls.Add( f ); this.tabControl1.Controls.Add( p ); FaceControls.Add( KVP.Key, f ); } }
public void LoadXML(FaceXML XML) { this.XML = XML; this.tabControl1.Controls.Clear(); this.tabPage1.Controls.Clear(); this.tabControl1.Controls.Add(tabPage1); int width = tabPage1.Size.Width; int height = tabPage1.Size.Height; FaceImageListControl f = new FaceImageListControl(XML, this); f.Size = new Size(width, height); f.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; this.tabPage1.Controls.Add(f); AllFacesControl = f; FaceControls = new Dictionary <string, FaceImageListControl>(); foreach (KeyValuePair <String, List <FaceImage> > KVP in XML.Categories) { TabPage p = new TabPage(KVP.Key); p.Size = new Size(width, height); f = new FaceImageListControl(KVP.Key, KVP.Value, AllFacesControl, this); f.Size = new Size(width, height); f.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; p.Controls.Add(f); this.tabControl1.Controls.Add(p); FaceControls.Add(KVP.Key, f); } }
private void buttonAddCategory_Click(object sender, EventArgs e) { InputBoxResult r = InputBox.Show("New category name:", "Add Category", "", null, false); if (r.OK && !String.IsNullOrEmpty(r.Text)) { if (FaceControls.Keys.Contains(r.Text)) { return; } List <FaceImage> l = new List <FaceImage>(); TabPage p = new TabPage(r.Text); p.Size = new Size(tabPage1.Size.Width, tabPage1.Size.Height); FaceImageListControl f = new FaceImageListControl(r.Text, l, AllFacesControl, this); f.Size = new Size(tabPage1.Size.Width, tabPage1.Size.Height); f.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; p.Controls.Add(f); this.tabControl1.Controls.Add(p); FaceControls.Add(r.Text, f); XML.AddCategory(r.Text, l); } }
public FaceImageControl(FaceImage Face, FaceImageListControl FaceControlParent) { this.Face = Face; this.FaceControlParent = FaceControlParent; InitializeComponent(); SetBounds(0, 0, Face.Face.Width, Face.Face.Height); List <MenuItem> menuitems = new List <MenuItem>(); MenuItem mi; mi = new MenuItem("Edit URL"); mi.Click += new EventHandler(mi_EditURL_Click); menuitems.Add(mi); mi = new MenuItem("Edit Name"); mi.Click += new EventHandler(mi_EditName_Click); menuitems.Add(mi); mi = new MenuItem("Delete"); mi.Click += new EventHandler(mi_Delete_Click); menuitems.Add(mi); RightClickMenuItems = menuitems.ToArray(); RightClickMenu = new System.Windows.Forms.ContextMenu(RightClickMenuItems); ImageAttrs = new System.Drawing.Imaging.ImageAttributes(); ColorMatrix = new System.Drawing.Imaging.ColorMatrix(); }
public FaceImageListControl( FaceXML XML, FaceForm ParentForm ) { InitializeComponent(); this.Category = null; this.ImageList = null; this.XML = XML; this.AllControl = null; this.ParentFaceForm = ParentForm; FillViewFromXML(); }
public FaceImageListControl( String Category, List<FaceImage> ImageList, FaceImageListControl AllControl, FaceForm ParentForm ) { InitializeComponent(); this.Category = Category; this.ImageList = ImageList; this.XML = null; this.AllControl = AllControl; this.ParentFaceForm = ParentForm; FillViewFromList(); }
public FaceImageListControl(FaceXML XML, FaceForm ParentForm) { InitializeComponent(); this.Category = null; this.ImageList = null; this.XML = XML; this.AllControl = null; this.ParentFaceForm = ParentForm; FillViewFromXML(); }
public FaceImageListControl(String Category, List <FaceImage> ImageList, FaceImageListControl AllControl, FaceForm ParentForm) { InitializeComponent(); this.Category = Category; this.ImageList = ImageList; this.XML = null; this.AllControl = AllControl; this.ParentFaceForm = ParentForm; FillViewFromList(); }
void mi_Delete_Click(object sender, EventArgs e) { string categoryName = tabControl1.SelectedTab.Text; FaceImageListControl fc = FaceControls[categoryName]; fc.RemoveAllImages(true); XML.RemoveCategory(categoryName); TabPage tabToRemove = tabControl1.SelectedTab; tabControl1.DeselectTab(tabToRemove); tabControl1.Controls.Remove(tabToRemove); }
private void buttonAddCategory_Click( object sender, EventArgs e ) { InputBoxResult r = InputBox.Show( "New category name:", "Add Category", "", null, false ); if ( r.OK && !String.IsNullOrEmpty( r.Text ) ) { if ( FaceControls.Keys.Contains( r.Text ) ) { return; } List<FaceImage> l = new List<FaceImage>(); TabPage p = new TabPage( r.Text ); p.Size = new Size( tabPage1.Size.Width, tabPage1.Size.Height ); FaceImageListControl f = new FaceImageListControl( r.Text, l, AllFacesControl, this ); f.Size = new Size( tabPage1.Size.Width, tabPage1.Size.Height ); f.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; p.Controls.Add( f ); this.tabControl1.Controls.Add( p ); FaceControls.Add( r.Text, f ); XML.AddCategory( r.Text, l ); } }