椭圆形按钮的代码

原创 2004年09月06日 14:20:00

 .skins.RectBorder;
 .skins.SkinElement;
 .core.ext.UIObjectExtensions;

 OvalButtonSkin  RectBorder
{
        
          symbolName: = ;
        
          symbolOwner: = OvalButtonSkin;
        
        
         className = ;
        
         backgroundColorName = ;
        
                
         OvalButtonSkin()
        {
        }
        
         init():
        {
                .init();
        }
        
         ():
        {
                drawHaloRect(,);
        }
        
         drawHaloRect(w:,h:):
        {
                 borderStyle = ();
                 themeCol = ();
                 emph: = .emphasized;
                ();
                 (borderStyle)
                {
                         :
                         (emph)
                        {
                                drawOval( x,y,w,h,0x919999,100);                                drawOval( x,y,w,h,themeCol,75);                                drawOval( x+1,y+1,w-2,h-2,[0x333333,0xffffff],85,0,);
                                drawOval( x+2,y+2,w-4,h-4,[0x000000,0xdadada],100,0,);
                                drawOval( x+2,y+2,w-4,h-4,themeCol,75);
                                drawOval( x+3,y+3,w-6,h-6,0xffffff,100);                                drawOval( x+3,y+4,w-6,h-7,0xf8f8f8,100);                        }
                        
                        {
                                drawOval( 0,0,w,h,0x919999,100);                                drawOval( 1,1,w-2,h-2,[0xcad1d1,0xf7f7f7],100,0,);
                                drawOval( 2,2,w-4,h-4,[0x919999,0xd2dada],100,0,);
                                drawOval( 3,3,w-6,h-6,0xffffff,100);                                drawOval( 4,4,w-6,h-7,0xf8f8f8,100);                        }
                        ;
                         :
                        drawOval( x,y,w,h,0x919999,100);                        drawOval( x+1,y+1,w-2,h-2,[0x333333,0xfcfcfc],100,0,);
                        drawOval( x+1,y+1,w-2,h-2,themeCol,50);
                        drawOval( x+2,y+2,w-4,h-4,[0x000000,0xdadada],100,0,);
                        drawOval( x,y,w,h,themeCol,40);                        drawOval( x+3,y+3,w-6,h-6,0xffffff,100);                        drawOval( x+3,y+4,w-6,h-7,themeCol,20);                        ;
                         :
                        drawOval( x,y,w,h,0x919999,100);                        drawOval( x,y,w,h,themeCol,50);                        drawOval( x+1,y+1,w-2,h-2,[0x333333,0xffffff],100,0,);
                        drawOval( x+2,y+2,w-4,h-4,[0x000000,0xdadada],100,0,);
                        drawOval( x+2,y+2,w-4,h-4,themeCol,50);
                        drawOval( x+3,y+3,w-6,h-6,0xffffff,100);                        drawOval( x+3,y+4,w-6,h-7,0xf8f8f8,100);                        ;
                         :
                        drawOval( 0,0,w,h,0xc8cccc,100);                        drawOval( 1,1,w-2,h-2,0xf2f2f2,100);
                        drawOval( 2,2,w-4,h-4,0xd4d9d9,100);
                        drawOval( 3,3,w-6,h-6,0xf2f2f2,100);                        ;
                         :
                        drawOval( x,y,w,h,0x999999,100);                        drawOval( x+1,y+1,w-2,h-2,[0x333333,0xfcfcfc],100,0,);
                        drawOval( x+1,y+1,w-2,h-2,themeCol,50);
                        drawOval( x+2,y+2,w-4,h-4,[0x000000,0xdadada],100,0,);
                        drawOval( x,y,w,h,themeCol,40);                        drawOval( x+3,y+3,w-6,h-6,0xffffff,100);                        drawOval( x+3,y+4,w-6,h-7,0xf7f7f7,100);                        ;
                         :
                        drawOval( x,y,w,h,0x999999,100);                        drawOval( x+1,y+1,w-2,h-2,[0x333333,0xfcfcfc],100,0,);
                        drawOval( x+1,y+1,w-2,h-2,themeCol,50);
                        drawOval( x+2,y+2,w-4,h-4,[0x000000,0xdadada],100,0,);
                        drawOval( x,y,w,h,themeCol,40);                        drawOval( x+3,y+3,w-6,h-6,0xffffff,100);                        drawOval( x+3,y+4,w-6,h-7,themeCol,20);                        ;
                         :
                        drawOval( x,y,w,h,0x919999,100);                        drawOval( x,y,w,h,themeCol,50);                        drawOval( x+1,y+1,w-2,h-2,[0x333333,0xffffff],100,0,);
                        drawOval( x+1,y+1,w-2,h-2,themeCol,40);
                        drawOval(x+2,y+2,w-4,h-4,[0x000000,0xdadada],100,0,);
                        drawOval( x+2,y+2,w-4,h-4,themeCol,40);
                        drawOval( x+3,y+3,w-6,h-6,0xffffff,100);                        drawOval( x+3,y+4,w-6,h-7,0xf8f8f8,100);                        ;
                         :
                        drawOval( 0,0,w,h,0xc8cccc,100);                        drawOval( 1,1,w-2,h-2,0xf2f2f2,100);
                        drawOval( 2,2,w-4,h-4,0xd4d9d9,100);
                        drawOval( 3,3,w-6,h-6,0xf2f2f2,100);                }
        }
        
        
        
         drawOval(x0:, y0:, w:, h:,c,alpha:,rot:,grad:)
        {
                 radius = w/2;
                 yRadius = h/2;
                 x = x0+radius;
                 y = y0+yRadius;
                 (arguments. < 3)
                {
                        ;
                }
                ( c == ){
                         alphas = [alpha,alpha];
                         ratios = [ 0, 0xff ];
                         sh = h *.7
                        
                         matrix = {matrixType:, x:-sh, y:sh, w:w*2, h:h*4, r:rot * 0.0174532925199433 }
                         (grad == ){
                                .( , c, alphas, ratios, matrix );
                        }{
                                .( , c, alphas, ratios, matrix );
                        }
                }  (c != ) {
                        . (c, alpha);
                }
                
                
                
                                 theta:, xrCtrl:, yrCtrl:, angle:, angleMid:;
                 px:, py:, cx:, cy:;
                                 (yRadius == )
                {
                        yRadius = radius;
                }
                                theta = . / 4;
                                xrCtrl = radius / .(theta / 2);
                yrCtrl = yRadius / .(theta / 2);
                                angle = 0;
                .(x + radius, y);
                                 ( i = 0; i < 8; i++)
                {
                                                angle += theta;
                        angleMid = angle - (theta / 2);
                                                cx = x + .(angleMid) * xrCtrl;
                        cy = y + .(angleMid) * yrCtrl;
                                                px = x + .(angle) * radius;
                        py = y + .(angle) * yRadius;
                                                .(cx, cy, px, py);
                }
                
                
                 (c != )
                .();
        };
        
          classConstruct():
        {
                UIObjectExtensions.Extensions();
                .skinRegistry[] = ;
                 ;
        }
          classConstructed: = classConstruct();
          UIObjectExtensionsDependency = UIObjectExtensions;
}

    

bootstrap 圆形按钮

●html lg xl ●css body{margin:40px;} .btn-circle {   width: 30px;   height: 3...
  • jsjpanxiaoyu
  • jsjpanxiaoyu
  • 2017-03-07 14:16:14
  • 6203

自绘圆形按钮

  • 2015年01月18日 17:34
  • 59.75MB
  • 下载

Windows API BUTTON篇学习笔记

下面是一些关于windows下的按钮控件的一些东东,希望对大家有用  常用的按钮有普通按钮、单选按钮、复选框,和组框,普通按钮作用是帮助用户触发指定动作;单选按钮一般各选项之间存在互斥性;复选框用来显...
  • hellosijian
  • hellosijian
  • 2011-07-18 23:18:52
  • 15543

椭圆形按钮的代码

//****************************************************************************// ...
  • flashvan
  • flashvan
  • 2004-09-06 14:20:00
  • 2034

<em>椭圆</em>,<em>圆形</em>,菱形按钮

不规则按钮,重载C<em>Button</em>,构成如<em>椭圆</em>,<em>圆形</em>,菱形按钮等。... 不规则按钮,重载C<em>Button</em>,构成如<em>椭圆</em>,<em>圆形</em>,菱形按钮等。综合评分:3 收藏评论(1)举报 ...
  • 2018年04月09日 00:00

自定义Button形状(圆形、椭圆)

这里介绍2种改变Button形状的方法,一个是直接通过设置一张圆形背景图片, 另一种方法是通过引用自定义的shape 文件。具体参见如下:       --------main_menu_b...
  • xyylchq
  • xyylchq
  • 2011-09-19 08:36:10
  • 59122

椭圆,圆形,菱形按钮

  • 2008年09月15日 13:29
  • 24KB
  • 下载

自定义Button形状(圆形、椭圆)

这里介绍2种改变Button形状的方法,一个是直接通过设置一张圆形背景图片, 另一种方法是通过引用自定义的shape 文件。具体参见如下:       --------main_menu_b...
  • wangjia55
  • wangjia55
  • 2012-12-29 21:43:59
  • 2903

android - RadioButton椭圆形背景样式和字体选择时候的颜色

效果图: 上不是一个ToolBar可在文章中:Android 自带ToolBar自定义中间标题&分类  RadioButton布局: ...
  • u012246458
  • u012246458
  • 2016-07-07 09:37:40
  • 2279

定制椭圆形状

1、自适应椭圆在创建圆形时,是通过border-radius这个属性给四个角指定一个合适的半径,当角半径大于一定值时就是圆了。 Tip : 但是,我们往往不希望设置固定的角半径,而是希望根据容器中...
  • u014695532
  • u014695532
  • 2016-06-09 12:20:24
  • 235
收藏助手
不良信息举报
您举报文章:椭圆形按钮的代码
举报原因:
原因补充:

(最多只允许输入30个字)