Talk About Network

Google





Programming > Borland Delphi > Re: calling a f...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 8 Topic 3671 of 4030
Post > Topic >>

Re: calling a frame's method

by Hedrew3 <peterg12345@[EMAIL PROTECTED] > Apr 1, 2008 at 03:38 PM

On Apr 1, 12:04 pm, Danny Str=FCmpel <dannys9@[EMAIL PROTECTED]
> wrote:
> peterg12...@[EMAIL PROTECTED]
 schrieb:
>
> > CurrentFrame is type TFrame. Rob, you're right - it is a compilation
> > error it says that DoSomeInitializations is an undeclared identifier
> > at line 2:
>
> > CurrentFrame :=3D Frame1;
> > CurrentFrame.DoSomeInitializations;
>
> > even though Frame1 has a public procedure called
> > DoSomeInitializations.
>
> That's because there's no DoSomeInitializations in TFrame. Do what Erich
> G=FCnthner suggested, and you'll be fine:
>
> type
>    TBaseFrame =3D class(TFrame)
>    public
>      procedure DoSomeInitializations; virtual;
>    end;
>
>    TYourFrame1 =3D class(TBaseFrame)
>      { maybe override DoSomeInitializations }
>    end;
>
> var
>    Frame1: TYourFrame1;
>    CurrentFrame: TBaseFrame;
>
> When you now assign Frame1 do CurrentFrame and call
> DoSomeInitializations from there, it will work.
>
> You can put common stuff into TBaseFrame.DoSomeInitializations and
> additional stuff into the overridden methods.
>
> --
> Den Todesanzeigen zufolge sterben gemeine und unwichtige Leute niemals.
>
> ...und wech
>           Danny <dannys9 (at) gmx (dot) de>

OK, I think I've got it. Basically my frames should be deriving from a
newly created TBaseFrame class, which contains my method. Then
CurrentFrame calls the method and eventually each frame's custom
method will be called.

I'll give it a shot. Thanks all!
 




 8 Posts in Topic:
calling a frame's method
peterg12345@[EMAIL PROTEC  2008-03-31 20:39:17 
Re: calling a frame's method
=?ISO-8859-1?Q?Erich_G=FC  2008-04-01 07:55:05 
Re: calling a frame's method
Jim P <Jim_P@[EMAIL PR  2008-03-31 23:04:20 
Re: calling a frame's method
Rob Kennedy <me3@[EMAI  2008-04-01 07:33:39 
Re: calling a frame's method
peterg12345@[EMAIL PROTEC  2008-04-01 08:48:14 
Re: calling a frame's method
=?ISO-8859-1?Q?Danny_Str=  2008-04-01 21:04:45 
Re: calling a frame's method
Jamie <jamie_ka1lpa_no  2008-04-01 20:18:34 
Re: calling a frame's method
Hedrew3 <peterg12345@[  2008-04-01 15:38:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 8:32:07 PST 2009.