Jump to content

Search the Community

Showing results for tags 'tcomponentname'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 1 result

  1. i have this Abstract Base Unit : unit UBase; interface uses System.Classes; type TBaseAbstract = class(TComponent) procedure Method(aObjectEvent: TNotifyEvent); virtual; abstract; end; TConcrete = class(TBaseAbstract) procedure Method(aObjectEvent: TNotifyEvent); override; strict private fReadOnlyProperty: string; public constructor New(aValue: string; aOwner: TComponent); destructor Destroy; override; property ReadOnlyProperty: string Read fReadOnlyProperty; // Read Only Property .. end; implementation { TConcrete } destructor TConcrete.Destroy; begin inherited; end; procedure TConcrete.Method(aObjectEvent: TNotifyEvent); begin aObjectEvent(Self) end; constructor TConcrete.New(aValue: string; aOwner: TComponent); begin inherited Create(aOwner); fReadOnlyProperty := aValue + Self.ClassName +' ] '+ sLineBreak + 'Object Instance Name is: [' + Self.Name +' ]'; end; end. in my App Demo Main Form i have this: var FrmMain: TFrmMain; implementation uses UBase; var fConcrete: TConcrete; fBASE: TBaseAbstract; {$R *.dfm} procedure TFrmMain.FormCreate(Sender: TObject); begin fConcrete := TConcrete.New('i''m a Read Only PROPERTY of [ ', Self); end; procedure TFrmMain.FormDestroy(Sender: TObject); begin fConcrete.Free; end; procedure TFrmMain.Btn_Normal_EventClick(Sender: TObject); begin ShowMessage('i''m an Event of [ ' + Sender.ClassName +' ] '+ sLineBreak + ' And My Object Instance Name IS: [ ' + TComponent(Sender).Name +' ]'); end; procedure TFrmMain.Btn_Call_MethodClick(Sender: TObject); begin fBASE := TConcrete.Create(nil); try fBASE.Method(Btn_Normal_Event.OnClick); finally fBASE.Free; end; end; procedure TFrmMain.Btn_Call_Abstract_MethodClick(Sender: TObject); begin fConcrete.Method(Btn_Normal_Event.OnClick); end; procedure TFrmMain.Btn_Get_Concret_PropertyClick(Sender: TObject); begin ShowMessage(fConcrete.ReadOnlyProperty); end; end. Btn_Normal_EventClick work correctlly (i got the name of this button when i click on it [Btn_Normal_Event]) but from fConcrete or fBase whether using Abstract Method or GetProperty the NAME IS EMPTY !!! ------------ do i missing something ?
×