トップ 一覧 検索 ヘルプ RSS ログイン

Palm OS Programmer's API Reference/21の変更点

  • 追加された行はこのように表示されます。
  • 削除された行はこのように表示されます。
{{div_begin}}
[[← 20 章に戻る|Palm OS Programmer's API Reference/20]] [[↑トップへ|Palm OS Programmer's API Reference]] [[22 章に進む →|Palm OS Programmer's API Reference/22]]
----
{{div_end}}

{{anchor top}}
{{div_begin style="margin-bottom:-10px"}}
!!!21 UI カラー リスト
{{div_end}}

この章の索引

{{div_begin "style='position:absolute;right:0px;font-size:70%;margin-right:15px;margin-top:15px;width:250px;'"}}
*{{goto UI Color Data Types,UI カラー データ タイプ}}
**{{goto UIColorTableEntries,UIColorTableEntries}}
*{{goto UI Color Functions,UI カラー関数}}
**{{goto UIColorGetTableEntryIndex,UIColorGetTableEntryIndex}}
**{{goto UIColorGetTableEntryRGB,UIColorGetTableEntryRGB}}
**{{goto UIColorSetTableEntry,UIColorSetTableEntry}}
{{div_end}}

----

!!!21 UI カラー リスト

{{div_begin "style='position:relative;padding:0px;padding-right:5px;padding-left:10px;margin-right:250px;margin-top:20px;width:auto;border-right-style:dotted;border-right-width:2px;border-right-color:silver;'"}}
この章では、以下で説明する UI カラー リストについての情報を提供します。

*{{goto UI Color Data Types,UI カラー データ タイプ}}
*{{goto UI Color Functions,UI カラー関数}}

ヘッダ ファイル {{span style='color:blue;font-family:monospace;',UIColor.h}} がこの章で説明する API を定義しています。カラー リストについての更なる情報は、''Palm OS Programmer's Companion, vol. I'' の中の[[「カラーとグレイスケールのサポート」|Palm OS Programmer's Companion Volume I/4-15]]を参照してください。


!!{{anchor UI Color Data Types}}UI カラー データ タイプ {{goto top,^TOP^}}


!{{anchor UIColorTableEntries}}UIColorTableEntries 列挙体 {{goto top,^TOP^}}

'''目的'''

{{span style='color:blue;font-family:monospace;',UIColorTableEntries}} 列挙体はさまざまな UI 要素のために記号的なカラー定数を宣言します。

UI カラー リストをシステム カラー テーブルと混同しないでください。'''システム カラー テーブル'''(または'''システム パレット''')はウィンドウの表示または描画のために、使用されるかされないかにかかわらず、すべての使用可能なカラーを定義します。'''UI カラー リスト'''はインターフェイス オブジェクトを描くために使用されるカラーを定義します。

'''Prototype'''

 typedef enum UIColorTableEntries {
 	UIObjectFrame = 0,
 	UIObjectFill,
 	UIObjectForeground,
 	UIObjectSelectedFill,
 	UIObjectSelectedForeground,
 
 	UIMenuFrame,
 	UIMenuFill,
 	UIMenuForeground,
 	UIMenuSelectedFill,
 	UIMenuSelectedForeground,
 
 	UIFieldBackground,
 	UIFieldText,
 	UIFieldTextLines,
 	UIFieldCaret,
 	UIFieldTextHighlightBackground,
 	UIFieldTextHighlightForeground,
 	UIFieldFepRawText,
 	UIFieldFepRawBackground,
 	UIFieldFepConvertedText,
 	UIFieldFepConvertedBackground,
 	UIFieldFepUnderline,
 
 	UIFormFrame,
 	UIFormFill,
 
 	UIDialogFrame,
 	UIDialogFill,
 
 	UIAlertFrame,
 	UIAlertFill,
 
 	UIOK,
 	UICaution,
 	UIWarning,
 
 	UIFieldFepConvertedUnderline
 
 	UILastColorTableEntry
 } UIColorTableEntries;

'''定数'''

*{{span style='color:blue;font-family:monospace;',UIObjectFrame}}
**ユーザ インターフェイス オブジェクト(コマンド ボタン、プッシュ ボタン、セレクタ トリガ、メニュー、矢印チェックボックス、その他のコントロールなど)の境界線のためのカラー。
*{{span style='color:blue;font-family:monospace;',UIObjectFill}}
**ソリッドまたは「塗りつぶされる」(原文: solid or "filled")ユーザ インターフェイス オブジェクトのためのバックグランド カラー。{{br}}テーブルの中のオブジェクトは {{span style='color:blue;font-family:monospace;',UIObject...}} カラーの代わりに {{span style='color:blue;font-family:monospace;',UIField...}} カラーを使用することに注意してください。
*{{span style='color:blue;font-family:monospace;',UIObjectForeground}}
**ユーザ インターフェイス オブジェクトの中のフォアグランド アイテム(ラベルやグラフィックなど)のためのカラー。
*{{span style='color:blue;font-family:monospace;',UIObjectSelectedFill}}
**現在選択されているユーザ インターフェイス オブジェクト - そのオブジェクトがソリッドかどうかに関係なく - のバックグランド カラー。
*{{span style='color:blue;font-family:monospace;',UIObjectSelectedForeground}}
**選択されているユーザ インターフェイス オブジェクトの中のフォアグランド アイテムのカラー。
*{{span style='color:blue;font-family:monospace;',UIMenuFrame}}
**メニューの周りの境界線のカラー。
*{{span style='color:blue;font-family:monospace;',UIMenuFill}}
**メニュー アイテムのバックグランド カラー。
*{{span style='color:blue;font-family:monospace;',UIMenuForeground}}
**メニューのテキストのカラー。
*{{span style='color:blue;font-family:monospace;',UIMenuSelectedFill}}
**選択されているメニュー アイテムのバックグランド カラー。
*{{span style='color:blue;font-family:monospace;',UIMenuSelectedForeground}}
**選択されているメニュー アイテムのテキストのカラー。
*{{span style='color:blue;font-family:monospace;',UIFieldBackground}}
**編集可能なテキスト フィールドのバックグランド カラー。
*{{span style='color:blue;font-family:monospace;',UIFieldText}}
**編集可能なフィールドの中のテキストのカラー。
*{{span style='color:blue;font-family:monospace;',UIFieldTextLines}}
**編集可能なフィールドの中の下線のカラー。
*{{span style='color:blue;font-family:monospace;',UIFieldCaret}}
**編集可能なテキスト フィールドの中のカーソルのカラー。
*{{span style='color:blue;font-family:monospace;',UIFieldTextHighlightBackground}}
**編集可能なテキスト フィールドの中の選択されているテキストのバックグランド カラー。
*{{span style='color:blue;font-family:monospace;',UIFieldTextHighlightForeground}}
**編集可能なテキスト フィールドの中の選択されているテキストのカラー。
*{{span style='color:blue;font-family:monospace;',UIFieldFepRawText}}
**FEPがテキスト入力手段として使用されている(例えば、日本語デバイス上)時の、インライン変換エリアの中の変換されていないテキストのために使用されるカラー。FEP カラーがフィールド カラーと等しい場合、変換されていないテキストは実下線を持ちます。
*{{span style='color:blue;font-family:monospace;',UIFieldFepRawBackground}}
**FEPがテキスト入力手段として使用されている時の、インライン変換エリアの中の変換されていないテキストのためのバックグランド カラー。FEP カラーがフィールド カラーと等しい場合、変換されていないテキストは実下線を持ちます。
*{{span style='color:blue;font-family:monospace;',UIFieldFepConvertedText}}
**FEPがテキスト入力手段として使用されている(例えば、日本語デバイス上)時の、インライン変換エリアの中の変換されたテキストのために使用されるカラー。FEP カラーがフィールド カラーと等しい場合、変換されたテキストは倍幅の下線を持ちます。
*{{span style='color:blue;font-family:monospace;',UIFieldFepConvertedBackground}}**FEPがテキスト入力手段として使用されている時の、インライン変換エリアの中の変換されたテキストのためのバックグランド カラー。FEP カラーがフィールド カラーと等しい場合、変換されたテキストは倍幅の下線を持ちます。
*{{span style='color:blue;font-family:monospace;',UIFieldFepUnderline}}
**インライン変換エリアの中の変換されていないテキストのすぐ下の下線のために使用されるカラー。
*{{span style='color:blue;font-family:monospace;',UIFormFrame}}
**フォーム上の境界線とタイトルバーのカラー。
*{{span style='color:blue;font-family:monospace;',UIFormFill}}
**フォームのバックグランド カラー。この値には白色が推奨されます。
*{{span style='color:blue;font-family:monospace;',UIDialogFrame}}
**モーダル フォーム上の境界線とタイトルバーのカラー。
*{{span style='color:blue;font-family:monospace;',UIDialogFill}}
**モーダル フォームのバックグランド カラー。
*{{span style='color:blue;font-family:monospace;',UIAlertFrame}}
**アラート パネル上の境界線とタイトルバーのカラー。
*{{span style='color:blue;font-family:monospace;',UIAlertFill}}
**アラート パネルのバックグランド カラー。
*{{span style='color:blue;font-family:monospace;',UIOK}}
**使用されません。
*{{span style='color:blue;font-family:monospace;',UICaution}}
**使用されません。
*{{span style='color:blue;font-family:monospace;',UIWarning}}
**使用されません。
*{{span style='color:blue;font-family:monospace;',UIFieldFepConvertedUnderline}}
**インライン変換エリアの中の変換されたテキストのすぐ下の下線のために使用されるカラー。
*{{span style='color:blue;font-family:monospace;',UILastColorTableEntry}}
**列挙体の終わりを示すためのプレイスホルダー(原文: placeholder, 訳者注: 文字列の NULL 終端子のようなもの?)。

'''互換性'''

{{goto 3.5 New Feature Set,3.5 New Feature Set|Palm OS Programmer's API Reference/B}} が存在する場合にのみ、実装されます。
{{goto 3.5 New Feature Set,3.5 New Feature Set|Palm OS Programmer's API Reference/B-1}} が存在する場合にのみ、実装されます。


!!{{anchor UI Color Functions}}UI カラー関数 {{goto top,^TOP^}}


!{{anchor UIColorGetTableEntryIndex}}UIColorGetTableEntryIndex 関数 {{goto top,^TOP^}}

'''目的'''

現在のシステム パレットのための UI カラーのインデックス値を返します。

'''宣言されている場所'''

{{span style='color:blue;font-family:monospace;',UIColor.h}}

'''Prototype'''

 IndexedColorType UIColorGetTableEntryIndex(
 	UIColorTableEntries which
 )

'''パラメータ'''

*{{span style='color:blue;font-family:monospace;',→ which}}
**記号的なカラー定数の 1 つ。{{goto UIColorTableEntries,UIColorTableEntries}} を参照してください。

'''返り値'''

指定された記号的なカラーのために使用されるカラーのシステム カラー テーブルでのインデックスを返します。

'''コメント'''

すべてのカラーのインデックスを見つけ出す方法の 1 つは、OS が UI カラー リストの初めから終わりまでを通過するループを使用することです。各スロット(訳者注: 値のことか?)で {{span style='color:blue;font-family:monospace;',UIColorGetTableEntryIndex}} を呼び出し、リストに保存します(重複するものを除いて)。

 IndexedColorType  
   colorsUsed[UILastColorTableEntry]; 
 UInt16 numColors = 0; 
 ... 
 for (i = 0; i < UILastColorTableEntry; i++) { 
   IndexedColorType currentColor; 
   Boolean isNew = true; 
   
   currentColor = UIColorGetTableEntryIndex(i); 
   
   for (j = 0; ((j < numColors) && isNew); j++)  
     if (colorsUsed[j] == currentColor)  
       isNew = false; /* exit loop */ 
   if (isNew) { 
     numColors++; 
     colorsUsed[j] = currentColor; 
   } 

カラーの RGB 値を取得するには、{{goto UIColorGetTableEntryRGB,UIColorGetTableEntryRGB()}} 呼び出しで同様にします。

'''互換性'''

{{goto 3.5 New Feature Set,3.5 New Feature Set|Palm OS Programmer's API Reference/B}} が存在する場合にのみ、実装されます。
{{goto 3.5 New Feature Set,3.5 New Feature Set|Palm OS Programmer's API Reference/B-1}} が存在する場合にのみ、実装されます。

'''参照'''

{{goto IndexedColorType,IndexedColorType|Palm OS Programmer's API Reference/59}}, {{goto WinIndexToRGB,WinIndexToRGB()|Palm OS Programmer's API Reference/59}}


!{{anchor UIColorGetTableEntryRGB}}UIColorGetTableEntryRGB 関数 {{goto top,^TOP^}}

'''目的'''

UI カラーのための RGB 値を返します。

'''宣言されている場所'''

{{span style='color:blue;font-family:monospace;',UIColor.h}}

'''Prototype'''

 void UIColorGetTableEntryRGB(
 	UIColorTableEntries which,
 	RGBColorType *rgbP
 )

'''パラメータ'''

*{{span style='color:blue;font-family:monospace;',→ which}}
**記号的なカラー定数の 1 つ。{{goto UIColorTableEntries,UIColorTableEntries}} を参照してください。
*{{span style='color:blue;font-family:monospace;',← rgbP}}
**記号的なカラーのために使用されている現在のカラーに対応する RGB カラー値へのポインタ。

'''返り値'''

返り値はありません。

'''コメント'''

一般に、RGB カラー エントリの代わりにインデックス カラー エントリで作業をしたほうがより効果的です。

'''互換性'''

{{goto 3.5 New Feature Set,3.5 New Feature Set|Palm OS Programmer's API Reference/B}} が存在する場合にのみ、実装されます。
{{goto 3.5 New Feature Set,3.5 New Feature Set|Palm OS Programmer's API Reference/B-1}} が存在する場合にのみ、実装されます。

'''参照'''

{{goto UIColorGetTableEntryIndex,UIColorGetTableEntryIndex()}}, {{goto WinRGBToIndex,WinRGBToIndex()|Palm OS Programmer's API Reference/59}}


!{{anchor UIColorSetTableEntry}}UIColorSetTableEntry 関数 {{goto top,^TOP^}}

'''目的'''

UI カラー リストの中の値を変更します。

'''宣言されている場所'''

{{span style='color:blue;font-family:monospace;',UIColor.h}}

'''Prototype'''

 Err UIColorSetTableEntry(
 	UIColorTableEntries which,
 	const RGBColorType *rgbP
 )

*{{span style='color:blue;font-family:monospace;',→ which}}
**記号的なカラー定数の 1 つ。{{goto UIColorTableEntries,UIColorTableEntries}} を参照してください。
*{{span style='color:blue;font-family:monospace;',→ rgbP}}
**指定された UI オブジェクトのために使用されるべきカラーの RGB 値({{goto RGBColorType,RGBColorType|Palm OS Programmer's API Reference/26}} を参照してください)。
'''返り値'''

成功時には 0 を返します。

'''コメント'''

UI カラー エントリの値に渡された RGB 値をセットします。現在描かれているウィンドウによって使用されるパレットに対応する RGB 値に最もよくフィットするように UI カラー エントリのためのインデックスを更新します。

描かれるウィンドウが現在スクリーン上にある場合にのみこの関数を使用することがベストです。さもないと、ベスト-フィット アルゴリズムは現在のスクリーンでは使用できないカラーを選択するかもしれません。

'''参照'''

{{goto WinIndexToRGB,WinIndexToRGB()|Palm OS Programmer's API Reference/59}}, {{goto UIColorGetTableEntryIndex,UIColorGetTableEntryIndex()}}, {{goto UIColorGetTableEntryRGB,UIColorGetTableEntryRGB()}}
{{div_end}}

----
{{div_begin "style='border-top-style:solid;border-top-width:1px;border-top-color:silver;'"}}
[[← 20 章に戻る|Palm OS Programmer's API Reference/20]] [[↑トップへ|Palm OS Programmer's API Reference]] [[22 章に進む →|Palm OS Programmer's API Reference/22]]
{{div_end}}