Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2007.06.10;
Скачать: CL | DM;

Вниз

ДизайнТайм VS Рантайм   Найти похожие ветки 

 
DevilDevil ©   (2006-08-15 19:09) [0]

При изменении свойства, в ДизайнТайм всё работает как надо; в рантайм не хочет. У кого нибудь возникала такая проблема?


 
Юрий Зотов ©   (2006-08-15 22:29) [1]

Похоже, что свойство не сохраняется в DFM.


 
Phoroon~ ©   (2006-08-15 23:46) [2]

Кого предок, твое свойство.


 
DevilDevil ©   (2006-08-16 16:57) [3]

> Юрий Зотов ©   (15.08.06 22:29) [1]
Похоже, что свойство не сохраняется в DFM.


Да, действительно. Посмотрел DFM, компонент не сохраняется

> Phoroon~ ©   (15.08.06 23:46) [2]
> Кого предок, твое свойство.

думаю, лучше показать:

class TCellStyleStruct : public TPersistent
{
private:
 TBorder FLeftBorder;
 TBorder FRightBorder;
 TBorder FTopBorder;
 TBorder FBottomBorder;

 TBorder * __fastcall GetLeftBorder  (){return &FLeftBorder  ;}
 TBorder * __fastcall GetRightBorder (){return &FRightBorder ;}
 TBorder * __fastcall GetTopBorder   (){return &FTopBorder   ;}
 TBorder * __fastcall GetBottomBorder(){return &FBottomBorder;}

 void __fastcall SetBorderColor(TColor Value);
 void __fastcall SetBorderStyle(TPenStyle Value);

 TFont*     FFont;
 void __fastcall SetFont (TFont *F){FFont->Assign(F); }

 TColor FBorderColor;
 TPenStyle FBorderStyle;

 TColor  FCellColor;
 void __fastcall SetCellColor(TColor Value) {FCellColor = Value;}
public:

 __fastcall  TCellStyleStruct(TPersistent &AOwner);
 __fastcall ~TCellStyleStruct(void){ delete FFont; };//TPersistent::~TPersistent();};
//----------------------

  __property TBorder *LeftBorder   = {read=GetLeftBorder  };
  __property TBorder *RightBorder  = {read=GetRightBorder };
  __property TBorder *TopBorder    = {read=GetTopBorder   };
  __property TBorder *BottomBorder = {read=GetBottomBorder};

__published:

  __property TColor CellColor = {read=FCellColor, write=SetCellColor};
  __property TFont *Font    = {read=FFont, write=SetFont};
  __property TColor BorderColor = {read=FBorderColor, write=SetBorderColor};
  __property TPenStyle BorderStyle = {read=FBorderStyle, write=SetBorderStyle};
};

__fastcall TCellStyleStruct::TCellStyleStruct(TPersistent& AOwner)
{
 TPersistent::TPersistent(AOwner);

 FFont = new TFont;
 FCellColor = clWhite;

 // Color = clBlack; PenStyle = psSolid;
 ZeroMemory(&FLeftBorder  , sizeof(TBorder) );
 ZeroMemory(&FRightBorder , sizeof(TBorder) );
 ZeroMemory(&FTopBorder   , sizeof(TBorder) );
 ZeroMemory(&FBottomBorder, sizeof(TBorder) );

 FBorderColor = clBlack;
 FBorderStyle = psSolid;
}


 
DevilDevil ©   (2006-08-16 16:58) [4]

всмысле... моё свойство - класс, реализация которого приведена выше


 
DevilDevil ©   (2006-08-16 17:01) [5]

> Юрий Зотов ©   (15.08.06 22:29) [1]
Сам компонент сохраняется. Не сохраняется свойство


 
DevilDevil ©   (2006-08-16 19:18) [6]

ДОШЛО:

__published:
 __property TCellStyleStruct* StyleStandart1 = {read=GetcsStandart1};


Я write не прописал... а как write для свойства-класса прописать?


 
DevilDevil ©   (2006-08-16 19:23) [7]

Фууу. Ну я и...

private:
  TCellStyleStruct* __fastcall GetcsStandart1()
  {return FCellStyles[0];};

  __fastcall SetcsStandart1(TCellStyleStruct* Value)
  {FCellStyles[0]->Assign(Value);};

__published:
__property TCellStyleStruct* StyleStandart1 = {read=GetcsStandart1, write=SetcsStandart1};



Страницы: 1 вся ветка

Текущий архив: 2007.06.10;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.026 c
3-1174627833
vajo
2007-03-23 08:30
2007.06.10
Как избавиться от запроса пароля на базу Access?


2-1179854765
Prasal
2007-05-22 21:26
2007.06.10
Поиск


15-1179229189
Layner
2007-05-15 15:39
2007.06.10
Фокус со звонками из Молдовы, в чем секрет


15-1179253032
N3xt_
2007-05-15 22:17
2007.06.10
Программа


15-1179371529
vajo
2007-05-17 07:12
2007.06.10
Можно ли выявить с какого компьютера из сети идет спам?