Graphic (クラス)
public abstract Graphic {inherits Visual}
インポート元: CURL.GUI.STANDARD. package 内で定義されています CURL.GUI.BASE.
直接継承しているサブクラス: EmbeddedBrowserGraphic, LookAndFeel, StretchyGraphic, ActiveXGraphic, DrawableGraphic, Box, FontGraphic

すべてのファーストクラス グラフィカル オブジェクトの (抽象) 基本クラス。このオブジェクトは、グラフィックで表示したり、レイアウト ネゴシエーションに参加できます。

注意事項

Graphic ではない可視オブジェクトは、書式設定されたテキスト (paragraph など) だけです。これは、TextFlowBox の内部にのみ表示されます。Graphic と書式設定されたテキストは、いずれも Visual のサブクラスです。つまり、これはグラフィカルに表示できるオブジェクトすべてに共通のスーパークラスです。

プログラミング注意事項

このクラスは、Curl言語のファーストクラス グラフィカル オブジェクトへのインターフェイスを定義します。したがって、ファーストクラスのグラフィカル オブジェクトである値を持つ変数は、Graphic 型として宣言する必要があります。

コンストラクタ
clone-appearance-from:このタイプの新しいオブジェクトを作成するために Visual.clone-appearance が使用するコンストラクタ。
コンストラクタ protected {Graphic.clone-appearance-from other:Graphic}
default:Graphic を初期化します。
コンストラクタ public {Graphic.default ...}
from-any:any から Graphic を作成します。
ファクトリ public implicit {Graphic.from-any obj:any}:Graphic
from-Dynamic:Dynamic から Graphic を作成します。
ファクトリ public implicit {Graphic.from-Dynamic obj:Dynamic}:Graphic
from-string:String から Graphic を作成します。
ファクトリ public implicit {Graphic.from-string obj:String}:Graphic
from-TextFormat:
ファクトリ public implicit {Graphic.from-TextFormat obj:TextFormat}:Graphic
from-Visual:Visual から Graphic を作成します。
ファクトリ public implicit {Graphic.from-Visual obj:Visual}:Graphic

プロパティ
avoid-page-break?:true の場合は、この Graphic のコンテナは、パジネーションが実行される時に、この Graphic をページ間に分割せずに、1 ページに収めようとします。
ローカル オプション public Graphic.avoid-page-break?:bool
background:グラフィカル オブジェクトの背景色または背景パターン。
ローカル オプション public Graphic.background:Background =Background.transparent
border-color:グラフィカル オブジェクトの境界の色またはパターン。
非ローカル オプション public Graphic.border-color:FillPattern
border-spec:GraphicBorderSpec を指定します。
ローカル オプション public Graphic.border-spec:#BorderSpec =null
border-style:オブジェクトの境界の外観を指定します。
ローカル オプション public Graphic.border-style:BorderStyle =BorderStyle.flat
border-width:オブジェクトの境界の幅を指定します。
ローカル オプション public Graphic.border-width:any =0pt
cell-border-spec:Table セルの BorderSpec を指定します。
非ローカル オプション public Graphic.cell-border-spec:#BorderSpec
cell-border-width:Table のテーブル セル ボーダーの幅を指定します。
非ローカル オプション public Graphic.cell-border-width:any
cell-margin:テーブル セルの境界とその子スロット (テーブル セルがその子グラフィックを配置する場所) の間の距離を指定します。
非ローカル オプション public Graphic.cell-margin:any
clip-child-shadows?:この Graphic の子の影がこの box の目に見える境界の外に描画されるかどうかを規定します。
アクセサ public Graphic.clip-child-shadows?:bool
discrete-select-in-range?:この GraphicGuiRangeSelectionContext でリーフのように機能するかどうかを決定します。
ローカル オプション public Graphic.discrete-select-in-range?:bool =false
display-context:このオブジェクトに関連付けられている DisplayContext
非ローカル オプション public Graphic.display-context:#DisplayContext
enabled?:Visual が有効であるかどうかを指定します。
非ローカル オプション public Graphic.enabled?:bool
graphic-selectable:この GraphicDiscreteGraphicSelectionContext 内で選択可能にするかどうかを決定します。
ローカル オプション public Graphic.graphic-selectable:#GraphicSelectable =null
height:Graphic の高さ設定。
ローカル オプション public Graphic.height:any
horigin:オブジェクトの外側起点の x 座標を指定します。
ローカル オプション public Graphic.horigin:any ="origin"
is-paginating?:true の場合は、この Graphic がパジネートします。
フィールド public-get private-set Graphic.is-paginating?:bool
layout:このオブジェクトに関連付けて、Layout オブジェクトをポイントします。
フィールド public-get protected-set Graphic.layout:#Layout
margin:オブジェクトのボーダーとその子スロット (オブジェクトがそのグラフィカルな子を配置する場所) との間の距離を指定します。
ローカル オプション public Graphic.margin:any =0pt
opaque-to-events?:透明なセクションに発生する PointerEvent をこのオブジェクトが受け取るかどうかを指定する bool
ローカル オプション public Graphic.opaque-to-events?:bool =false
option-parent:オブジェクトのオプションの親を返します。
アクセサ public Graphic.option-parent:#GraphicOptions
outside-margin:Graphic の外側マージンとして適用される OffsetSpec を規定します。
ローカル オプション public Graphic.outside-margin:#OffsetSpec =null
pagination-state:このオプションが非 null のときは、この Graphic に対するパジネーション シーケンスの状態を表します。
ローカル オプション public Graphic.pagination-state:#PaginationState =null
parent:オブジェクトのグラフィカルな親を返します。
アクセサ public Graphic.parent:#Box
selection-context:このグラフィックとそのグラフィック子孫に関連付けられた SelectionContext
非ローカル オプション public Graphic.selection-context:#SelectionContext
shadow-color:影の色です。既定の色は黒で、アルファ値は 0.175 です。
非ローカル オプション public Graphic.shadow-color:FillPattern
shadow-spec:GraphicShadowSpec を指定します。
ローカル オプション public Graphic.shadow-spec:#ShadowSpec =null
visible?:描画や PointerEvent ディスパッチの目的でこのオブジェクトを透明にして不可視にするかどうかを示す bool
ローカル オプション public Graphic.visible?:bool =true
vorigin:Graphic.horigin オプションとほぼ同じですが、オブジェクトの外側起点の y 座標を指定する点が異なります。
ローカル オプション public Graphic.vorigin:any ="origin"
width:Graphic の幅設定。
ローカル オプション public Graphic.width:any
プロパティ 継承 Visual: _style-element, clonable-class?, completely-clonable-children?, cursor, data-source, dragee, font-size, input-method-enabled?, input-method-keyboard-mode, name, options, options-present-here, style-class, style-element, style-manager, style-options, test-description, test-name, test-parent?, test-type-name, test-visible?, tooltip, user-data
プロパティ 継承 DataBindingTarget: data-binding-context, data-bindings
プロパティ 継承 EventTarget: event-handlers
プロパティ 継承 OptionListInterface: option-register-proc, registered-option-keys

メソッド
after-reposition:Graphic が移動またはサイズ変更されたことを、Graphic に通知します。
public {Graphic.after-reposition layout-context:LayoutContext}:void
attempt-revalidate-layout:最後のレイアウト ネゴシエーションが完了してから、Graphic のレイアウト設定が変更されたかどうかを判定します。
public {Graphic.attempt-revalidate-layout lc:LayoutContext}:bool
before-reposition:Graphic が移動またはサイズ変更されることを、Graphic に対して通知します。
public {Graphic.before-reposition layout-context:LayoutContext}:void
constrain-height:指定した高さの制約を受けた場合にこの Graphic の幅設定を返します。
public {Graphic.constrain-height
lc:LayoutContext,
ascent:Distance,
descent:Distance
}:Dimension
constrain-width:指定した高さの制約を受けた場合にこの Graphic の高さ設定を返します。
public {Graphic.constrain-width
lc:LayoutContext,
lextent:Distance,
rextent:Distance
}:Dimension
contains-point?:指定されたポイントで発生するイベントが、ターゲット ボックス (BasicBox.contains-point? を参照) か、またはそのグラフィカルな子のどちらに関するものかを判定します。
public {Graphic.contains-point? x:Distance, y:Distance}:bool
create-pagination-state:PaginationState オブジェクトをインスタンス化します。
protected {Graphic.create-pagination-state
bounds:GRect,
show-decorations-at-page-breaks?:bool
}:PaginationState
detach:self をそのグラフィカルな親から削除します。
public {Graphic.detach}:void
draw:このオブジェクトの可視表現を描画します。
public {Graphic.draw renderer2d:Renderer2d}:void
draw-range-as-selected:このグラフィックの一部を選択領域として描画します。
public {Graphic.draw-range-as-selected
rng:GuiRange,
background:FillPattern,
color:FillPattern,
gc:Renderer2d
}:void
draw-shadow:オブジェクトの影を描画します。
public {Graphic.draw-shadow renderer2d:Renderer2d}:void
end-pagination:この Graphic に対するパジネーション プロセスを終了し、PaginationState を記録するためのデータ構造を割り当て解除します。
public {Graphic.end-pagination}:void
find-ancestor:与えられた述語に適合する最も近いグラフィックの祖先を返します。
public {Graphic.find-ancestor p:{proc-type {Graphic}:bool}}:#Graphic
find-graphic-at:指定ポイントをカバーし、指定テストの条件を満たす Graphic を見つけます。
public {Graphic.find-graphic-at
x:Distance,
y:Distance,
test:{proc-type {Graphic}:bool}
}:#Graphic
find-graphical-ancestor:与えられた述語に適合する最も近いグラフィックの祖先を返します。
public {Graphic.find-graphical-ancestor
p:{proc-type {Graphic}:bool}
}:#Graphic
fire-inferior-crossing-event:このオブジェクトで PointerCrossing イベントを発生させます。
protected {Graphic.fire-inferior-crossing-event}:void
get-graphical-root:Visual のグラフィック階層のルートで、オブジェクトを取得します。
public {Graphic.get-graphical-root}:Graphic
get-height-preference:この Graphic の高さ設定を返します。
public abstract {Graphic.get-height-preference}:Dimension
get-origin-in-graphical-ancestor:グラフィック階層内における指定された祖先に対する Visual の相対的位置を見つけます。
public {Graphic.get-origin-in-graphical-ancestor
ancestor:Graphic
}:(x:Distance, y:Distance, found?:bool)
get-origin-in-root:グラフィック階層のルートにあるオブジェクトを基準とし、Visual の位置を取得します。
public {Graphic.get-origin-in-root
}:(x:Distance, y:Distance, root:Graphic)
get-pagination-state:GraphicPaginationState を返します。
public {Graphic.get-pagination-state query-only?:bool}:PaginationState
get-range-as-selected-text:start-boundend-bound 間の、このグラフィック内に含まれる選択したテキストを取得します。
public {Graphic.get-range-as-selected-text
into:StringBuf,
start-bound:#GuiMark = null,
end-bound:#GuiMark = null
}:void
get-top-left-in-ancestor:グラフィック階層に含まれる指定上位オブジェクトの座標フレームでこのオブジェクトの左上隅のロケーションを見つけます。
public {Graphic.get-top-left-in-ancestor
ancestor:Graphic
}:(x:Distance, y:Distance, found?:bool)
get-visible-bounds-into:オブジェクトの実際の可視領域の境界ボックスを計算します。
public {Graphic.get-visible-bounds-into grect:GRect}:void
get-width-preference:この Graphic の幅設定を返します。
public abstract {Graphic.get-width-preference}:Dimension
graphical-child-visible-at:位置 x、y にある目に見えるグラフィカルな子を規定します。
public {Graphic.graphical-child-visible-at}:#Graphic
make-gui-mark:この Graphic を参照する GuiMark を作成する標準的な方法。
public {Graphic.make-gui-mark}:GuiMark
on-drag-enter:DragEnter イベントのスタティック イベント ハンドラ
public {Graphic.on-drag-enter e:DragEnter}:void
on-inspection:Inspection イベントのスタティック イベント ハンドラ
public {Graphic.on-inspection e:Inspection}:void
on-pointer-enter:PointerEnter イベントのスタティック イベント ハンドラ
public {Graphic.on-pointer-enter e:PointerEnter}:void
option-changed:このオブジェクトにオプションの値が変更したことを通知します。
public {Graphic.option-changed key:String, value:any}:void
paginate:グラフィックにパジネーションを適用します。
public {Graphic.paginate
page-height:Distance,
next-page-height:Distance,
query-only?:bool
}:(PaginationState, PaginationQuality)
paint-with-decorations:ボーダーやマージンを含めたオブジェクトのセル全体を描画します。
public {Graphic.paint-with-decorations gc:Renderer2d}:void
pointer-enter-occurred:このオブジェクトで PointerLeafEnter を発生させます。
public {Graphic.pointer-enter-occurred e:GuiInputEvent}:void
pointer-leave-occurred:このオブジェクトで PointerLeafLeave を発生させます。
public {Graphic.pointer-leave-occurred e:GuiInputEvent}:void
replace-with:このオブジェクトに代わって別のオブジェクトをグラフィック階層に置きます。
public {Graphic.replace-with g:Graphic}:Graphic
request-draw:描画する Graphic に属するピクセルを確認します。
public {Graphic.request-draw
layout-context:LayoutContext = {self.get-layout-context}
}:void
request-draw-rect:指定した GRect を再描画するためにピクセルを要求します。
public {Graphic.request-draw-rect
rect:GRect,
layout-context:LayoutContext = {self.get-layout-context}
}:void
request-layout:Graphic のレイアウト設定が変更されたため、新しいレイアウト ネゴシエーションを行う必要があることを通知します。
public {Graphic.request-layout}:void
request-pointer-trace:表示されたオブジェクトの幾何形状が変更されていることを宣言し、必要な PointerCrossing イベントの発生を要求します。
public {Graphic.request-pointer-trace}:void
search-next:この Graphic 内か、その子の 1 つに現れるパターンの境界を返します。
public {Graphic.search-next
pattern:SearchPattern,
gm:#GuiMark = null
}:(pattern-start:#GuiMark,pattern-end:#GuiMark)
search-next-here:この Graphic 内か、その子の 1 つに現れるパターンの境界を返します。通常このメソッドは、アプリケーション コードから直接呼び出しません。代わりに Graphic.search-next を呼び出します。
protected {Graphic.search-next-here
pattern:SearchPattern,
gm:#GuiMark = null
}:(pattern-start:#GuiMark,pattern-end:#GuiMark)
search-prev:この Graphic 内か、その子の 1 つに現れるパターンの境界を返します。
public {Graphic.search-prev
pattern:SearchPattern,
gm:#GuiMark = null
}:(#GuiMark, #GuiMark)
search-prev-here:この Graphic 内か、その子の 1 つに現れるパターンの境界を返します。通常このメソッドは、アプリケーション コードから直接呼び出しません。代わりに Graphic.search-prev を呼び出します。
protected {Graphic.search-prev-here
pattern:SearchPattern,
gm:#GuiMark = null
}:(#GuiMark, #GuiMark)
set-layout:Graphic のレイアウト オブジェクトを設定します。
public {Graphic.set-layout l:#Layout}:void
set-size:このオブジェクトにレイアウト幅と高さを代入します。
public {Graphic.set-size lc:LayoutContext, bounds:GRect}:void
start-pagination:パジネートできるように Graphic を準備します。
public {Graphic.start-pagination}:PaginationState
xy-offset-to:2 つの グラフィカル オブジェクトの起点の間の (x、y) オフセットを計算します。
public {Graphic.xy-offset-to}:(x:Distance, y:Distance, valid?:bool)
メソッド 継承 Visual: add, add-from-init-args, add-option, add-style-option, animate, change-cursor, clear, clonable-appearance?, clone-appearance, clone-appearance-helper, find-test-children, get-focus-manager, get-layout-context, get-test-parent, get-test-property, get-text, get-view, maybe-fire-attach-event, maybe-fire-detach-event, non-keyword-init-arg, note-attached, note-caret-position, note-detaching, on-drag-leave, on-pointer-envelope-event, on-pointer-leave, pop-cursor, prepare-test-object, prepare-test-parent, push-cursor, quantize-width, release-key-focus, remove-option, remove-style-option, request-key-focus, scroll-to-include, test-record, test-run, transform-from-display-coordinates, transform-from-graphical-root-coordinates, transform-to-display-coordinates, transform-to-graphical-root-coordinates
メソッド 継承 GraphicOptions: any-to-Distance, get-display-context
メソッド 継承 GuiEventTarget: handle-event, on-action, on-cancel-mode, on-command-changed, on-commit, on-composition-change-event, on-composition-result-event, on-context-menu-event, on-current-record-change-request, on-current-record-changed, on-destroy-notify, on-destroy-requested, on-drag-over, on-drag-pointer, on-drag-started, on-drop, on-end-composition-event, on-focus-event, on-focus-in, on-focus-out, on-grab-release, on-gui-event, on-input-method-event, on-key-event, on-key-press, on-pointer-button, on-pointer-crossing, on-pointer-event, on-pointer-motion, on-pointer-press, on-pointer-release, on-pointer-scroll, on-raw-key-event, on-raw-key-press, on-raw-key-release, on-reset, on-selectable-added, on-selectable-removed, on-selection-changed, on-selection-context-activated, on-selection-context-deactivated, on-selection-event, on-start-composition-event, on-start-event, on-stop-event, on-view-activate, on-view-deactivate, on-window-close, remove-event-handlers-for-event-class
メソッド 継承 DataBindingTarget: add-data-binding, get-data-binding, refresh-data-binding, remove-data-binding, unset-property, update-data-binding, validate-data-binding
メソッド 継承 EventTarget: accepts-event-class?, add-event-handler, event-handler-present?, remove-event-handler, verify-event
メソッド 継承 OptionListInterface: change-option-parent-notify, clone-options, get-option, get-option-by-name, keyword-init-arg, local-add-notify, local-remove-notify, name-to-option-key, new-option-item, notify-option-children, option-change-notify, option-lookup, option-lookup-here, option-propagate-notify, option-set?, propagate-option-change, register-options, remove-styles, set-option-by-name, set-style-option-by-name, unset-option-by-name, unset-style-option-by-name
メソッド 継承 BasicEventTarget: enqueue-event
メソッド 継承 InitRestArgParser: process-rest-args
メソッド 継承 Object: object-describe, object-describe-for-debugging, object-serialize



コンストラクタ詳細
clone-appearance-from (コンストラクタ)
protected {Graphic.clone-appearance-from other:Graphic}

このタイプの新しいオブジェクトを作成するために Visual.clone-appearance が使用するコンストラクタ。

other: クローンする Graphic

注意事項

クローン化をサポートする Graphic のサブクラスには、このコンストラクタを呼び出すコンストラクタが必要です。ただし、これらのコンストラクタがそれぞれ自身のオプションをクローン化する場合は、その限りではありません。


default (コンストラクタ)
public {Graphic.default ...}

Graphic を初期化します。

説明

キーワード引数は、最終的にそれらをオプション設定として解釈する OptionListInterface.keyword-init-arg によって処理されます。位置引数は、Visual.non-keyword-init-arg によって処理され、このとき引数は EventHandler あることが必要です。これらは両方ともサブクラスでオーバーライドできます。


from-any (ファクトリ)
public implicit {Graphic.from-any obj:any}:Graphic

any から Graphic を作成します。

説明

このファクトリーは、 他の Graphic ファクトリーと一致しない型を持つ値を処理するために存在します。そのような型を処理するためには記述されておらず、動作も他のファクトリーと異ります。


from-Dynamic (ファクトリ)
public implicit {Graphic.from-Dynamic obj:Dynamic}:Graphic

Dynamic から Graphic を作成します。



from-string (ファクトリ)
public implicit {Graphic.from-string obj:String}:Graphic

String から Graphic を作成します。



from-TextFormat (ファクトリ)
public implicit {Graphic.from-TextFormat obj:TextFormat}:Graphic
この項目はサポートされていません。内部使用限定となっています。


from-Visual (ファクトリ)
public implicit {Graphic.from-Visual obj:Visual}:Graphic

Visual から Graphic を作成します。




プロパティ詳細
avoid-page-break? (ローカル オプション)
public Graphic.avoid-page-break?:bool

true の場合は、この Graphic のコンテナは、パジネーションが実行される時に、この Graphic をページ間に分割せずに、1 ページに収めようとします。

注意事項

コンテナ (Box など) のパジネーション アルゴリズムでは、パジネーションを実行する場合、この Graphic が現行ページに収まらないときには次のページに押し込むことを常に考慮する必要があります。ただし、次のページにも収まらない場合は、次のページでパジネーションを実行するために Graphic.paginate を呼び出す必要があります。


background (ローカル オプション)
public Graphic.background:Background =Background.transparent

グラフィカル オブジェクトの背景色または背景パターン。

説明

グラフィカル オブジェクトの背景色または背景パターンを、"red" などの FillPattern に自動変換する BackgroundFillPattern、 または String に設定します。


例: 背景を文字列に設定
{CheckButton
    label="Check here if you like my background",
    background="lime"
}



例: 背景を Background オブジェクトに設定
{Fill
    width = 2cm,
    height = 2cm,
    background =
        {Background
            {url "curl://install/docs/default/images/grass.jpg"}
        }
}

注意事項

背景を Observable でもある FillPattern アニメーションに設定すると、必要に応じて Graphic がそれ自体を再描画するように FillPattern が登録されます。

ただし、よりシンプルな call-back メカニズムによって背景を NotifyingFillPattern に設定した場合もこのような処理が行われるので注意してください。


border-color (非ローカル オプション)
public Graphic.border-color:FillPattern

グラフィカル オブジェクトの境界の色またはパターン。

説明

境界色は、境界が存在する場合、つまり、オブジェクトの border-width オプションを設定した場合にのみ適用されます。

任意の FillPattern オブジェクトに border-color、またはサポートしている String に設定し、FillPattern に自動変換します。

オブジェクトの border-width は定義されているが border-color が定義されていない場合、オブジェクトの境界はオブジェクトの背景色を使ってペイントされます。オブジェクトの背景色は、オブジェクトの border-style オプションによっては境界が見えない場合もあります。

次の図は、グラフィカル オブジェクトの境界を青色で表示しています。



参照: Graphic.background, Graphic.border-width, Graphic.border-style.


border-spec (ローカル オプション)
public Graphic.border-spec:#BorderSpec =null

GraphicBorderSpec を指定します。

説明

NULL の場合、GraphicGraphic.border-widthGraphic.margin を使用して、そのボーダーとマージンを指定します。
NULL でない場合は、BorderSpec に指定されたボーダーとマージンを使用します。BorderSpec.left-border-widthBorderSpec.right-border-widthBorderSpec.top-border-width、および BorderSpec.bottom-border-width のどれもが null であると、GraphicGraphic.border-width で指定された値を使用します。
同様に、BorderSpec.left-marginBorderSpec.right-marginBorderSpec.top-margin、および BorderSpec.bottom-margin のどれもが null であると、GraphicGraphic.margin で指定された値を使用します。


例: BorderSpec の使用
{define-proc package {make-frame
                         border-style:BorderStyle,
                         border-color:FillPattern =
                             FillPattern.blue,
                         border-spec:#BorderSpec = null
                     }
    {return
        {Frame                 
            border-width = 3pt,
            margin = 10pt,
            background = FillPattern.silver, 
            border-color = border-color,                
            border-style = border-style,
            border-spec = border-spec,
            "Apple"
        }
    }
}

{spaced-hbox
    margin = 2pt,
    || Note that this Frame is setting the left and right border
    || width to 0pt. Since top and bottom border width are not 
    || specified in the BorderSpec they will be equal to the 
    || value of the border-width option on the Frame. 
    {make-frame 
        BorderStyle.dot,
        border-spec = 
            {BorderSpec
                left-border-width = 0pt,
                right-border-width = 0pt
            }
    },
    || Note that this Frame is setting the left and right margin 
    || to 0pt. Since top and bottom margin are not specified in the 
    || BorderSpec they will be equal to the value of the margin 
    || option on the Frame. 
    {make-frame 
        BorderStyle.dot,
        border-spec =
            {BorderSpec
                left-margin = 0pt,
                right-margin = 0pt
            }                
    }
}


border-style (ローカル オプション)
public Graphic.border-style:BorderStyle =BorderStyle.flat

オブジェクトの境界の外観を指定します。

説明

有効値は次のとおりです。


例: 次は、さまざまなテーブル セルのボーダー スタイルを青で表示しています (tiled を除く)。
{define-proc package {make-frame
                         border-style:BorderStyle,
                         border-color:FillPattern =
                             FillPattern.blue
                     }
    let label:String = {{String border-style}.tail 12}
    {return
        || Outer Frame is added for spacing only.
        {Frame margin = 3pt,
            {Frame
                width = 2cm, 
                height = 1cm, 
                border-width = 3pt,
                background = FillPattern.silver, 
                border-color = border-color,                
                border-style = border-style,
                label
            }
        }
    }
}       

{RasterBox      
    {make-frame BorderStyle.none},
    {make-frame BorderStyle.flat},
    {make-frame BorderStyle.raised},
    {make-frame BorderStyle.sunken},
    {make-frame BorderStyle.ridge},
    {make-frame BorderStyle.groove},
    {make-frame BorderStyle.dash},
    {make-frame BorderStyle.dot},
    {make-frame BorderStyle.double}
}
この例は、tiled ボーダー スタイルの使用法を示しています。ボーダー幅が変化するにつれて、ボーダーのタイル部分がどのように変化するか注意してください。この場合は、タイル部分には 24px より小さいボーダー幅のイメージの傾斜部分が含まれます。また、ピクセルの単一の行と列が伸長され、イメージ部分がなくなるまで、ボーダーが大きくなるにつれて、両側と上部に沿ったタイル表示に使用できるイメージ部分が小さくなっていくことに注意してください。これは、ボーダー幅がイメージ サイズの半分以上の場合に発生します。このイメージは 256x256 のため、ボーダー幅を 128px 以上に設定するとこの効果を確認することができます。
border-color に使用されるイメージは次のように表示されます。

例: tiled ボーダー スタイルの使用
{let constant f:Frame =
    {Frame
        border-width = 60px,
        border-style = BorderStyle.tiled,
        border-color =
            {FillPattern.from-url
                {url "curl://source/docs/default/images/tiled-border.gif"}
            }
    }
}

{value
    {f.add
        {HBox
            background = "#6f4e20",
            control-content-background = "#6f4e20",
            color = "white",
            spacing = 5mm,
            "border-width:",
            {TextField
                width = 2cm,
                value = "60px",
                control-appearance-changeable? = true,
                {on ValueFinished at tf:TextField do
                    set f.border-width = {evaluate tf.value}
                }
            }
        }
    }
    
    f
}

注意事項

参照: Graphic.border-width, border-color.


border-width (ローカル オプション)
public Graphic.border-width:any =0pt

オブジェクトの境界の幅を指定します。

説明

有効な値は次のとおりです。
既定値は 0pt です。

距離は同じで境界幅 (青) の異なる 2 つのオブジェクトを次に示します。


{spaced-hbox
    valign="bottom",
    {Frame width=3cm,
           height=2cm,
           background="silver",
           border-color="blue",
           border-width=3pt},
    {Frame width=3cm,
           height=2cm,
           background="silver",
           border-color="blue",
           border-width=0.25cm}}

注意事項

border-width に代入する値には、10pt (10points)、.5cm (.5centimeters)、0.3in (0.3inches)、または 1px (1pixel) などの明示的な距離単位を指定することをお勧めします。単位が指定されていない整数や浮動小数点数は、距離をポイント (1pt = 1/72 インチ) で表していると見なされます。

Graphic.width オプションや Graphic.height オプション同様に、指定した境界幅がピクセル サイズの正確な倍数にならない場合、最も近い倍数に丸められます。ただし、ゼロより大きくても 1 ピクセルより小さいピクセル サイズは、常に 1 ピクセルに切り上げられます。


cell-border-spec (非ローカル オプション)
public Graphic.cell-border-spec:#BorderSpec

Table セルの BorderSpec を指定します。

説明

NULL の場合、Tablecell-border-widthcell-margin を使用して、Table セルのボーダーとマージンを指定します。
NULL でない場合は、BorderSpec に指定されたボーダーとマージンを使用します。BorderSpec.left-border-widthBorderSpec.right-border-widthBorderSpec.top-border-width、および BorderSpec.bottom-border-width のどれもが null であると、Tablecell-border-width で指定された値を使用します。
同様に、BorderSpec.left-marginBorderSpec.right-marginBorderSpec.top-margin、および BorderSpec.bottom-margin のどれもが null であると、Tablecell-margin で指定された値を使用します。


例: BorderSpec の使用
{define-proc package {make-table
                         cell-border-style:BorderStyle,
                         cell-border-color:FillPattern =
                             FillPattern.blue,
                         cell-border-spec:#BorderSpec = null
                     }
    {return
        {Table
            columns = 3,
            width = 7cm,
            height = 3cm,
            background = FillPattern.silver,                
            border-width = 1pt,
            border-color = FillPattern.black,
            cell-border-style = cell-border-style,
            cell-border-color = cell-border-color,
            cell-border-width = 2pt,
            cell-margin = 5pt,                
            cell-border-spec = cell-border-spec,
            "Apple", "Banana", "Grapes",
            "Papaya", "Strawberry", "Guava"
        }
    }
}

{spaced-hbox
    margin = 2pt,
    || Note that this Table is setting the left and right cell 
    || border width to 0pt. Since top and bottom cell border width
    || are not specified in the BorderSpec they will be equal to 
    || the value of the cell-border-width option on the Table. 
    {make-table
        BorderStyle.flat,
        cell-border-spec = 
            {BorderSpec
                left-border-width = 0pt,
                right-border-width = 0pt
            }
    },
    || Note that this Table is setting the left and right cell 
    |