AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Fragen zu Assigned und Handle

Ein Thema von Lich · begonnen am 14. Sep 2006 · letzter Beitrag vom 14. Sep 2006
 
Lich

Registriert seit: 17. Aug 2006
43 Beiträge
 
#3

Re: Fragen zu Assigned und Handle

  Alt 14. Sep 2006, 15:43
Das ist der Code, der zu der Komponente ColerGrid gehört

Delphi-Quellcode:
unit Clrgrid;

interface
uses winTypes, classes, Graphics, grids;

type
  TColorEvent = procedure (Sender: TObject; ARow, ACol: Longint;
                           AState: TGridDrawState;
                           ABrush: TBrush; AFont: TFont ) of object;

  TColorStringGrid = class(TStringGrid)
  private
    FonGetCellColor: TColorEvent;
  protected
    procedure DrawCell(ACol, ARow: Longint; ARect: TRect;
              AState: TGridDrawState); override;
  Published
    property OnGetCellColor: TColorEvent read FOnGetCellColor
                                         write FOnGetCellColor;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('Samples',[TColorStringGrid]);
end;

procedure TColorStringGrid.DrawCell(ACol, ARow: Longint; ARect: TRect;
          AState: TGridDrawState);
begin
  if Assigned(FOnGetCellColor) then
    FOnGetCellColor(Self, ARow, ACol, AState, Canvas.Brush, Canvas.Font);
  inherited DrawCell(ACol, ARow, ARect, AState);
end;[/quote]

Und hier wird überprüft, ob FOnGetCellColor Assigned ist, bevor die Funktion zum Ausfüllen der Grid gestartet wird:

[quote]if Assigned(FOnGetCellColor) then
    FOnGetCellColor(Self, ARow, ACol, AState, Canvas.Brush, Canvas.Font);
  inherited DrawCell(ACol, ARow, ARect, AState);
Bei mir ist das ganze irgentwie nie Assigned und ich weiß nicht wodran es liegen könnte?

[edit=SirThornberry]Delphi-Tags gesetzt - Mfg, SirThornberry[/edit]
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:40 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz