![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
ДизайнТайм VS Рантайм
DevilDevil © (2006-08-15 19:09:00)При изменении свойства, в ДизайнТайм всё работает как надо; в рантайм не хочет. У кого нибудь возникала такая проблема?
DevilDevil (2006-08-16 19:23:00) [1]Фууу. Ну я и...
private:
TCellStyleStruct* __fastcall GetcsStandart1()
{return FCellStyles[0];};
__fastcall SetcsStandart1(TCellStyleStruct* Value)
{FCellStyles[0]->Assign(Value);};
__published:
__property TCellStyleStruct* StyleStandart1 = {read=GetcsStandart1, write=SetcsStandart1};
DevilDevil (2006-08-16 19:18:00) [2]ДОШЛО:
__published:
__property TCellStyleStruct* StyleStandart1 = {read=GetcsStandart1};
Я write не прописал... а как write для свойства-класса прописать?
DevilDevil (2006-08-16 17:01:00) [3]> Юрий Зотов © (15.08.06 22:29) [1]
Сам компонент сохраняется. Не сохраняется свойство
DevilDevil (2006-08-16 16:58:00) [4]всмысле... моё свойство - класс, реализация которого приведена выше
DevilDevil (2006-08-16 16:57:00) [5]> Юрий Зотов © (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;
}
Phoroon~ (2006-08-15 23:46:00) [6]Кого предок, твое свойство.
Юрий Зотов (2006-08-15 22:29:00) [7]Похоже, что свойство не сохраняется в DFM.