View Issue Details

IDProjectCategoryView StatusLast Update
0027277PatchesLCLpublic2015-01-18 15:58
ReporterDerit Agustin Assigned ToBart Broersma  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Platformwin32OSWindows 
Target Version1.4Fixed in Version1.4RC1 
Summary0027277: patch for Edit button
Descriptionthis patch add missing Properties
TagsNo tags attached.
Fixed in Revisionr47411
LazTarget1.4
Widgetset
Attached Files

Activities

Derit Agustin

2015-01-09 18:22

reporter  

editbtn2.pas.patch (4,019 bytes)   
Index: editbtn.pas
===================================================================
--- editbtn.pas	(revision 47321)
+++ editbtn.pas	(working copy)
@@ -93,6 +93,7 @@
     function GetAutoSelect: Boolean;
     function GetAutoSelected: Boolean;
     function GetBtnCaption: TCaption;
+    function GetButtonCursor: TCursor;
     function GetButtonHint: TTranslateString;
     function GetButtonWidth: Integer;
     function GetCanUndo: Boolean;
@@ -156,6 +157,7 @@
     procedure SetAutoSelected(AValue: Boolean);
     procedure SetButtonAlign(AValue: TButtonAlign);
     procedure SetBtnCaption(AValue: TCaption);
+    procedure SetButtonCursor(AValue: TCursor);
     procedure SetButtonHint(AValue: TTranslateString);
     procedure SetButtonOnlyWhenFocused(AValue: Boolean);
     procedure SetButtonWidth(AValue: Integer);
@@ -243,6 +245,7 @@
     property ButtonHint: TTranslateString read GetButtonHint write SetButtonHint;
     property ButtonOnlyWhenFocused: Boolean read FButtonOnlyWhenFocused write SetButtonOnlyWhenFocused default False;
     property ButtonWidth: Integer read GetButtonWidth write SetButtonWidth;
+    property ButtonCursor:TCursor read GetButtonCursor write SetButtonCursor;
     property Color: TColor read GetColor write SetColor stored True default {$ifdef UseCLDefault}clDefault{$else}clWindow{$endif};
     property DirectInput : Boolean read GetDirectInput write SetDirectInput default True;
     property Edit: TEbEdit read FEdit;
@@ -332,12 +335,13 @@
     property Anchors;
     property BiDiMode;
     property BorderSpacing;
-    property BorderStyle default bsNone;
+   // property BorderStyle default bsNone;
     property ButtonAlign;
     property ButtonCaption;
     property ButtonHint;
     property ButtonOnlyWhenFocused;
     property ButtonWidth;
+    property ButtonCursor;
     property CharCase;
     property Color;
     property Constraints;
@@ -565,6 +569,8 @@
     property ButtonWidth;
     property DirectInput;
     property ButtonOnlyWhenFocused;
+    property ButtonAlign;
+    property ButtonCursor;
     // property Glyph;
     property NumGlyphs;
     property Flat;
@@ -576,7 +582,7 @@
     property AutoSelect;
     property BidiMode;
     property BorderSpacing;
-    property BorderStyle;
+   // property BorderStyle;
     property AutoSize;
     property Color;
     property DragCursor;
@@ -652,6 +658,8 @@
     property ButtonWidth;
     property DirectInput;
     property ButtonOnlyWhenFocused;
+    property ButtonAlign;
+    property ButtonCursor;
     // property Glyph;
     property NumGlyphs;
     property Flat;
@@ -663,7 +671,7 @@
     property AutoSelect;
     property BidiMode;
     property BorderSpacing;
-    property BorderStyle;
+   // property BorderStyle;
     property Color;
     property DragCursor;
     property DragMode;
@@ -846,6 +854,8 @@
     property ButtonWidth;
     property DirectInput;
     property ButtonOnlyWhenFocused;
+    property ButtonAlign;
+    property ButtonCursor;
     // property Glyph;
     property NumGlyphs;
     property Flat;
@@ -855,7 +865,7 @@
     property Anchors;
     property BidiMode;
     property BorderSpacing;
-    property BorderStyle;
+   // property BorderStyle;
     property AutoSize;
     property AutoSelect;
     property Color;
@@ -1211,6 +1221,11 @@
   Result := FButton.Caption;
 end;
 
+function TCustomEditButton.GetButtonCursor: TCursor;
+begin
+  Result:=FButton.Cursor;
+end;
+
 procedure TCustomEditButton.SetButtonAlign(AValue: TButtonAlign);
 begin
   if FButtonAlign = AValue then
@@ -1354,6 +1369,11 @@
   FButton.Caption := AValue;
 end;
 
+procedure TCustomEditButton.SetButtonCursor(AValue: TCursor);
+begin
+FButton.Cursor:=AValue;
+end;
+
 class function TCustomEditButton.GetControlClassDefaultSize: TSize;
 begin
   Result.CX := 80 + 23; //as TCustomEdit + TCustomSpeedButton
@@ -1409,7 +1429,6 @@
   if Cursor = AValue then
     Exit;
   inherited SetCursor(AValue);
-  FButton.Cursor := AValue;
   FEdit.Cursor := AValue;
 end;
 
editbtn2.pas.patch (4,019 bytes)   

Bart Broersma

2015-01-10 19:30

developer   ~0080263

Why: + // property BorderStyle;?

Derit Agustin

2015-01-10 22:54

reporter   ~0080272

it border set of the container border
not border of TEdit

Bart Broersma

2015-01-11 00:40

developer   ~0080274

Last edited: 2015-01-11 00:42

View 2 revisions

> it border set of the container border
Yes.
I find that visually more pleasing than fiddling with the Edit's borderstyle.

But, more to the point, please do not mix separate issues in one patch (and one bugreport).

Could you please provide a patch for the button properties only?
Also not sure about ButtonAlign: what's the use case for it?

Derit Agustin

2015-01-18 13:49

reporter  

editbtn3.pas.patch (4,799 bytes)   
Index: editbtn.pas
===================================================================
--- editbtn.pas	(revision 47410)
+++ editbtn.pas	(working copy)
@@ -92,7 +92,9 @@
     function GetAlignment: TAlignment;
     function GetAutoSelect: Boolean;
     function GetAutoSelected: Boolean;
+    function GetBorderStyle: TBorderStyle;
     function GetBtnCaption: TCaption;
+    function GetButtonCursor: TCursor;
     function GetButtonHint: TTranslateString;
     function GetButtonWidth: Integer;
     function GetCanUndo: Boolean;
@@ -154,8 +156,10 @@
     procedure SetAlignment(AValue: TAlignment);
     procedure SetAutoSelect(AValue: Boolean);
     procedure SetAutoSelected(AValue: Boolean);
+    procedure SetBorderSyle(AValue: TBorderStyle);
     procedure SetButtonAlign(AValue: TButtonAlign);
     procedure SetBtnCaption(AValue: TCaption);
+    procedure SetButtonCursor(AValue: TCursor);
     procedure SetButtonHint(AValue: TTranslateString);
     procedure SetButtonOnlyWhenFocused(AValue: Boolean);
     procedure SetButtonWidth(AValue: Integer);
@@ -234,7 +238,7 @@
     procedure SetAutoSize(AValue: Boolean); override;
     procedure SetColor(AValue: TColor); override;
     procedure SetCursor(AValue: TCursor); override;
-
+    property BorderStyle:TBorderStyle read GetBorderStyle write SetBorderSyle;
     property AutoSelect: Boolean read GetAutoSelect write SetAutoSelect default True;
     property AutoSelected: Boolean read GetAutoSelected write SetAutoSelected;
     property Button: TSpeedButton read FButton;
@@ -243,6 +247,8 @@
     property ButtonHint: TTranslateString read GetButtonHint write SetButtonHint;
     property ButtonOnlyWhenFocused: Boolean read FButtonOnlyWhenFocused write SetButtonOnlyWhenFocused default False;
     property ButtonWidth: Integer read GetButtonWidth write SetButtonWidth;
+    property ButtonCursor:TCursor read GetButtonCursor write SetButtonCursor;
+
     property Color: TColor read GetColor write SetColor stored True default {$ifdef UseCLDefault}clDefault{$else}clWindow{$endif};
     property DirectInput : Boolean read GetDirectInput write SetDirectInput default True;
     property Edit: TEbEdit read FEdit;
@@ -332,12 +338,13 @@
     property Anchors;
     property BiDiMode;
     property BorderSpacing;
-    property BorderStyle default bsNone;
+    property BorderStyle Default bsSingle;
     property ButtonAlign;
     property ButtonCaption;
     property ButtonHint;
     property ButtonOnlyWhenFocused;
     property ButtonWidth;
+    property ButtonCursor;
     property CharCase;
     property Color;
     property Constraints;
@@ -565,6 +572,8 @@
     property ButtonWidth;
     property DirectInput;
     property ButtonOnlyWhenFocused;
+    property ButtonAlign;
+    property ButtonCursor;
     // property Glyph;
     property NumGlyphs;
     property Flat;
@@ -652,6 +661,8 @@
     property ButtonWidth;
     property DirectInput;
     property ButtonOnlyWhenFocused;
+    property ButtonAlign;
+    property ButtonCursor;
     // property Glyph;
     property NumGlyphs;
     property Flat;
@@ -846,6 +857,8 @@
     property ButtonWidth;
     property DirectInput;
     property ButtonOnlyWhenFocused;
+    property ButtonAlign;
+    property ButtonCursor;
     // property Glyph;
     property NumGlyphs;
     property Flat;
@@ -1201,6 +1214,11 @@
   Result := FEdit.AutoSelected;
 end;
 
+function TCustomEditButton.GetBorderStyle: TBorderStyle;
+begin
+  Result:=FEdit.BorderStyle;
+end;
+
 function TCustomEditButton.GetButtonHint: TTranslateString;
 begin
   Result := FButton.Hint;
@@ -1211,6 +1229,11 @@
   Result := FButton.Caption;
 end;
 
+function TCustomEditButton.GetButtonCursor: TCursor;
+begin
+  Result:=FButton.Cursor;
+end;
+
 procedure TCustomEditButton.SetButtonAlign(AValue: TButtonAlign);
 begin
   if FButtonAlign = AValue then
@@ -1340,6 +1363,11 @@
   FEdit.AutoSelected := AValue;
 end;
 
+procedure TCustomEditButton.SetBorderSyle(AValue: TBorderStyle);
+begin
+  FEdit.BorderStyle:=AValue;
+end;
+
 procedure TCustomEditButton.SetAutoSize(AValue: Boolean);
 begin
   if AutoSize = AValue then
@@ -1354,6 +1382,11 @@
   FButton.Caption := AValue;
 end;
 
+procedure TCustomEditButton.SetButtonCursor(AValue: TCursor);
+begin
+FButton.Cursor:=AValue;
+end;
+
 class function TCustomEditButton.GetControlClassDefaultSize: TSize;
 begin
   Result.CX := 80 + 23; //as TCustomEdit + TCustomSpeedButton
@@ -1409,7 +1442,6 @@
   if Cursor = AValue then
     Exit;
   inherited SetCursor(AValue);
-  FButton.Cursor := AValue;
   FEdit.Cursor := AValue;
 end;
 
@@ -1745,7 +1777,7 @@
     Align := alClient;
     ParentColor := False;
     ParentFont := True;
-
+    BorderStyle:=bsSingle;
     AutoSelect := True;
     Alignment := taLeftJustify;
     ReadOnly := False;
editbtn3.pas.patch (4,799 bytes)   

Derit Agustin

2015-01-18 13:51

reporter   ~0080482

@ButtonAlign property change button position from Edit

Derit Agustin

2015-01-18 15:11

reporter   ~0080486

ok up to you :)

Bart Broersma

2015-01-18 15:13

developer   ~0080487

I won't commit the borderstyle stuff.

> @ButtonAlign property change button position from Edit
By design.
In hindsight maybe it could have been better implemented as property layout: TLeftRight (see e.g. TCheckBox).

Bart Broersma

2015-01-18 15:58

developer   ~0080488

Implemented ButtonCursor in r47411.
Please close if OK.

Issue History

Date Modified Username Field Change
2015-01-09 18:22 Derit Agustin New Issue
2015-01-09 18:22 Derit Agustin File Added: editbtn2.pas.patch
2015-01-10 19:30 Bart Broersma Note Added: 0080263
2015-01-10 19:30 Bart Broersma Assigned To => Bart Broersma
2015-01-10 19:30 Bart Broersma Status new => assigned
2015-01-10 19:30 Bart Broersma LazTarget => -
2015-01-10 19:30 Bart Broersma Status assigned => feedback
2015-01-10 22:54 Derit Agustin Note Added: 0080272
2015-01-10 22:54 Derit Agustin Status feedback => assigned
2015-01-11 00:40 Bart Broersma Note Added: 0080274
2015-01-11 00:42 Bart Broersma Note Edited: 0080274 View Revisions
2015-01-11 00:42 Bart Broersma Status assigned => feedback
2015-01-18 13:49 Derit Agustin File Added: editbtn3.pas.patch
2015-01-18 13:51 Derit Agustin Note Added: 0080482
2015-01-18 13:51 Derit Agustin Status feedback => assigned
2015-01-18 14:49 Bart Broersma Status assigned => feedback
2015-01-18 15:11 Derit Agustin Note Added: 0080486
2015-01-18 15:11 Derit Agustin Status feedback => assigned
2015-01-18 15:13 Bart Broersma Note Added: 0080487
2015-01-18 15:58 Bart Broersma Fixed in Revision => r47411
2015-01-18 15:58 Bart Broersma LazTarget - => 1.4
2015-01-18 15:58 Bart Broersma Note Added: 0080488
2015-01-18 15:58 Bart Broersma Status assigned => resolved
2015-01-18 15:58 Bart Broersma Fixed in Version => 1.4RC1
2015-01-18 15:58 Bart Broersma Resolution open => fixed
2015-01-18 15:58 Bart Broersma Target Version => 1.4