Hi,
ich versuche gerade der TCalendar-Komponente der LCL zu entlocken, wo bzw wie sie malt, um die Klasse ableiten und einige Änderungen/Erweiterungen einzubauen. Allerdings komme ich nicht ganz dahinter, wo die Komponente sich malt.
Das Interface der TCustomCalendar sieht so aus:
Delphi-Quellcode:
TCustomCalendar = class(TWinControl)
private
FDateAsString : String;
FDate: TDateTime; // last valid date
FDisplaySettings : TDisplaySettings;
FOnChange: TNotifyEvent;
FReadOnly: Boolean;
FDayChanged: TNotifyEvent;
FMonthChanged: TNotifyEvent;
FYearChanged: TNotifyEvent;
FPropsChanged: boolean;
function GetDateTime: TDateTime;
function ReadOnlyIsStored: boolean;
procedure SetDateTime(const AValue: TDateTime);
procedure SetReadOnly(const AValue: Boolean);
Procedure GetProps;
Procedure SetProps;
function GetDisplaySettings: TDisplaySettings;
procedure SetDisplaySettings(const AValue: TDisplaySettings);
function GetDate: String;
procedure SetDate(const AValue: String);
protected
procedure LMChanged(var Message: TLMessage); message LM_CHANGED;
procedure LMMonthChanged(var Message: TLMessage); message LM_MONTHCHANGED;
procedure LMYearChanged(var Message: TLMessage); message LM_YEARCHANGED;
procedure LMDayChanged(var Message: TLMessage); message LM_DAYCHANGED;
class function GetControlClassDefaultSize: TPoint; override;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
procedure Loaded; override;
procedure InitializeWnd; override;
property Date: String read GetDate write SetDate stored false;
property DateTime: TDateTime read GetDateTime write SetDateTime;
property DisplaySettings: TDisplaySettings read GetDisplaySettings write SetDisplaySettings;
property ReadOnly: Boolean read FReadOnly write SetReadOnly stored ReadOnlyIsStored;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
property OnDayChanged: TNotifyEvent read FDayChanged write FDayChanged;
property OnMonthChanged: TNotifyEvent read FMonthChanged write FMonthChanged;
property OnYearChanged: TNotifyEvent read FYearChanged write FYearChanged;
end;
Vielleicht weiß ja jemand wo da gemalt wird