Share via


CMFCPropertyGridColorProperty クラス

CMFCPropertyGridColorProperty クラスは、色の選択用のダイアログ ボックスを開くプロパティ リスト コントロール項目をサポートします。

構文

class CMFCPropertyGridColorProperty : public CMFCPropertyGridProperty

メンバー

パブリック コンストラクター

名前 説明
CMFCPropertyGridColorProperty::CMFCPropertyGridColorProperty CMFCPropertyGridColorProperty オブジェクトを構築します。
CMFCPropertyGridColorProperty::~CMFCPropertyGridColorProperty デストラクターです。

パブリック メソッド

名前 説明
CMFCPropertyGridColorProperty::EnableAutomaticButton [色の 選択] ダイアログ ボックスで自動 ボタンを有効にします。 (標準の自動ボタンにラベルが付けられます。 自動)。)
CMFCPropertyGridColorProperty::EnableOtherButton [色の 選択] ダイアログ ボックスのもう一方 のボタンを有効にします。 (標準の他のボタンにはラベルが付けられます その他の色)。)
CMFCPropertyGridColorProperty::FormatProperty プロパティ値のテキスト表現の書式を設定します (オーバーライド CMFCPropertyGridProperty::FormatProperty.)
CMFCPropertyGridColorProperty::GetColor プロパティの現在の色を取得します。
CMFCPropertyGridColorProperty::GetThisClass このクラス型に関連付けられている CRuntimeClass オブジェクトへのポインターを取得するためにフレームワークによって使用されます。
CMFCPropertyGridColorProperty::OnClickButton プロパティに含まれているボタンをユーザーがクリックすると、フレームワークによって呼び出されます (オーバーライド CMFCPropertyGridProperty::OnClickButton.)
CMFCPropertyGridColorProperty::OnDrawValue プロパティ値を表示するためにフレームワークによって呼び出されます (オーバーライド CMFCPropertyGridProperty::OnDrawValue.)
CMFCPropertyGridColorProperty::OnEdit ユーザーがプロパティ値を変更しようとすると、フレームワークによって呼び出されます (オーバーライド CMFCPropertyGridProperty::OnEdit.)
CMFCPropertyGridColorProperty::OnUpdateValue 編集可能なプロパティの値が変更されると、フレームワークによって呼び出されます (オーバーライド CMFCPropertyGridProperty::OnUpdateValue.)
CMFCPropertyGridColorProperty::SetColor プロパティの新しい色を設定します。
CMFCPropertyGridColorProperty::SetColumnsNumber 現在のカラー プロパティ グリッド内の列の数を指定します。
CMFCPropertyGridColorProperty::SetOriginalValue 編集可能なプロパティの元の値を設定します。

解説

CMFCPropertyGridColorProperty クラスは、プロパティ リスト コントロールに追加できるカラー プロパティをサポートします。 詳細については、CMFCPropertyGridCtrl クラス参照してください。

CMFCPropertyGridColorProperty クラスのオブジェクトを構築する方法、および CMFCPropertyGridColorProperty クラスの各種メソッドを使用してこのオブジェクトを構成する方法を次の例に示します。 このコードでは、自動ボタンとその他ボタンを有効にする方法、および色と列番号を設定する方法を示しています。 この例は、新しいコントロールの サンプルの一部です。

CMFCPropertyGridColorProperty *pColorProp = new CMFCPropertyGridColorProperty(_T("Window Color"), RGB(210, 192, 254), NULL, _T("Specifies the default dialog color"));
pColorProp->EnableOtherButton(_T("Other..."));
pColorProp->EnableAutomaticButton(_T("Default"), ::GetSysColor(COLOR_3DFACE));
pColorProp->SetColor(RGB(255, 0, 0));
pColorProp->SetColumnsNumber(3);

継承階層

CObject

CMFCPropertyGridProperty

CMFCPropertyGridColorProperty

必要条件

ヘッダー: afxpropertygridctrl.h

CMFCPropertyGridColorProperty::CMFCPropertyGridColorProperty

CMFCPropertyGridColorProperty オブジェクトを構築します。

CMFCPropertyGridColorProperty(
    const CString& strName,
    const COLORREF& color,
    CPalette* pPalette = NULL,
    LPCTSTR lpszDescr = NULL,
    DWORD_PTR dwData = 0);

パラメーター

Strname
[in] プロパティの名前。

color
[in]プロパティの色の値。

pPalette
[in]色のパレットへのポインター。 既定値は NULL です。

lpszDescr
[in] プロパティの説明。 既定値は NULL です。

dwData
[in]整数やプロパティに関連付けられている他のデータへのポインターなど、アプリケーション固有のデータ。 既定値は 0 です。

CMFCPropertyGridColorProperty::EnableAutomaticButton

[色の 選択] ダイアログ ボックスで自動 ボタンを有効にします。 (標準の自動ボタンにラベルが付けられます。 自動)。)

void EnableAutomaticButton(
    LPCTSTR lpszLabel,
    COLORREF colorAutomatic,
    BOOL bEnable=TRUE);

パラメーター

lpszLabel
[in]自動ボタンのラベル テキスト。

colorAutomatic
[in]自動 (既定) 色の RGB カラー値。

bEnable
[in]自動ボタンを有効にする場合は TRUE。それ以外の場合は FAL Standard Edition。 既定値は TRUE です。

解説

CMFCPropertyGridColorProperty::EnableOtherButton

[色の 選択] ダイアログ ボックスのもう一方 のボタンを有効にします。 (標準の他のボタンにはラベルが付けられます その他の色)。)

void EnableOtherButton(
    LPCTSTR lpszLabel,
    BOOL bAltColorDlg = TRUE,
    BOOL bEnable = TRUE);

パラメーター

lpszLabel
[in]もう一方のボタンのラベル テキスト。

bAltColorDlg
[in]ダイアログ ボックスを表示する場合は CMFCColorDialog TRUE。FAL Standard Edition 標準の色選択ダイアログ ボックスを表示します。 既定値は TRUE です。

bEnable
[in]他のボタンを表示する場合は TRUE。それ以外の場合は FAL Standard Edition。 既定値は TRUE です。

解説

CMFCPropertyGridColorProperty::GetColor

プロパティの現在の色を取得します。

COLORREF GetColor() const;

戻り値

RGB カラー値。

解説

CMFCPropertyGridColorProperty::SetColor

プロパティの新しい色を設定します。

void SetColor(COLORREF color);

パラメーター

color
[in]RGB カラー値。

解説

CMFCPropertyGridColorProperty::SetColumnsNumber

現在のカラー プロパティ グリッド内の列の数を指定します。

void SetColumnsNumber(int nColumnsNumber);

パラメーター

nColumnsNumber
[in]カラー プロパティ グリッド内の列の推奨数。

解説

このメソッドは、保護されたデータ メンバーの値を m_nColumnsNumber 設定します。

CMFCPropertyGridColorProperty::SetOriginalValue

編集可能なプロパティの元の値を設定します。

virtual void SetOriginalValue(const COleVariant& varValue);

パラメーター

varValue
[in]値。

解説

CMFCPropertyGridProperty::ResetOriginalValue メソッドを使用して、編集されたプロパティの元の値をリセットします。

関連項目

階層図
クラス
CMFCPropertyGridCtrl クラス
CMFCPropertyGridProperty クラス