Exemple #1
0
        protected override System.Drawing.Size CalcMinButtonBounds(EditorButtonObjectInfoArgs info)
        {
            RepositoryItemCustomButtonEdit   item = Item as RepositoryItemCustomButtonEdit;
            CustomEditorButtonObjectInfoArgs args = info as CustomEditorButtonObjectInfoArgs;

            args.SetCustomImage(item);
            return(base.CalcMinButtonBounds(info));
        }
        protected override void DrawButton(ButtonEditViewInfo viewInfo, EditorButtonObjectInfoArgs info)
        {
            RepositoryItemCustomButtonEdit   item = viewInfo.Item as RepositoryItemCustomButtonEdit;
            CustomEditorButtonObjectInfoArgs args = info as CustomEditorButtonObjectInfoArgs;

            args.SetCustomImage(item);
            base.DrawButton(viewInfo, info);
        }
 protected virtual void DrawCustomKindImage(CustomEditorButtonObjectInfoArgs e, Rectangle rect)
 {
     if (e.Button.Kind == ButtonPredefines.Glyph)
     {
         Rectangle r = new Rectangle(Point.Empty, e.ImageSize);
         if (!e.GetAllowGlyphSkinning())
         {
             e.Cache.Paint.DrawImage(e.Graphics, e.CustomImage, rect, r, e.State != ObjectState.Disabled);
         }
     }
 }
        protected override void DrawKindImage(EditorButtonObjectInfoArgs e, Rectangle rect)
        {
            CustomEditorButtonObjectInfoArgs args = e as CustomEditorButtonObjectInfoArgs;

            if (args.CustomImage == null)
            {
                base.DrawKindImage(e, rect);
            }
            else
            {
                DrawCustomKindImage(args, rect);
            }
        }
Exemple #5
0
        protected override EditorButtonObjectInfoArgs CreateButtonInfo(EditorButton button, int index)
        {
            CustomEditorButtonObjectInfoArgs res = new CustomEditorButtonObjectInfoArgs(button, PaintAppearance);

            if (setContextHtmlPropertyInfoDelegate != null)
            {
                setContextHtmlPropertyInfoDelegate(res, GetHtmlContext());
            }
            res.AllowGlyphSkinning = Item.GetAllowGlyphSkinning();
            res.AllowHtmlDraw      = AllowHtmlString;
            res.Appearance.TextOptions.RightToLeft = RightToLeft;
            return(res);
        }