🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.delphi
4 messages
4 total messages Started by Tomasz Latko Wed, 10 Sep 1997 00:00
Wywo³anie metody przodka przodka?
#5
Author: Tomasz Latko
Date: Wed, 10 Sep 1997 00:00
28 lines
1147 bytes
Jak wywo�a� metod� dziedziczon� po dziadku
Delphi wywala b��d gdy podaj� nazw� klasy dziadka zamiast 'inherited'

Oto przyk�ad z moich �r�de�:

  TKamDBLookupComboBox = class(TDBLookupComboBox)
  public
    procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
override;
  end;

implementation

procedure TKamDBLookupComboBox.SetBounds(ALeft, ATop, AWidth, AHeight:
Integer);
begin
  AHeight := 16;
  TCustomControl.SetBounds(ALeft, ATop, AWidth, AHeight);
  ^^^^^^^^^^^^^^ tu jest b��d Delphi: 
  Errpr: This form of method call anly allowed for class method !!!!
end;

-- 
____________________________________
Tomek Latko KAMSOFT Katowice Poland
phone: +48(32)2555993, 2563758
mailto:to...@kamsoft.com.pl
Re: Wywołanie metody przodka przodka?
#6
Author: oh... Andrzej Wzietal
Date: Wed, 10 Sep 1997 00:00
21 lines
1012 bytes
On Wed, 10 Sep 1997 13:22:37 +0200, Tomasz Latko
<tla...@kamsoft.com.pl> wrote:

>Jak wywo�a� metod� dziedziczon� po dziadku
>Delphi wywala b��d gdy podaj� nazw� klasy dziadka zamiast 'inherited'

Dla metod virtualnych jest to o ile wiem niemo�liwe.

>  TCustomControl.SetBounds(ALeft, ATop, AWidth, AHeight);
>  ^^^^^^^^^^^^^^ tu jest b��d Delphi: 
>  Errpr: This form of method call anly allowed for class method !!!!
>end;

Dla metod nie zadeklarowanych jako wirtualne spr�buj:

TCustomControl(Self).SetBounds(ALeft, ATop, AWidth, AHeight);

Pozdrawiam,

Andrzej Wzi�tal
Re: Wywołanie metody przodka przodka?
#7
Author: hob... Krzysztof Swiatkowski
Date: Thu, 11 Sep 1997 00:00
29 lines
1354 bytes
On Wed, 10 Sep 1997 13:22:37 +0200, in pl.comp.lang.delphi Tomasz Latko
<tla...@kamsoft.com.pl> wrote:

>Jak wywo�a� metod� dziedziczon� po dziadku
>Delphi wywala b��d gdy podaj� nazw� klasy dziadka zamiast 'inherited'

>procedure TKamDBLookupComboBox.SetBounds(ALeft, ATop, AWidth, AHeight:
>Integer);
>begin
>  AHeight := 16;
>  TCustomControl.SetBounds(ALeft, ATop, AWidth, AHeight);
>  ^^^^^^^^^^^^^^ tu jest b��d Delphi: 
>  Errpr: This form of method call anly allowed for class method !!!!
>end;

A jaki� szczeg�lny pow�d dla kt�rego chcesz to zrobi�? AFAIK TDBLookupCombo
nie ma metody SetBounds co z za�o�enia powoduje wywo�anie metody "dziadka"
przez inherited

Hobbit

--
----------------------------------
Krzysztof Swiatkowski - Lodz
e-Mail:  hob...@dom.vr.pl [lub] hob...@priv.onet.pl

"Things left alone tend to get worse" - Murphy's Law
----------------------------------
Re: Wywo³anie metody przodka przodka?
#8
Author: Tomasz Latko
Date: Tue, 16 Sep 1997 00:00
35 lines
1665 bytes
Krzysztof Swiatkowski wrote:
> 
> On Wed, 10 Sep 1997 13:22:37 +0200, in pl.comp.lang.delphi Tomasz
> Latko
> <tla...@kamsoft.com.pl> wrote:
> 
> >Jak wywo�a� metod� dziedziczon� po dziadku
> >Delphi wywala b��d gdy podaj� nazw� klasy dziadka zamiast 'inherited'
> 
> >procedure TKamDBLookupComboBox.SetBounds(ALeft, ATop, AWidth,
> AHeight:
> >Integer);
> >begin
> >  AHeight := 16;
> >  TCustomControl.SetBounds(ALeft, ATop, AWidth, AHeight);
> >  ^^^^^^^^^^^^^^ tu jest b��d Delphi:
> >  Errpr: This form of method call anly allowed for class method !!!!
> >end;
> 
> A jaki� szczeg�lny pow�d dla kt�rego chcesz to zrobi�? AFAIK
> TDBLookupCombo
> nie ma metody SetBounds co z za�o�enia powoduje wywo�anie metody
> "dziadka"
> przez inherited
Chodzi mi o TDBLookupComboBox, kt�ry ma metode SetBounds
ustawiajac� wysokos� na podstawie wielkoci font'a.
Chcia�bym sobie ustawi� inn� wielkos�, a do tego musze wywo�a�
metod� dziadka, albo pradziadka.

-- 
____________________________________
Tomek Latko KAMSOFT Katowice Poland
phone: +48(32)2555993, 2563758
mailto:to...@kamsoft.com.pl
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads