mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-26 18:23:46 +02:00
lcl: don't close calendar dialog and calendar popup form on double click if user clicked on wrong parts of calendar (issue #0009722)
git-svn-id: trunk@19126 -
This commit is contained in:
parent
3215e2c1d2
commit
5a3f0457dd
@ -192,7 +192,6 @@ function CreateCalculatorForm(AOwner: TComponent; ALayout : TCalculatorLayout; A
|
||||
Type
|
||||
{ TCalendarDialog }
|
||||
TCalendarDialog = class(TCommonDialog)
|
||||
procedure CalendarDblClick(Sender: TObject);
|
||||
private
|
||||
FDate: TDateTime;
|
||||
FDayChanged: TNotifyEvent;
|
||||
@ -208,6 +207,7 @@ Type
|
||||
function IsTitleStored: Boolean;
|
||||
protected
|
||||
procedure GetNewDate(Sender:TObject);//or onClick
|
||||
procedure CalendarDblClick(Sender: TObject);
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
function Execute: Boolean; override;
|
||||
@ -1186,12 +1186,17 @@ end;
|
||||
procedure TCalendarDialog.CalendarDblClick(Sender: TObject);
|
||||
var
|
||||
CalendarForm: TForm;
|
||||
P: TPoint;
|
||||
begin
|
||||
P := FCalendar.ScreenToClient(Mouse.CursorPos);
|
||||
if FCalendar.HitTest(P) in [cpNoWhere, cpDate] then
|
||||
begin
|
||||
GetNewDate(Sender);
|
||||
CalendarForm:=TForm(TComponent(Sender).Owner);
|
||||
// close the calendar dialog
|
||||
CalendarForm.ModalResult:=mrOk;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCalendarDialog.IsTitleStored: Boolean;
|
||||
begin
|
||||
|
@ -1,23 +1,23 @@
|
||||
object CalendarPopupForm: TCalendarPopupForm
|
||||
Left = 635
|
||||
Height = 192
|
||||
Height = 155
|
||||
Top = 259
|
||||
Width = 222
|
||||
Width = 164
|
||||
ActiveControl = Calendar
|
||||
AutoSize = True
|
||||
BorderIcons = [biMinimize, biMaximize]
|
||||
BorderStyle = bsNone
|
||||
Caption = 'CalendarPopupForm'
|
||||
ClientHeight = 192
|
||||
ClientWidth = 222
|
||||
ClientHeight = 155
|
||||
ClientWidth = 164
|
||||
OnClose = FormClose
|
||||
OnDeactivate = FormDeactivate
|
||||
LCLVersion = '0.9.27'
|
||||
object Calendar: TCalendar
|
||||
Left = 1
|
||||
Height = 190
|
||||
Height = 153
|
||||
Top = 1
|
||||
Width = 220
|
||||
Width = 162
|
||||
BorderSpacing.Around = 1
|
||||
DateTime = 38823
|
||||
OnDblClick = CalendarDblClick
|
||||
|
@ -2,12 +2,12 @@
|
||||
|
||||
LazarusResources.Add('TCalendarPopupForm','FORMDATA',[
|
||||
'TPF0'#18'TCalendarPopupForm'#17'CalendarPopupForm'#4'Left'#3'{'#2#6'Height'#3
|
||||
+#192#0#3'Top'#3#3#1#5'Width'#3#222#0#13'ActiveControl'#7#8'Calendar'#8'AutoS'
|
||||
+#155#0#3'Top'#3#3#1#5'Width'#3#164#0#13'ActiveControl'#7#8'Calendar'#8'AutoS'
|
||||
+'ize'#9#11'BorderIcons'#11#10'biMinimize'#10'biMaximize'#0#11'BorderStyle'#7
|
||||
+#6'bsNone'#7'Caption'#6#17'CalendarPopupForm'#12'ClientHeight'#3#192#0#11'Cl'
|
||||
+'ientWidth'#3#222#0#7'OnClose'#7#9'FormClose'#12'OnDeactivate'#7#14'FormDeac'
|
||||
+#6'bsNone'#7'Caption'#6#17'CalendarPopupForm'#12'ClientHeight'#3#155#0#11'Cl'
|
||||
+'ientWidth'#3#164#0#7'OnClose'#7#9'FormClose'#12'OnDeactivate'#7#14'FormDeac'
|
||||
+'tivate'#10'LCLVersion'#6#6'0.9.27'#0#9'TCalendar'#8'Calendar'#4'Left'#2#1#6
|
||||
+'Height'#3#190#0#3'Top'#2#1#5'Width'#3#220#0#20'BorderSpacing.Around'#2#1#8
|
||||
+'Height'#3#153#0#3'Top'#2#1#5'Width'#3#162#0#20'BorderSpacing.Around'#2#1#8
|
||||
+'DateTime'#5#0#0#0#0#0#0#167#151#14'@'#10'OnDblClick'#7#16'CalendarDblClick'
|
||||
+#9'OnKeyDown'#7#15'CalendarKeyDown'#7'TabStop'#9#0#0#0
|
||||
]);
|
||||
|
@ -83,7 +83,11 @@ begin
|
||||
end;
|
||||
|
||||
procedure TCalendarPopupForm.CalendarDblClick(Sender: TObject);
|
||||
var
|
||||
P: TPoint;
|
||||
begin
|
||||
P := Calendar.ScreenToClient(Mouse.CursorPos);
|
||||
if Calendar.HitTest(P) in [cpNoWhere, cpDate] then
|
||||
ReturnDate;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user