choose-color (プロシージャ)
public {choose-color
title:String = {hlmessage Select a Color},
prompt:String = "",
initial-color:FillPattern = FillPattern.white
}:#FillPattern
パッケージ: CURL.GUI.EXTRAS

[色選択] ダイアログを表示します。

title: ダイアログのタイトル バーに表示される文字列。
prompt: ダイアログ内に表示される文字列。
initial-color: 選択した初期色。

戻り値

ユーザーがダイアログをキャンセルした場合、FillPattern として選択した値か null が返されます。

プログラミング注意事項

以下は [色選択] ダイアログの例です。

{import * from CURL.GUI.EXTRAS}
{Frame 
    valign = "center", margin = 4pt,
    border-width = 1px, border-style = "sunken",
    background = "yellow",
    "Click to Choose Color",
    {on PointerRelease at f:Frame do
        {if-non-null fp:FillPattern = 
            {choose-color 
                prompt = "Select a color for the example:",
                initial-color = {f.background.to-FillPattern}
            }
         then
            set f.background = fp
        }
    }
}