public void Display(Skybound.VisualTips.VisualTipProvider provider, Skybound.VisualTips.VisualTip tip, System.Drawing.Rectangle toolArea, Skybound.VisualTips.VisualTipDisplayOptions options) { Provider = provider; _DisplayedTip = tip; _Options = options; RightToLeft = tip.RightToLeft; Skybound.VisualTips.Rendering.VisualTipLayout visualTipLayout = provider.Renderer.CreateLayout(tip); Size = visualTipLayout.GetSize(); Location = GetBestLocation(toolArea, Size, options); toolArea.Location = toolArea.Location - (new System.Drawing.Size(Location)); tip.SetRelativeToolArea(toolArea); if (IsLayeredWindow) { Animator.Stop(); using (System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(Width, Height)) using (System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap)) { provider.Renderer.Draw(new System.Windows.Forms.PaintEventArgs(graphics, new System.Drawing.Rectangle(0, 0, Width, Height)), tip, visualTipLayout); SetAlphaMask(bitmap, (byte)(Provider.Opacity * 255.0)); } } DisplayAnimate(); if (!IsLayeredWindow) { System.Drawing.Rectangle rectangle = visualTipLayout.WindowBounds; Width = rectangle.Width; Region = Provider.Renderer.CreateMaskRegion(tip, visualTipLayout); } }
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value) { WinForms = provider.GetService(typeof(System.Windows.Forms.Design.IWindowsFormsEditorService)) as System.Windows.Forms.Design.IWindowsFormsEditorService; Skybound.VisualTips.VisualTip visualTip = value as Skybound.VisualTips.VisualTip; System.Windows.Forms.Control control = new System.Windows.Forms.Control(); if (visualTip.ShouldSerialize()) { Layout = visualTip.Provider.Renderer.CreateLayout(visualTip); Layout.Offset(8, 8); CurrentTip = visualTip; control.Size = Layout.GetSize() + (new System.Drawing.Size(16, 16)); control.Paint += new System.Windows.Forms.PaintEventHandler(OnDropDownPaint); control.MouseDown += new System.Windows.Forms.MouseEventHandler(OnDropDownMouseDown); } else { control.Size = new System.Drawing.Size(144, 28); control.Paint += new System.Windows.Forms.PaintEventHandler(OnEmptyDropDownPaint); } WinForms.DropDownControl(control); return value; }
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value) { WinForms = provider.GetService(typeof(System.Windows.Forms.Design.IWindowsFormsEditorService)) as System.Windows.Forms.Design.IWindowsFormsEditorService; Skybound.VisualTips.VisualTip visualTip = value as Skybound.VisualTips.VisualTip; System.Windows.Forms.Control control = new System.Windows.Forms.Control(); if (visualTip.ShouldSerialize()) { Layout = visualTip.Provider.Renderer.CreateLayout(visualTip); Layout.Offset(8, 8); CurrentTip = visualTip; control.Size = Layout.GetSize() + (new System.Drawing.Size(16, 16)); control.Paint += new System.Windows.Forms.PaintEventHandler(OnDropDownPaint); control.MouseDown += new System.Windows.Forms.MouseEventHandler(OnDropDownMouseDown); } else { control.Size = new System.Drawing.Size(144, 28); control.Paint += new System.Windows.Forms.PaintEventHandler(OnEmptyDropDownPaint); } WinForms.DropDownControl(control); return(value); }