mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-23 00:29:25 +01:00
implemented calendar events for win32 interface (bug #980)
git-svn-id: trunk@7512 -
This commit is contained in:
parent
b526cdf66b
commit
faef2dfd4d
@ -67,6 +67,7 @@ Type
|
|||||||
function GetDate: String;
|
function GetDate: String;
|
||||||
procedure SetDate(const AValue: String);
|
procedure SetDate(const AValue: String);
|
||||||
protected
|
protected
|
||||||
|
procedure LMChanged(var Message: TLMessage); message LM_CHANGED;
|
||||||
procedure LMMonthChanged(var Message: TLMessage); message LM_MONTHCHANGED;
|
procedure LMMonthChanged(var Message: TLMessage); message LM_MONTHCHANGED;
|
||||||
procedure LMYearChanged(var Message: TLMessage); message LM_YEARCHANGED;
|
procedure LMYearChanged(var Message: TLMessage); message LM_YEARCHANGED;
|
||||||
procedure LMDayChanged(var Message: TLMessage); message LM_DAYCHANGED;
|
procedure LMDayChanged(var Message: TLMessage); message LM_DAYCHANGED;
|
||||||
@ -270,6 +271,23 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomCalendar.LMChanged(var Message: TLMessage);
|
||||||
|
var
|
||||||
|
NewDate: TDateTime;
|
||||||
|
OldDay, OldMonth, OldYear: word;
|
||||||
|
NewDay, NewMonth, NewYear: word;
|
||||||
|
begin
|
||||||
|
NewDate := TWSCalendarClass(WidgetSetClass).GetDateTime(Self);
|
||||||
|
if (NewDate=FDate) then exit;
|
||||||
|
DecodeDate(NewDate, NewYear, NewMonth, NewDay);
|
||||||
|
DecodeDate(FDate, OldYear, OldMonth, OldDay);
|
||||||
|
FDate:= NewDate;
|
||||||
|
if (OldYear<>NewYear) and Assigned(OnYearChanged) then OnYearChanged(self);
|
||||||
|
if (OldMonth<>NewMonth) and Assigned(OnMonthChanged) then OnMonthChanged(self);
|
||||||
|
if (OldDay<>NewDay) and Assigned(OnDayChanged) then OnDayChanged(self);
|
||||||
|
if Assigned(OnChange) then OnChange(self);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomCalendar.LMDAYChanged(var Message: TLMessage);
|
procedure TCustomCalendar.LMDAYChanged(var Message: TLMessage);
|
||||||
begin
|
begin
|
||||||
if Assigned(OnDayChanged) then OnDayChanged(self);
|
if Assigned(OnDayChanged) then OnDayChanged(self);
|
||||||
|
|||||||
@ -528,11 +528,6 @@ Begin
|
|||||||
Assert(False, Format('Trace:WindowProc - Window Value: $%S-%d; Msg Value: %S; WParam: $%S; LParam: $%S', [IntToHex(Window, 4), Window, WM_To_String(Msg), IntToHex(WParam, 4), IntToHex(LParam, 4)]));
|
Assert(False, Format('Trace:WindowProc - Window Value: $%S-%d; Msg Value: %S; WParam: $%S; LParam: $%S', [IntToHex(Window, 4), Window, WM_To_String(Msg), IntToHex(WParam, 4), IntToHex(LParam, 4)]));
|
||||||
|
|
||||||
Case Msg Of
|
Case Msg Of
|
||||||
LM_MONTHCHANGED..LM_DAYCHANGED:
|
|
||||||
Begin
|
|
||||||
If lWinControl Is TCalendar Then
|
|
||||||
LMessage.Msg := Msg;
|
|
||||||
End;
|
|
||||||
WM_ACTIVATE:
|
WM_ACTIVATE:
|
||||||
Begin
|
Begin
|
||||||
Case Lo(WParam) Of
|
Case Lo(WParam) Of
|
||||||
@ -1087,6 +1082,13 @@ Begin
|
|||||||
End;
|
End;
|
||||||
WM_NOTIFY:
|
WM_NOTIFY:
|
||||||
Begin
|
Begin
|
||||||
|
if PNMHdr(LParam)^.code=MCN_SELCHANGE then begin
|
||||||
|
LMessage.Msg := LM_CHANGED;
|
||||||
|
WindowInfo := GetWindowInfo(PNMHdr(LParam)^.hwndFrom);
|
||||||
|
if WindowInfo^.WinControl<>nil then
|
||||||
|
lWinControl := WindowInfo^.WinControl;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
PLMsg:=@LMNotify;
|
PLMsg:=@LMNotify;
|
||||||
With LMNotify Do
|
With LMNotify Do
|
||||||
Begin
|
Begin
|
||||||
@ -1104,6 +1106,7 @@ Begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
End;
|
End;
|
||||||
|
end;
|
||||||
End;
|
End;
|
||||||
WM_PAINT:
|
WM_PAINT:
|
||||||
Begin
|
Begin
|
||||||
|
|||||||
@ -142,6 +142,10 @@ Const
|
|||||||
LVS_EX_SNAPTOGRID = $00080000;
|
LVS_EX_SNAPTOGRID = $00080000;
|
||||||
LVS_EX_SIMPLESELECT = $00100000;
|
LVS_EX_SIMPLESELECT = $00100000;
|
||||||
|
|
||||||
|
// for calendar control
|
||||||
|
MCN_FIRST = (0-750); // monthcal
|
||||||
|
MCN_SELCHANGE = (MCN_FIRST + 1);
|
||||||
|
|
||||||
// missing listview macros
|
// missing listview macros
|
||||||
function ListView_GetHeader(hwndLV: HWND): HWND;
|
function ListView_GetHeader(hwndLV: HWND): HWND;
|
||||||
function ListView_GetExtendedListViewStyle(hwndLV: HWND): DWORD;
|
function ListView_GetExtendedListViewStyle(hwndLV: HWND): DWORD;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user