Board index » cppbuilder » Derive from TMaskEdit
William E. Mahaffey
CBuilder Developer |
Derive from TMaskEdit2005-09-24 05:37:55 AM cppbuilder43 I am rewriting an application where I used Orpheus components. I let the user build an input screen. Here is where I derived a class from an Orpheus component: //--------------------------------------------------------------------------- class TInventoryMoneyField : public TOvcNumericField { protected: // Attributes BEGIN_MESSAGE_MAP MESSAGE_HANDLER(WM_RBUTTONUP, TWMRButtonDown,WmRButtonUp) END_MESSAGE_MAP(TOvcNumericField) void __fastcall WmRButtonUp(TWMRButtonDown &Message); DYNAMIC void __fastcall MouseDown(TMouseButton Button,TShiftState Shift, int X, int Y); TForm *Inventory; private: // Attributes AnsiString ImageName; // Pointer to the VCL control TInventoryLabel *pLabel; int ItemType; int iMode; AnsiString ItemName; int FieldLength; int ElementID; bool bSelected; bool bLargeFonts; // Functions //void __fastcall ElementClick(TObject *Sender); void Initialize(void); void CheckForStartMove(void); public: __fastcall TInventoryMoneyField(TForm* OwnerInventory, AnsiString Name,int Length,POINT Loc,int Width,int Height,int Mode); __fastcall ~TInventoryMoneyField(void); // Make these properties available from parent __property Visible; __property TabOrder; // Attributes POINT Location; // Functions bool IsSelected(void); int GetID(void); void UpdateLocation(int X, int Y); void UpdateName(AnsiString Name); POINT GetElementLoc(void); POINT GetElementEnd(void); POINT GetElementSize(void); int GetFieldLength(void); AnsiString GetName(void); TInventoryLabel *GetLabelPointer(void); void SetElementLoc(POINT Loc); void SetElementEnd(POINT End); void SetElementSize(POINT Size); void SetTabOrder(int iOrder); void SetLabelPointer(TInventoryLabel *pLabel); void SetFieldLength(int Length); void SetPictureMask(AnsiString Mask); }; //---------------------------------------------------------------------------------------------------------- I would like to use the VCL components that are available with C++ Builder. I tried to use TMaskEdit Like this: //--------------------------------------------------------------------------- class TInventoryMoneyField : public TMaskEdit { protected: // Attributes BEGIN_MESSAGE_MAP MESSAGE_HANDLER(WM_RBUTTONUP, TWMRButtonDown,WmRButtonUp) END_MESSAGE_MAP(TMaskEdit) void __fastcall WmRButtonUp(TWMRButtonDown &Message); DYNAMIC void __fastcall MouseDown(TMouseButton Button,TShiftState Shift, int X, int Y); TForm *Inventory; private: // Attributes AnsiString ImageName; // Pointer to the VCL control TInventoryLabel *pLabel; int ItemType; int iMode; AnsiString ItemName; int FieldLength; int ElementID; bool bSelected; bool bLargeFonts; // Functions //void __fastcall ElementClick(TObject *Sender); void Initialize(void); void CheckForStartMove(void); public: __fastcall TInventoryMoneyField(TForm* OwnerInventory, AnsiString Name,int Length,POINT Loc,int Width,int Height,int Mode); __fastcall ~TInventoryMoneyField(void); // Make these properties available from parent __property Visible; __property TabOrder; // Attributes POINT Location; // Functions bool IsSelected(void); int GetID(void); void UpdateLocation(int X, int Y); void UpdateName(AnsiString Name); POINT GetElementLoc(void); POINT GetElementEnd(void); POINT GetElementSize(void); int GetFieldLength(void); AnsiString GetName(void); TInventoryLabel *GetLabelPointer(void); void SetElementLoc(POINT Loc); void SetElementEnd(POINT End); void SetElementSize(POINT Size); void SetTabOrder(int iOrder); void SetLabelPointer(TInventoryLabel *pLabel); void SetFieldLength(int Length); void SetPictureMask(AnsiString Mask); }; //--------------------------------------------------------------------------------------- I get errors here: class TInventoryMoneyField : public TMaskEdit [C++ Error] InventoryElements.h(278): E2303 Type name expected and here: DYNAMIC void __fastcall MouseDown(TMouseButton Button,TShiftState Shift, int X, int Y); [C++ Error] InventoryElements.h(289): E2092 Storage class 'dynamic' is not allowed here I am at a lost as what to do. Please help! Bill Mahaffey |