Browse Source

Merge pull request #220 from melchiorrecaruso/dev-bgracontrols

Updated TBCMaterialSpinEdit and TBCMaterialFloatSpinEdit components
Leandro Oscar Ezequiel Diaz 10 months ago
parent
commit
a8fc1f8dba

+ 133 - 2
bccombobox.pas

@@ -47,6 +47,8 @@ type
     function GetComboCanvas: TCanvas;
     function GetComboCanvas: TCanvas;
     function GetArrowSize: integer;
     function GetArrowSize: integer;
     function GetArrowWidth: integer;
     function GetArrowWidth: integer;
+    function GetButtonHint: TTranslateString;
+    function GetButtonShowHint: Boolean;
     function GetGlobalOpacity: byte;
     function GetGlobalOpacity: byte;
     function GetItemText: string;
     function GetItemText: string;
     function GetDropDownColor: TColor;
     function GetDropDownColor: TColor;
@@ -59,8 +61,7 @@ type
     function GetStateHover: TBCButtonState;
     function GetStateHover: TBCButtonState;
     function GetStateNormal: TBCButtonState;
     function GetStateNormal: TBCButtonState;
     function GetStaticButton: boolean;
     function GetStaticButton: boolean;
-    procedure ListBoxKeyDown(Sender: TObject; var Key: Word; {%H-}Shift: TShiftState
-      );
+    procedure ListBoxKeyDown(Sender: TObject; var Key: Word; {%H-}Shift: TShiftState);
     procedure ListBoxMouseUp({%H-}Sender: TObject; {%H-}Button: TMouseButton;
     procedure ListBoxMouseUp({%H-}Sender: TObject; {%H-}Button: TMouseButton;
                           {%H-}Shift: TShiftState; {%H-}X, {%H-}Y: Integer);
                           {%H-}Shift: TShiftState; {%H-}X, {%H-}Y: Integer);
     procedure ListBoxMouseLeave(Sender: TObject);
     procedure ListBoxMouseLeave(Sender: TObject);
@@ -75,6 +76,8 @@ type
     procedure SetArrowFlip(AValue: boolean);
     procedure SetArrowFlip(AValue: boolean);
     procedure SetArrowSize(AValue: integer);
     procedure SetArrowSize(AValue: integer);
     procedure SetArrowWidth(AValue: integer);
     procedure SetArrowWidth(AValue: integer);
+    procedure SetButtonHint(const AValue: TTranslateString);
+    procedure SetButtonShowHint(AValue: Boolean);
     procedure SetCanvasScaleMode(AValue: TBCCanvasScaleMode);
     procedure SetCanvasScaleMode(AValue: TBCCanvasScaleMode);
     procedure SetDropDownColor(AValue: TColor);
     procedure SetDropDownColor(AValue: TColor);
     procedure SetGlobalOpacity(AValue: byte);
     procedure SetGlobalOpacity(AValue: byte);
@@ -87,6 +90,24 @@ type
     procedure SetStateHover(AValue: TBCButtonState);
     procedure SetStateHover(AValue: TBCButtonState);
     procedure SetStateNormal(AValue: TBCButtonState);
     procedure SetStateNormal(AValue: TBCButtonState);
     procedure SetStaticButton(AValue: boolean);
     procedure SetStaticButton(AValue: boolean);
+
+    function GetOnButtonMouseDown: TMouseEvent;
+    function GetOnButtonMouseEnter: TNotifyEvent;
+    function GetOnButtonMouseLeave: TNotifyEvent;
+    function GetOnButtonMouseMove: TMouseMoveEvent;
+    function GetOnButtonMouseUp: TMouseEvent;
+    function GetOnButtonMouseWheel: TMouseWheelEvent;
+    function GetOnButtonMouseWheelDown: TMouseWheelUpDownEvent;
+    function GetOnButtonMouseWheelUp: TMouseWheelUpDownEvent;
+
+    procedure SetOnButtonMouseDown(AValue: TMouseEvent);
+    procedure SetOnButtonMouseEnter(AValue: TNotifyEvent);
+    procedure SetOnButtonMouseLeave(AValue: TNotifyEvent);
+    procedure SetOnButtonMouseMove(AValue: TMouseMoveEvent);
+    procedure SetOnButtonMouseUp(AValue: TMouseEvent);
+    procedure SetOnButtonMouseWheel(AValue: TMouseWheelEvent);
+    procedure SetOnButtonMouseWheelDown(AValue: TMouseWheelUpDownEvent);
+    procedure SetOnButtonMouseWheelUp(AValue: TMouseWheelUpDownEvent);
   protected
   protected
     function GetStyleExtension: String; override;
     function GetStyleExtension: String; override;
     procedure WMSetFocus(var {%H-}Message: {$IFDEF FPC}TLMSetFocus{$ELSE}TWMSetFocus{$ENDIF}); message {$IFDEF FPC}LM_SETFOCUS{$ELSE}WM_SETFOCUS{$ENDIF};
     procedure WMSetFocus(var {%H-}Message: {$IFDEF FPC}TLMSetFocus{$ELSE}TWMSetFocus{$ENDIF}); message {$IFDEF FPC}LM_SETFOCUS{$ELSE}WM_SETFOCUS{$ENDIF};
@@ -114,6 +135,7 @@ type
     property BorderSpacing;
     property BorderSpacing;
     property Canvas: TCanvas read GetComboCanvas;
     property Canvas: TCanvas read GetComboCanvas;
     property CanvasScaleMode: TBCCanvasScaleMode read FCanvasScaleMode write SetCanvasScaleMode default csmAuto;
     property CanvasScaleMode: TBCCanvasScaleMode read FCanvasScaleMode write SetCanvasScaleMode default csmAuto;
+    property Hint: TTranslateString read GetButtonHint write SetButtonHint;
     property Items: TStrings read GetItems write SetItems;
     property Items: TStrings read GetItems write SetItems;
     property ItemIndex: integer read GetItemIndex write SetItemIndex;
     property ItemIndex: integer read GetItemIndex write SetItemIndex;
     property ItemHeight: integer read FItemHeight write FItemHeight default 0;
     property ItemHeight: integer read FItemHeight write FItemHeight default 0;
@@ -132,6 +154,7 @@ type
     property GlobalOpacity: byte read GetGlobalOpacity write SetGlobalOpacity;
     property GlobalOpacity: byte read GetGlobalOpacity write SetGlobalOpacity;
     property MemoryUsage: TBCButtonMemoryUsage read GetMemoryUsage write SetMemoryUsage;
     property MemoryUsage: TBCButtonMemoryUsage read GetMemoryUsage write SetMemoryUsage;
     property Rounding: TBCRounding read GetRounding write SetRounding;
     property Rounding: TBCRounding read GetRounding write SetRounding;
+    property ShowHint: Boolean read GetButtonShowHint write SetButtonShowHint default False;
     property StateClicked: TBCButtonState read GetStateClicked write SetStateClicked;
     property StateClicked: TBCButtonState read GetStateClicked write SetStateClicked;
     property StateHover: TBCButtonState read GetStateHover write SetStateHover;
     property StateHover: TBCButtonState read GetStateHover write SetStateHover;
     property StateNormal: TBCButtonState read GetStateNormal write SetStateNormal;
     property StateNormal: TBCButtonState read GetStateNormal write SetStateNormal;
@@ -140,6 +163,14 @@ type
     property OnDrawItem: TDrawItemEvent read FOnDrawItem write FOnDrawItem;
     property OnDrawItem: TDrawItemEvent read FOnDrawItem write FOnDrawItem;
     property OnDrawSelectedItem: TOnAfterRenderBCButton read GetOnDrawSelectedItem write SetOnDrawSelectedItem;
     property OnDrawSelectedItem: TOnAfterRenderBCButton read GetOnDrawSelectedItem write SetOnDrawSelectedItem;
     property OnChange: TNotifyEvent read FOnChange write FOnChange;
     property OnChange: TNotifyEvent read FOnChange write FOnChange;
+    property OnMouseDown: TMouseEvent read GetOnButtonMouseDown write SetOnButtonMouseDown;
+    property OnMouseMove: TMouseMoveEvent read GetOnButtonMouseMove write SetOnButtonMouseMove;
+    property OnMouseUp: TMouseEvent read GetOnButtonMouseUp write SetOnButtonMouseUp;
+    property OnMouseEnter: TNotifyEvent read GetOnButtonMouseEnter write SetOnButtonMouseEnter;
+    property OnMouseLeave: TNotifyEvent read GetOnButtonMouseLeave write SetOnButtonMouseLeave;
+    property OnMouseWheel: TMouseWheelEvent read GetOnButtonMouseWheel write SetOnButtonMouseWheel;
+    property OnMouseWheelDown: TMouseWheelUpDownEvent read GetOnButtonMouseWheelDown write SetOnButtonMouseWheelDown;
+    property OnMouseWheelUp: TMouseWheelUpDownEvent read GetOnButtonMouseWheelUp write SetOnButtonMouseWheelUp;
     property TabStop;
     property TabStop;
     property TabOrder;
     property TabOrder;
   end;
   end;
@@ -240,6 +271,16 @@ begin
   result := Button.DropDownWidth;
   result := Button.DropDownWidth;
 end;
 end;
 
 
+function TBCComboBox.GetButtonHint: TTranslateString;
+begin
+  result := FButton.Hint;
+end;
+
+function TBCComboBox.GetButtonShowHint: Boolean;
+begin
+  result := FButton.ShowHint;
+end;
+
 function TBCComboBox.GetGlobalOpacity: byte;
 function TBCComboBox.GetGlobalOpacity: byte;
 begin
 begin
   result := Button.GlobalOpacity;
   result := Button.GlobalOpacity;
@@ -448,6 +489,16 @@ begin
   Button.DropDownWidth:= AValue;
   Button.DropDownWidth:= AValue;
 end;
 end;
 
 
+procedure TBCComboBox.SetButtonHint(const AValue: TTranslateString);
+begin
+  FButton.Hint := AValue;
+end;
+
+procedure TBCComboBox.SetButtonShowHint(AValue: Boolean);
+begin
+  FButton.ShowHint := AValue;
+end;
+
 procedure TBCComboBox.SetCanvasScaleMode(AValue: TBCCanvasScaleMode);
 procedure TBCComboBox.SetCanvasScaleMode(AValue: TBCCanvasScaleMode);
 begin
 begin
   if FCanvasScaleMode=AValue then Exit;
   if FCanvasScaleMode=AValue then Exit;
@@ -526,6 +577,86 @@ begin
   Button.StaticButton:= AValue;
   Button.StaticButton:= AValue;
 end;
 end;
 
 
+function TBCComboBox.GetOnButtonMouseDown: TMouseEvent;
+begin
+  result := FButton.OnMouseDown;
+end;
+
+function TBCComboBox.GetOnButtonMouseEnter: TNotifyEvent;
+begin
+  result := FButton.OnMouseEnter;
+end;
+
+function TBCComboBox.GetOnButtonMouseLeave: TNotifyEvent;
+begin
+  result := FButton.OnMouseLeave;
+end;
+
+function TBCComboBox.GetOnButtonMouseMove: TMouseMoveEvent;
+begin
+  result := FButton.OnMouseMove;
+end;
+
+function TBCComboBox.GetOnButtonMouseUp: TMouseEvent;
+begin
+  result := FButton.OnMouseUp;
+end;
+
+function TBCComboBox.GetOnButtonMouseWheel: TMouseWheelEvent;
+begin
+  result := FButton.OnMouseWheel;
+end;
+
+function TBCComboBox.GetOnButtonMouseWheelDown: TMouseWheelUpDownEvent;
+begin
+  result := FButton.OnMouseWheelDown;
+end;
+
+function TBCComboBox.GetOnButtonMouseWheelUp: TMouseWheelUpDownEvent;
+begin
+  result := FButton.OnMouseWheelUp;
+end;
+
+procedure TBCComboBox.SetOnButtonMouseDown(AValue: TMouseEvent);
+begin
+  FButton.OnMouseDown := AValue;
+end;
+
+procedure TBCComboBox.SetOnButtonMouseEnter(AValue: TNotifyEvent);
+begin
+  FButton.OnMouseEnter := AValue;
+end;
+
+procedure TBCComboBox.SetOnButtonMouseLeave(AValue: TNotifyEvent);
+begin
+  FButton.OnMouseLeave := AValue;
+end;
+
+procedure TBCComboBox.SetOnButtonMouseMove(AValue: TMouseMoveEvent);
+begin
+  FButton.OnMouseMove := AValue;
+end;
+
+procedure TBCComboBox.SetOnButtonMouseUp(AValue: TMouseEvent);
+begin
+  FButton.OnMouseUp := AValue;
+end;
+
+procedure TBCComboBox.SetOnButtonMouseWheel(AValue: TMouseWheelEvent);
+begin
+  FButton.OnMouseWheel := AValue;
+end;
+
+procedure TBCComboBox.SetOnButtonMouseWheelDown(AValue: TMouseWheelUpDownEvent);
+begin
+  FButton.OnMouseWheelDown := AValue;
+end;
+
+procedure TBCComboBox.SetOnButtonMouseWheelUp(AValue: TMouseWheelUpDownEvent);
+begin
+  FButton.OnMouseWheelUp := AValue;
+end;
+
 function TBCComboBox.GetStyleExtension: String;
 function TBCComboBox.GetStyleExtension: String;
 begin
 begin
   result := 'bccombo';
   result := 'bccombo';

+ 302 - 226
bcmaterialedit.pas

@@ -1,6 +1,6 @@
 unit BCMaterialEdit;
 unit BCMaterialEdit;
 
 
-{$I bgracontrols.inc}
+{$mode objfpc}{$H+}
 
 
 interface
 interface
 
 
@@ -10,25 +10,20 @@ uses
 
 
 type
 type
 
 
-  { TBCMaterialEdit }
+  { TBCMaterialEditBase }
 
 
-  TBCMaterialEdit = class(TCustomControl)
+  generic TBCMaterialEditBase<T> = class(TCustomPanel)
   private
   private
     FAccentColor: TColor;
     FAccentColor: TColor;
     FDisabledColor: TColor;
     FDisabledColor: TColor;
-    FEdit: TEdit;
+    FEdit: T;
     FLabel: TBoundLabel;
     FLabel: TBoundLabel;
     FFocused: boolean;
     FFocused: boolean;
-    function IsNeededAdjustHeight: boolean;
+    function IsNeededAdjustSize: boolean;
 
 
     function GetOnEditChange: TNotifyEvent;
     function GetOnEditChange: TNotifyEvent;
     function GetOnEditClick: TNotifyEvent;
     function GetOnEditClick: TNotifyEvent;
-    function GetOnEditContextPopup: TContextPopupEvent;
-    function GetOnEditDblClick: TNotifyEvent;
-    function GetOnEditDragDrop: TDragDropEvent;
-    function GetOnEditDragOver: TDragOverEvent;
     function GetOnEditEditingDone: TNotifyEvent;
     function GetOnEditEditingDone: TNotifyEvent;
-    function GetOnEditEndDrag: TEndDragEvent;
     function GetOnEditEnter: TNotifyEvent;
     function GetOnEditEnter: TNotifyEvent;
     function GetOnEditExit: TNotifyEvent;
     function GetOnEditExit: TNotifyEvent;
     function GetOnEditKeyDown: TKeyEvent;
     function GetOnEditKeyDown: TKeyEvent;
@@ -42,17 +37,11 @@ type
     function GetOnEditMouseWheel: TMouseWheelEvent;
     function GetOnEditMouseWheel: TMouseWheelEvent;
     function GetOnEditMouseWheelDown: TMouseWheelUpDownEvent;
     function GetOnEditMouseWheelDown: TMouseWheelUpDownEvent;
     function GetOnEditMouseWheelUp: TMouseWheelUpDownEvent;
     function GetOnEditMouseWheelUp: TMouseWheelUpDownEvent;
-    function GetOnEditStartDrag: TStartDragEvent;
     function GetOnEditUTF8KeyPress: TUTF8KeyPressEvent;
     function GetOnEditUTF8KeyPress: TUTF8KeyPressEvent;
 
 
     procedure SetOnEditChange(AValue: TNotifyEvent);
     procedure SetOnEditChange(AValue: TNotifyEvent);
     procedure SetOnEditClick(AValue: TNotifyEvent);
     procedure SetOnEditClick(AValue: TNotifyEvent);
-    procedure SetOnEditContextPopup(AValue: TContextPopupEvent);
-    procedure SetOnEditDblClick(AValue: TNotifyEvent);
-    procedure SetOnEditDragDrop(AValue: TDragDropEvent);
-    procedure SetOnEditDragOver(AValue: TDragOverEvent);
     procedure SetOnEditEditingDone(AValue: TNotifyEvent);
     procedure SetOnEditEditingDone(AValue: TNotifyEvent);
-    procedure SetOnEditEndDrag(AValue: TEndDragEvent);
     procedure SetOnEditEnter(AValue: TNotifyEvent);
     procedure SetOnEditEnter(AValue: TNotifyEvent);
     procedure SetOnEditExit(AValue: TNotifyEvent);
     procedure SetOnEditExit(AValue: TNotifyEvent);
     procedure SetOnEditKeyDown(AValue: TKeyEvent);
     procedure SetOnEditKeyDown(AValue: TKeyEvent);
@@ -66,7 +55,6 @@ type
     procedure SetOnEditMouseWheel(AValue: TMouseWheelEvent);
     procedure SetOnEditMouseWheel(AValue: TMouseWheelEvent);
     procedure SetOnEditMouseWheelDown(AValue: TMouseWheelUpDownEvent);
     procedure SetOnEditMouseWheelDown(AValue: TMouseWheelUpDownEvent);
     procedure SetOnEditMouseWheelUp(AValue: TMouseWheelUpDownEvent);
     procedure SetOnEditMouseWheelUp(AValue: TMouseWheelUpDownEvent);
-    procedure SetOnEditStartDrag(AValue: TStartDragEvent);
     procedure SetOnEditUTF8KeyPress(AValue: TUTF8KeyPressEvent);
     procedure SetOnEditUTF8KeyPress(AValue: TUTF8KeyPressEvent);
   protected
   protected
     function GetEditAlignment: TAlignment;
     function GetEditAlignment: TAlignment;
@@ -75,8 +63,6 @@ type
     function GetEditCharCase: TEditCharCase;
     function GetEditCharCase: TEditCharCase;
     function GetEditCursor: TCursor;
     function GetEditCursor: TCursor;
     function GetEditDoubleBuffered: Boolean;
     function GetEditDoubleBuffered: Boolean;
-    function GetEditDragCursor: TCursor;
-    function GetEditDragMode: TDragMode;
     function GetEditEchoMode: TEchoMode;
     function GetEditEchoMode: TEchoMode;
     function GetEditHideSelection: Boolean;
     function GetEditHideSelection: Boolean;
     function GetEditHint: TTranslateString;
     function GetEditHint: TTranslateString;
@@ -95,14 +81,13 @@ type
     function GetLabelSpacing: Integer;
     function GetLabelSpacing: Integer;
 
 
     procedure SetAnchors(const AValue: TAnchors); override;
     procedure SetAnchors(const AValue: TAnchors); override;
+    procedure SetColor(AValue: TColor); override;
     procedure SetEditAlignment(const AValue: TAlignment);
     procedure SetEditAlignment(const AValue: TAlignment);
     procedure SetEditAutoSize(AValue: Boolean);
     procedure SetEditAutoSize(AValue: Boolean);
     procedure SetEditAutoSelect(AValue: Boolean);
     procedure SetEditAutoSelect(AValue: Boolean);
     procedure SetEditCharCase(AValue: TEditCharCase);
     procedure SetEditCharCase(AValue: TEditCharCase);
     procedure SetEditCursor(AValue: TCursor);
     procedure SetEditCursor(AValue: TCursor);
     procedure SetEditDoubleBuffered(AValue: Boolean);
     procedure SetEditDoubleBuffered(AValue: Boolean);
-    procedure SetEditDragCursor(AValue: TCursor);
-    procedure SetEditDragMode(AValue: TDragMode);
     procedure SetEditEchoMode(AValue: TEchoMode);
     procedure SetEditEchoMode(AValue: TEchoMode);
     procedure SetEditHideSelection(AValue: Boolean);
     procedure SetEditHideSelection(AValue: Boolean);
     procedure SetEditHint(const AValue: TTranslateString);
     procedure SetEditHint(const AValue: TTranslateString);
@@ -133,7 +118,7 @@ type
     property AccentColor: TColor read FAccentColor write FAccentColor;
     property AccentColor: TColor read FAccentColor write FAccentColor;
     property Anchors;
     property Anchors;
     property AutoSelect: Boolean read GetEditAutoSelect write SetEditAutoSelect default True;
     property AutoSelect: Boolean read GetEditAutoSelect write SetEditAutoSelect default True;
-    property AutoSize: Boolean read GetEditAutoSize write SetEditAutoSize;
+    property AutoSize: Boolean read GetEditAutoSize write SetEditAutoSize default True;
     property BiDiMode;
     property BiDiMode;
     property BorderSpacing;
     property BorderSpacing;
     property Caption: TCaption read GetLabelCaption write SetLabelCaption;
     property Caption: TCaption read GetLabelCaption write SetLabelCaption;
@@ -143,16 +128,13 @@ type
     property Cursor: TCursor read GetEditCursor write SetEditCursor default crDefault;
     property Cursor: TCursor read GetEditCursor write SetEditCursor default crDefault;
     property DisabledColor: TColor read FDisabledColor write FDisabledColor;
     property DisabledColor: TColor read FDisabledColor write FDisabledColor;
     property DoubleBuffered: Boolean read GetEditDoubleBuffered write SetEditDoubleBuffered;
     property DoubleBuffered: Boolean read GetEditDoubleBuffered write SetEditDoubleBuffered;
-    property DragCursor: TCursor read GetEditDragCursor write SetEditDragCursor default crDrag;
-    property DragMode: TDragMode read GetEditDragMode write SetEditDragMode default dmManual;
-    property Font;
     property EchoMode: TEchoMode read GetEditEchoMode write SetEditEchoMode default emNormal;
     property EchoMode: TEchoMode read GetEditEchoMode write SetEditEchoMode default emNormal;
-    property Edit: TEdit read FEdit;
     property EditLabel: TBoundLabel read FLabel;
     property EditLabel: TBoundLabel read FLabel;
     property Enabled;
     property Enabled;
+    property Font;
     property HideSelection: Boolean read GetEditHideSelection write SetEditHideSelection default True;
     property HideSelection: Boolean read GetEditHideSelection write SetEditHideSelection default True;
     property Hint: TTranslateString read GetEditHint write SetEditHint;
     property Hint: TTranslateString read GetEditHint write SetEditHint;
-    property LabelSpacing: Integer read GetLabelSpacing write SetLabelSpacing default 0;
+    property LabelSpacing: Integer read GetLabelSpacing write SetLabelSpacing default 4;
     property MaxLength: Integer read GetEditMaxLength write SetEditMaxLength default 0;
     property MaxLength: Integer read GetEditMaxLength write SetEditMaxLength default 0;
     property NumbersOnly: Boolean read GetEditNumbersOnly write SetEditNumbersOnly default False;
     property NumbersOnly: Boolean read GetEditNumbersOnly write SetEditNumbersOnly default False;
     property ParentBiDiMode;
     property ParentBiDiMode;
@@ -172,12 +154,7 @@ type
     property OnChange: TNotifyEvent read GetOnEditChange write SetOnEditChange;
     property OnChange: TNotifyEvent read GetOnEditChange write SetOnEditChange;
     property OnChangeBounds;
     property OnChangeBounds;
     property OnClick: TNotifyEvent read GetOnEditClick write SetOnEditClick;
     property OnClick: TNotifyEvent read GetOnEditClick write SetOnEditClick;
-    property OnContextPopup: TContextPopupEvent read GetOnEditContextPopup write SetOnEditContextPopup;
-    property OnDbClick: TNotifyEvent read GetOnEditDblClick write SetOnEditDblClick;
-    property OnDragDrop: TDragDropEvent read GetOnEditDragDrop write SetOnEditDragDrop;
-    property OnDragOver: TDragOverEvent read GetOnEditDragOver write SetOnEditDragOver;
     property OnEditingDone: TNotifyEvent read GetOnEditEditingDone write SetOnEditEditingDone;
     property OnEditingDone: TNotifyEvent read GetOnEditEditingDone write SetOnEditEditingDone;
-    property OnEndDrag: TEndDragEvent read GetOnEditEndDrag write SetOnEditEndDrag;
     property OnEnter: TNotifyEvent read GetOnEditEnter write SetOnEditEnter;
     property OnEnter: TNotifyEvent read GetOnEditEnter write SetOnEditEnter;
     property OnExit: TNotifyEvent read GetOnEditExit write SetOnEditExit;
     property OnExit: TNotifyEvent read GetOnEditExit write SetOnEditExit;
     property OnKeyDown: TKeyEvent read GetOnEditKeyDown write SetOnEditKeyDown;
     property OnKeyDown: TKeyEvent read GetOnEditKeyDown write SetOnEditKeyDown;
@@ -192,10 +169,101 @@ type
     property OnMouseWheelDown: TMouseWheelUpDownEvent read GetOnEditMouseWheelDown write SetOnEditMouseWheelDown;
     property OnMouseWheelDown: TMouseWheelUpDownEvent read GetOnEditMouseWheelDown write SetOnEditMouseWheelDown;
     property OnMouseWheelUp: TMouseWheelUpDownEvent read GetOnEditMouseWheelUp write SetOnEditMouseWheelUp;
     property OnMouseWheelUp: TMouseWheelUpDownEvent read GetOnEditMouseWheelUp write SetOnEditMouseWheelUp;
     property OnResize;
     property OnResize;
-    property OnStartDrag: TStartDragEvent read GetOnEditStartDrag write SetOnEditStartDrag;
     property OnUTF8KeyPress: TUTF8KeyPressEvent read GetOnEditUTF8KeyPress write SetOnEditUTF8KeyPress;
     property OnUTF8KeyPress: TUTF8KeyPressEvent read GetOnEditUTF8KeyPress write SetOnEditUTF8KeyPress;
   end;
   end;
 
 
+  { TBCMaterialEdit }
+
+  TBCMaterialEdit = class(specialize TBCMaterialEditBase<TEdit>)
+  private
+    function GetEditDragCursor: TCursor;
+    function GetEditDragMode: TDragMode;
+
+    function GetOnEditContextPopup: TContextPopupEvent;
+    function GetOnEditDblClick: TNotifyEvent;
+    function GetOnEditDragDrop: TDragDropEvent;
+    function GetOnEditDragOver: TDragOverEvent;
+    function GetOnEditEndDrag: TEndDragEvent;
+    function GetOnEditStartDrag: TStartDragEvent;
+
+    procedure SetEditDragCursor(AValue: TCursor);
+    procedure SetEditDragMode(AValue: TDragMode);
+
+    procedure SetOnEditContextPopup(AValue: TContextPopupEvent);
+    procedure SetOnEditDblClick(AValue: TNotifyEvent);
+    procedure SetOnEditDragDrop(AValue: TDragDropEvent);
+    procedure SetOnEditDragOver(AValue: TDragOverEvent);
+    procedure SetOnEditEndDrag(AValue: TEndDragEvent);
+    procedure SetOnEditStartDrag(AValue: TStartDragEvent);
+  published
+    property Align;
+    property Alignment;
+    property AccentColor;
+    property Anchors;
+    property AutoSelect;
+    property AutoSize;
+    property BiDiMode;
+    property BorderSpacing;
+    property Caption;
+    property CharCase;
+    property Color;
+    property Constraints;
+    property Cursor;
+    property DisabledColor;
+    property DoubleBuffered;
+    property DragCursor: TCursor read GetEditDragCursor write SetEditDragCursor default crDrag;
+    property DragMode: TDragMode read GetEditDragMode write SetEditDragMode default dmManual;
+    property Font;
+    property EchoMode;
+    property Edit: TEdit read FEdit;
+    property EditLabel;
+    property Enabled;
+    property HideSelection;
+    property Hint;
+    property LabelSpacing;
+    property MaxLength;
+    property NumbersOnly;
+    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 Visible;
+
+    property OnChange;
+    property OnChangeBounds;
+    property OnClick;
+    property OnContextPopup;
+    property OnDbClick: TNotifyEvent read GetOnEditDblClick write SetOnEditDblClick;
+    property OnDragDrop: TDragDropEvent read GetOnEditDragDrop write SetOnEditDragDrop;
+    property OnDragOver: TDragOverEvent read GetOnEditDragOver write SetOnEditDragOver;
+    property OnEditingDone;
+    property OnEndDrag: TEndDragEvent read GetOnEditEndDrag write SetOnEditEndDrag;
+    property OnEnter;
+    property OnExit;
+    property OnKeyDown;
+    property OnKeyPress;
+    property OnKeyUp;
+    property OnMouseDown;
+    property OnMouseEnter;
+    property OnMouseLeave;
+    property OnMouseMove;
+    property OnMouseUp;
+    property OnMouseWheel;
+    property OnMouseWheelDown;
+    property OnMouseWheelUp;
+    property OnResize;
+    property OnStartDrag: TStartDragEvent read GetOnEditStartDrag write SetOnEditStartDrag;
+    property OnUTF8KeyPress;
+  end;
+
 procedure Register;
 procedure Register;
 
 
 implementation
 implementation
@@ -208,506 +276,429 @@ begin
   RegisterComponents('BGRA Controls', [TBCMaterialEdit]);
   RegisterComponents('BGRA Controls', [TBCMaterialEdit]);
 end;
 end;
 
 
-{ TBCMaterialEdit }
+{ TBCMaterialEditBase }
 
 
-function TBCMaterialEdit.GetEditAlignment: TAlignment;
+function TBCMaterialEditBase.GetEditAlignment: TAlignment;
 begin
 begin
   result := FEdit.Alignment;
   result := FEdit.Alignment;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditAutoSize: Boolean;
+function TBCMaterialEditBase.GetEditAutoSize: Boolean;
 begin
 begin
   result := FEdit.AutoSize;
   result := FEdit.AutoSize;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditAutoSelect: Boolean;
+function TBCMaterialEditBase.GetEditAutoSelect: Boolean;
 begin
 begin
   result := FEdit.AutoSelect;
   result := FEdit.AutoSelect;
 end;
 end;
 
 
-function TBCMaterialEdit.GetLabelCaption: TCaption;
-begin
-  result := FLabel.Caption
-end;
-
-function TBCMaterialEdit.GetEditCharCase: TEditCharCase;
+function TBCMaterialEditBase.GetEditCharCase: TEditCharCase;
 begin
 begin
   result := FEdit.CharCase;
   result := FEdit.CharCase;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditCursor: TCursor;
+function TBCMaterialEditBase.GetEditCursor: TCursor;
 begin
 begin
   result := FEdit.Cursor;
   result := FEdit.Cursor;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditDoubleBuffered: Boolean;
+function TBCMaterialEditBase.GetEditDoubleBuffered: Boolean;
 begin
 begin
   result := FEdit.DoubleBuffered;
   result := FEdit.DoubleBuffered;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditDragCursor: TCursor;
-begin
-  result := FEdit.DragCursor;
-end;
-
-function TBCMaterialEdit.GetEditDragMode: TDragMode;
-begin
-  result := FEdit.DragMode;
-end;
-
-function TBCMaterialEdit.GetEditEchoMode: TEchoMode;
+function TBCMaterialEditBase.GetEditEchoMode: TEchoMode;
 begin
 begin
   result := FEdit.EchoMode;
   result := FEdit.EchoMode;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditHideSelection: Boolean;
+function TBCMaterialEditBase.GetEditHideSelection: Boolean;
 begin
 begin
   result := FEdit.HideSelection;
   result := FEdit.HideSelection;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditHint: TTranslateString;
+function TBCMaterialEditBase.GetEditHint: TTranslateString;
 begin
 begin
   result := FEdit.Hint;
   result := FEdit.Hint;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditMaxLength: Integer;
+function TBCMaterialEditBase.GetEditMaxLength: Integer;
 begin
 begin
   result := FEdit.MaxLength;
   result := FEdit.MaxLength;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditNumbersOnly: Boolean;
+function TBCMaterialEditBase.GetEditNumbersOnly: Boolean;
 begin
 begin
   result := FEdit.NumbersOnly;
   result := FEdit.NumbersOnly;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditPasswordChar: Char;
+function TBCMaterialEditBase.GetEditPasswordChar: Char;
 begin
 begin
   result := FEdit.PasswordChar;
   result := FEdit.PasswordChar;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditParentColor: Boolean;
+function TBCMaterialEditBase.GetEditParentColor: Boolean;
 begin
 begin
   Result := Self.ParentColor;
   Result := Self.ParentColor;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditPopupMenu: TPopupMenu;
+function TBCMaterialEditBase.GetEditPopupMenu: TPopupMenu;
 begin
 begin
   if (csDestroying in ComponentState) then Exit(nil);
   if (csDestroying in ComponentState) then Exit(nil);
 
 
   result := FEdit.PopupMenu;
   result := FEdit.PopupMenu;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditReadOnly: Boolean;
+function TBCMaterialEditBase.GetEditReadOnly: Boolean;
 begin
 begin
   result := FEdit.ReadOnly;
   result := FEdit.ReadOnly;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditShowHint: Boolean;
+function TBCMaterialEditBase.GetEditShowHint: Boolean;
 begin
 begin
   result := FEdit.ShowHint;
   result := FEdit.ShowHint;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditTag: PtrInt;
+function TBCMaterialEditBase.GetEditTag: PtrInt;
 begin
 begin
   result := FEdit.Tag;
   result := FEdit.Tag;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditTabStop: Boolean;
+function TBCMaterialEditBase.GetEditTabStop: Boolean;
 begin
 begin
   result := FEdit.TabStop;
   result := FEdit.TabStop;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditText: TCaption;
+function TBCMaterialEditBase.GetEditText: TCaption;
 begin
 begin
   result := FEdit.Text;
   result := FEdit.Text;
 end;
 end;
 
 
-function TBCMaterialEdit.GetEditTextHint: TCaption;
+function TBCMaterialEditBase.GetEditTextHint: TCaption;
 begin
 begin
   result := FEdit.TextHint;
   result := FEdit.TextHint;
 end;
 end;
 
 
-function TBCMaterialEdit.GetLabelSpacing: Integer;
-begin
-  result := FLabel.BorderSpacing.Bottom;
-end;
-
-function TBCMaterialEdit.GetOnEditChange: TNotifyEvent;
-begin
-  result := FEdit.OnChange;
-end;
-
-function TBCMaterialEdit.GetOnEditClick: TNotifyEvent;
+function TBCMaterialEditBase.GetLabelCaption: TCaption;
 begin
 begin
-  result := FEdit.OnClick;
-end;
-
-function TBCMaterialEdit.GetOnEditContextPopup: TContextPopupEvent;
-begin
-  result := FEdit.OnContextPopup;
+  result := FLabel.Caption
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditDblClick: TNotifyEvent;
+function TBCMaterialEditBase.GetLabelSpacing: Integer;
 begin
 begin
-  result := FEdit.OnDblClick;
+  result := FLabel.BorderSpacing.Bottom;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditDragDrop: TDragDropEvent;
+function TBCMaterialEditBase.GetOnEditChange: TNotifyEvent;
 begin
 begin
-  result := FEdit.OnDragDrop;
+  result := FEdit.OnChange;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditDragOver: TDragOverEvent;
+function TBCMaterialEditBase.GetOnEditClick: TNotifyEvent;
 begin
 begin
-  result := FEdit.OnDragOver;
+  result := FEdit.OnClick;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditEditingDone: TNotifyEvent;
+function TBCMaterialEditBase.GetOnEditEditingDone: TNotifyEvent;
 begin
 begin
   result := FEdit.OnEditingDone;
   result := FEdit.OnEditingDone;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditEndDrag: TEndDragEvent;
-begin
-  result := FEdit.OnEndDrag;
-end;
-
-function TBCMaterialEdit.GetOnEditEnter: TNotifyEvent;
+function TBCMaterialEditBase.GetOnEditEnter: TNotifyEvent;
 begin
 begin
   result := FEdit.OnEnter;
   result := FEdit.OnEnter;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditExit: TNotifyEvent;
+function TBCMaterialEditBase.GetOnEditExit: TNotifyEvent;
 begin
 begin
   result := FEdit.OnExit;
   result := FEdit.OnExit;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditKeyDown: TKeyEvent;
+function TBCMaterialEditBase.GetOnEditKeyDown: TKeyEvent;
 begin
 begin
   result := FEdit.OnKeyDown;
   result := FEdit.OnKeyDown;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditKeyPress: TKeyPressEvent;
+function TBCMaterialEditBase.GetOnEditKeyPress: TKeyPressEvent;
 begin
 begin
   result := FEdit.OnKeyPress;
   result := FEdit.OnKeyPress;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditKeyUp: TKeyEvent;
+function TBCMaterialEditBase.GetOnEditKeyUp: TKeyEvent;
 begin
 begin
   result := FEdit.OnKeyUp;
   result := FEdit.OnKeyUp;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditMouseDown: TMouseEvent;
+function TBCMaterialEditBase.GetOnEditMouseDown: TMouseEvent;
 begin
 begin
   result := FEdit.OnMouseDown;
   result := FEdit.OnMouseDown;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditMouseEnter: TNotifyEvent;
+function TBCMaterialEditBase.GetOnEditMouseEnter: TNotifyEvent;
 begin
 begin
   result := FEdit.OnMouseEnter;
   result := FEdit.OnMouseEnter;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditMouseLeave: TNotifyEvent;
+function TBCMaterialEditBase.GetOnEditMouseLeave: TNotifyEvent;
 begin
 begin
   result := FEdit.OnMouseLeave;
   result := FEdit.OnMouseLeave;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditMouseMove: TMouseMoveEvent;
+function TBCMaterialEditBase.GetOnEditMouseMove: TMouseMoveEvent;
 begin
 begin
   result := FEdit.OnMouseMove;
   result := FEdit.OnMouseMove;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditMouseUp: TMouseEvent;
+function TBCMaterialEditBase.GetOnEditMouseUp: TMouseEvent;
 begin
 begin
   result := FEdit.OnMouseUp;
   result := FEdit.OnMouseUp;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditMouseWheel: TMouseWheelEvent;
+function TBCMaterialEditBase.GetOnEditMouseWheel: TMouseWheelEvent;
 begin
 begin
   result := FEdit.OnMouseWheel;
   result := FEdit.OnMouseWheel;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditMouseWheelDown: TMouseWheelUpDownEvent;
+function TBCMaterialEditBase.GetOnEditMouseWheelDown: TMouseWheelUpDownEvent;
 begin
 begin
   result := FEdit.OnMouseWheelDown;
   result := FEdit.OnMouseWheelDown;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditMouseWheelUp: TMouseWheelUpDownEvent;
+function TBCMaterialEditBase.GetOnEditMouseWheelUp: TMouseWheelUpDownEvent;
 begin
 begin
   result := FEdit.OnMouseWheelUp;
   result := FEdit.OnMouseWheelUp;
 end;
 end;
 
 
-function TBCMaterialEdit.GetOnEditStartDrag: TStartDragEvent;
-begin
-  result := FEdit.OnStartDrag;
-end;
-
-function TBCMaterialEdit.GetOnEditUTF8KeyPress: TUTF8KeyPressEvent;
+function TBCMaterialEditBase.GetOnEditUTF8KeyPress: TUTF8KeyPressEvent;
 begin
 begin
   result := FEdit.OnUTF8KeyPress;
   result := FEdit.OnUTF8KeyPress;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditChange(AValue: TNotifyEvent);
+procedure TBCMaterialEditBase.SetOnEditChange(AValue: TNotifyEvent);
 begin
 begin
   FEdit.OnChange := AValue;
   FEdit.OnChange := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditClick(AValue: TNotifyEvent);
+procedure TBCMaterialEditBase.SetOnEditClick(AValue: TNotifyEvent);
 begin
 begin
   FEdit.OnClick := AValue;
   FEdit.OnClick := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditContextPopup(AValue: TContextPopupEvent);
-begin
-  FEdit.OnContextPopup := AValue;
-end;
-
-procedure TBCMaterialEdit.SetOnEditDblClick(AValue: TNotifyEvent);
-begin
-  FEdit.OnDblClick := AValue;
-end;
-
-procedure TBCMaterialEdit.SetOnEditDragDrop(AValue: TDragDropEvent);
-begin
-  FEdit.OnDragDrop := AValue;
-end;
-
-procedure TBCMaterialEdit.SetOnEditDragOver(AValue: TDragOverEvent);
-begin
-  FEdit.OnDragOver := AValue;
-end;
-
-procedure TBCMaterialEdit.SetOnEditEditingDone(AValue: TNotifyEvent);
+procedure TBCMaterialEditBase.SetOnEditEditingDone(AValue: TNotifyEvent);
 begin
 begin
   FEdit.OnEditingDone := AValue;
   FEdit.OnEditingDone := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditEndDrag(AValue: TEndDragEvent);
-begin
-  FEdit.OnEndDrag := AValue;
-end;
-
-procedure TBCMaterialEdit.SetOnEditEnter(AValue: TNotifyEvent);
+procedure TBCMaterialEditBase.SetOnEditEnter(AValue: TNotifyEvent);
 begin
 begin
   FEdit.OnEnter := AValue;
   FEdit.OnEnter := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditExit(AValue: TNotifyEvent);
+procedure TBCMaterialEditBase.SetOnEditExit(AValue: TNotifyEvent);
 begin
 begin
   FEdit.OnExit := AValue;
   FEdit.OnExit := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditKeyDown(AValue: TKeyEvent);
+procedure TBCMaterialEditBase.SetOnEditKeyDown(AValue: TKeyEvent);
 begin
 begin
   FEdit.OnKeyDown := AValue;
   FEdit.OnKeyDown := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditKeyPress(AValue: TKeyPressEvent);
+procedure TBCMaterialEditBase.SetOnEditKeyPress(AValue: TKeyPressEvent);
 begin
 begin
   FEdit.OnKeyPress := AValue;
   FEdit.OnKeyPress := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditKeyUp(AValue: TKeyEvent);
+procedure TBCMaterialEditBase.SetOnEditKeyUp(AValue: TKeyEvent);
 begin
 begin
   FEdit.OnKeyUp := AValue;
   FEdit.OnKeyUp := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditMouseDown(AValue: TMouseEvent);
+procedure TBCMaterialEditBase.SetOnEditMouseDown(AValue: TMouseEvent);
 begin
 begin
   FEdit.OnMouseDown := AValue;
   FEdit.OnMouseDown := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditMouseEnter(AValue: TNotifyEvent);
+procedure TBCMaterialEditBase.SetOnEditMouseEnter(AValue: TNotifyEvent);
 begin
 begin
   FEdit.OnMouseEnter := AValue;
   FEdit.OnMouseEnter := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditMouseLeave(AValue: TNotifyEvent);
+procedure TBCMaterialEditBase.SetOnEditMouseLeave(AValue: TNotifyEvent);
 begin
 begin
   FEdit.OnMouseLeave := AValue;
   FEdit.OnMouseLeave := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditMouseMove(AValue: TMouseMoveEvent);
+procedure TBCMaterialEditBase.SetOnEditMouseMove(AValue: TMouseMoveEvent);
 begin
 begin
   FEdit.OnMouseMove := AValue;
   FEdit.OnMouseMove := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditMouseUp(AValue: TMouseEvent);
+procedure TBCMaterialEditBase.SetOnEditMouseUp(AValue: TMouseEvent);
 begin
 begin
   FEdit.OnMouseUp := AValue;
   FEdit.OnMouseUp := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditMouseWheel(AValue: TMouseWheelEvent);
+procedure TBCMaterialEditBase.SetOnEditMouseWheel(AValue: TMouseWheelEvent);
 begin
 begin
   FEdit.OnMouseWheel := AValue;
   FEdit.OnMouseWheel := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditMouseWheelDown(AValue: TMouseWheelUpDownEvent);
+procedure TBCMaterialEditBase.SetOnEditMouseWheelDown(AValue: TMouseWheelUpDownEvent);
 begin
 begin
   FEdit.OnMouseWheelDown := AValue;
   FEdit.OnMouseWheelDown := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditMouseWheelUp(AValue: TMouseWheelUpDownEvent);
+procedure TBCMaterialEditBase.SetOnEditMouseWheelUp(AValue: TMouseWheelUpDownEvent);
 begin
 begin
   FEdit.OnMouseWheelUp := AValue;
   FEdit.OnMouseWheelUp := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetOnEditStartDrag(AValue: TStartDragEvent);
-begin
-  FEdit.OnStartDrag := AValue;
-end;
-
-procedure TBCMaterialEdit.SetOnEditUTF8KeyPress(AValue: TUTF8KeyPressEvent);
+procedure TBCMaterialEditBase.SetOnEditUTF8KeyPress(AValue: TUTF8KeyPressEvent);
 begin
 begin
   FEdit.OnUTF8KeyPress := AValue;
   FEdit.OnUTF8KeyPress := AValue;
 end;
 end;
 
 
-function TBCMaterialEdit.IsNeededAdjustHeight: boolean;
+function TBCMaterialEditBase.IsNeededAdjustSize: boolean;
 begin
 begin
   if (Self.Align in [alLeft, alRight, alClient]) then Exit(False);
   if (Self.Align in [alLeft, alRight, alClient]) then Exit(False);
   if (akTop in Self.Anchors) and (akBottom in Self.Anchors) then Exit(False);
   if (akTop in Self.Anchors) and (akBottom in Self.Anchors) then Exit(False);
   result := FEdit.AutoSize;
   result := FEdit.AutoSize;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetAnchors(const AValue: TAnchors);
+procedure TBCMaterialEditBase.SetAnchors(const AValue: TAnchors);
 begin
 begin
-  if Self.Anchors <> AValue then
-  begin
-    inherited SetAnchors(AValue);
-    Self.DoOnResize;
-  end;
+  if (Self.Anchors = AValue) then Exit;
+  inherited SetAnchors(AValue);
+
+  if not (csLoading in ComponentState) then Self.DoOnResize;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditAlignment(const AValue: TAlignment);
+procedure TBCMaterialEditBase.SetColor(AValue: TColor);
+begin
+  inherited SetColor(AValue);
+  FEdit.Color := AValue;
+end;
+
+procedure TBCMaterialEditBase.SetEditAlignment(const AValue: TAlignment);
 begin
 begin
   FEdit.Alignment := AValue;
   FEdit.Alignment := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditAutoSize(AValue: Boolean);
+procedure TBCMaterialEditBase.SetEditAutoSize(AValue: Boolean);
 begin
 begin
-  if FEdit.AutoSize <> AValue then
-  begin
-    FEdit.AutoSize := AValue;
-    Self.DoOnResize;
-  end;
+  if (FEdit.AutoSize = AValue) then Exit;
+  FEdit.AutoSize := AValue;
+
+  if not (csLoading in ComponentState) then Self.DoOnResize;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditAutoSelect(AValue: Boolean);
+procedure TBCMaterialEditBase.SetEditAutoSelect(AValue: Boolean);
 begin
 begin
   FEdit.AutoSelect := AValue;
   FEdit.AutoSelect := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditCharCase(AValue: TEditCharCase);
+procedure TBCMaterialEditBase.SetEditCharCase(AValue: TEditCharCase);
 begin
 begin
   FEdit.CharCase := AValue;
   FEdit.CharCase := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditCursor(AValue: TCursor);
+procedure TBCMaterialEditBase.SetEditCursor(AValue: TCursor);
 begin
 begin
   FEdit.Cursor := AValue;
   FEdit.Cursor := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditDoubleBuffered(AValue: Boolean);
+procedure TBCMaterialEditBase.SetEditDoubleBuffered(AValue: Boolean);
 begin
 begin
   FEdit.DoubleBuffered := AValue;
   FEdit.DoubleBuffered := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditDragCursor(AValue: TCursor);
-begin
-  FEdit.DragCursor := AValue;
-end;
-
-procedure TBCMaterialEdit.SetEditDragMode(AValue: TDragMode);
-begin
-  FEdit.DragMode := AValue;
-end;
-
-procedure TBCMaterialEdit.SetEditEchoMode(AValue: TEchoMode);
+procedure TBCMaterialEditBase.SetEditEchoMode(AValue: TEchoMode);
 begin
 begin
   FEdit.EchoMode := AValue;
   FEdit.EchoMode := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditHideSelection(AValue: Boolean);
+procedure TBCMaterialEditBase.SetEditHideSelection(AValue: Boolean);
 begin
 begin
   FEdit.HideSelection := AValue;
   FEdit.HideSelection := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditHint(const AValue: TTranslateString);
+procedure TBCMaterialEditBase.SetEditHint(const AValue: TTranslateString);
 begin
 begin
   FEdit.Hint := AValue;
   FEdit.Hint := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditMaxLength(AValue: Integer);
+procedure TBCMaterialEditBase.SetEditMaxLength(AValue: Integer);
 begin
 begin
   FEdit.MaxLength := AValue;
   FEdit.MaxLength := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditNumbersOnly(AValue: Boolean);
+procedure TBCMaterialEditBase.SetEditNumbersOnly(AValue: Boolean);
 begin
 begin
   FEdit.NumbersOnly := AValue;
   FEdit.NumbersOnly := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditParentColor(AValue: Boolean);
+procedure TBCMaterialEditBase.SetEditParentColor(AValue: Boolean);
 begin
 begin
   FEdit.ParentColor  := AValue;
   FEdit.ParentColor  := AValue;
   FLabel.ParentColor := AValue;
   FLabel.ParentColor := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditPasswordChar(AValue: Char);
+procedure TBCMaterialEditBase.SetEditPasswordChar(AValue: Char);
 begin
 begin
   FEdit.PasswordChar := AValue;
   FEdit.PasswordChar := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditTabStop(AValue: Boolean);
+procedure TBCMaterialEditBase.SetEditTabStop(AValue: Boolean);
 begin
 begin
   FEdit.TabStop := AValue;
   FEdit.TabStop := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditPopupMenu(AValue: TPopupmenu);
+procedure TBCMaterialEditBase.SetEditPopupMenu(AValue: TPopupmenu);
 begin
 begin
   FEdit.PopupMenu := AValue;
   FEdit.PopupMenu := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditReadOnly(AValue: Boolean);
+procedure TBCMaterialEditBase.SetEditReadOnly(AValue: Boolean);
 begin
 begin
   FEdit.ReadOnly := AValue;
   FEdit.ReadOnly := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditShowHint(AValue: Boolean);
+procedure TBCMaterialEditBase.SetEditShowHint(AValue: Boolean);
 begin
 begin
   FEdit.ShowHint := AValue;
   FEdit.ShowHint := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditTag(AValue: PtrInt);
+procedure TBCMaterialEditBase.SetEditTag(AValue: PtrInt);
 begin
 begin
   FEdit.Tag := AValue;
   FEdit.Tag := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditTextHint(const Avalue: TTranslateString);
+procedure TBCMaterialEditBase.SetEditTextHint(const Avalue: TTranslateString);
 begin
 begin
   FEdit.TextHint := AValue;
   FEdit.TextHint := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetEditText(const AValue: TCaption);
+procedure TBCMaterialEditBase.SetEditText(const AValue: TCaption);
 begin
 begin
   FEdit.Text := AValue;
   FEdit.Text := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetLabelCaption(const AValue: TCaption);
+procedure TBCMaterialEditBase.SetLabelCaption(const AValue: TCaption);
 begin
 begin
   FLabel.Caption := AValue;
   FLabel.Caption := AValue;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetLabelSpacing(AValue: Integer);
+procedure TBCMaterialEditBase.SetLabelSpacing(AValue: Integer);
 begin
 begin
-  if FLabel.BorderSpacing.Bottom <> AValue then
-  begin
-    FLabel.BorderSpacing.Bottom := AValue;
-    Self.DoOnResize;
-  end;
+  if (FLabel.BorderSpacing.Bottom = AValue) then Exit;
+  FLabel.BorderSpacing.Bottom := AValue;
+
+  if not (csLoading in ComponentState) then Self.DoOnResize;
 end;
 end;
 
 
-procedure TBCMaterialEdit.SetName(const AValue: TComponentName);
+procedure TBCMaterialEditBase.SetName(const AValue: TComponentName);
 begin
 begin
   if (csDesigning in ComponentState) then
   if (csDesigning in ComponentState) then
   begin
   begin
@@ -726,26 +717,25 @@ begin
   inherited SetName(AValue);
   inherited SetName(AValue);
 end;
 end;
 
 
-procedure TBCMaterialEdit.DoEnter;
+procedure TBCMaterialEditBase.DoEnter;
 begin
 begin
   inherited DoEnter;
   inherited DoEnter;
   FFocused := True;
   FFocused := True;
   Invalidate;
   Invalidate;
-  FLabel.Font.Color := AccentColor;
 end;
 end;
 
 
-procedure TBCMaterialEdit.DoExit;
+procedure TBCMaterialEditBase.DoExit;
 begin
 begin
   FFocused := False;
   FFocused := False;
   Invalidate;
   Invalidate;
-  FLabel.Font.Color := DisabledColor;
+  inherited DoExit;
 end;
 end;
 
 
-procedure TBCMaterialEdit.DoOnResize;
+procedure TBCMaterialEditBase.DoOnResize;
 var
 var
   AutoSizedHeight: longint;
   AutoSizedHeight: longint;
 begin
 begin
-  if IsNeededAdjustHeight then
+  if IsNeededAdjustSize then
   begin
   begin
     FEdit.Align := alBottom;
     FEdit.Align := alBottom;
     AutoSizedHeight :=
     AutoSizedHeight :=
@@ -767,7 +757,7 @@ begin
   inherited DoOnResize;
   inherited DoOnResize;
 end;
 end;
 
 
-procedure TBCMaterialEdit.Paint;
+procedure TBCMaterialEditBase.Paint;
 var
 var
   LeftPos, RightPos: integer;
   LeftPos, RightPos: integer;
 begin
 begin
@@ -786,31 +776,35 @@ begin
     RightPos := Width;
     RightPos := Width;
   end;
   end;
 
 
-  if (FFocused) and (FEdit.Enabled) then
+  if (FFocused) and (Self.Enabled) then
   begin
   begin
     Canvas.Pen.Color := AccentColor;
     Canvas.Pen.Color := AccentColor;
     Canvas.Line(LeftPos, Height - 2, RightPos, Height - 2);
     Canvas.Line(LeftPos, Height - 2, RightPos, Height - 2);
     Canvas.Line(LeftPos, Height - 1, RightPos, Height - 1);
     Canvas.Line(LeftPos, Height - 1, RightPos, Height - 1);
+    FLabel.Font.Color := AccentColor;
   end else
   end else
   begin
   begin
     Canvas.Pen.Color := DisabledColor;
     Canvas.Pen.Color := DisabledColor;
     Canvas.Line(LeftPos, Height - 1, RightPos, Height - 1);
     Canvas.Line(LeftPos, Height - 1, RightPos, Height - 1);
+    FLabel.Font.Color := DisabledColor;
   end;
   end;
 end;
 end;
 
 
-constructor TBCMaterialEdit.Create(AOwner: TComponent);
+constructor TBCMaterialEditBase.Create(AOwner: TComponent);
 begin
 begin
+  FEdit := T.Create(Self);
+  FLabel := TBoundLabel.Create(Self);
   inherited Create(AOwner);
   inherited Create(AOwner);
   Self.AccentColor := clHighlight;
   Self.AccentColor := clHighlight;
   Self.BorderStyle := bsNone;
   Self.BorderStyle := bsNone;
   Self.Color := clWindow;
   Self.Color := clWindow;
   Self.DisabledColor := $00B8AFA8;
   Self.DisabledColor := $00B8AFA8;
   Self.ParentColor := False;
   Self.ParentColor := False;
-  FLabel := TBoundLabel.Create(Self);
+
   FLabel.Align := alTop;
   FLabel.Align := alTop;
   FLabel.AutoSize := True;
   FLabel.AutoSize := True;
   FLabel.BorderSpacing.Around := 0;
   FLabel.BorderSpacing.Around := 0;
-  FLabel.BorderSpacing.Bottom := 2;
+  FLabel.BorderSpacing.Bottom := 4;
   FLabel.BorderSpacing.Left := 4;
   FLabel.BorderSpacing.Left := 4;
   FLabel.BorderSpacing.Right := 4;
   FLabel.BorderSpacing.Right := 4;
   FLabel.BorderSpacing.Top := 4;
   FLabel.BorderSpacing.Top := 4;
@@ -820,7 +814,7 @@ begin
   FLabel.ParentFont := False;
   FLabel.ParentFont := False;
   FLabel.ParentBiDiMode := True;
   FLabel.ParentBiDiMode := True;
   FLabel.SetSubComponent(True);
   FLabel.SetSubComponent(True);
-  FEdit := TEdit.Create(Self);
+
   FEdit.Align := alBottom;
   FEdit.Align := alBottom;
   FEdit.AutoSelect := True;
   FEdit.AutoSelect := True;
   FEdit.AutoSize := True;
   FEdit.AutoSize := True;
@@ -839,4 +833,86 @@ begin
   FEdit.SetSubComponent(True);
   FEdit.SetSubComponent(True);
 end;
 end;
 
 
+{ TBCMaterialEdit }
+
+function TBCMaterialEdit.GetEditDragCursor: TCursor;
+begin
+  result := FEdit.DragCursor;
+end;
+
+function TBCMaterialEdit.GetEditDragMode: TDragMode;
+begin
+  result := FEdit.DragMode;
+end;
+
+function TBCMaterialEdit.GetOnEditContextPopup: TContextPopupEvent;
+begin
+  result := FEdit.OnContextPopup;
+end;
+
+function TBCMaterialEdit.GetOnEditDblClick: TNotifyEvent;
+begin
+  result := FEdit.OnDblClick;
+end;
+
+function TBCMaterialEdit.GetOnEditDragDrop: TDragDropEvent;
+begin
+  result := FEdit.OnDragDrop;
+end;
+
+function TBCMaterialEdit.GetOnEditDragOver: TDragOverEvent;
+begin
+  result := FEdit.OnDragOver;
+end;
+
+function TBCMaterialEdit.GetOnEditEndDrag: TEndDragEvent;
+begin
+  result := FEdit.OnEndDrag;
+end;
+
+function TBCMaterialEdit.GetOnEditStartDrag: TStartDragEvent;
+begin
+  result := FEdit.OnStartDrag;
+end;
+
+procedure TBCMaterialEdit.SetEditDragCursor(AValue: TCursor);
+begin
+  FEdit.DragCursor := AValue;
+end;
+
+procedure TBCMaterialEdit.SetEditDragMode(AValue: TDragMode);
+begin
+  FEdit.DragMode := AValue;
+end;
+
+procedure TBCMaterialEdit.SetOnEditContextPopup(AValue: TContextPopupEvent);
+begin
+  FEdit.OnContextPopup := AValue;
+end;
+
+procedure TBCMaterialEdit.SetOnEditDblClick(AValue: TNotifyEvent);
+begin
+  FEdit.OnDblClick := AValue;
+end;
+
+procedure TBCMaterialEdit.SetOnEditDragDrop(AValue: TDragDropEvent);
+begin
+  FEdit.OnDragDrop := AValue;
+end;
+
+procedure TBCMaterialEdit.SetOnEditDragOver(AValue: TDragOverEvent);
+begin
+  FEdit.OnDragOver := AValue;
+end;
+
+procedure TBCMaterialEdit.SetOnEditEndDrag(AValue: TEndDragEvent);
+begin
+  FEdit.OnEndDrag := AValue;
+end;
+
+procedure TBCMaterialEdit.SetOnEditStartDrag(AValue: TStartDragEvent);
+begin
+  FEdit.OnStartDrag := AValue;
+end;
+
 end.
 end.

+ 175 - 94
bcmaterialfloatspinedit.pas

@@ -5,45 +5,114 @@ unit BCMaterialFloatSpinEdit;
 interface
 interface
 
 
 uses
 uses
-  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
-  StdCtrls, Spin;
+  BCMaterialEdit, Classes, Controls, Dialogs, ExtCtrls, Forms, Graphics,
+  {$IFDEF FPC} LCLType, LResources, {$ENDIF} Menus, Spin, StdCtrls, SysUtils;
 
 
 type
 type
 
 
   { TBCMaterialFloatSpinEdit }
   { TBCMaterialFloatSpinEdit }
 
 
-  TBCMaterialFloatSpinEdit = class(TCustomPanel)
+  TBCMaterialFloatSpinEdit = class(specialize TBCMaterialEditBase<TFloatSpinEdit>)
   private
   private
-    FAccentColor: TColor;
-    FDisabledColor: TColor;
-    Flbl: TLabel;
-    Fedt: TFloatSpinEdit;
-    Ffocused: boolean;
-    FOnChange: TNotifyEvent;
-    FTexto: string;
-    procedure ChangeEdit(Sender: TObject);
-    procedure EnterEdit(Sender: TObject);
-    procedure ExitEdit(Sender: TObject);
-    function GetTabStop: Boolean;
-    procedure SetTabStop(AValue: Boolean);
-    procedure SetTexto(AValue: string);
-  protected
-    procedure Paint; override;
-  public
-    constructor Create(AOwner: TComponent); override;
+    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
   published
     property Align;
     property Align;
+    property Alignment;
     property Anchors;
     property Anchors;
+    property AutoSelect;
+    property AutoSize;
+  //property BiDiMode;
     property BorderSpacing;
     property BorderSpacing;
+    property Caption;
+  //property CharCase;
     property Color;
     property Color;
-    property Text: string read FTexto write SetTexto;
-    property Edit: TFloatSpinEdit read Fedt;
-    property Title: TLabel read Flbl;
-    property DisabledColor: TColor read FDisabledColor write FDisabledColor;
-    property AccentColor: TColor read FAccentColor write FAccentColor;
-    property OnChange: TNotifyEvent read FOnChange write FOnChange;
+    property Constraints;
+    property Cursor;
+    property DecimalPlaces: integer read GetEditDecimalPlaces write SetEditDecimalPlaces;
+    property DisabledColor;
+  //property DoubleBuffered;
+  //property EchoMode;
+    property Edit: TFloatSpinEdit read FEdit;
+    property EditorEnabled: boolean read GetEditEditorEnabled write SetEditEditorEnabled default True;
+    property EditLabel;
+    property Enabled;
+    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 Name;
+  //property ParentBiDiMode;
+    property ParentColor;
+    property ParentFont;
+    property PopupMenu;
+    property ReadOnly;
+    property ShowHint;
     property TabOrder;
     property TabOrder;
-    property TabStop: boolean read GetTabStop write SetTabStop default True;
+    property TabStop;
+  //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 OnEditingDone;
+  //property OnEndDrag;
+    property OnEnter;
+    property OnExit;
+    property OnKeyDown;
+    property OnKeyPress;
+    property OnKeyUp;
+    property OnMouseDown;
+    property OnMouseEnter;
+    property OnMouseLeave;
+    property OnMouseMove;
+    property OnMouseUp;
+    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 OnUTF8KeyPress;
   end;
   end;
 
 
 procedure Register;
 procedure Register;
@@ -52,98 +121,110 @@ implementation
 
 
 procedure Register;
 procedure Register;
 begin
 begin
+  {$IFDEF FPC}
+    {$I icons\bcmaterialfloatspinedit_icon.lrs}
+  {$ENDIF}
   RegisterComponents('BGRA Controls', [TBCMaterialFloatSpinEdit]);
   RegisterComponents('BGRA Controls', [TBCMaterialFloatSpinEdit]);
 end;
 end;
 
 
-{ TBCMaterialFloatSpinEdit }
+function TBCMaterialFloatSpinEdit.GetEditDecimalPlaces: integer;
+begin
+  result := FEdit.DecimalPlaces;
+end;
 
 
-procedure TBCMaterialFloatSpinEdit.EnterEdit(Sender: TObject);
+function TBCMaterialFloatSpinEdit.GetEditEditorEnabled: boolean;
 begin
 begin
-  Ffocused := True;
-  Invalidate;
-  Flbl.Font.Color := AccentColor;
+  result := FEdit.EditorEnabled;
 end;
 end;
 
 
-procedure TBCMaterialFloatSpinEdit.ChangeEdit(Sender: TObject);
+function TBCMaterialFloatSpinEdit.GetEditIncrement: double;
 begin
 begin
-  if Assigned(FOnChange) then
-    FOnChange(Self);
+  result := FEdit.Increment;
 end;
 end;
 
 
-procedure TBCMaterialFloatSpinEdit.ExitEdit(Sender: TObject);
+function TBCMaterialFloatSpinEdit.GetEditMinValue: double;
 begin
 begin
-  Ffocused := False;
-  Invalidate;
-  Flbl.Font.Color := DisabledColor;
+  result := FEdit.MinValue;
 end;
 end;
 
 
-function TBCMaterialFloatSpinEdit.GetTabStop: Boolean;
+function TBCMaterialFloatSpinEdit.GetEditMaxValue: double;
 begin
 begin
-  result := Fedt.TabStop;
+  result := FEdit.MaxValue;
 end;
 end;
 
 
-procedure TBCMaterialFloatSpinEdit.SetTabStop(AValue: Boolean);
+function TBCMaterialFloatSpinEdit.GetEditValue: double;
 begin
 begin
-  if Fedt.TabStop = AValue then Exit;
-  Fedt.TabStop := AValue;
+  result := FEdit.Value;
 end;
 end;
 
 
-procedure TBCMaterialFloatSpinEdit.SetTexto(AValue: string);
+function TBCMaterialFloatSpinEdit.GetEditValueEmpty: boolean;
 begin
 begin
-  if FTexto = AValue then
-    Exit;
-  FTexto := AValue;
-  Flbl.Caption := FTexto;
-  //Fedt.TextHint := FTexto;
+  result := FEdit.ValueEmpty;
 end;
 end;
 
 
-procedure TBCMaterialFloatSpinEdit.Paint;
+procedure TBCMaterialFloatSpinEdit.SetEditDecimalPlaces(AValue: integer);
 begin
 begin
-  inherited Paint;
-  Canvas.Brush.Color := Color;
-  Canvas.Pen.Color := Color;
-  Canvas.Rectangle(0, 0, Width, Height);
-  if (fFocused) then
-  begin
-    Canvas.Pen.Color := AccentColor;
-    Canvas.Line(0, Height - 2, Width, Height - 2);
-    Canvas.Line(0, Height - 1, Width, Height - 1);
-  end
-  else
-  begin
-    Canvas.Pen.Color := DisabledColor;
-    Canvas.Line(0, Height - 1, Width, Height - 1);
-  end;
+  FEdit.DecimalPlaces := AValue;
+end;
+
+procedure TBCMaterialFloatSpinEdit.SetEditEditorEnabled(AValue: boolean);
+begin
+  FEdit.EditorEnabled := AValue;
 end;
 end;
 
 
-constructor TBCMaterialFloatSpinEdit.Create(AOwner: TComponent);
-begin
-  inherited Create(AOwner);
-  Self.BevelOuter := bvNone;
-  Self.Color := clWhite;
-  AccentColor := clHighlight;
-  DisabledColor := $00B8AFA8;
-  Flbl := TLabel.Create(Self);
-  Flbl.Align := alTop;
-  Flbl.Caption := 'Buscar';
-  Flbl.BorderSpacing.Around := 4;
-  Flbl.Font.Style := [fsBold];
-  Flbl.Font.Color := $00B8AFA8;
-  Flbl.Parent := Self;
-  Fedt := TFloatSpinEdit.Create(Self);
-  Fedt.Color := Color;
-  Fedt.Font.Color := clBlack;
-  Fedt.OnEnter := @EnterEdit;
-  Fedt.OnExit := @ExitEdit;
-  Fedt.OnChange:=@ChangeEdit;
-  Fedt.Align := alClient;
-  Fedt.BorderStyle := bsNone;
-  //Fedt.TextHint := 'Buscar';
-  Fedt.BorderSpacing.Around := 4;
-  Fedt.Parent := Self;
-  Fedt.MinValue := 0;
-  Fedt.MaxValue := MaxInt;
-  Fedt.TabStop := True;
+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;
 
 
 end.
 end.

+ 149 - 94
bcmaterialspinedit.pas

@@ -5,45 +5,108 @@ unit BCMaterialSpinEdit;
 interface
 interface
 
 
 uses
 uses
-  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
-  StdCtrls, Spin;
+  BCMaterialEdit, Classes, Controls, Dialogs, ExtCtrls, Forms, Graphics,
+  {$IFDEF FPC} LCLType, LResources, {$ENDIF} Menus, Spin, StdCtrls, SysUtils;
 
 
 type
 type
 
 
   { TBCMaterialSpinEdit }
   { TBCMaterialSpinEdit }
 
 
-  TBCMaterialSpinEdit = class(TCustomPanel)
+  TBCMaterialSpinEdit = class(specialize TBCMaterialEditBase<TSpinEdit>)
   private
   private
-    FAccentColor: TColor;
-    FDisabledColor: TColor;
-    Flbl: TLabel;
-    Fedt: TSpinEdit;
-    Ffocused: boolean;
-    FOnChange: TNotifyEvent;
-    FTexto: string;
-    procedure ChangeEdit(Sender: TObject);
-    procedure EnterEdit(Sender: TObject);
-    procedure ExitEdit(Sender: TObject);
-    function GetTabStop: Boolean;
-    procedure SetTabStop(AValue: Boolean);
-    procedure SetTexto(AValue: string);
-  protected
-    procedure Paint; override;
-  public
-    constructor Create(AOwner: TComponent); override;
+    function GetEditEditorEnabled: boolean;
+    function GetEditIncrement: double;
+    function GetEditMinValue: double;
+    function GetEditMaxValue: double;
+    function GetEditValue: double;
+
+    procedure SetEditEditorEnabled(AValue: boolean);
+    procedure SetEditIncrement(AValue: double);
+    procedure SetEditMinValue(AValue: double);
+    procedure SetEditMaxValue(AValue: double);
+    procedure SetEditValue(AValue: double);
+
+    function GetOnEditMouseWheelHorz: TMouseWheelEvent;
+    function GetOnEditMouseWheelLeft: TMouseWheelUpDownEvent;
+    function GetOnEditMouseWheelRight: TMouseWheelUpDownEvent;
+
+    procedure SetOnEditMouseWheelHorz(AValue: TMouseWheelEvent);
+    procedure SetOnEditMouseWheelLeft(AValue: TMouseWheelUpDownEvent);
+    procedure SetOnEditMouseWheelRight(AValue: TMouseWheelUpDownEvent);
   published
   published
     property Align;
     property Align;
+    property Alignment;
     property Anchors;
     property Anchors;
+    property AutoSelect;
+    property AutoSize;
+  //property BiDiMode;
     property BorderSpacing;
     property BorderSpacing;
+    property Caption;
+  //property CharCase;
     property Color;
     property Color;
-    property Text: string read FTexto write SetTexto;
-    property Edit: TSpinEdit read Fedt;
-    property Title: TLabel read Flbl;
-    property DisabledColor: TColor read FDisabledColor write FDisabledColor;
-    property AccentColor: TColor read FAccentColor write FAccentColor;
-    property OnChange: TNotifyEvent read FOnChange write FOnChange;
+    property Constraints;
+    property Cursor;
+    property DisabledColor;
+  //property DoubleBuffered;
+  //property EchoMode;
+    property Edit: TSpinEdit read FEdit;
+    property EditorEnabled: boolean read GetEditEditorEnabled write SetEditEditorEnabled default True;
+    property EditLabel;
+    property Enabled;
+    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 Name;
+  //property ParentBiDiMode;
+    property ParentColor;
+    property ParentFont;
+    property PopupMenu;
+    property ReadOnly;
+    property ShowHint;
     property TabOrder;
     property TabOrder;
-    property TabStop: boolean read GetTabStop write SetTabStop default True;
+    property TabStop;
+    property Tag;
+  //property Text;
+  //property TextHint;
+    property Top;
+    property Value: double read GetEditValue write SetEditValue;
+    property Visible;
+    property Width;
+
+    property OnChange;
+    property OnChangeBounds;
+    property OnClick;
+    //property OnContextPopup;
+    //property OnDragDrop;
+    //property OnDragOver;
+    property OnEditingDone;
+    //property OnEndDrag;
+    property OnEnter;
+    property OnExit;
+    property OnKeyDown;
+    property OnKeyPress;
+    property OnKeyUp;
+    property OnMouseDown;
+    property OnMouseEnter;
+    property OnMouseLeave;
+    property OnMouseMove;
+    property OnMouseUp;
+    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 OnUTF8KeyPress;
   end;
   end;
 
 
 procedure Register;
 procedure Register;
@@ -52,98 +115,90 @@ implementation
 
 
 procedure Register;
 procedure Register;
 begin
 begin
+  {$IFDEF FPC}
+    {$I icons\bcmaterialspinedit_icon.lrs}
+  {$ENDIF}
   RegisterComponents('BGRA Controls', [TBCMaterialSpinEdit]);
   RegisterComponents('BGRA Controls', [TBCMaterialSpinEdit]);
 end;
 end;
 
 
-{ TBCMaterialSpinEdit }
+function TBCMaterialSpinEdit.GetEditEditorEnabled: boolean;
+begin
+  result := FEdit.EditorEnabled;
+end;
 
 
-procedure TBCMaterialSpinEdit.EnterEdit(Sender: TObject);
+function TBCMaterialSpinEdit.GetEditIncrement: double;
 begin
 begin
-  Ffocused := True;
-  Invalidate;
-  Flbl.Font.Color := AccentColor;
+  result := FEdit.Increment;
 end;
 end;
 
 
-procedure TBCMaterialSpinEdit.ChangeEdit(Sender: TObject);
+function TBCMaterialSpinEdit.GetEditMinValue: double;
 begin
 begin
-  if Assigned(FOnChange) then
-    FOnChange(Self);
+  result := FEdit.MinValue;
 end;
 end;
 
 
-procedure TBCMaterialSpinEdit.ExitEdit(Sender: TObject);
+function TBCMaterialSpinEdit.GetEditMaxValue: double;
 begin
 begin
-  Ffocused := False;
-  Invalidate;
-  Flbl.Font.Color := DisabledColor;
+  result := FEdit.MaxValue;
 end;
 end;
 
 
-function TBCMaterialSpinEdit.GetTabStop: Boolean;
+function TBCMaterialSpinEdit.GetEditValue: double;
 begin
 begin
-  result := Fedt.TabStop;
+  result := FEdit.Value;
 end;
 end;
 
 
-procedure TBCMaterialSpinEdit.SetTabStop(AValue: Boolean);
+procedure TBCMaterialSpinEdit.SetEditEditorEnabled(AValue: boolean);
 begin
 begin
-  if Fedt.TabStop = AValue then Exit;
-  Fedt.TabStop := AValue;
+  FEdit.EditorEnabled := AValue;
 end;
 end;
 
 
-procedure TBCMaterialSpinEdit.SetTexto(AValue: string);
+procedure TBCMaterialSpinEdit.SetEditIncrement(AValue: double);
 begin
 begin
-  if FTexto = AValue then
-    Exit;
-  FTexto := AValue;
-  Flbl.Caption := FTexto;
-  //Fedt.TextHint := FTexto;
+  FEdit.Increment := AValue;
 end;
 end;
 
 
-procedure TBCMaterialSpinEdit.Paint;
+procedure TBCMaterialSpinEdit.SetEditMinValue(AValue: double);
 begin
 begin
-  inherited Paint;
-  Canvas.Brush.Color := Color;
-  Canvas.Pen.Color := Color;
-  Canvas.Rectangle(0, 0, Width, Height);
-  if (fFocused) then
-  begin
-    Canvas.Pen.Color := AccentColor;
-    Canvas.Line(0, Height - 2, Width, Height - 2);
-    Canvas.Line(0, Height - 1, Width, Height - 1);
-  end
-  else
-  begin
-    Canvas.Pen.Color := DisabledColor;
-    Canvas.Line(0, Height - 1, Width, Height - 1);
-  end;
+  FEdit.MinValue := AValue;
 end;
 end;
 
 
-constructor TBCMaterialSpinEdit.Create(AOwner: TComponent);
-begin
-  inherited Create(AOwner);
-  Self.BevelOuter := bvNone;
-  Self.Color := clWhite;
-  AccentColor := clHighlight;
-  DisabledColor := $00B8AFA8;
-  Flbl := TLabel.Create(Self);
-  Flbl.Align := alTop;
-  Flbl.Caption := 'Buscar';
-  Flbl.BorderSpacing.Around := 4;
-  Flbl.Font.Style := [fsBold];
-  Flbl.Font.Color := $00B8AFA8;
-  Flbl.Parent := Self;
-  Fedt := TSpinEdit.Create(Self);
-  Fedt.Color := Color;
-  Fedt.Font.Color := clBlack;
-  Fedt.OnEnter := @EnterEdit;
-  Fedt.OnExit := @ExitEdit;
-  Fedt.OnChange:=@ChangeEdit;
-  Fedt.Align := alClient;
-  Fedt.BorderStyle := bsNone;
-  //Fedt.TextHint := 'Buscar';
-  Fedt.BorderSpacing.Around := 4;
-  Fedt.Parent := Self;
-  Fedt.MinValue := 0;
-  Fedt.MaxValue := MaxInt;
-  Fedt.TabStop := True;
+procedure TBCMaterialSpinEdit.SetEditMaxValue(AValue: double);
+begin
+  FEdit.MaxValue := AValue;
+end;
+
+procedure TBCMaterialSpinEdit.SetEditValue(AValue: double);
+begin
+  FEdit.Value := AValue;
+end;
+
+function TBCMaterialSpinEdit.GetOnEditMouseWheelHorz: TMouseWheelEvent;
+begin
+  result := FEdit.OnMouseWheelHorz;
+end;
+
+function TBCMaterialSpinEdit.GetOnEditMouseWheelLeft: TMouseWheelUpDownEvent;
+begin
+  result := FEdit.OnMouseWheelLeft;
+end;
+
+function TBCMaterialSpinEdit.GetOnEditMouseWheelRight: TMouseWheelUpDownEvent;
+begin
+  result := FEdit.OnMouseWheelRight;
+end;
+
+procedure TBCMaterialSpinEdit.SetOnEditMouseWheelHorz(AValue: TMouseWheelEvent);
+begin
+  FEdit.OnMouseWheelHorz := AValue;
+end;
+
+procedure TBCMaterialSpinEdit. SetOnEditMouseWheelLeft(AValue: TMouseWheelUpDownEvent);
+begin
+  FEdit.OnMouseWheelLeft := AValue;
+end;
+
+procedure TBCMaterialSpinEdit.SetOnEditMouseWheelRight(AValue: TMouseWheelUpDownEvent);
+begin
+  FEdit.OnMouseWheelRight := AValue;
 end;
 end;
 
 
 end.
 end.

+ 30 - 32
icons/bcmaterialedit_icon.lrs

@@ -1,36 +1,34 @@
 LazarusResources.Add('tbcmaterialedit','PNG',[
 LazarusResources.Add('tbcmaterialedit','PNG',[
   #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
   #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
   +#0#0#9'pHYs'#0#0#7'a'#0#0#7'a'#1#149#195#184#182#0#0#0#25'tEXtSoftware'#0'ww'
   +#0#0#9'pHYs'#0#0#7'a'#0#0#7'a'#1#149#195#184#182#0#0#0#25'tEXtSoftware'#0'ww'
-  +'w.inkscape.org'#155#238'<'#26#0#0#2#212'IDATH'#137#237#149#203'O'#163'U'#24
-  +#135#159#211'~'#237#16'c'#249#148'|'#1'3'#160#24#147#153#138#193'!1F'#140'`'
-  +#164'NwnHHHL'#19'C\'#129#255'AwnH'#144#165#27']'#201#198#16#137'MX0'#152'.d!'
-  +'i'#189#16'5'#136#14'6'#138'M'#157#137#14#19#200#12#212#9#189'~'#231#231#130
-  +#218#204'L'#209#233#194#186#242#183';'#183#247'y/'#231'='#199'H'#162#147#10
-  +'t'#212#250#127#1'p'#128#142#230'('#0#176#146#169'S'#173#183'.~'#248'Y'#141
-  +#252'M'#219'2_'#174#193';'#171#213#182#0#14#192#149#175#235#188#246'|'#144
-  +#176'c'#248#228#155':'#217#156#207#235'/'#135#200#223#20#185#223'j<'#225#5'x'
-  +#243'r'#136#247#210'U0'#134'7^q'#184'z'#189#21#252#183#128#187#21'y'#200#16
-  +'v'#12#31#127'^#'#24'0\'#190#228#240'~'#186#202#163#15#27#190#252#201#18#12
-  +#194'3'#3#237#151#174#185#243#211#239'|~'#184'fy'#251#163#10#189#174#193'o8'
-  +#152#253#209#231'N'#25#158#236'5'#156#11#193#212#139#14#23#207#183#15'0'#146
-  +#244#213#207'>'#183#254#16#143'{'#1'$'#8'4'#206#27#192#183'p.'#4#23#207#7#184
-  +'z'#221#178#127'['#188#244't'#144#239#127#245'y'#225'B'#176'=@'#219#238'<@'
-  +#190#5#219#136'<'#212'H~K'#13#178#217','#133'B'#129'D"'#1#192#241#241'1'#171
-  +#171#171#28#29#29#17#139#197#24#25#25#193'ZK:'#157'&'#151#203#17#137'D'#152
-  +#154#154#162#167#167#135'/r>'#235#223#214'y'#245'Y'#135#248#165' '#198#0'j'
-  +#200'Z'#171#133#133#5#5#131'A'#13#12#12'H'#146'J'#165#146#6#7#7#213#219#219
-  +#171'h4'#170'P('#164'L&'#163#181#181'5uwwkbbB'#174#235'*'#26#141#202'Z'#171
-  +'_n'#248#250'`'#163#218#176'wj'#183#9'XYYQ'#127#127#191#226#241'x'#19' I[[[*'
-  +#149'J*'#151#203'r'#28'G'#243#243#243#146#164'b'#177'(IZ\\TWW'#151'*'#149#202
-  +'?'#3#172#181':88'#208#236#236#236'='#128#191#180#190#190'.c'#140'2'#153#140
-  +'$iccC333'#138'F'#163'ZZZ'#146#164'3'#1#205#251'f'#140#193#243#188'3'#139#183
-  +#189#189'M"'#145' '#153'L266'#6'@'#185'\'#6#224#228#228#132#229#229#229#230
-  +#184'E'#247'{z'#127#4';;;'#242'<O'#201'd'#178'%*IJ'#165'R'#2#180#185#185'yf'
-  +#4'-'#183#232'n'#29#30#30#18#143#199#169#213'j'#236#237#237'1=='#205#240#240
-  +'0'#225'p'#152'B'#161'@__'#31#169'T'#10#215'u'#25#26#26#162'x'#198'{'#214#2
-  +#24#31#31#199'u]'#0#234#245':'#147#147#147#247#172'G"'#17'FGG'#201#231#243
-  +#236#238#238#18#139#197#152#155#155#195#243'<'#246#175'Y'#138''''#226#198'm'
-  +#241#216'#'#230'4'#245#255'f'#163#253'~K'#236#31#157'v'#218'sO'#157'v'#185'y'
-  +#247'J'#165#163#255#129#185#240#214#157#206#2#254#255#244#31#164'?'#1#215'G'
-  +#243'`X'#22'f'#26#0#0#0#0'IEND'#174'B`'#130
+  +'w.inkscape.org'#155#238'<'#26#0#0#2#172'IDATH'#137#237#149'OH'#147'a'#28#199
+  +'?'#207#243'n3c'#17#11#243' Z'#25'L3f'#193#24'3'#146#236'0'#186#152#176'C^'#4
+  +#237#16#226#193'K '#130#183#152#130#160'''A'#193#13'v'#237'`t'#200#131#196
+  +#148#14#5#217#31')$J'#146#130#23'J'#139#13'u'#27'&c'#239#182#247'};'#168'o'
+  +#193#140#237#208':'#245';>'#207#247#247'|~'#127#158#223#243#8#211'4'#169#164
+  +#201#138#158#254'/'#0'6'#160#162'5'#146#0#15#158#23#200#21#138'7'#239'?'#203
+  +#163'&'#140#162#245'l'#30'&'#31#229#202#2#216#0#22#222#20#184#233'Sp'#216#4
+  +#143#223#22'X^'#215#233#185'fGM'#152#172#127#203's'#166'Fr''`'''#28#203#129
+  +#16#220#190'ncm'#163#24#252'G'#192#239'v'#226#184#192'a'#19'<|'#145'G'#145
+  +#130#192'%'#27#145'X'#14#151'S'#240#234#147#129#162#192#197#250#242'[g)'#159
+  +#188#211#249#240#213' 4'#167'Q{R'#160#31#4#184#252'Qg/'#11#231'j'#5'Uv'#184
+  +'u'#197'FS]'#249#0'a'#154#166#249#250#179'N'#242#135'IC'#141#196'4A'#30#248
+  +#11'@7'#160#202#14'Mu'#146#181#13#131'x'#202#228#234#5#133#247'_t'#252'n'#165
+  +'<@'#217#225#148'0'#221#0#227' s'#251'A'#241'K'#230#26#137'Dp'#187#221'e'#1
+  +'^'#174#235#220#155#211'x'#186#166's'#24'vI@:'#157'FU'#213#178#0'u'#167#4'Mu'
+  +#146#27#151#127#149#206#2'$'#147'Iz{{'#241'x<ttt'#16#139#197','#145#195#225
+  +'`||'#28#191#223#207#232#232#168#181#30#14#135'ikk'#195#231#243#17#141'F'#143
+  +#132'Z'#0#151#203#133#215#235'ejj'#10#167#211'I__'#159'%'#202'f'#179'lmm'#209
+  +#222#222'N('#20'bii'#137#197#197'E'#6#7#7#241#251#253#244#247#247#211#220#220
+  +'|$'#192#154#131'T*E:'#157'fvv'#22'UU'#217#222#222'F'#211'4K811'#129#162'('
+  +#204#204#204#176#178#178#194#238#238'.'#213#213#213'LOO#'#132#0'@'#141#23#15
+  +#159#149#193#208#208#16#209'h'#148#225#225'a'#186#187#187#139#132';;;h'#154
+  +#134'a'#24'H)'#145'R'#162#235':'#133#194#17'o'#204'Q'#25#28#138'WWW'#153#159
+  +#159'/'#18#14#12#12#160'('#10#166'i'#18#8#4#200'd2LNN'#18#12#6'iii'#161#190
+  +#190#158'`'#207#221'"?%'#20#10#133#0'|>'#31#137'D'#130'x<'#206#216#216#24'RJ'
+  +#186#186#186#200'd2'#180#182#182#226#245'z'#217#220#220'ddd'#132#206#206'N'
+  +#26#27#27#241'x<'#168#170'J6'#155'%'#24#12#162'8'#27'X'#223'48{Z'#226'<&'#16
+  +#226'/'#15#218#247#164'I<'#189#223#7#239#249#253#171'*'#166#23#180#138#254#7
+  +#194'='#184'WY'#192#255'O'#191#148#253#4'y`'#10#133#195'"|'#158#0#0#0#0'IEND'
+  +#174'B`'#130
 ]);
 ]);

+ 35 - 0
icons/bcmaterialfloatspinedit_icon.lrs

@@ -0,0 +1,35 @@
+LazarusResources.Add('tbcmaterialfloatspinedit','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+  +#0#0#9'pHYs'#0#0#7'a'#0#0#7'a'#1#149#195#184#182#0#0#0#25'tEXtSoftware'#0'ww'
+  +'w.inkscape.org'#155#238'<'#26#0#0#2#221'IDATH'#137#237#149']HSq'#24#198#159
+  +#255'v'#142#163'c)'#225':'#193#200'4t'#218#188'Hg'#17#169'X'#248#209#197#12
+  +#132#144'!'#221't'#17'v'#227#141#16#4'F ]'#22#162#23'F'#172#242'&('#176#8'jA'
+  +#31#219'P(LK'#168#139'0I'#12#148#26#129#11'i'#204#156#206#179's'#246't'#161
+  +#140#173')'#13#201#174'z'#224#220#188#207#251#158#223'{'#222#255#199#17'$'
+  +#177#157'2m'#235#219#255#5'@'#2#176#173'32'#1#192#131#215':4='#211#188#247'*'
+  +#142#217'P"#'#30#139#3#215#30'kY'#1'$'#0'x'#250'N'#199#169'#f'#228'H'#2#207
+  +#223#235#24#155'6p'#166'^'#198'l'#136#152#254#22#199'~'#171#9#231#154'dx|'#26
+  +' '#4#206#158#144'0'#21#204#4'o'#10'H'#213'.E G'#18'x8'#30#135#217'$'#208'tH'
+  +#194'M'#159#134#221';'#5#222#206'$`6'#3#21#251#178'_'#186'd'#230#240#7#3#31
+  +#191'&p'#229#254'*'#212'|'#1'c'#189#193#177'O'#6#150'b@'#177'*`'#145#129#182
+  +'c'#18#202'l'#217#3#4'IN|6'#240#227'''Qh5'#129#4'L'#235#245#2#128#145#0',2Pf'
+  +'3a*'#152#192'|'#152#168'=h'#198#228#23#3'G'#237#230#236#0'Y'#183#179#5'e'
+  +#172#193#194#194#2#188'^/VVV'#208#220#220#12#135#195#145'Q'#164#235':'#252'~'
+  +'?fffPYY'#137#198#198#198#164#231#157#208'Qh'#21'8\'#178#254'uLQ8'#28#166#213
+  +'j'#165#205'fcII'#9#21'E'#225#228#228'dj'#10#23#23#23#233't:'#169#170'*].'#23
+  +#7#6#6#146'^4'#150'`'#221#165'(O_]'#166#145'X'#139#165#1'Hr||'#156#154#166'1'
+  +#20#10#17#0'='#30'O'#154#223#211#211'C'#187#221#206'H$'#242'{)'#251#158#172
+  +#210#222#185'D{'#231#18#31#189#137#147'$3'#182'CMM'#13'dYF '#16#128'$I'#168
+  +#175#175'O'#243'GFFPTT'#132#186#186':TTT`hh'#8#0#176#26#7#230#195#132#171'Z'
+  +#130#171':'#229#156'd'#180'Artt'#148#138#162#176#175#175'/'#195'+//gqq1'#135
+  +#135#135#217#218#218'JUUI'#146'1'#141#188#29#208'x'#203#191#246#220'}'#169'm'
+  +'>'#162#188#188'<'#246#246#246'n'#196'fCC'#3#219#218#218'H'#146#30#143#135#0
+  +#24#141'FI'#146#23#239#196#146'#'#186#241'b'#3#192#220#220#28#243#243#243#169
+  +#170'*'#221'n7'#221'n7'#251#251#251#233#243#249'XUU'#197'`0'#200#193#193'A'
+  +#202#178#204#174#174'.'#150#150#150#178#182#182'6Y'#255'='#146#160#243'B'#148
+  +#199'/G'#185#188#186#22'K'#219#166#134'a'#160#189#189'=m'#230#185#185#185'(('
+  +'('#128#195#225#128#162'('#232#232#232#128#197'b'#129#207#231'CKK'#11#186#187
+  +#187#147#185'{'#242#4#206#159#148'q`'#175#192#142#156#181#216'_?hq'#29#144'S'
+  +#218#150#174'?'#203#238#218#221#170#132#189'si['#175#10#241#255#167#255''''
+  +#253#2'*B'#18'4'#147#29#1'K'#0#0#0#0'IEND'#174'B`'#130
+]);

+ 35 - 0
icons/bcmaterialspinedit_icon.lrs

@@ -0,0 +1,35 @@
+LazarusResources.Add('tbcmaterialspinedit','PNG',[
+  #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+  +#0#0#9'pHYs'#0#0#7'a'#0#0#7'a'#1#149#195#184#182#0#0#0#25'tEXtSoftware'#0'ww'
+  +'w.inkscape.org'#155#238'<'#26#0#0#2#198'IDATH'#137#237'UOH'#147'a'#28'~'#222
+  +'o'#223#220#154#173#8#157#225'l'#163#153#127'b'#202' '#219'"'#10#235' '#19'd'
+  +#7#137#220#161'KB'#224#197#131#135'A'#7#233#210#177'@A'#200#168'v'#10#234'P'
+  +#134'e'#208#159'-s6'#205'J'#168'CTLJ'#132#146'@'#3#147'h'#147#237#219#246'='
+  +#29#28#31#198'X'#14'i'#157'z'#224#189'<'#239#251#188#207#239#207#251'G'#144
+  +'D)!'#149't'#247#127'a '#3'(i'#141'$'#0#184#253'<'#3'%'#147'?y3'#154#198#194
+  +#178#154#199''''#211#192#197'{JQ'#6'2'#0'<x'#157#129#207#173'C'#153','#240
+  +#232'M'#6'3sY'#156'j'#213'ca'#153#152#251#154#134#189'R'#194#153'6='#174#132
+  +#20'@'#8#156'>.'#227#195'b'#190'qA'#131#141'0'#155#4#202'd'#129';/'#210#208
+  +'I'#2'm.'#25'WC'#10'vm'#23'x'#245'Q'#133'N'#7'8'#247#20#223':m'#229#211#183
+  +'Y'#188#255#162#226#252#173#20#170'v'#10'ds'#1#206#196#178#136''''#129#189'U'
+  +#2#6'=p'#242#176#140#6'k'#241#6#130'$g?e'#241#253'''a'#171#148'@'#2'RN/'#0'd'
+  +'U'#192#160#7#26#172#18'>,'#170'XZ%'#142#236#215#225#221#231','#14#213#235
+  +#138'3(:'#156'- '#175#7#27#17#139#197'0>>'#14#147#201#132#206#206'NX,'#22#0
+  +#128#162'('#8#133'B'#152#159#159#135#199#227'Akk'#171#166#25#155#205#192'V)p'
+  +'p_.;'#22'@4'#26#165'$It:'#157#172#168#168'`mm-'#21'E'#225#202#202#10#157'N'
+  +''''#171#171#171#233#243#249#24#12#6'5M"'#169#242'h'#127#130'''.'#172'1'#171
+  +#174's'#5#13'TU'#229#212#212#20'Irdd'#132#0#24#139#197#24#8#4#232'r'#185#24
+  +#143#199#243'4'#131#247'S'#172#239#141#179#190'7'#206#187'/'#211'$'#201#130
+  +#199'A'#8#161#165#30#14#135'a'#179#217'PWW'#135#137#137#9'X'#173'V'#184#221
+  +'n477cll'#12#0#144'J'#3'K'#171'DG'#139#140#142#150#13#247#164'P'#6'ZT'#131
+  +#131'4'#153'L'#156#158#158'&I'#214#212#212#176#177#177#145#145'H'#132'^'#175
+  +#151#14#135#131'$'#153'T'#200#224#19#133#215#194#235#227#198'3'#229#207'%"'
+  +#201#225#225'a'#154#205'fNNNj'#156#199#227'aww7Ir``'#128#178',SU'#215#11'~'
+  +#246'zR+'#209#229#199#155#24#140#142#142'R'#8#193#166#166'&'#250#253'~'#250
+  +#253'~'#134#195'a'#14#13#13#209'h42'#16#8#208'n'#183#179#189#189']'#211'|'
+  +#251#161#242'@ '#193'c'#231#18'\K'#173's'#5#143#169#209'hDOO'#207'o'#156#193
+  +'`@__'#31#202#203#203#17#137'D'#208#213#213#133#254#254'~m'#222#178'C'#160
+  +#199#171#135'c'#183#192#182#178'\/'#249#151'/Z:'#3#232'7'#132'-_zX'#220#179
+  +#187'U'#136#250#222'xI'#159#10#241#255#211#223#12#191#0#169#162#15#154#4#170
+  +#133#154#0#0#0#0'IEND'#174'B`'#130
+]);

BIN
icons/tbcmaterialedit.png


BIN
icons/tbcmaterialfloatspinedit.png


BIN
icons/tbcmaterialspinedit.png


BIN
images/bgracontrols_images.res


+ 6 - 0
images/bgracontrols_images_list.txt

@@ -10,6 +10,12 @@ tbclabel_200.png
 tbcmaterialedit.png
 tbcmaterialedit.png
 tbcmaterialedit_150.png
 tbcmaterialedit_150.png
 tbcmaterialedit_200.png
 tbcmaterialedit_200.png
+tbcmaterialspinedit.png
+tbcmaterialspinedit_150.png
+tbcmaterialspinedit_200.png
+tbcmaterialfloatspinedit.png
+tbcmaterialfloatspinedit_150.png
+tbcmaterialfloatspinedit_200.png
 tbcmaterialdesignbutton.png
 tbcmaterialdesignbutton.png
 tbcmaterialdesignbutton_150.png
 tbcmaterialdesignbutton_150.png
 tbcmaterialdesignbutton_200.png
 tbcmaterialdesignbutton_200.png

+ 40 - 41
images/svg/tbcmaterialedit.svg

@@ -34,7 +34,7 @@
      inkscape:window-x="0"
      inkscape:window-x="0"
      inkscape:window-y="0"
      inkscape:window-y="0"
      inkscape:window-maximized="1"
      inkscape:window-maximized="1"
-     inkscape:current-layer="layer1"
+     inkscape:current-layer="g2"
      showgrid="false" />
      showgrid="false" />
   <defs
   <defs
      id="defs1">
      id="defs1">
@@ -55,71 +55,70 @@
        style="font-size:192px;text-align:start;writing-mode:lr-tb;direction:ltr;white-space:pre;shape-inside:url(#rect2);display:inline;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"><tspan
        style="font-size:192px;text-align:start;writing-mode:lr-tb;direction:ltr;white-space:pre;shape-inside:url(#rect2);display:inline;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"><tspan
          x="78.566406"
          x="78.566406"
          y="509.26244"
          y="509.26244"
-         id="tspan5"><tspan
+         id="tspan6"><tspan
            dx="0 15.253366 15.253366"
            dx="0 15.253366 15.253366"
            style="font-size:26.6667px"
            style="font-size:26.6667px"
-           id="tspan1">123</tspan></tspan></text>
+           id="tspan2">123</tspan></tspan></text>
     <g
     <g
        id="g2">
        id="g2">
-      <rect
-         style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:3.24645;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:12.9858, 3.24645;stroke-dashoffset:3.24645;stroke-opacity:1;paint-order:markers fill stroke"
-         id="rect4"
-         width="47.989674"
-         height="36"
-         x="0"
-         y="6" />
-      <rect
-         style="fill:#256af4;fill-opacity:1;stroke:#256af4;stroke-width:0;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0.880555;stroke-opacity:1;paint-order:markers fill stroke"
-         id="rect1"
-         width="48"
-         height="3"
-         x="0"
-         y="39" />
-      <text
-         xml:space="preserve"
-         style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10.6667px;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans Bold';text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#256af4;fill-opacity:1;stroke:none;stroke-width:1.8;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:7.2, 1.8;stroke-dashoffset:1.8;stroke-opacity:1;paint-order:markers fill stroke"
-         x="1.539997"
-         y="16.606693"
-         id="text4"><tspan
-           sodipodi:role="line"
-           id="tspan4"
+      <g
+         id="g1">
+        <rect
+           style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:3.24645;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:12.9858, 3.24645;stroke-dashoffset:3.24645;stroke-opacity:1;paint-order:markers fill stroke"
+           id="rect4"
+           width="47.989674"
+           height="36"
+           x="0"
+           y="6" />
+        <rect
+           style="fill:#256af4;fill-opacity:1;stroke:#256af4;stroke-width:0;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0.880555;stroke-opacity:1;paint-order:markers fill stroke"
+           id="rect1"
+           width="48"
+           height="3"
+           x="0"
+           y="39" />
+        <text
+           xml:space="preserve"
+           style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10.6667px;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans Bold';text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#256af4;fill-opacity:1;stroke:none;stroke-width:1.8;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:7.2, 1.8;stroke-dashoffset:1.8;stroke-opacity:1;paint-order:markers fill stroke"
            x="1.539997"
            x="1.539997"
            y="16.606693"
            y="16.606693"
-           style="font-size:10.6667px;stroke-width:1.8">Label</tspan></text>
-      <text
-         xml:space="preserve"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:19.6246px;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans';text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.94244;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:15.7698, 3.94244;stroke-dashoffset:3.94244;stroke-opacity:1;paint-order:markers fill stroke"
-         x="3.6747451"
-         y="35.20821"
-         id="text3"><tspan
-           sodipodi:role="line"
-           id="tspan3"
+           id="text4"><tspan
+             sodipodi:role="line"
+             id="tspan4"
+             x="1.539997"
+             y="16.606693"
+             style="font-size:10.6667px;stroke-width:1.8">Label</tspan></text>
+        <text
+           xml:space="preserve"
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:19.6246px;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans';text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.94244;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:15.7698, 3.94244;stroke-dashoffset:3.94244;stroke-opacity:1;paint-order:markers fill stroke"
            x="3.6747451"
            x="3.6747451"
            y="35.20821"
            y="35.20821"
-           style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans Bold';fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.94244;stroke-opacity:1">123</tspan></text>
-      <g
-         id="g1"
-         transform="translate(0.33480764)">
+           id="text3"><tspan
+             sodipodi:role="line"
+             id="tspan3"
+             x="3.6747451"
+             y="35.20821"
+             style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans Bold';fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.94244;stroke-opacity:1">abc</tspan></text>
         <rect
         <rect
            style="fill:#256af4;fill-opacity:1;stroke:none;stroke-width:2.95821;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:11.8312, 2.95821;stroke-dashoffset:2.95821;stroke-opacity:1;paint-order:markers fill stroke"
            style="fill:#256af4;fill-opacity:1;stroke:none;stroke-width:2.95821;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:11.8312, 2.95821;stroke-dashoffset:2.95821;stroke-opacity:1;paint-order:markers fill stroke"
            id="rect5"
            id="rect5"
            width="5.0587049"
            width="5.0587049"
            height="16.5"
            height="16.5"
-           x="38.611244"
+           x="38.946053"
            y="19.952229" />
            y="19.952229" />
         <rect
         <rect
            style="fill:#ffffff;fill-opacity:1;stroke-width:1.33566;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:5.34257, 1.33566;stroke-dashoffset:1.33566;paint-order:markers fill stroke"
            style="fill:#ffffff;fill-opacity:1;stroke-width:1.33566;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:5.34257, 1.33566;stroke-dashoffset:1.33566;paint-order:markers fill stroke"
            id="rect3"
            id="rect3"
            width="2.4367449"
            width="2.4367449"
            height="15.121"
            height="15.121"
-           x="38.263256"
+           x="38.598064"
            y="20.641727" />
            y="20.641727" />
         <rect
         <rect
            style="fill:#ffffff;fill-opacity:1;stroke-width:1.43716;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:5.74885, 1.43716;stroke-dashoffset:1.43716;paint-order:markers fill stroke"
            style="fill:#ffffff;fill-opacity:1;stroke-width:1.43716;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:5.74885, 1.43716;stroke-dashoffset:1.43716;paint-order:markers fill stroke"
            id="rect3-5"
            id="rect3-5"
            width="2.8214552"
            width="2.8214552"
            height="15.121"
            height="15.121"
-           x="41.505615"
+           x="41.840424"
            y="20.641727" />
            y="20.641727" />
       </g>
       </g>
     </g>
     </g>

+ 154 - 0
images/svg/tbcmaterialfloatspinedit.svg

@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   width="48"
+   height="48"
+   viewBox="0 0 48 48"
+   version="1.1"
+   id="svg1"
+   sodipodi:docname="tbcmaterialfloatspinedit.svg"
+   inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
+   inkscape:export-filename="../tbcmaterialspinedit.png"
+   inkscape:export-xdpi="48"
+   inkscape:export-ydpi="48"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <sodipodi:namedview
+     id="namedview1"
+     pagecolor="#505050"
+     bordercolor="#ffffff"
+     borderopacity="1"
+     inkscape:showpageshadow="0"
+     inkscape:pageopacity="0"
+     inkscape:pagecheckerboard="1"
+     inkscape:deskcolor="#505050"
+     inkscape:document-units="px"
+     inkscape:zoom="16.895833"
+     inkscape:cx="23.822442"
+     inkscape:cy="29.178792"
+     inkscape:window-width="2560"
+     inkscape:window-height="1371"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="g1"
+     showgrid="false" />
+  <defs
+     id="defs1">
+    <rect
+       x="-6.3329224"
+       y="20.123305"
+       width="33.972874"
+       height="15.980272"
+       id="rect5" />
+    <rect
+       x="78.565514"
+       y="167.72414"
+       width="343.3931"
+       height="166.84138"
+       id="rect2" />
+  </defs>
+  <g
+     inkscape:label="Livello 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <text
+       xml:space="preserve"
+       id="text1"
+       style="font-size:192px;text-align:start;writing-mode:lr-tb;direction:ltr;white-space:pre;shape-inside:url(#rect2);display:inline;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"><tspan
+         x="78.566406"
+         y="509.26244"
+         id="tspan5"><tspan
+           dx="0 15.253366 15.253366"
+           style="font-size:26.6667px"
+           id="tspan1">123</tspan></tspan></text>
+    <g
+       id="g2">
+      <g
+         id="g1">
+        <rect
+           style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:3.24645;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:12.9858, 3.24645;stroke-dashoffset:3.24645;stroke-opacity:1;paint-order:markers fill stroke"
+           id="rect4"
+           width="47.989674"
+           height="36"
+           x="0"
+           y="6" />
+        <rect
+           style="fill:#256af4;fill-opacity:1;stroke:#256af4;stroke-width:0;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0.880555;stroke-opacity:1;paint-order:markers fill stroke"
+           id="rect1"
+           width="48"
+           height="3"
+           x="0"
+           y="39" />
+        <text
+           xml:space="preserve"
+           style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10.6667px;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans Bold';text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#256af4;fill-opacity:1;stroke:none;stroke-width:1.8;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:7.2, 1.8;stroke-dashoffset:1.8;stroke-opacity:1;paint-order:markers fill stroke"
+           x="1.539997"
+           y="16.606693"
+           id="text4"><tspan
+             sodipodi:role="line"
+             id="tspan4"
+             x="1.539997"
+             y="16.606693"
+             style="font-size:10.6667px;stroke-width:1.8">Label</tspan></text>
+        <text
+           xml:space="preserve"
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:19.6246px;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans';text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.94244;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:15.7698, 3.94244;stroke-dashoffset:3.94244;stroke-opacity:1;paint-order:markers fill stroke"
+           x="6.7542653"
+           y="35.20821"
+           id="text3"><tspan
+             sodipodi:role="line"
+             id="tspan3"
+             x="6.7542653"
+             y="35.20821"
+             style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans Bold';fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.94244;stroke-opacity:1">2.6</tspan></text>
+        <g
+           id="g3"
+           transform="translate(0,-0.00576427)">
+          <path
+             sodipodi:type="star"
+             style="fill:#256af4;stroke:#256af4;stroke-width:0;stroke-linejoin:round;stroke-miterlimit:10;stroke-dashoffset:21.5109;paint-order:markers fill stroke"
+             id="path3"
+             inkscape:flatsided="true"
+             sodipodi:sides="3"
+             sodipodi:cx="41.725407"
+             sodipodi:cy="19.32468"
+             sodipodi:r1="4.3998275"
+             sodipodi:r2="2.1999137"
+             sodipodi:arg1="0.52359878"
+             sodipodi:arg2="1.5707963"
+             inkscape:rounded="0"
+             inkscape:randomized="0"
+             d="m 45.535769,21.524594 -7.620725,0 3.810363,-6.599741 z"
+             inkscape:transform-center-y="-1.2268713"
+             transform="matrix(1.1153795,0,0,1.1153795,-4.6896631,3.3531251)"
+             inkscape:transform-center-x="3.1089262e-06" />
+          <path
+             sodipodi:type="star"
+             style="fill:#256af4;stroke:#256af4;stroke-width:0;stroke-linejoin:round;stroke-miterlimit:10;stroke-dashoffset:21.5109;paint-order:markers fill stroke"
+             id="path3-5"
+             inkscape:flatsided="true"
+             sodipodi:sides="3"
+             sodipodi:cx="41.725407"
+             sodipodi:cy="19.32468"
+             sodipodi:r1="4.3998275"
+             sodipodi:r2="2.1999137"
+             sodipodi:arg1="0.52359878"
+             sodipodi:arg2="1.5707963"
+             inkscape:rounded="0"
+             inkscape:randomized="0"
+             d="m 45.535769,21.524594 -7.620725,0 3.810363,-6.599741 z"
+             inkscape:transform-center-y="1.2268691"
+             transform="matrix(0.55768974,-0.96594696,0.96594696,0.55768974,-0.08644392,61.035861)" />
+        </g>
+        <text
+           xml:space="preserve"
+           id="text5"
+           style="font-weight:600;font-size:10.6667px;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans Semi-Bold';text-align:start;writing-mode:lr-tb;direction:ltr;white-space:pre;shape-inside:url(#rect5);display:inline;fill:#256af4;stroke:#256af4;stroke-width:0;stroke-linejoin:round;stroke-miterlimit:10;stroke-dashoffset:21.5109;paint-order:markers fill stroke" />
+      </g>
+    </g>
+  </g>
+</svg>

+ 154 - 0
images/svg/tbcmaterialspinedit.svg

@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   width="48"
+   height="48"
+   viewBox="0 0 48 48"
+   version="1.1"
+   id="svg1"
+   sodipodi:docname="tbcmaterialspinedit.svg"
+   inkscape:version="1.4 (e7c3feb100, 2024-10-09)"
+   inkscape:export-filename="../tbcmaterialspinedit.png"
+   inkscape:export-xdpi="48"
+   inkscape:export-ydpi="48"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <sodipodi:namedview
+     id="namedview1"
+     pagecolor="#505050"
+     bordercolor="#ffffff"
+     borderopacity="1"
+     inkscape:showpageshadow="0"
+     inkscape:pageopacity="0"
+     inkscape:pagecheckerboard="1"
+     inkscape:deskcolor="#505050"
+     inkscape:document-units="px"
+     inkscape:zoom="16.895833"
+     inkscape:cx="23.822442"
+     inkscape:cy="29.178792"
+     inkscape:window-width="2560"
+     inkscape:window-height="1371"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="g1"
+     showgrid="false" />
+  <defs
+     id="defs1">
+    <rect
+       x="-6.3329224"
+       y="20.123305"
+       width="33.972874"
+       height="15.980272"
+       id="rect5" />
+    <rect
+       x="78.565514"
+       y="167.72414"
+       width="343.3931"
+       height="166.84138"
+       id="rect2" />
+  </defs>
+  <g
+     inkscape:label="Livello 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <text
+       xml:space="preserve"
+       id="text1"
+       style="font-size:192px;text-align:start;writing-mode:lr-tb;direction:ltr;white-space:pre;shape-inside:url(#rect2);display:inline;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"><tspan
+         x="78.566406"
+         y="509.26244"
+         id="tspan6"><tspan
+           dx="0 15.253366 15.253366"
+           style="font-size:26.6667px"
+           id="tspan2">123</tspan></tspan></text>
+    <g
+       id="g2">
+      <g
+         id="g1">
+        <rect
+           style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:3.24645;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:12.9858, 3.24645;stroke-dashoffset:3.24645;stroke-opacity:1;paint-order:markers fill stroke"
+           id="rect4"
+           width="47.989674"
+           height="36"
+           x="0"
+           y="6" />
+        <rect
+           style="fill:#256af4;fill-opacity:1;stroke:#256af4;stroke-width:0;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0.880555;stroke-opacity:1;paint-order:markers fill stroke"
+           id="rect1"
+           width="48"
+           height="3"
+           x="0"
+           y="39" />
+        <text
+           xml:space="preserve"
+           style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10.6667px;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans Bold';text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#256af4;fill-opacity:1;stroke:none;stroke-width:1.8;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:7.2, 1.8;stroke-dashoffset:1.8;stroke-opacity:1;paint-order:markers fill stroke"
+           x="1.539997"
+           y="16.606693"
+           id="text4"><tspan
+             sodipodi:role="line"
+             id="tspan4"
+             x="1.539997"
+             y="16.606693"
+             style="font-size:10.6667px;stroke-width:1.8">Label</tspan></text>
+        <text
+           xml:space="preserve"
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:19.6246px;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans';text-align:start;writing-mode:lr-tb;direction:ltr;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.94244;stroke-linejoin:round;stroke-miterlimit:10;stroke-dasharray:15.7698, 3.94244;stroke-dashoffset:3.94244;stroke-opacity:1;paint-order:markers fill stroke"
+           x="12.254265"
+           y="35.20821"
+           id="text3"><tspan
+             sodipodi:role="line"
+             id="tspan3"
+             x="12.254265"
+             y="35.20821"
+             style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans Bold';fill:#000000;fill-opacity:1;stroke:none;stroke-width:3.94244;stroke-opacity:1">26</tspan></text>
+        <g
+           id="g3"
+           transform="translate(0,-0.00576427)">
+          <path
+             sodipodi:type="star"
+             style="fill:#256af4;stroke:#256af4;stroke-width:0;stroke-linejoin:round;stroke-miterlimit:10;stroke-dashoffset:21.5109;paint-order:markers fill stroke"
+             id="path3"
+             inkscape:flatsided="true"
+             sodipodi:sides="3"
+             sodipodi:cx="41.725407"
+             sodipodi:cy="19.32468"
+             sodipodi:r1="4.3998275"
+             sodipodi:r2="2.1999137"
+             sodipodi:arg1="0.52359878"
+             sodipodi:arg2="1.5707963"
+             inkscape:rounded="0"
+             inkscape:randomized="0"
+             d="m 45.535769,21.524594 -7.620725,0 3.810363,-6.599741 z"
+             inkscape:transform-center-y="-1.2268713"
+             transform="matrix(1.1153795,0,0,1.1153795,-4.6896631,3.3531251)"
+             inkscape:transform-center-x="3.1089262e-06" />
+          <path
+             sodipodi:type="star"
+             style="fill:#256af4;stroke:#256af4;stroke-width:0;stroke-linejoin:round;stroke-miterlimit:10;stroke-dashoffset:21.5109;paint-order:markers fill stroke"
+             id="path3-5"
+             inkscape:flatsided="true"
+             sodipodi:sides="3"
+             sodipodi:cx="41.725407"
+             sodipodi:cy="19.32468"
+             sodipodi:r1="4.3998275"
+             sodipodi:r2="2.1999137"
+             sodipodi:arg1="0.52359878"
+             sodipodi:arg2="1.5707963"
+             inkscape:rounded="0"
+             inkscape:randomized="0"
+             d="m 45.535769,21.524594 -7.620725,0 3.810363,-6.599741 z"
+             inkscape:transform-center-y="1.2268691"
+             transform="matrix(0.55768974,-0.96594696,0.96594696,0.55768974,-0.08644392,61.035861)" />
+        </g>
+        <text
+           xml:space="preserve"
+           id="text5"
+           style="font-weight:600;font-size:10.6667px;font-family:'Noto Sans';-inkscape-font-specification:'Noto Sans Semi-Bold';text-align:start;writing-mode:lr-tb;direction:ltr;white-space:pre;shape-inside:url(#rect5);display:inline;fill:#256af4;stroke:#256af4;stroke-width:0;stroke-linejoin:round;stroke-miterlimit:10;stroke-dashoffset:21.5109;paint-order:markers fill stroke" />
+      </g>
+    </g>
+  </g>
+</svg>

BIN
images/tbcmaterialedit.png


BIN
images/tbcmaterialedit_150.png


BIN
images/tbcmaterialedit_200.png


BIN
images/tbcmaterialfloatspinedit.png


BIN
images/tbcmaterialfloatspinedit_150.png


BIN
images/tbcmaterialfloatspinedit_200.png


BIN
images/tbcmaterialspinedit.png


BIN
images/tbcmaterialspinedit_150.png


BIN
images/tbcmaterialspinedit_200.png


+ 378 - 0
test/test_material_edit/bcmaterialedit_test/bcmaterialedit_form.lfm

@@ -0,0 +1,378 @@
+object Form1: TForm1
+  Left = 289
+  Height = 691
+  Top = 311
+  Width = 634
+  Caption = 'TBCMaterialEdit TEST'
+  ClientHeight = 691
+  ClientWidth = 634
+  Color = clForm
+  Position = poDesktopCenter
+  LCLVersion = '4.0.0.2'
+  OnCreate = FormCreate
+  object Button1: TButton
+    AnchorSideLeft.Control = AnchorsCheckGroup
+    AnchorSideTop.Side = asrBottom
+    AnchorSideRight.Control = AnchorsCheckGroup
+    AnchorSideRight.Side = asrBottom
+    AnchorSideBottom.Control = Button2
+    Left = 210
+    Height = 48
+    Top = 575
+    Width = 136
+    Anchors = [akLeft, akRight, akBottom]
+    BorderSpacing.Top = 10
+    Caption = 'Dark/Light'
+    Constraints.MaxHeight = 48
+    Constraints.MinHeight = 48
+    TabOrder = 2
+    OnClick = Button1Click
+  end
+  object AnchorsCheckGroup: TCheckGroup
+    AnchorSideLeft.Control = EventsCheckGroup
+    AnchorSideLeft.Side = asrBottom
+    AnchorSideTop.Control = EventsCheckGroup
+    Left = 210
+    Height = 124
+    Top = 217
+    Width = 136
+    AutoFill = True
+    AutoSize = True
+    BorderSpacing.Left = 14
+    Caption = 'Anchors'
+    ChildSizing.LeftRightSpacing = 6
+    ChildSizing.TopBottomSpacing = 6
+    ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
+    ChildSizing.EnlargeVertical = crsHomogenousChildResize
+    ChildSizing.ShrinkHorizontal = crsScaleChilds
+    ChildSizing.ShrinkVertical = crsScaleChilds
+    ChildSizing.Layout = cclLeftToRightThenTopToBottom
+    ChildSizing.ControlsPerLine = 1
+    ClientHeight = 104
+    ClientWidth = 134
+    Items.Strings = (
+      'Top anchor'
+      'Left anchor'
+      'Right anchor'
+      'Bottom anchor'
+    )
+    ParentBackground = False
+    TabOrder = 3
+    OnItemClick = AnchorsCheckGroupItemClick
+    Data = {
+      0400000002020202
+    }
+  end
+  object EventsCheckGroup: TCheckGroup
+    AnchorSideLeft.Control = Owner
+    AnchorSideBottom.Control = Owner
+    AnchorSideBottom.Side = asrBottom
+    Left = 5
+    Height = 469
+    Top = 217
+    Width = 191
+    Anchors = [akLeft, akBottom]
+    AutoFill = True
+    AutoSize = True
+    BorderSpacing.Left = 5
+    BorderSpacing.Bottom = 5
+    Caption = 'Events'
+    ChildSizing.LeftRightSpacing = 6
+    ChildSizing.TopBottomSpacing = 6
+    ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
+    ChildSizing.EnlargeVertical = crsHomogenousChildResize
+    ChildSizing.ShrinkHorizontal = crsScaleChilds
+    ChildSizing.ShrinkVertical = crsScaleChilds
+    ChildSizing.Layout = cclLeftToRightThenTopToBottom
+    ChildSizing.ControlsPerLine = 1
+    ClientHeight = 449
+    ClientWidth = 189
+    Items.Strings = (
+      'On Change'
+      'On Change Bounds'
+      'On Click'
+      'On Double Click'
+      'On Editing Done'
+      'On Enter'
+      'On Exit'
+      'On Key Down'
+      'On Key Press'
+      'On Key Up'
+      'On Mouse Down'
+      'On Mouse Enter'
+      'On Mouse Leave'
+      'On Mouse Move'
+      'On Mouse Up'
+      'On Mouse Wheel'
+      'On Mouse Wheel Down'
+      'On Mouse Wheel Up'
+      'On Resize'
+    )
+    ParentBackground = False
+    ParentFont = False
+    TabOrder = 4
+    Data = {
+      1300000002020202020202020202020202020202020202
+    }
+  end
+  object Button2: TButton
+    AnchorSideLeft.Control = Button1
+    AnchorSideTop.Control = Button1
+    AnchorSideTop.Side = asrBottom
+    AnchorSideRight.Control = Button1
+    AnchorSideRight.Side = asrBottom
+    AnchorSideBottom.Control = Owner
+    AnchorSideBottom.Side = asrBottom
+    Left = 210
+    Height = 48
+    Top = 633
+    Width = 136
+    Anchors = [akLeft, akRight, akBottom]
+    BorderSpacing.Top = 10
+    BorderSpacing.Bottom = 10
+    Caption = 'Clear Meno'
+    Constraints.MaxHeight = 48
+    Constraints.MinHeight = 48
+    TabOrder = 5
+    OnClick = Button2Click
+  end
+  object Label1: TMemo
+    AnchorSideLeft.Control = DividerBevel1
+    AnchorSideTop.Control = DividerBevel1
+    AnchorSideTop.Side = asrBottom
+    AnchorSideRight.Control = DividerBevel1
+    AnchorSideRight.Side = asrBottom
+    AnchorSideBottom.Control = Owner
+    AnchorSideBottom.Side = asrBottom
+    Left = 356
+    Height = 445
+    Top = 241
+    Width = 273
+    Anchors = [akTop, akLeft, akRight, akBottom]
+    BorderSpacing.Top = 5
+    BorderSpacing.Bottom = 5
+    TabOrder = 0
+  end
+  object DividerBevel1: TDividerBevel
+    AnchorSideLeft.Control = AnchorsCheckGroup
+    AnchorSideLeft.Side = asrBottom
+    AnchorSideTop.Control = AnchorsCheckGroup
+    AnchorSideRight.Control = Owner
+    AnchorSideRight.Side = asrBottom
+    Left = 356
+    Height = 19
+    Top = 217
+    Width = 273
+    Caption = 'Monitor'
+    Anchors = [akTop, akLeft, akRight]
+    BorderSpacing.Left = 10
+    BorderSpacing.Right = 5
+    ParentFont = False
+  end
+  object Panel1: TPanel
+    AnchorSideLeft.Control = Owner
+    AnchorSideTop.Control = Owner
+    AnchorSideRight.Control = Owner
+    AnchorSideRight.Side = asrBottom
+    AnchorSideBottom.Control = EventsCheckGroup
+    Left = 5
+    Height = 207
+    Top = 5
+    Width = 624
+    Anchors = [akTop, akLeft, akRight, akBottom]
+    BorderSpacing.Left = 5
+    BorderSpacing.Top = 5
+    BorderSpacing.Right = 5
+    BorderSpacing.Bottom = 5
+    BevelInner = bvRaised
+    BevelOuter = bvLowered
+    ClientHeight = 207
+    ClientWidth = 624
+    Color = clWhite
+    ParentBackground = False
+    ParentColor = False
+    TabOrder = 1
+    object BCMaterialEdit1: TBCMaterialEdit
+      AnchorSideLeft.Control = Panel1
+      AnchorSideTop.Control = Panel1
+      Left = 216
+      Height = 103
+      Top = 50
+      Width = 207
+      AccentColor = clHighlight
+      Anchors = []
+      AutoSize = False
+      BorderSpacing.Left = 10
+      BorderSpacing.Top = 10
+      BorderSpacing.Right = 10
+      BorderSpacing.Bottom = 10
+      Caption = 'Test'
+      Constraints.MinWidth = 50
+      DisabledColor = 12103592
+      DoubleBuffered = False
+      EditLabel.Height = 19
+      EditLabel.Width = 197
+      EditLabel.Caption = 'Test'
+      EditLabel.ParentFont = False
+      EditLabel.Font.Color = 12103592
+      EditLabel.Font.Style = [fsBold]
+      LabelSpacing = 2
+      ParentColor = True
+      ParentFont = True
+      TabOrder = 0
+      Text = 'Text'
+      OnChange = BCMaterialEdit1Change
+      OnChangeBounds = BCMaterialEdit1ChangeBounds
+      OnClick = BCMaterialEdit1Click
+      OnEditingDone = BCMaterialEdit1EditingDone
+      OnEnter = BCMaterialEdit1Enter
+      OnExit = BCMaterialEdit1Exit
+      OnKeyDown = BCMaterialEdit1KeyDown
+      OnKeyPress = BCMaterialEdit1KeyPress
+      OnKeyUp = BCMaterialEdit1KeyUp
+      OnMouseDown = BCMaterialEdit1MouseDown
+      OnMouseEnter = BCMaterialEdit1MouseEnter
+      OnMouseLeave = BCMaterialEdit1MouseLeave
+      OnMouseMove = BCMaterialEdit1MouseMove
+      OnMouseUp = BCMaterialEdit1MouseUp
+      OnMouseWheel = BCMaterialEdit1MouseWheel
+      OnMouseWheelDown = BCMaterialEdit1MouseWheelDown
+      OnMouseWheelUp = BCMaterialEdit1MouseWheelUp
+      OnResize = BCMaterialEdit1Resize
+      Edit.Left = 5
+      Edit.Height = 72
+      Edit.Top = 26
+      Edit.Width = 197
+      Edit.Align = alClient
+      Edit.AutoSize = False
+      Edit.BorderSpacing.Left = 4
+      Edit.BorderSpacing.Right = 4
+      Edit.BorderSpacing.Bottom = 4
+      Edit.BorderStyle = bsNone
+      Edit.Color = clWhite
+      Edit.DoubleBuffered = False
+      Edit.ParentDoubleBuffered = False
+      Edit.TabOrder = 0
+      Edit.Text = 'Text'
+      Edit.OnChange = BCMaterialEdit1Change
+      Edit.OnClick = BCMaterialEdit1Click
+      Edit.OnDblClick = BCMaterialEdit1DbClick
+      Edit.OnEditingDone = BCMaterialEdit1EditingDone
+      Edit.OnEnter = BCMaterialEdit1Enter
+      Edit.OnExit = BCMaterialEdit1Exit
+      Edit.OnKeyDown = BCMaterialEdit1KeyDown
+      Edit.OnKeyPress = BCMaterialEdit1KeyPress
+      Edit.OnKeyUp = BCMaterialEdit1KeyUp
+      Edit.OnMouseDown = BCMaterialEdit1MouseDown
+      Edit.OnMouseEnter = BCMaterialEdit1MouseEnter
+      Edit.OnMouseLeave = BCMaterialEdit1MouseLeave
+      Edit.OnMouseMove = BCMaterialEdit1MouseMove
+      Edit.OnMouseUp = BCMaterialEdit1MouseUp
+      Edit.OnMouseWheel = BCMaterialEdit1MouseWheel
+      Edit.OnMouseWheelDown = BCMaterialEdit1MouseWheelDown
+      Edit.OnMouseWheelUp = BCMaterialEdit1MouseWheelUp
+      OnDbClick = BCMaterialEdit1DbClick
+    end
+  end
+  object Button3: TButton
+    AnchorSideLeft.Control = AnchorsCheckGroup
+    AnchorSideTop.Control = AnchorsCheckGroup
+    AnchorSideTop.Side = asrBottom
+    AnchorSideRight.Control = AnchorsCheckGroup
+    AnchorSideRight.Side = asrBottom
+    Left = 210
+    Height = 48
+    Top = 346
+    Width = 136
+    Anchors = [akTop, akLeft, akRight]
+    BorderSpacing.Top = 5
+    Caption = 'Autosize'
+    Constraints.MaxHeight = 48
+    Constraints.MinHeight = 48
+    TabOrder = 6
+    OnClick = Button3Click
+  end
+  object Button4: TButton
+    AnchorSideLeft.Control = Button3
+    AnchorSideTop.Control = Button3
+    AnchorSideTop.Side = asrBottom
+    AnchorSideRight.Control = Button3
+    AnchorSideRight.Side = asrBottom
+    Left = 210
+    Height = 48
+    Top = 399
+    Width = 136
+    Anchors = [akTop, akLeft, akRight]
+    BorderSpacing.Top = 5
+    Caption = 'Enabled'
+    Constraints.MaxHeight = 48
+    Constraints.MinHeight = 48
+    TabOrder = 7
+    OnClick = Button4Click
+  end
+  object Button5: TButton
+    AnchorSideLeft.Control = Button4
+    AnchorSideTop.Control = Button4
+    AnchorSideTop.Side = asrBottom
+    AnchorSideRight.Control = Button4
+    AnchorSideRight.Side = asrBottom
+    Left = 210
+    Height = 48
+    Top = 452
+    Width = 136
+    Anchors = [akTop, akLeft, akRight]
+    BorderSpacing.Top = 5
+    Caption = 'Visible'
+    Constraints.MaxHeight = 48
+    Constraints.MinHeight = 48
+    TabOrder = 8
+    OnClick = Button5Click
+  end
+  object ColorButton1: TColorButton
+    AnchorSideLeft.Control = Button5
+    AnchorSideTop.Control = Button5
+    AnchorSideTop.Side = asrBottom
+    AnchorSideRight.Control = Button5
+    AnchorSideRight.Side = asrBottom
+    Left = 210
+    Height = 48
+    Top = 505
+    Width = 136
+    Anchors = [akTop, akLeft, akRight]
+    BorderSpacing.Top = 5
+    BorderWidth = 2
+    ButtonColorSize = 16
+    ButtonColor = clWhite
+    ColorDialog = ColorDialog1
+    Constraints.MaxHeight = 48
+    Constraints.MinHeight = 48
+    OnColorChanged = ColorButton1ColorChanged
+  end
+  object ColorDialog1: TColorDialog
+    Color = clBlack
+    CustomColors.Strings = (
+      'ColorA=000000'
+      'ColorB=000080'
+      'ColorC=008000'
+      'ColorD=008080'
+      'ColorE=800000'
+      'ColorF=800080'
+      'ColorG=808000'
+      'ColorH=808080'
+      'ColorI=C0C0C0'
+      'ColorJ=0000FF'
+      'ColorK=00FF00'
+      'ColorL=00FFFF'
+      'ColorM=FF0000'
+      'ColorN=FF00FF'
+      'ColorO=FFFF00'
+      'ColorP=FFFFFF'
+      'ColorQ=C0DCC0'
+      'ColorR=F0CAA6'
+      'ColorS=F0FBFF'
+      'ColorT=A4A0A0'
+    )
+    Left = 400
+    Top = 248
+  end
+end

+ 270 - 0
test/test_material_edit/bcmaterialedit_test/bcmaterialedit_form.pas

@@ -0,0 +1,270 @@
+unit bcmaterialedit_form;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
+  DividerBevel, BCMaterialEdit, Types;
+
+type
+
+  { TForm1 }
+
+  TForm1 = class(TForm)
+    BCMaterialEdit1: TBCMaterialEdit;
+    Button1: TButton;
+    AnchorsCheckGroup: TCheckGroup;
+    Button2: TButton;
+    Button3: TButton;
+    Button4: TButton;
+    Button5: TButton;
+    ColorButton1: TColorButton;
+    ColorDialog1: TColorDialog;
+    DividerBevel1: TDividerBevel;
+    EventsCheckGroup: TCheckGroup;
+    Label1: TMemo;
+    Panel1: TPanel;
+    procedure BCMaterialEdit1Change(Sender: TObject);
+    procedure BCMaterialEdit1ChangeBounds(Sender: TObject);
+    procedure BCMaterialEdit1Click(Sender: TObject);
+    procedure BCMaterialEdit1DbClick(Sender: TObject);
+    procedure BCMaterialEdit1EditingDone(Sender: TObject);
+    procedure BCMaterialEdit1Enter(Sender: TObject);
+    procedure BCMaterialEdit1Exit(Sender: TObject);
+    procedure BCMaterialEdit1KeyDown(Sender: TObject; var Key: Word;
+      Shift: TShiftState);
+    procedure BCMaterialEdit1KeyPress(Sender: TObject; var Key: char);
+    procedure BCMaterialEdit1KeyUp(Sender: TObject; var Key: Word;
+      Shift: TShiftState);
+    procedure BCMaterialEdit1MouseDown(Sender: TObject; Button: TMouseButton;
+      Shift: TShiftState; X, Y: Integer);
+    procedure BCMaterialEdit1MouseEnter(Sender: TObject);
+    procedure BCMaterialEdit1MouseLeave(Sender: TObject);
+    procedure BCMaterialEdit1MouseMove(Sender: TObject; Shift: TShiftState; X,
+      Y: Integer);
+    procedure BCMaterialEdit1MouseUp(Sender: TObject; Button: TMouseButton;
+      Shift: TShiftState; X, Y: Integer);
+    procedure BCMaterialEdit1MouseWheel(Sender: TObject; Shift: TShiftState;
+      WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
+    procedure BCMaterialEdit1MouseWheelDown(Sender: TObject;
+      Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
+    procedure BCMaterialEdit1MouseWheelUp(Sender: TObject; Shift: TShiftState;
+      MousePos: TPoint; var Handled: Boolean);
+    procedure BCMaterialEdit1Resize(Sender: TObject);
+    procedure Button1Click(Sender: TObject);
+    procedure AnchorsCheckGroupItemClick(Sender: TObject; Index: integer);
+    procedure Button2Click(Sender: TObject);
+    procedure Button3Click(Sender: TObject);
+    procedure Button4Click(Sender: TObject);
+    procedure Button5Click(Sender: TObject);
+    procedure ColorButton1ColorChanged(Sender: TObject);
+    procedure FormCreate(Sender: TObject);
+  private
+
+  public
+
+  end;
+
+var
+  Form1: TForm1;
+
+implementation
+
+{$R *.lfm}
+
+{ TForm1 }
+
+procedure TForm1.BCMaterialEdit1Change(Sender: TObject);
+begin
+  if EventsCheckGroup.Checked[0] then Label1.Append('OnChange');
+end;
+
+procedure TForm1.BCMaterialEdit1ChangeBounds(Sender: TObject);
+begin
+  if EventsCheckGroup.Checked[1] then Label1.Append('OnChangeBounds');
+end;
+
+procedure TForm1.BCMaterialEdit1Click(Sender: TObject);
+begin
+  if EventsCheckGroup.Checked[2] then Label1.Append('OnClick');
+end;
+
+procedure TForm1.BCMaterialEdit1DbClick(Sender: TObject);
+begin
+  if EventsCheckGroup.Checked[3] then Label1.Append('OnDbClick');
+end;
+
+procedure TForm1.BCMaterialEdit1EditingDone(Sender: TObject);
+begin
+  if EventsCheckGroup.Checked[4] then Label1.Append('OnEditingDone');
+end;
+
+procedure TForm1.BCMaterialEdit1Enter(Sender: TObject);
+begin
+  if EventsCheckGroup.Checked[5] then Label1.Append('OnEnter');
+end;
+
+procedure TForm1.BCMaterialEdit1Exit(Sender: TObject);
+begin
+  if EventsCheckGroup.Checked[6] then Label1.Append('OnExit');
+end;
+
+procedure TForm1.BCMaterialEdit1KeyDown(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  if EventsCheckGroup.Checked[7] then Label1.Append('OnKeyDown');
+end;
+
+procedure TForm1.BCMaterialEdit1KeyPress(Sender: TObject; var Key: char);
+begin
+  if EventsCheckGroup.Checked[8] then Label1.Append('OnKeyPress');
+end;
+
+procedure TForm1.BCMaterialEdit1KeyUp(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  if EventsCheckGroup.Checked[9] then Label1.Append('OnKeyUp');
+end;
+
+procedure TForm1.BCMaterialEdit1MouseDown(Sender: TObject;
+  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
+begin
+  if EventsCheckGroup.Checked[10] then Label1.Append('OnMouseDown');
+end;
+
+procedure TForm1.BCMaterialEdit1MouseEnter(Sender: TObject);
+begin
+  if EventsCheckGroup.Checked[11] then Label1.Append('OnMouseEnter');
+end;
+
+procedure TForm1.BCMaterialEdit1MouseLeave(Sender: TObject);
+begin
+  if EventsCheckGroup.Checked[12] then Label1.Append('OnMouseLeave');
+end;
+
+procedure TForm1.BCMaterialEdit1MouseMove(Sender: TObject; Shift: TShiftState;
+  X, Y: Integer);
+begin
+  if EventsCheckGroup.Checked[13] then Label1.Append('OnMouseMove');
+end;
+
+procedure TForm1.BCMaterialEdit1MouseUp(Sender: TObject; Button: TMouseButton;
+  Shift: TShiftState; X, Y: Integer);
+begin
+  if EventsCheckGroup.Checked[14] then Label1.Append('OnMouseUp');
+end;
+
+procedure TForm1.BCMaterialEdit1MouseWheel(Sender: TObject; Shift: TShiftState;
+  WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
+begin
+  if EventsCheckGroup.Checked[15] then Label1.Append('OnMouseWheel');
+end;
+
+procedure TForm1.BCMaterialEdit1MouseWheelDown(Sender: TObject;
+  Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
+begin
+  if EventsCheckGroup.Checked[16] then Label1.Append('OnMouseWheelDown');
+end;
+
+procedure TForm1.BCMaterialEdit1MouseWheelUp(Sender: TObject;
+  Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
+begin
+  if EventsCheckGroup.Checked[17] then Label1.Append('OnMouseWheelUp');
+end;
+
+procedure TForm1.BCMaterialEdit1Resize(Sender: TObject);
+begin
+  if EventsCheckGroup.Checked[18] then Label1.Append('OnResize');
+end;
+
+procedure TForm1.Button1Click(Sender: TObject);
+begin
+  if Panel1.Color = clBlack then
+  begin
+    Panel1.Color := clWhite;
+    BCMaterialEdit1.Color := clWhite;
+    BCMaterialEdit1.Font.Color := clBlack;
+    BCMaterialEdit1.Edit.Color := clWhite;
+    BCMaterialEdit1.Edit.Font.Color := clBlack;
+  end else
+  begin
+    Panel1.Color := clBlack;
+    BCMaterialEdit1.Color := clBlack;
+    {$IFDEF LCLGTK2}
+    BCMaterialEdit1.Font.Color := clBlack;
+    BCMaterialEdit1.Edit.Color := clWhite;
+    BCMaterialEdit1.Edit.Font.Color := clBlack;
+    {$ELSE}
+    BCMaterialEdit1.Font.Color := clWhite;
+    BCMaterialEdit1.Edit.Color := clBlack;
+    BCMaterialEdit1.Edit.Font.Color := clWhite;
+    {$ENDIF}
+  end;
+end;
+
+procedure TForm1.AnchorsCheckGroupItemClick(Sender: TObject; Index: integer);
+var
+  NewAnchors: TAnchors;
+begin
+  NewAnchors := [];
+  if AnchorsCheckGroup.Checked[0] then Include(NewAnchors, akTop);
+  if AnchorsCheckGroup.Checked[1] then Include(NewAnchors, akLeft);
+  if AnchorsCheckGroup.Checked[2] then Include(NewAnchors, akRight);
+  if AnchorsCheckGroup.Checked[3] then Include(NewAnchors, akBottom);
+  BCMaterialEdit1.Anchors := NewAnchors;
+end;
+
+procedure TForm1.Button2Click(Sender: TObject);
+begin
+  Label1.Clear;
+end;
+
+procedure TForm1.Button3Click(Sender: TObject);
+begin
+  if Assigned(Sender) then
+    BCMaterialEdit1.AutoSize := not BCMaterialEdit1.AutoSize;
+
+  case BCMaterialEdit1.AutoSize of
+    True:  Button3.Caption := 'AutoSize is TRUE';
+    False: Button3.Caption := 'AutoSize is FALSE';
+  end;
+end;
+
+procedure TForm1.Button4Click(Sender: TObject);
+begin
+  if Assigned(Sender) then
+    BCMaterialEdit1.Enabled := not BCMaterialEdit1.Enabled;
+
+  case BCMaterialEdit1.Enabled of
+    True:  Button4.Caption := 'Enabled is TRUE';
+    False: Button4.Caption := 'Enabled is FALSE';
+  end;
+end;
+
+procedure TForm1.Button5Click(Sender: TObject);
+begin
+  if Assigned(Sender) then
+    BCMaterialEdit1.Visible := not BCMaterialEdit1.Visible;
+
+  case BCMaterialEdit1.Visible of
+    True:  Button5.Caption := 'Visible is TRUE';
+    False: Button5.Caption := 'Visible is FALSE';
+  end;
+end;
+
+procedure TForm1.ColorButton1ColorChanged(Sender: TObject);
+begin
+  BCMaterialEdit1.Color := ColorDialog1.Color;
+end;
+
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+  Button3Click(nil);
+  Button4Click(nil);
+  Button5Click(nil);
+end;
+
+end.
+

BIN
test/test_material_edit/bcmaterialedit_test/bcmaterialedit_test.ico


+ 101 - 0
test/test_material_edit/bcmaterialedit_test/bcmaterialedit_test.lpi

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="12"/>
+    <PathDelim Value="\"/>
+    <General>
+      <Flags>
+        <SaveClosedFiles Value="False"/>
+        <SaveJumpHistory Value="False"/>
+        <SaveFoldState Value="False"/>
+        <CompatibilityMode Value="True"/>
+      </Flags>
+      <Title Value="bcmaterialedit_test"/>
+      <Scaled Value="True"/>
+      <ResourceType Value="res"/>
+      <UseXPManifest Value="True"/>
+      <XPManifest>
+        <DpiAware Value="True"/>
+      </XPManifest>
+      <Icon Value="0"/>
+    </General>
+    <BuildModes Count="1" Active="Default">
+      <Item1 Name="Default" Default="True"/>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <UseFileFilters Value="True"/>
+    </PublishOptions>
+    <RunParams>
+      <FormatVersion Value="2"/>
+    </RunParams>
+    <RequiredPackages Count="4">
+      <Item1>
+        <PackageName Value="LazControls"/>
+      </Item1>
+      <Item2>
+        <PackageName Value="LazControlDsgn"/>
+      </Item2>
+      <Item3>
+        <PackageName Value="bgracontrols"/>
+      </Item3>
+      <Item4>
+        <PackageName Value="LCL"/>
+      </Item4>
+    </RequiredPackages>
+    <Units Count="2">
+      <Unit0>
+        <Filename Value="bcmaterialedit_test.lpr"/>
+        <IsPartOfProject Value="True"/>
+        <UsageCount Value="20"/>
+      </Unit0>
+      <Unit1>
+        <Filename Value="bcmaterialedit_form.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="Form1"/>
+        <HasResources Value="True"/>
+        <ResourceBaseClass Value="Form"/>
+        <IsVisibleTab Value="True"/>
+        <TopLine Value="170"/>
+        <CursorPos X="72" Y="180"/>
+        <UsageCount Value="20"/>
+        <Loaded Value="True"/>
+        <LoadedDesigner Value="True"/>
+      </Unit1>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <PathDelim Value="\"/>
+    <Target>
+      <Filename Value="bcmaterialedit_test"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Linking>
+      <Debugging>
+        <DebugInfoType Value="dsDwarf2Set"/>
+      </Debugging>
+      <Options>
+        <Win32>
+          <GraphicApplication Value="True"/>
+        </Win32>
+      </Options>
+    </Linking>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions Count="3">
+      <Item1>
+        <Name Value="EAbort"/>
+      </Item1>
+      <Item2>
+        <Name Value="ECodetoolError"/>
+      </Item2>
+      <Item3>
+        <Name Value="EFOpenError"/>
+      </Item3>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 22 - 0
test/test_material_edit/bcmaterialedit_test/bcmaterialedit_test.lpr

@@ -0,0 +1,22 @@
+program bcmaterialedit_test;
+
+{$mode objfpc}{$H+}
+
+uses
+  {$IFDEF UNIX}{$IFDEF UseCThreads}
+  cthreads,
+  {$ENDIF}{$ENDIF}
+  Interfaces, // this includes the LCL widgetset
+  Forms, lazcontrols, bcmaterialedit_form
+  { you can add units after this };
+
+{$R *.res}
+
+begin
+  RequireDerivedFormResource:=True;
+  Application.Scaled:=True;
+  Application.Initialize;
+  Application.CreateForm(TForm1, Form1);
+  Application.Run;
+end.
+