VCLEditors 에 있는 TBooleanProperty 를 사용해야하는 군요...
#include
PPropInfo PropInfo = GetPropInfo(__typeinfo(TMyShape), "Enabled");
RegisterPropertyEditor(*(PropInfo->PropType), NULL, "", __classid(TBooleanProperty));
송신영 님이 쓰신 글 :
: 안녕하세요.
: 컴포넌트를 하나 만든 후 Form에 올려서 Object Inspector에서 속성 편집을 할 때 보면
: 아래 그림과 같이 bool 형일 경우 기존 컴포넌트는 앞에 체크박스가 표기되는데
: 직접 만든 컴포넌트에는 그냥 true, false를 선택할 수 만 있네요...
: 오른쪽 처럼 체크 박스가 나오도록 설정하려면 어떻게 해야하나요?
:
:
:
: 시도해 본 것은 아래와 같습니다.
:
:
: // 1
: PPropInfo PropInfo = GetPropInfo(__typeinfo(TMyShape), "Enabled");
: RegisterPropertyEditor(*(PropInfo->PropType), NULL, "", __classid(TBoolProperty));
:
: // 2
: RegisterPropertyEditor( __typeinfo(TMyShape),
: __classid(TComponent),
: "Enabled",
: __classid(TBoolProperty));
: RegisterPropertyInCategory("Action", __classid(TMyShape), "Enabled");
: RegisterPropertyInCategory("Visual", __classid(TMyShape), "Enabled");
: RegisterPropertyInCategory("Input", __classid(TMyShape), "Enabled");
:
:
|