Здравствуйте господа спасители!!!
привожу сразу исходный код
//---------------------------------------------------------------------------
#include
#pragma hdrstop
#include "ResARINC.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------
// ValidCtrCheck is used to assure that the components created do not have
// any pure virtual functions.
//
static inline void ValidCtrCheck(TResARINC *)
{
new TResARINC(NULL);
}
//---------------------------------------------------------------------------
__fastcall TResARINC::TResARINC(TComponent* Owner)
: TWinControl(Owner)
{
FsName="Iacaaiea ia";
FsNumber="0";
FsDimension="ei/?";
Width = 70;
Height = 30;
FLabel_Name = new TLabel (this);
FLabel_Name->Parent = this;
FLabel_Name->WordWrap = true;
FLabel_Name->Caption = sName;
FLabel_Name->Font->Color = clMaroon;
FLabel_Name->Font->Size = 8;
FLabel_Number = new TLabel (this);
FLabel_Number->Parent = this;
FLabel_Number->Caption = FsNumber;
FLabel_Number->Font->Color = clBlue;
FLabel_Number->Font->Size = 10;
FLabel_Number->Top = FLabel_Name->Top+FLabel_Name->Height+1;
FLabel_Dimension = new TLabel (this);
FLabel_Dimension->Parent = this;
FLabel_Dimension->Caption = FsDimension;
FLabel_Dimension->Font->Color = clMaroon;
FLabel_Dimension->Font->Size = 8;
FLabel_Dimension->Top = FLabel_Number->Top+FLabel_Number->Height+1;
Height = FLabel_Name->Height+FLabel_Number->Height+FLabel_Dimension->Height+3;
}
//---------------------------------------------------------------------------
namespace Resarinc
{
void __fastcall PACKAGE Register()
{
TComponentClass classes[1] = {__classid(TResARINC)};
RegisterComponents("ARINC", classes, 0);
}
}
//---------------------------------------------------------------------------
void __fastcall TResARINC::SetResult(int iNumberRead)
{
float fResult;
// далее идет мат обработка которой еще нет
fResult = (float)iNumberRead;
FLabel_Number->Caption = FloatToStr(fResult);
}
void __fastcall TResARINC::Set_Name(AnsiString str)
{
FsName=sName;
FLabel_Name->Caption = FsName;
}
//---------------------------------------------------------------------------
#ifndef ResARINCH
#define ResARINCH
//---------------------------------------------------------------------------
#include
#include
#include
//---------------------------------------------------------------------------
class PACKAGE TResARINC : public TWinControl
{
private:
TLabel *FLabel_Name;
TLabel *FLabel_Number;
TLabel *FLabel_Dimension;
protected:
public:
AnsiString FsName;
AnsiString FsNumber;
AnsiString FsDimension;
double FPriceHighOrderDigit; // oaia noa?oaai ?ac?yaa
void __fastcall SetResult(int iNumberRead);
void __fastcall Set_Name(AnsiString str);
__fastcall TResARINC(TComponent* Owner);
__published:
__property AnsiString sName = {read = FsName, write = Set_Name};
};
//---------------------------------------------------------------------------
#endif
//---------------------------------------------------------------------------
#include
#pragma hdrstop
#include "Unit1.h"
#include "ResARINC.cpp"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
TResARINC *ra;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
ra = new TResARINC (Form1);
ra->Parent=Form1;
ra->Top = 100;
ra->Left = 100;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
ra->SetResult(4);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
ra->sName = "eeeeeeeee eeeeeee";
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include
#include
#include
#include
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TButton *Button1;
TButton *Button2;
void __fastcall Button1Click(TObject *Sender);
void __fastcall Button2Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
возникла проблема такого плана я хочу чтобы при программном коде вида
ra->sName = "eeeeeeeee eeeeeee";
менялся Caption в моем созреваемом компоненте. но что то все никак. Подскажите как правильно методы готовить надо