Browse Source

Adding TBCMaterialFloatSpinEdit methods and properties

Melchiorre Caruso 10 months ago
parent
commit
2aecbe283b
1 changed files with 156 additions and 23 deletions
  1. 156 23
      bcmaterialfloatspinedit.pas

+ 156 - 23
bcmaterialfloatspinedit.pas

@@ -13,57 +13,87 @@ type
   { TBCMaterialFloatSpinEdit }
 
   TBCMaterialFloatSpinEdit = class(specialize TBCMaterialEditBase<TFloatSpinEdit>)
-  public
-    property AutoSelect;
+  private
+    function GetEditDecimalPlaces: integer;
+    function GetEditEditorEnabled: boolean;
+    function GetEditIncrement: double;
+    function GetEditMinValue: double;
+    function GetEditMaxValue: double;
+    function GetEditValue: double;
+    function GetEditValueEmpty: boolean;
+
+    procedure SetEditDecimalPlaces(AValue: integer);
+    procedure SetEditEditorEnabled(AValue: boolean);
+    procedure SetEditIncrement(AValue: double);
+    procedure SetEditMinValue(AValue: double);
+    procedure SetEditMaxValue(AValue: double);
+    procedure SetEditValue(AValue: double);
+    procedure SetEditValueEmpty(AValue: boolean);
+
+    function GetOnEditMouseWheelHorz: TMouseWheelEvent;
+    function GetOnEditMouseWheelLeft: TMouseWheelUpDownEvent;
+    function GetOnEditMouseWheelRight: TMouseWheelUpDownEvent;
+
+    procedure SetOnEditMouseWheelHorz(AValue: TMouseWheelEvent);
+    procedure SetOnEditMouseWheelLeft(AValue: TMouseWheelUpDownEvent);
+    procedure SetOnEditMouseWheelRight(AValue: TMouseWheelUpDownEvent);
   published
     property Align;
     property Alignment;
-    property AccentColor;
     property Anchors;
+    property AutoSelect;
     property AutoSize;
-    property BiDiMode;
+  //property BiDiMode;
     property BorderSpacing;
     property Caption;
-    property CharCase;
+  //property CharCase;
     property Color;
     property Constraints;
     property Cursor;
+    property DecimalPlaces: integer read GetEditDecimalPlaces write SetEditDecimalPlaces;
     property DisabledColor;
-    property DoubleBuffered;
-    property DragCursor;
-    property DragMode;
-    property Font;
-    property EchoMode;
+  //property DoubleBuffered;
+  //property EchoMode;
     property Edit: TFloatSpinEdit read FEdit;
+    property EditorEnabled: boolean read GetEditEditorEnabled write SetEditEditorEnabled default True;
     property EditLabel;
     property Enabled;
-    property HideSelection;
+    property Font;
+    property Height;
+  //property HideSelection;
     property Hint;
+    property Increment: double read GetEditIncrement write SetEditIncrement;
+    property Left;
+    property MinValue: double read GetEditMinValue write SetEditMinValue;
+  //property MaxLength;
+    property MaxValue: double read GetEditMaxValue write SetEditMaxValue;
     property LabelSpacing;
-    property MaxLength;
-    property NumbersOnly;
-    property ParentBiDiMode;
+    property Name;
+  //property ParentBiDiMode;
     property ParentColor;
     property ParentFont;
-    property PasswordChar;
     property PopupMenu;
     property ReadOnly;
     property ShowHint;
-    property Tag;
     property TabOrder;
     property TabStop;
-    property Text;
-    property TextHint;
+  //property Text;
+  //property TextHint;
+    property Tag;
+    property Top;
+    property Value: double read GetEditValue write SetEditValue;
+    property ValueEmpty: boolean read GetEditValueEmpty write SetEditValueEmpty default False;
     property Visible;
+    property Width;
 
     property OnChange;
     property OnChangeBounds;
     property OnClick;
-    property OnContextPopup;
-    property OnDragDrop;
-    property OnDragOver;
+  //property OnContextPopup;
+  //property OnDragDrop;
+  //property OnDragOver;
     property OnEditingDone;
-    property OnEndDrag;
+  //property OnEndDrag;
     property OnEnter;
     property OnExit;
     property OnKeyDown;
@@ -77,8 +107,11 @@ type
     property OnMouseWheel;
     property OnMouseWheelDown;
     property OnMouseWheelUp;
+    property OnMouseWheelHorz: TMouseWheelEvent read GetOnEditMouseWheelHorz write SetOnEditMouseWheelHorz;
+    property OnMouseWheelLeft: TMouseWheelUpDownEvent read GetOnEditMouseWheelLeft write SetOnEditMouseWheelLeft;
+    property OnMouseWheelRight: TMouseWheelUpDownEvent read GetOnEditMouseWheelRight write SetOnEditMouseWheelRight;
     property OnResize;
-    property OnStartDrag;
+  //property OnStartDrag;
     property OnUTF8KeyPress;
   end;
 
@@ -94,4 +127,104 @@ begin
   RegisterComponents('BGRA Controls', [TBCMaterialFloatSpinEdit]);
 end;
 
+function TBCMaterialFloatSpinEdit.GetEditDecimalPlaces: integer;
+begin
+  result := FEdit.DecimalPlaces;
+end;
+
+function TBCMaterialFloatSpinEdit.GetEditEditorEnabled: boolean;
+begin
+  result := FEdit.EditorEnabled;
+end;
+
+function TBCMaterialFloatSpinEdit.GetEditIncrement: double;
+begin
+  result := FEdit.Increment;
+end;
+
+function TBCMaterialFloatSpinEdit.GetEditMinValue: double;
+begin
+  result := FEdit.MinValue;
+end;
+
+function TBCMaterialFloatSpinEdit.GetEditMaxValue: double;
+begin
+  result := FEdit.MaxValue;
+end;
+
+function TBCMaterialFloatSpinEdit.GetEditValue: double;
+begin
+  result := FEdit.Value;
+end;
+
+function TBCMaterialFloatSpinEdit.GetEditValueEmpty: boolean;
+begin
+  result := FEdit.ValueEmpty;
+end;
+
+procedure TBCMaterialFloatSpinEdit.SetEditDecimalPlaces(AValue: integer);
+begin
+  FEdit.DecimalPlaces := AValue;
+end;
+
+procedure TBCMaterialFloatSpinEdit.SetEditEditorEnabled(AValue: boolean);
+begin
+  FEdit.EditorEnabled := AValue;
+end;
+
+procedure TBCMaterialFloatSpinEdit.SetEditIncrement(AValue: double);
+begin
+  FEdit.Increment := AValue;
+end;
+
+procedure TBCMaterialFloatSpinEdit.SetEditMinValue(AValue: double);
+begin
+  FEdit.MinValue := AValue;
+end;
+
+procedure TBCMaterialFloatSpinEdit.SetEditMaxValue(AValue: double);
+begin
+  FEdit.MaxValue := AValue;
+end;
+
+procedure TBCMaterialFloatSpinEdit.SetEditValue(AValue: double);
+begin
+  FEdit.Value := AValue;
+end;
+
+procedure TBCMaterialFloatSpinEdit.SetEditValueEmpty(AValue: boolean);
+begin
+  FEdit.ValueEmpty := AValue;
+end;
+
+function TBCMaterialFloatSpinEdit.GetOnEditMouseWheelHorz: TMouseWheelEvent;
+begin
+  result := FEdit.OnMouseWheelHorz;
+end;
+
+function TBCMaterialFloatSpinEdit.GetOnEditMouseWheelLeft: TMouseWheelUpDownEvent;
+begin
+  result := FEdit.OnMouseWheelLeft;
+end;
+
+function TBCMaterialFloatSpinEdit.GetOnEditMouseWheelRight: TMouseWheelUpDownEvent;
+begin
+  result := FEdit.OnMouseWheelRight;
+end;
+
+procedure TBCMaterialFloatSpinEdit.SetOnEditMouseWheelHorz(AValue: TMouseWheelEvent);
+begin
+  FEdit.OnMouseWheelHorz := AValue;
+end;
+
+procedure TBCMaterialFloatSpinEdit. SetOnEditMouseWheelLeft(AValue: TMouseWheelUpDownEvent);
+begin
+  FEdit.OnMouseWheelLeft := AValue;
+end;
+
+procedure TBCMaterialFloatSpinEdit.SetOnEditMouseWheelRight(AValue: TMouseWheelUpDownEvent);
+begin
+  FEdit.OnMouseWheelRight := AValue;
+end;
+
 end.