【问题标题】:Rebol 3 What are the available border effects for r3gui?Rebol 3 r3gui 有哪些可用的边框效果?
【发布时间】:2015-11-21 09:07:44
【问题描述】:

我知道如何在 r3gui 中调整边框的大小:

view [
    b: box 800x400 red options [
        box-model: 'frame border-size: [4x2 2x4]
    ]
]

但是如何使用 r3gui 从 R2/View 中获得 ibevel 边框/边缘效果?

Rebol2/查看示例:

view [
    box 800x400 red edge [size: 4x4 effect: 'ibevel color: gray]
]

【问题讨论】:

    标签: rebol rebol3


    【解决方案1】:

    Rebol3 不直接支持 'ibevel 效果。但是您应该能够使用绘图方言使用 R3-GUI 小部件样式自定义来实现它:

    stylize [
        my-box: box [
            facets: [
                border-colors: [
                    65.65.65 191.191.191
                ]
            ]
            draw: [
                line-width 1 fixed
                pen border-colors/1
                fill-pen border-colors/1;
                polygon border-box/top-left border-box/top-right (as-pair border-box/top-right/x - border-size/2/1 border-box/top-right/y + border-size/1/2) (border-box/top-left + border-size/1)
                (as-pair border-box/bottom-left/x + border-size/1/1 border-box/bottom-left/y - border-size/2/2) border-box/bottom-left
                pen border-colors/2 ;
                fill-pen border-colors/2
                polygon border-box/bottom-right border-box/top-right 
                (as-pair border-box/top-right/x - border-size/2/1 border-box/top-right/y + border-size/1/2) (as-pair border-box/bottom-right/x - border-size/2/1 border-box/bottom-right/y - border-size/2/2)
                (as-pair border-box/bottom-left/x + border-size/1/1 border-box/bottom-left/y - border-size/2/2) border-box/bottom-left
            ]
        ]
    ]
    
    view [
        my-box 300x300 red options [
            border-size: [4x2 2x4]
        ]
        my-box 300x300 red options [
            border-size: [4x8 12x24]
            border-colors: [0.0.255 0.255.0]
        ]
    ]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-10
      • 1970-01-01
      • 2020-08-30
      相关资源
      最近更新 更多