mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 11:58:12 +02:00
renamed TWSCalendar to TWSCustomCalendar, fix using TTICalendar (bug #1203)
git-svn-id: trunk@7823 -
This commit is contained in:
parent
cd92287656
commit
df9b074830
@ -247,7 +247,7 @@ Procedure TCustomCalendar.GetProps;
|
||||
begin
|
||||
if HandleAllocated and ([csLoading,csDestroying]*ComponentState=[]) then
|
||||
begin
|
||||
FDate := TWSCalendarClass(WidgetSetClass).GetDateTime(Self);
|
||||
FDate := TWSCustomCalendarClass(WidgetSetClass).GetDateTime(Self);
|
||||
FDateAsString := FormatDateTime(ShortDateFormat,FDate);
|
||||
{$IFDEF VerboseCalenderSetDate}
|
||||
DebugLn('TCustomCalendar.GetProps A ',FDate,' ',FDateAsString);
|
||||
@ -263,9 +263,9 @@ begin
|
||||
{$IFDEF VerboseCalenderSetDate}
|
||||
DebugLn('TCustomCalendar.SetProps A ',FDate,' ',FDateAsString);
|
||||
{$ENDIF}
|
||||
TWSCalendarClass(WidgetSetClass).SetDateTime(Self, FDate);
|
||||
TWSCalendarClass(WidgetSetClass).SetDisplaySettings(Self, FDisplaySettings);
|
||||
TWSCalendarClass(WidgetSetClass).SetReadOnly(Self, FReadOnly);
|
||||
TWSCustomCalendarClass(WidgetSetClass).SetDateTime(Self, FDate);
|
||||
TWSCustomCalendarClass(WidgetSetClass).SetDisplaySettings(Self, FDisplaySettings);
|
||||
TWSCustomCalendarClass(WidgetSetClass).SetReadOnly(Self, FReadOnly);
|
||||
end else begin
|
||||
FPropsChanged:=true;
|
||||
end;
|
||||
@ -277,7 +277,7 @@ var
|
||||
OldDay, OldMonth, OldYear: word;
|
||||
NewDay, NewMonth, NewYear: word;
|
||||
begin
|
||||
NewDate := TWSCalendarClass(WidgetSetClass).GetDateTime(Self);
|
||||
NewDate := TWSCustomCalendarClass(WidgetSetClass).GetDateTime(Self);
|
||||
if (NewDate=FDate) then exit;
|
||||
DecodeDate(NewDate, NewYear, NewMonth, NewDay);
|
||||
DecodeDate(FDate, OldYear, OldMonth, OldDay);
|
||||
|
@ -39,9 +39,9 @@ uses
|
||||
|
||||
type
|
||||
|
||||
{ TCarbonWSCalendar }
|
||||
{ TCarbonWSCustomCalendar }
|
||||
|
||||
TCarbonWSCalendar = class(TWSCalendar)
|
||||
TCarbonWSCustomCalendar = class(TWSCustomCalendar)
|
||||
private
|
||||
protected
|
||||
public
|
||||
@ -58,6 +58,6 @@ initialization
|
||||
// To improve speed, register only classes
|
||||
// which actually implement something
|
||||
////////////////////////////////////////////////////
|
||||
// RegisterWSComponent(TCalendar, TCarbonWSCalendar);
|
||||
// RegisterWSComponent(TCustomCalendar, TCarbonWSCustomCalendar);
|
||||
////////////////////////////////////////////////////
|
||||
end.
|
||||
|
@ -39,9 +39,9 @@ uses
|
||||
|
||||
type
|
||||
|
||||
{ TGnomeWSCalendar }
|
||||
{ TGnomeWSCustomCalendar }
|
||||
|
||||
TGnomeWSCalendar = class(TWSCalendar)
|
||||
TGnomeWSCustomCalendar = class(TWSCustomCalendar)
|
||||
private
|
||||
protected
|
||||
public
|
||||
@ -58,6 +58,6 @@ initialization
|
||||
// To improve speed, register only classes
|
||||
// which actually implement something
|
||||
////////////////////////////////////////////////////
|
||||
// RegisterWSComponent(TCalendar, TGnomeWSCalendar);
|
||||
// RegisterWSComponent(TCustomCalendar, TGnomeWSCustomCalendar);
|
||||
////////////////////////////////////////////////////
|
||||
end.
|
||||
|
@ -37,9 +37,9 @@ uses
|
||||
|
||||
type
|
||||
|
||||
{ TGtkWSCalendar }
|
||||
{ TGtkWSCustomCalendar }
|
||||
|
||||
TGtkWSCalendar = class(TWSCalendar)
|
||||
TGtkWSCustomCalendar = class(TWSCustomCalendar)
|
||||
private
|
||||
protected
|
||||
public
|
||||
@ -65,7 +65,7 @@ begin
|
||||
Result:=PGtkCalendar(WinWidgetInfo^.CoreWidget);
|
||||
end;
|
||||
|
||||
function TGtkWSCalendar.GetDateTime(const ACalendar: TCustomCalendar): TDateTime;
|
||||
function TGtkWSCustomCalendar.GetDateTime(const ACalendar: TCustomCalendar): TDateTime;
|
||||
var
|
||||
Year, Month, Day: word; //used for csCalendar
|
||||
begin
|
||||
@ -74,7 +74,7 @@ begin
|
||||
Result := EncodeDate(Year,Month+1,Day);
|
||||
end;
|
||||
|
||||
procedure TGtkWSCalendar.SetDateTime(const ACalendar: TCustomCalendar; const ADateTime: TDateTime);
|
||||
procedure TGtkWSCustomCalendar.SetDateTime(const ACalendar: TCustomCalendar; const ADateTime: TDateTime);
|
||||
var
|
||||
Year, Month, Day: string;
|
||||
GtkCalendar: PGtkCalendar;
|
||||
@ -87,7 +87,7 @@ begin
|
||||
gtk_calendar_select_day(GtkCalendar,StrToInt(Day));
|
||||
end;
|
||||
|
||||
procedure TGtkWSCalendar.SetDisplaySettings(const ACalendar: TCustomCalendar;
|
||||
procedure TGtkWSCustomCalendar.SetDisplaySettings(const ACalendar: TCustomCalendar;
|
||||
const ADisplaySettings: TDisplaySettings);
|
||||
var
|
||||
num: dword;
|
||||
@ -113,7 +113,7 @@ begin
|
||||
gtk_Calendar_Display_options(GetGtkCalendar(ACalendar), gtkCalendarDisplayOptions);
|
||||
end;
|
||||
|
||||
procedure TGtkWSCalendar.SetReadOnly(const ACalendar: TCustomCalendar;
|
||||
procedure TGtkWSCustomCalendar.SetReadOnly(const ACalendar: TCustomCalendar;
|
||||
const AReadOnly: boolean);
|
||||
var
|
||||
GtkCalendar: PGtkCalendar;
|
||||
@ -133,6 +133,6 @@ initialization
|
||||
// To improve speed, register only classes
|
||||
// which actually implement something
|
||||
////////////////////////////////////////////////////
|
||||
RegisterWSComponent(TCalendar, TGtkWSCalendar);
|
||||
RegisterWSComponent(TCustomCalendar, TGtkWSCustomCalendar);
|
||||
////////////////////////////////////////////////////
|
||||
end.
|
||||
|
@ -41,7 +41,7 @@ type
|
||||
|
||||
{ TGtk2WSCalendar }
|
||||
|
||||
TGtk2WSCalendar = class(TWSCalendar)
|
||||
TGtk2WSCustomCalendar = class(TWSCustomCalendar)
|
||||
private
|
||||
protected
|
||||
public
|
||||
|
@ -39,9 +39,9 @@ uses
|
||||
|
||||
type
|
||||
|
||||
{ TQtWSCalendar }
|
||||
{ TQtWSCustomCalendar }
|
||||
|
||||
TQtWSCalendar = class(TWSCalendar)
|
||||
TQtWSCustomCalendar = class(TWSCustomCalendar)
|
||||
private
|
||||
protected
|
||||
public
|
||||
@ -58,6 +58,6 @@ initialization
|
||||
// To improve speed, register only classes
|
||||
// which actually implement something
|
||||
////////////////////////////////////////////////////
|
||||
// RegisterWSComponent(TCalendar, TQtWSCalendar);
|
||||
// RegisterWSComponent(TCustomCalendar, TQtWSCustomCalendar);
|
||||
////////////////////////////////////////////////////
|
||||
end.
|
||||
|
@ -39,9 +39,9 @@ uses
|
||||
|
||||
type
|
||||
|
||||
{ TWin32WSCalendar }
|
||||
{ TWin32WSCustomCalendar }
|
||||
|
||||
TWin32WSCalendar = class(TWSCalendar)
|
||||
TWin32WSCustomCalendar = class(TWSCustomCalendar)
|
||||
private
|
||||
protected
|
||||
public
|
||||
@ -61,9 +61,9 @@ implementation
|
||||
uses
|
||||
Win32Int, InterfaceBase;
|
||||
|
||||
{ TWin32WSCalendar }
|
||||
{ TWin32WSCustomCalendar }
|
||||
|
||||
function TWin32WSCalendar.CreateHandle(const AWinControl: TWinControl;
|
||||
function TWin32WSCustomCalendar.CreateHandle(const AWinControl: TWinControl;
|
||||
const AParams: TCreateParams): HWND;
|
||||
var
|
||||
Params: TCreateWindowExParams;
|
||||
@ -90,7 +90,7 @@ const
|
||||
MCM_FIRST = $1000;
|
||||
MCM_GETMINREQRECT = MCM_FIRST + 9;
|
||||
|
||||
procedure TWin32WSCalendar.AdaptBounds(const AWinControl: TWinControl;
|
||||
procedure TWin32WSCustomCalendar.AdaptBounds(const AWinControl: TWinControl;
|
||||
var Left, Top, Width, Height: integer; var SuppressMove: boolean);
|
||||
var
|
||||
WinHandle: HWND;
|
||||
@ -102,7 +102,7 @@ begin
|
||||
Height := lRect.Bottom;
|
||||
end;
|
||||
|
||||
function TWin32WSCalendar.GetDateTime(const ACalendar: TCustomCalendar): TDateTime;
|
||||
function TWin32WSCustomCalendar.GetDateTime(const ACalendar: TCustomCalendar): TDateTime;
|
||||
var
|
||||
ST: SystemTime;
|
||||
begin
|
||||
@ -111,7 +111,7 @@ begin
|
||||
Result := EncodeDate(WYear,WMonth,WDay);
|
||||
end;
|
||||
|
||||
procedure TWin32WSCalendar.SetDateTime(const ACalendar: TCustomCalendar; const ADateTime: TDateTime);
|
||||
procedure TWin32WSCustomCalendar.SetDateTime(const ACalendar: TCustomCalendar; const ADateTime: TDateTime);
|
||||
var
|
||||
ST: SystemTime;
|
||||
begin
|
||||
@ -119,12 +119,12 @@ begin
|
||||
SendMessage(ACalendar.Handle, MCM_SETCURSEL, 0, Windows.LParam(@ST));
|
||||
end;
|
||||
|
||||
procedure TWin32WSCalendar.SetDisplaySettings(const ACalendar: TCustomCalendar; const ASettings: TDisplaySettings);
|
||||
procedure TWin32WSCustomCalendar.SetDisplaySettings(const ACalendar: TCustomCalendar; const ASettings: TDisplaySettings);
|
||||
begin
|
||||
// TODO: implement me!
|
||||
end;
|
||||
|
||||
procedure TWin32WSCalendar.SetReadOnly(const ACalendar: TCustomCalendar; const AReadOnly: boolean);
|
||||
procedure TWin32WSCustomCalendar.SetReadOnly(const ACalendar: TCustomCalendar; const AReadOnly: boolean);
|
||||
begin
|
||||
// TODO: implement me!
|
||||
end;
|
||||
@ -137,6 +137,6 @@ initialization
|
||||
// To improve speed, register only classes
|
||||
// which actually implement something
|
||||
////////////////////////////////////////////////////
|
||||
RegisterWSComponent(TCalendar, TWin32WSCalendar);
|
||||
RegisterWSComponent(TCustomCalendar, TWin32WSCustomCalendar);
|
||||
////////////////////////////////////////////////////
|
||||
end.
|
||||
|
@ -49,10 +49,10 @@ uses
|
||||
WSLCLClasses, WSControls;
|
||||
|
||||
type
|
||||
{ TWSCalendar }
|
||||
{ TWSCustomCalendar }
|
||||
|
||||
TWSCalendarClass = class of TWSCalendar;
|
||||
TWSCalendar = class(TWSWinControl)
|
||||
TWSCustomCalendarClass = class of TWSCustomCalendar;
|
||||
TWSCustomCalendar = class(TWSWinControl)
|
||||
class function GetDateTime(const ACalendar: TCustomCalendar): TDateTime; virtual;
|
||||
class procedure SetDateTime(const ACalendar: TCustomCalendar; const ADateTime: TDateTime); virtual;
|
||||
class procedure SetDisplaySettings(const ACalendar: TCustomCalendar;
|
||||
@ -63,21 +63,21 @@ type
|
||||
|
||||
implementation
|
||||
|
||||
function TWSCalendar.GetDateTime(const ACalendar: TCustomCalendar): TDateTime;
|
||||
function TWSCustomCalendar.GetDateTime(const ACalendar: TCustomCalendar): TDateTime;
|
||||
begin
|
||||
Result := 0.0;
|
||||
end;
|
||||
|
||||
procedure TWSCalendar.SetDateTime(const ACalendar: TCustomCalendar; const ADateTime: TDateTime);
|
||||
procedure TWSCustomCalendar.SetDateTime(const ACalendar: TCustomCalendar; const ADateTime: TDateTime);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TWSCalendar.SetDisplaySettings(const ACalendar: TCustomCalendar;
|
||||
procedure TWSCustomCalendar.SetDisplaySettings(const ACalendar: TCustomCalendar;
|
||||
const ADisplaySettings: TDisplaySettings);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TWSCalendar.SetReadOnly(const ACalendar: TCustomCalendar; const AReadOnly: boolean);
|
||||
procedure TWSCustomCalendar.SetReadOnly(const ACalendar: TCustomCalendar; const AReadOnly: boolean);
|
||||
begin
|
||||
end;
|
||||
|
||||
@ -87,6 +87,6 @@ initialization
|
||||
// To improve speed, register only classes
|
||||
// which actually implement something
|
||||
////////////////////////////////////////////////////
|
||||
// RegisterWSComponent(TCalendar, TWSCalendar);
|
||||
// RegisterWSComponent(TCustomCalendar, TWSCustomCalendar);
|
||||
////////////////////////////////////////////////////
|
||||
end.
|
||||
|
@ -92,7 +92,7 @@ type
|
||||
|
||||
{ TWSDBCalendar }
|
||||
|
||||
TWSDBCalendar = class(TWSCalendar)
|
||||
TWSDBCalendar = class(TWSCustomCalendar)
|
||||
end;
|
||||
|
||||
{ TWSDBCustomNavigator }
|
||||
|
Loading…
Reference in New Issue
Block a user