View Issue Details

IDProjectCategoryView StatusLast Update
0028561LazarusLCLpublic2015-09-19 17:18
ReporterJanusz TomczakAssigned ToBart Broersma 
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version1.5 (SVN)Product Build 
Target Version1.6Fixed in Version1.6 
Summary0028561: [Patches] TimeEdit - property SimpleLayout
DescriptionI created new property SimpleLayout. This property allows to set start layout of minutes grids. If true then set simple, else extended.
TagsNo tags attached.
Fixed in Revisionr49850
LazTarget1.6
Widgetset
Attached Files
  • editbtn.pas.patch (2,116 bytes)
    Index: editbtn.pas
    ===================================================================
    --- editbtn.pas	(revision 49703)
    +++ editbtn.pas	(working copy)
    @@ -39,8 +39,6 @@
     
     type
     
    -
    -
       { TEbEdit }
     
       TEbEdit = class(TCustomMaskedit)
    @@ -872,11 +870,14 @@
           IsEmptyTime: Boolean;
           FDefaultNow: Boolean;
           FDroppedDown: Boolean;
    +      FSimpleLayout: Boolean;
           FOnAcceptTime: TAcceptTimeEvent;
           FOnCustomTime: TCustomTimeEvent;
           function GetTime: TDateTime;
           procedure SetTime(AValue: TDateTime);
           procedure SetEmptyTime;
    +      function GetLayout: Boolean;
    +      procedure SetLayout(AValue: Boolean);
           procedure TimePopupReturnTime(Sender: TObject; const ATime: TDateTime);
           procedure TimePopupShowHide(Sender: TObject);
           procedure OpenTimePopup;
    @@ -948,6 +949,7 @@
           property ParentShowHint;
           property PopupMenu;
           property ShowHint;
    +      property SimpleLayout: Boolean read GetLayout write SetLayout default True;
           property TabStop;
           property TabOrder;
           property Visible;
    @@ -2946,6 +2948,16 @@
       end;
     end;
     
    +function TTimeEdit.GetLayout: Boolean;
    +begin
    +  Result := FSimpleLayout;
    +end;
    +
    +procedure TTimeEdit.SetLayout(AValue: Boolean);
    +begin
    +  FSimpleLayout := AValue;
    +end;
    +
     procedure TTimeEdit.SetTime(AValue: TDateTime);
     var
       Output: String;
    @@ -2996,7 +3008,7 @@
       ATime := GetTime;
       if ATime = NullDate then
         ATime := SysUtils.Time;
    -  ShowTimePopup(PopupOrigin, ATime, Self.DoubleBuffered, @TimePopupReturnTime, @TimePopupShowHide);
    +  ShowTimePopup(PopupOrigin, ATime, Self.DoubleBuffered, @TimePopupReturnTime, @TimePopupShowHide, FSimpleLayout);
     end;
     
     function TTimeEdit.TryParseInput(AInput: String; out ParseResult: TDateTime): Boolean;
    @@ -3042,7 +3054,6 @@
       OpenTimePopup;
     end;
     
    -
     procedure TTimeEdit.EditEditingDone;
     begin
       ParseInput;
    @@ -3049,11 +3060,11 @@
       inherited EditEditingDone;
     end;
     
    -
     constructor TTimeEdit.Create(AOwner: TComponent);
     begin
       inherited Create(AOwner);
       SetEmptyTime;
    +  FSimpleLayout := True;
     end;
     
     { TCalcEdit }
    
    editbtn.pas.patch (2,116 bytes)
  • timepopup.pas.patch (1,475 bytes)
    Index: timepopup.pas
    ===================================================================
    --- timepopup.pas	(revision 49703)
    +++ timepopup.pas	(working copy)
    @@ -54,7 +54,7 @@
       end;
     
     procedure ShowTimePopup(const Position: TPoint; ATime: TDateTime; const DoubleBufferedForm: Boolean;
    -                        const OnReturnTime: TReturnTimeEvent; const OnShowHide: TNotifyEvent = nil);
    +                        const OnReturnTime: TReturnTimeEvent; const OnShowHide: TNotifyEvent = nil; SimpleLayout: Boolean = True);
     
     implementation
     
    @@ -61,7 +61,7 @@
     {$R *.lfm}
     
     procedure ShowTimePopup(const Position: TPoint; ATime: TDateTime; const DoubleBufferedForm: Boolean; const OnReturnTime: TReturnTimeEvent;
    -                        const OnShowHide: TNotifyEvent);
    +                        const OnShowHide: TNotifyEvent; SimpleLayout: Boolean);
     var
       NewForm: TTimePopupForm;
     begin
    @@ -72,6 +72,7 @@
       NewForm.OnHide := OnShowHide;
       if DoubleBufferedForm then
         NewForm.ActivateDoubleBuffered;
    +  NewForm.SetLayout(SimpleLayout);
       NewForm.Show;
     end;
     
    @@ -178,6 +179,7 @@
       try
       if SimpleLayout then
       begin
    +    MoreLessBtn.Caption := '>>';
         MinutesGrid.RowCount := 2;
         MinutesGrid.ColCount := 6;
         for r := 0 to MinutesGrid.RowCount - 1 do
    @@ -189,6 +191,7 @@
       end
       else
       begin
    +    MoreLessBtn.Caption := '<<';
         MinutesGrid.RowCount := 12;
         MinutesGrid.ColCount := 5;
         for r := 0 to MinutesGrid.RowCount - 1 do
    
    timepopup.pas.patch (1,475 bytes)
  • timeedit.patch (3,633 bytes)
    Index: lcl/editbtn.pas
    ===================================================================
    --- lcl/editbtn.pas	(revision 49709)
    +++ lcl/editbtn.pas	(working copy)
    @@ -39,8 +39,6 @@
     
     type
     
    -
    -
       { TEbEdit }
     
       TEbEdit = class(TCustomMaskedit)
    @@ -872,11 +870,14 @@
           IsEmptyTime: Boolean;
           FDefaultNow: Boolean;
           FDroppedDown: Boolean;
    +      FSimpleLayout: Boolean;
           FOnAcceptTime: TAcceptTimeEvent;
           FOnCustomTime: TCustomTimeEvent;
           function GetTime: TDateTime;
           procedure SetTime(AValue: TDateTime);
           procedure SetEmptyTime;
    +      function GetLayout: Boolean;
    +      procedure SetLayout(AValue: Boolean);
           procedure TimePopupReturnTime(Sender: TObject; const ATime: TDateTime);
           procedure TimePopupShowHide(Sender: TObject);
           procedure OpenTimePopup;
    @@ -948,6 +949,7 @@
           property ParentShowHint;
           property PopupMenu;
           property ShowHint;
    +      property SimpleLayout: Boolean read GetLayout write SetLayout default True;
           property TabStop;
           property TabOrder;
           property Visible;
    @@ -2946,6 +2948,16 @@
       end;
     end;
     
    +function TTimeEdit.GetLayout: Boolean;
    +begin
    +  Result := FSimpleLayout;
    +end;
    +
    +procedure TTimeEdit.SetLayout(AValue: Boolean);
    +begin
    +  FSimpleLayout := AValue;
    +end;
    +
     procedure TTimeEdit.SetTime(AValue: TDateTime);
     var
       Output: String;
    @@ -2996,7 +3008,7 @@
       ATime := GetTime;
       if ATime = NullDate then
         ATime := SysUtils.Time;
    -  ShowTimePopup(PopupOrigin, ATime, Self.DoubleBuffered, @TimePopupReturnTime, @TimePopupShowHide);
    +  ShowTimePopup(PopupOrigin, ATime, Self.DoubleBuffered, @TimePopupReturnTime, @TimePopupShowHide, FSimpleLayout);
     end;
     
     function TTimeEdit.TryParseInput(AInput: String; out ParseResult: TDateTime): Boolean;
    @@ -3042,7 +3054,6 @@
       OpenTimePopup;
     end;
     
    -
     procedure TTimeEdit.EditEditingDone;
     begin
       ParseInput;
    @@ -3049,11 +3060,11 @@
       inherited EditEditingDone;
     end;
     
    -
     constructor TTimeEdit.Create(AOwner: TComponent);
     begin
       inherited Create(AOwner);
       SetEmptyTime;
    +  FSimpleLayout := True;
     end;
     
     { TCalcEdit }
    Index: lcl/forms/timepopup.pas
    ===================================================================
    --- lcl/forms/timepopup.pas	(revision 49709)
    +++ lcl/forms/timepopup.pas	(working copy)
    @@ -54,7 +54,7 @@
       end;
     
     procedure ShowTimePopup(const Position: TPoint; ATime: TDateTime; const DoubleBufferedForm: Boolean;
    -                        const OnReturnTime: TReturnTimeEvent; const OnShowHide: TNotifyEvent = nil);
    +                        const OnReturnTime: TReturnTimeEvent; const OnShowHide: TNotifyEvent = nil; SimpleLayout: Boolean = True);
     
     implementation
     
    @@ -61,7 +61,7 @@
     {$R *.lfm}
     
     procedure ShowTimePopup(const Position: TPoint; ATime: TDateTime; const DoubleBufferedForm: Boolean; const OnReturnTime: TReturnTimeEvent;
    -                        const OnShowHide: TNotifyEvent);
    +                        const OnShowHide: TNotifyEvent; SimpleLayout: Boolean);
     var
       NewForm: TTimePopupForm;
     begin
    @@ -72,6 +72,7 @@
       NewForm.OnHide := OnShowHide;
       if DoubleBufferedForm then
         NewForm.ActivateDoubleBuffered;
    +  NewForm.SetLayout(SimpleLayout);
       NewForm.Show;
     end;
     
    @@ -178,6 +179,7 @@
       try
       if SimpleLayout then
       begin
    +    MoreLessBtn.Caption := '>>';
         MinutesGrid.RowCount := 2;
         MinutesGrid.ColCount := 6;
         for r := 0 to MinutesGrid.RowCount - 1 do
    @@ -189,6 +191,7 @@
       end
       else
       begin
    +    MoreLessBtn.Caption := '<<';
         MinutesGrid.RowCount := 12;
         MinutesGrid.ColCount := 5;
         for r := 0 to MinutesGrid.RowCount - 1 do
    
    timeedit.patch (3,633 bytes)

Activities

Janusz Tomczak

2015-08-23 14:38

reporter  

editbtn.pas.patch (2,116 bytes)
Index: editbtn.pas
===================================================================
--- editbtn.pas	(revision 49703)
+++ editbtn.pas	(working copy)
@@ -39,8 +39,6 @@
 
 type
 
-
-
   { TEbEdit }
 
   TEbEdit = class(TCustomMaskedit)
@@ -872,11 +870,14 @@
       IsEmptyTime: Boolean;
       FDefaultNow: Boolean;
       FDroppedDown: Boolean;
+      FSimpleLayout: Boolean;
       FOnAcceptTime: TAcceptTimeEvent;
       FOnCustomTime: TCustomTimeEvent;
       function GetTime: TDateTime;
       procedure SetTime(AValue: TDateTime);
       procedure SetEmptyTime;
+      function GetLayout: Boolean;
+      procedure SetLayout(AValue: Boolean);
       procedure TimePopupReturnTime(Sender: TObject; const ATime: TDateTime);
       procedure TimePopupShowHide(Sender: TObject);
       procedure OpenTimePopup;
@@ -948,6 +949,7 @@
       property ParentShowHint;
       property PopupMenu;
       property ShowHint;
+      property SimpleLayout: Boolean read GetLayout write SetLayout default True;
       property TabStop;
       property TabOrder;
       property Visible;
@@ -2946,6 +2948,16 @@
   end;
 end;
 
+function TTimeEdit.GetLayout: Boolean;
+begin
+  Result := FSimpleLayout;
+end;
+
+procedure TTimeEdit.SetLayout(AValue: Boolean);
+begin
+  FSimpleLayout := AValue;
+end;
+
 procedure TTimeEdit.SetTime(AValue: TDateTime);
 var
   Output: String;
@@ -2996,7 +3008,7 @@
   ATime := GetTime;
   if ATime = NullDate then
     ATime := SysUtils.Time;
-  ShowTimePopup(PopupOrigin, ATime, Self.DoubleBuffered, @TimePopupReturnTime, @TimePopupShowHide);
+  ShowTimePopup(PopupOrigin, ATime, Self.DoubleBuffered, @TimePopupReturnTime, @TimePopupShowHide, FSimpleLayout);
 end;
 
 function TTimeEdit.TryParseInput(AInput: String; out ParseResult: TDateTime): Boolean;
@@ -3042,7 +3054,6 @@
   OpenTimePopup;
 end;
 
-
 procedure TTimeEdit.EditEditingDone;
 begin
   ParseInput;
@@ -3049,11 +3060,11 @@
   inherited EditEditingDone;
 end;
 
-
 constructor TTimeEdit.Create(AOwner: TComponent);
 begin
   inherited Create(AOwner);
   SetEmptyTime;
+  FSimpleLayout := True;
 end;
 
 { TCalcEdit }
editbtn.pas.patch (2,116 bytes)

Janusz Tomczak

2015-08-23 14:39

reporter  

timepopup.pas.patch (1,475 bytes)
Index: timepopup.pas
===================================================================
--- timepopup.pas	(revision 49703)
+++ timepopup.pas	(working copy)
@@ -54,7 +54,7 @@
   end;
 
 procedure ShowTimePopup(const Position: TPoint; ATime: TDateTime; const DoubleBufferedForm: Boolean;
-                        const OnReturnTime: TReturnTimeEvent; const OnShowHide: TNotifyEvent = nil);
+                        const OnReturnTime: TReturnTimeEvent; const OnShowHide: TNotifyEvent = nil; SimpleLayout: Boolean = True);
 
 implementation
 
@@ -61,7 +61,7 @@
 {$R *.lfm}
 
 procedure ShowTimePopup(const Position: TPoint; ATime: TDateTime; const DoubleBufferedForm: Boolean; const OnReturnTime: TReturnTimeEvent;
-                        const OnShowHide: TNotifyEvent);
+                        const OnShowHide: TNotifyEvent; SimpleLayout: Boolean);
 var
   NewForm: TTimePopupForm;
 begin
@@ -72,6 +72,7 @@
   NewForm.OnHide := OnShowHide;
   if DoubleBufferedForm then
     NewForm.ActivateDoubleBuffered;
+  NewForm.SetLayout(SimpleLayout);
   NewForm.Show;
 end;
 
@@ -178,6 +179,7 @@
   try
   if SimpleLayout then
   begin
+    MoreLessBtn.Caption := '>>';
     MinutesGrid.RowCount := 2;
     MinutesGrid.ColCount := 6;
     for r := 0 to MinutesGrid.RowCount - 1 do
@@ -189,6 +191,7 @@
   end
   else
   begin
+    MoreLessBtn.Caption := '<<';
     MinutesGrid.RowCount := 12;
     MinutesGrid.ColCount := 5;
     for r := 0 to MinutesGrid.RowCount - 1 do
timepopup.pas.patch (1,475 bytes)

Bart Broersma

2015-08-24 21:28

developer   ~0085523

Could you possibly create a single patch, preferrably from within the Lazarus root folder.
Makes it just a little easier to patch at my side.

Janusz Tomczak

2015-08-24 22:05

reporter   ~0085524

Thanks for the tip. Yes, that is better.

Janusz Tomczak

2015-08-24 22:07

reporter  

timeedit.patch (3,633 bytes)
Index: lcl/editbtn.pas
===================================================================
--- lcl/editbtn.pas	(revision 49709)
+++ lcl/editbtn.pas	(working copy)
@@ -39,8 +39,6 @@
 
 type
 
-
-
   { TEbEdit }
 
   TEbEdit = class(TCustomMaskedit)
@@ -872,11 +870,14 @@
       IsEmptyTime: Boolean;
       FDefaultNow: Boolean;
       FDroppedDown: Boolean;
+      FSimpleLayout: Boolean;
       FOnAcceptTime: TAcceptTimeEvent;
       FOnCustomTime: TCustomTimeEvent;
       function GetTime: TDateTime;
       procedure SetTime(AValue: TDateTime);
       procedure SetEmptyTime;
+      function GetLayout: Boolean;
+      procedure SetLayout(AValue: Boolean);
       procedure TimePopupReturnTime(Sender: TObject; const ATime: TDateTime);
       procedure TimePopupShowHide(Sender: TObject);
       procedure OpenTimePopup;
@@ -948,6 +949,7 @@
       property ParentShowHint;
       property PopupMenu;
       property ShowHint;
+      property SimpleLayout: Boolean read GetLayout write SetLayout default True;
       property TabStop;
       property TabOrder;
       property Visible;
@@ -2946,6 +2948,16 @@
   end;
 end;
 
+function TTimeEdit.GetLayout: Boolean;
+begin
+  Result := FSimpleLayout;
+end;
+
+procedure TTimeEdit.SetLayout(AValue: Boolean);
+begin
+  FSimpleLayout := AValue;
+end;
+
 procedure TTimeEdit.SetTime(AValue: TDateTime);
 var
   Output: String;
@@ -2996,7 +3008,7 @@
   ATime := GetTime;
   if ATime = NullDate then
     ATime := SysUtils.Time;
-  ShowTimePopup(PopupOrigin, ATime, Self.DoubleBuffered, @TimePopupReturnTime, @TimePopupShowHide);
+  ShowTimePopup(PopupOrigin, ATime, Self.DoubleBuffered, @TimePopupReturnTime, @TimePopupShowHide, FSimpleLayout);
 end;
 
 function TTimeEdit.TryParseInput(AInput: String; out ParseResult: TDateTime): Boolean;
@@ -3042,7 +3054,6 @@
   OpenTimePopup;
 end;
 
-
 procedure TTimeEdit.EditEditingDone;
 begin
   ParseInput;
@@ -3049,11 +3060,11 @@
   inherited EditEditingDone;
 end;
 
-
 constructor TTimeEdit.Create(AOwner: TComponent);
 begin
   inherited Create(AOwner);
   SetEmptyTime;
+  FSimpleLayout := True;
 end;
 
 { TCalcEdit }
Index: lcl/forms/timepopup.pas
===================================================================
--- lcl/forms/timepopup.pas	(revision 49709)
+++ lcl/forms/timepopup.pas	(working copy)
@@ -54,7 +54,7 @@
   end;
 
 procedure ShowTimePopup(const Position: TPoint; ATime: TDateTime; const DoubleBufferedForm: Boolean;
-                        const OnReturnTime: TReturnTimeEvent; const OnShowHide: TNotifyEvent = nil);
+                        const OnReturnTime: TReturnTimeEvent; const OnShowHide: TNotifyEvent = nil; SimpleLayout: Boolean = True);
 
 implementation
 
@@ -61,7 +61,7 @@
 {$R *.lfm}
 
 procedure ShowTimePopup(const Position: TPoint; ATime: TDateTime; const DoubleBufferedForm: Boolean; const OnReturnTime: TReturnTimeEvent;
-                        const OnShowHide: TNotifyEvent);
+                        const OnShowHide: TNotifyEvent; SimpleLayout: Boolean);
 var
   NewForm: TTimePopupForm;
 begin
@@ -72,6 +72,7 @@
   NewForm.OnHide := OnShowHide;
   if DoubleBufferedForm then
     NewForm.ActivateDoubleBuffered;
+  NewForm.SetLayout(SimpleLayout);
   NewForm.Show;
 end;
 
@@ -178,6 +179,7 @@
   try
   if SimpleLayout then
   begin
+    MoreLessBtn.Caption := '>>';
     MinutesGrid.RowCount := 2;
     MinutesGrid.ColCount := 6;
     for r := 0 to MinutesGrid.RowCount - 1 do
@@ -189,6 +191,7 @@
   end
   else
   begin
+    MoreLessBtn.Caption := '<<';
     MinutesGrid.RowCount := 12;
     MinutesGrid.ColCount := 5;
     for r := 0 to MinutesGrid.RowCount - 1 do
timeedit.patch (3,633 bytes)

Bart Broersma

2015-09-19 16:03

developer   ~0086007

Apllied with one modification (initial grid values were wrong if SimpleLayout := False).
Thanks for the patch.
Please close if OK.

Issue History

Date Modified Username Field Change
2015-08-23 14:38 Janusz Tomczak New Issue
2015-08-23 14:38 Janusz Tomczak File Added: editbtn.pas.patch
2015-08-23 14:39 Janusz Tomczak File Added: timepopup.pas.patch
2015-08-23 23:14 Bart Broersma Assigned To => Bart Broersma
2015-08-23 23:14 Bart Broersma Status new => assigned
2015-08-24 21:28 Bart Broersma LazTarget => -
2015-08-24 21:28 Bart Broersma Note Added: 0085523
2015-08-24 21:28 Bart Broersma Status assigned => feedback
2015-08-24 22:05 Janusz Tomczak Note Added: 0085524
2015-08-24 22:05 Janusz Tomczak Status feedback => assigned
2015-08-24 22:07 Janusz Tomczak File Added: timeedit.patch
2015-09-19 16:03 Bart Broersma Fixed in Revision => r49850
2015-09-19 16:03 Bart Broersma LazTarget - => 1.6
2015-09-19 16:03 Bart Broersma Note Added: 0086007
2015-09-19 16:03 Bart Broersma Status assigned => resolved
2015-09-19 16:03 Bart Broersma Fixed in Version => 1.6
2015-09-19 16:03 Bart Broersma Resolution open => fixed
2015-09-19 16:03 Bart Broersma Target Version => 1.6
2015-09-19 17:18 Janusz Tomczak Status resolved => closed