/// <summary> /// Creates the default BubbleTab for the control /// </summary> /// <param name="imageListSmall"></param> /// <param name="imageListLarge"></param> private void SetupBubbleTab( ImageList imageListSmall, ImageList imageListLarge) { Images = imageListSmall; ImagesLarge = imageListLarge; ImageSizeNormal = new Size(32, 32); ImageSizeLarge = new Size(64, 64); BubbleBarTab tab = new BubbleBarTab(); Tabs.Add(tab); for (int i = 0; i < imageListSmall.Images.Count; i++) { BubbleButton bb = new BubbleButton(); tab.Buttons.Add(bb); bb.ImageIndex = i; bb.ImageIndexLarge = i; } }
private void GetTabComponents(BubbleBarTab tab, ArrayList c) { foreach(BubbleButton b in tab.Buttons) c.Add(b); }
private BubbleButton CreateButton(BubbleBarTab tab) { BubbleBar bar=this.Control as BubbleBar; if(bar==null) return null; IDesignerHost dh=(IDesignerHost)GetService(typeof(IDesignerHost)); if(dh==null) return null; IComponentChangeService change=this.GetService(typeof(IComponentChangeService)) as IComponentChangeService; if(change!=null) change.OnComponentChanging(this.Component,TypeDescriptor.GetProperties(tab).Find("Buttons",true)); BubbleButton button=dh.CreateComponent(typeof(BubbleButton)) as BubbleButton; if(button==null) return null; button.Image=Helpers.LoadBitmap("SystemImages.Note24.png"); button.ImageLarge = Helpers.LoadBitmap("SystemImages.Note64.png"); tab.Buttons.Add(button); if(change!=null) change.OnComponentChanged(this.Component,TypeDescriptor.GetProperties(tab).Find("Buttons",true),null,null); return button; }