Component - Why Is It SO!!!! SOLVED...

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

Component - Why Is It SO!!!! SOLVED...

Postby theLizard » Sun Jul 24, 2016 12:11 pm

I have, apart from their names, 2 components which are identical yet one will compile and run with 3 properties

__property TGaugePanel* Line1 = { read = getLine1, write = setLine1 };
__property TGaugePanel* Line2 = { read = getLine2, write = setLine2 };
__property TGaugePanel* Line3 = { read = getLine3, write = setLine3 };

in the _published section and the other will not, I get a compile error saying that TGaugePanel* is not an allowed type yet it's ok in the first component.

Component 1

Code: Select all
#ifndef TEKMGaugeValuesH
#define TEKMGaugeValuesH
// ---------------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Classes.hpp>
// ---------------------------------------------------------------------------------
//#include "TEKMAnalogGauge.h"
#include "ekmdefines.h"
#include "template_classes.h"
#include "TEkmV4Data.h"
#include "TGaugePanel.h"
// ---------------------------------------------------------------------------------
class PACKAGE TEKMGaugeValues : public TComponent
   {
   private:
      TGaugePanel* Fline1;
      TGaugePanel* Fline2;
      TGaugePanel* Fline3;
                float minVoltsL1, minVoltsL2, minVoltsL3;
      int FdecAmps;
      int FdecPf;

      int __fastcall getDecAmps();
      void __fastcall  setDecAmps(int value );
      int __fastcall getDecPf();
      void __fastcall  setDecPf(int value );

      TEkmV4Data* Fdata;
      int Fline;

      int __fastcall getLine();
      void __fastcall  setLine(int value );
      TEkmV4Data* __fastcall getData();
      void __fastcall  setData(TEkmV4Data* value );
      TGaugePanel* __fastcall getLine1();
      void __fastcall  setLine1(TGaugePanel* value );
      TGaugePanel* __fastcall getLine2();
      void __fastcall  setLine2(TGaugePanel* value );
      TGaugePanel* __fastcall getLine3();
      void __fastcall  setLine3(TGaugePanel* value );
   protected:
          work<AnsiString> w;
   public:
      __fastcall TEKMGaugeValues(TComponent* Owner);
      __fastcall ~TEKMGaugeValues();
      __property TEkmV4Data* Data = { read = getData, write = setData };
    void __fastcall Update();

   __published:
      __property TGaugePanel* Line1 = { read = getLine1, write = setLine1 };
      __property TGaugePanel* Line2 = { read = getLine2, write = setLine2 };
       __property TGaugePanel* Line3 = { read = getLine3, write = setLine3 };
      __property lines Line = { read = getLine, write = setLine };
      __property int DecAmps = { read = getDecAmps, write = setDecAmps };
      __property int DecPf = { read = getDecPf, write = setDecPf };
   };
// ---------------------------------------------------------------------------------
#endif


Component 2

Code: Select all
#ifndef TEKMV3GaugeValuesH
#define TEKMV3GaugeValuesH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Classes.hpp>
// ---------------------------------------------------------------------------------
//#include "TEKMAnalogGauge.h"
#include "ekmdefines.h"
#include "template_classes.h"
#include "TEkmV3Data.h"
#include "TGaugePanel.h"
//---------------------------------------------------------------------------
class PACKAGE TEKMV3GaugeValues : public TComponent
   {
  friend class TGaugePanel;
   private:
      TGaugePanel* Fline1;
      TGaugePanel* Fline2;
      TGaugePanel* Fline3;
      float minVoltsL1, minVoltsL2, minVoltsL3;
      int FdecAmps;
      int FdecPf;

      int __fastcall getDecAmps();
      void __fastcall  setDecAmps(int value );
      int __fastcall getDecPf();
      void __fastcall  setDecPf(int value );

      TEkmV3Data* Fdata;
      int Fline;

      int __fastcall getLine();
      void __fastcall  setLine(int value );
      TEkmV3Data* __fastcall getData();
      void __fastcall  setData(TEkmV3Data* value );
      TGaugePanel* __fastcall getLine1();
      void __fastcall  setLine1(TGaugePanel* value );
      TGaugePanel* __fastcall getLine2();
      void __fastcall  setLine2(TGaugePanel* value );
      TGaugePanel* __fastcall getLine3();
      void __fastcall  setLine3(TGaugePanel* value );
   protected:
      work<AnsiString> w;
   public:
      __fastcall TEKMV3GaugeValues(TComponent* Owner);
      __fastcall ~TEKMV3GaugeValues();
      __property TEkmV3Data* Data = { read = getData, write = setData };
      void __fastcall Update();

      __property TGaugePanel* Line1 = { read = getLine1, write = setLine1 };
      __property TGaugePanel* Line2 = { read = getLine2, write = setLine2 };
      __property TGaugePanel* Line3 = { read = getLine3, write = setLine3 };

   __published:
//      __property TGaugePanel* Line1 = { read = getLine1, write = setLine1 };
//      __property TGaugePanel* Line2 = { read = getLine2, write = setLine2 };
//      __property TGaugePanel* Line3 = { read = getLine3, write = setLine3 };
      __property lines Line = { read = getLine, write = setLine };
      __property int DecAmps = { read = getDecAmps, write = setDecAmps };
      __property int DecPf = { read = getDecPf, write = setDecPf };
};
//---------------------------------------------------------------------------
#endif


What am I missing!!!

Cheers
theLizard
BCBJ Master
BCBJ Master
 
Posts: 447
Joined: Wed Mar 18, 2009 2:14 pm

Return to Technical

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 5 guests