C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[16953] 프라퍼티에 대한 질문입니다.
궁그미 [zimzion] 823 읽음    2002-03-28 10:28
public으로 선언된 프라퍼티(unpublished propterty)는 빌더에게 값을 어떻게 읽고 쓰는지를 알려한다고 하네요. 그러한 기능을 하는 메써드로 DefineProperties라는 것이 있는데요.
현재 어떤 클래스에

class TComp : public TComponent
{
...
};

class TSampleComp : public TComponent
{
private:
TComp* FComp3;
public:
__property TComp* Comp3 = {read = FComp3, write = FComp3};
};

void __fastcall TSampleComp::DefineProperties(TFiler* Filer)
{
TComponent::DefineProperties(Filer);
bool WriteValue;
if(Filer->Ancestor)
{
TSampleComp* FilerComp = dynamic_cast<TSampleComp*>(Filer->Ancestor);
if(FilerComp->Comp3==NULL)
WriteValue=(Comp3!=NULL);
else
{
if((Comp3==NULL) || (FilerComp->Comp3->Name != Comp3->Name))
WriteValue = true;
else
WriteValue = false;
}
}
else
WriteValue = (Comp3 !=NULL);
Filer->DefineProperty("Comp3",ReadComp3,WriteComp3,WriteValue);
}

ㅡㅡ;; 넘 복잡하네요. 패턴은 비슷할테니.. 제가 의도하는 바는 아시죠?

1. TFiler는 TSampleComp에서 상속된 클래스인가요?
2. DefineProperties는 누가 호출하나요?
3. DefineProperties하고 Filer안에 DefineProptery는 어떻게 다른가요?
4. 내장형값의 프라퍼티는 간단히 DefineProperty만 호출하던데요. 컴포넌트의 프라퍼티는 왜 이런 복잡한 과정을 거쳐야 하나요? 책에는 "a few times" 읽으면 이해될꺼라고 하는데 "many many times" 읽어도 이해가 안되요. ㅡㅡ;;

감사합니다.

+ -

관련 글 리스트
16953 프라퍼티에 대한 질문입니다. 궁그미 823 2002/03/28
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.