~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to rtl/objpas/classes/compon.inc

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2005-05-30 11:59:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050530115910-x5pbzm4qqta4i94h
Tags: 2.0.0-2
debian/fp-compiler.postinst.in: forgot to reapply the patch that
correctly creates the slave link to pc(1).  (Closes: #310907)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
{
2
 
    $Id: compon.inc,v 1.2 2004/01/12 17:44:22 peter Exp $
 
2
    $Id: compon.inc,v 1.9 2005/04/15 07:21:09 michael Exp $
3
3
    This file is part of the Free Component Library (FCL)
4
4
    Copyright (c) 1999-2000 by the Free Pascal development team
5
5
 
243
243
end;
244
244
 
245
245
 
 
246
procedure TComponent.PaletteCreated;
 
247
  begin
 
248
  end;
 
249
 
 
250
 
246
251
Procedure TComponent.ReadState(Reader: TReader);
247
252
 
248
253
begin
374
379
 
375
380
Destructor TComponent.Destroy;
376
381
 
377
 
Var Runner : Longint;
 
382
Var
 
383
  I : Integer;
 
384
  C : TComponent;
378
385
 
379
386
begin
 
387
  Destroying;
380
388
  If Assigned(FFreeNotifies) then
381
389
    begin
382
 
    For Runner:=0 To FFreeNotifies.Count-1 do
383
 
      TComponent(FFreeNotifies.Items[Runner]).Notification (self,opRemove);
384
 
    FFreeNotifies.Free;
385
 
    FFreeNotifies:=Nil;
 
390
    I:=FFreeNotifies.Count-1;
 
391
    While (I>=0) do
 
392
      begin
 
393
      C:=TComponent(FFreeNotifies.Items[I]);
 
394
      // Delete, so one component is not notified twice, if it is owned.
 
395
      FFreeNotifies.Delete(I);
 
396
      C.Notification (self,opRemove);
 
397
      If (FFreeNotifies=Nil) then
 
398
        I:=0
 
399
      else if (I>FFreeNotifies.Count) then
 
400
        I:=FFreeNotifies.Count;
 
401
      dec(i);
 
402
      end;
 
403
    FreeAndNil(FFreeNotifies);
386
404
    end;
387
 
  Destroying;
388
405
  DestroyComponents;
389
406
  If FOwner<>Nil Then FOwner.RemoveComponent(Self);
390
407
  inherited destroy;
391
408
end;
392
409
 
393
410
 
 
411
Procedure TComponent.BeforeDestruction;
 
412
begin
 
413
  if not(csDestroying in FComponentstate) then
 
414
    Destroying;
 
415
end;
 
416
 
 
417
 
394
418
Procedure TComponent.DestroyComponents;
395
419
 
396
420
Var acomponent: TComponent;
450
474
 
451
475
begin
452
476
  If (Owner<>Nil) and (AComponent=Owner) then exit;
453
 
  If not (Assigned(FFreeNotifies)) then
454
 
    FFreeNotifies:=TList.Create;
455
 
  If FFreeNotifies.IndexOf(AComponent)=-1 then
 
477
  if csDestroying in ComponentState then
 
478
    AComponent.Notification(Self,opRemove)
 
479
  else
456
480
    begin
457
 
    FFreeNotifies.Add(AComponent);
458
 
    AComponent.FreeNotification (self);
 
481
    If not (Assigned(FFreeNotifies)) then
 
482
      FFreeNotifies:=TList.Create;
 
483
    If FFreeNotifies.IndexOf(AComponent)=-1 then
 
484
      begin
 
485
      FFreeNotifies.Add(AComponent);
 
486
      AComponent.FreeNotification (self);
 
487
      end;
459
488
    end;
460
489
end;
461
490
 
519
548
  SafeCallException:=0;
520
549
end;
521
550
 
 
551
procedure TComponent.SetSubComponent(ASubComponent: Boolean);
 
552
begin
 
553
  if ASubComponent then
 
554
    Include(FComponentStyle, csSubComponent)
 
555
  else
 
556
    Exclude(FComponentStyle, csSubComponent);
 
557
end;
 
558
 
522
559
 
523
560
function TComponent.UpdateAction(Action: TBasicAction): Boolean;
524
561
begin
531
568
    Result := False;
532
569
end;
533
570
 
 
571
{$ifdef HASINTF}
 
572
function TComponent.QueryInterface(const IID: TGUID; out Obj): HResult;stdcall;
 
573
begin
 
574
  if GetInterface(IID, Obj) then
 
575
    result:=S_OK
 
576
  else
 
577
    result:=E_NOINTERFACE;
 
578
end;
 
579
 
 
580
function TComponent._AddRef: Integer;stdcall;
 
581
begin
 
582
  result:=-1;
 
583
end;
 
584
 
 
585
function TComponent._Release: Integer;stdcall;
 
586
begin
 
587
  result:=-1;
 
588
end;
 
589
 
 
590
{$endif HASINTF}
 
591
 
534
592
{
535
593
  $Log: compon.inc,v $
536
 
  Revision 1.2  2004/01/12 17:44:22  peter
537
 
    * LongRec is a packed record
538
 
 
539
 
  Revision 1.1  2003/10/06 21:01:06  peter
540
 
    * moved classes unit to rtl
541
 
 
542
 
  Revision 1.9  2003/04/27 21:16:11  sg
543
 
  * Fixed TComponent.ValidateRename
544
 
 
545
 
  Revision 1.8  2002/10/15 20:06:19  michael
546
 
  + Fixed SetAncestor. Index was getting too big
547
 
 
548
 
  Revision 1.7  2002/09/07 15:15:24  peter
549
 
    * old logs removed and tabs fixed
550
 
 
551
 
  Revision 1.6  2002/01/09 10:40:24  michael
552
 
  + re-enabled Top/Left property writing
553
 
 
554
 
  Revision 1.5  2002/01/06 21:54:50  peter
555
 
    * action classes added
 
594
  Revision 1.9  2005/04/15 07:21:09  michael
 
595
  +  Streaming of subcomponents added by Marc Weustink
 
596
 
 
597
  Revision 1.8  2005/02/14 17:13:31  peter
 
598
    * truncate log
 
599
 
 
600
  Revision 1.7  2005/02/02 19:56:11  florian
 
601
    + PaletteCreated added
 
602
    + TCollectionNotification added
 
603
 
 
604
  Revision 1.6  2005/01/31 19:41:39  peter
 
605
    * interface additions
556
606
 
557
607
}