-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathbcmaterialfloatspinedit.pas
230 lines (196 loc) · 6.22 KB
/
bcmaterialfloatspinedit.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
unit BCMaterialFloatSpinEdit;
{$mode objfpc}{$H+}
interface
uses
BCMaterialEdit, Classes, Controls, Dialogs, ExtCtrls, Forms, Graphics,
{$IFDEF FPC} LCLType, LResources, {$ENDIF} Menus, Spin, StdCtrls, SysUtils;
type
{ TBCMaterialFloatSpinEdit }
TBCMaterialFloatSpinEdit = class(specialize TBCMaterialEditBase<TFloatSpinEdit>)
private
function GetEditDecimalPlaces: integer;
function GetEditEditorEnabled: boolean;
function GetEditIncrement: double;
function GetEditMinValue: double;
function GetEditMaxValue: double;
function GetEditValue: double;
function GetEditValueEmpty: boolean;
procedure SetEditDecimalPlaces(AValue: integer);
procedure SetEditEditorEnabled(AValue: boolean);
procedure SetEditIncrement(AValue: double);
procedure SetEditMinValue(AValue: double);
procedure SetEditMaxValue(AValue: double);
procedure SetEditValue(AValue: double);
procedure SetEditValueEmpty(AValue: boolean);
function GetOnEditMouseWheelHorz: TMouseWheelEvent;
function GetOnEditMouseWheelLeft: TMouseWheelUpDownEvent;
function GetOnEditMouseWheelRight: TMouseWheelUpDownEvent;
procedure SetOnEditMouseWheelHorz(AValue: TMouseWheelEvent);
procedure SetOnEditMouseWheelLeft(AValue: TMouseWheelUpDownEvent);
procedure SetOnEditMouseWheelRight(AValue: TMouseWheelUpDownEvent);
published
property Align;
property Alignment;
property Anchors;
property AutoSelect;
property AutoSize;
//property BiDiMode;
property BorderSpacing;
property Caption;
//property CharCase;
property Color;
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 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;
procedure Register;
implementation
procedure Register;
begin
{$IFDEF FPC}
{$I icons\bcmaterialfloatspinedit_icon.lrs}
{$ENDIF}
RegisterComponents('BGRA Controls', [TBCMaterialFloatSpinEdit]);
end;
function TBCMaterialFloatSpinEdit.GetEditDecimalPlaces: integer;
begin
result := FEdit.DecimalPlaces;
end;
function TBCMaterialFloatSpinEdit.GetEditEditorEnabled: boolean;
begin
result := FEdit.EditorEnabled;
end;
function TBCMaterialFloatSpinEdit.GetEditIncrement: double;
begin
result := FEdit.Increment;
end;
function TBCMaterialFloatSpinEdit.GetEditMinValue: double;
begin
result := FEdit.MinValue;
end;
function TBCMaterialFloatSpinEdit.GetEditMaxValue: double;
begin
result := FEdit.MaxValue;
end;
function TBCMaterialFloatSpinEdit.GetEditValue: double;
begin
result := FEdit.Value;
end;
function TBCMaterialFloatSpinEdit.GetEditValueEmpty: boolean;
begin
result := FEdit.ValueEmpty;
end;
procedure TBCMaterialFloatSpinEdit.SetEditDecimalPlaces(AValue: integer);
begin
FEdit.DecimalPlaces := AValue;
end;
procedure TBCMaterialFloatSpinEdit.SetEditEditorEnabled(AValue: boolean);
begin
FEdit.EditorEnabled := AValue;
end;
procedure TBCMaterialFloatSpinEdit.SetEditIncrement(AValue: double);
begin
FEdit.Increment := AValue;
end;
procedure TBCMaterialFloatSpinEdit.SetEditMinValue(AValue: double);
begin
FEdit.MinValue := AValue;
end;
procedure TBCMaterialFloatSpinEdit.SetEditMaxValue(AValue: double);
begin
FEdit.MaxValue := AValue;
end;
procedure TBCMaterialFloatSpinEdit.SetEditValue(AValue: double);
begin
FEdit.Value := AValue;
end;
procedure TBCMaterialFloatSpinEdit.SetEditValueEmpty(AValue: boolean);
begin
FEdit.ValueEmpty := AValue;
end;
function TBCMaterialFloatSpinEdit.GetOnEditMouseWheelHorz: TMouseWheelEvent;
begin
result := FEdit.OnMouseWheelHorz;
end;
function TBCMaterialFloatSpinEdit.GetOnEditMouseWheelLeft: TMouseWheelUpDownEvent;
begin
result := FEdit.OnMouseWheelLeft;
end;
function TBCMaterialFloatSpinEdit.GetOnEditMouseWheelRight: TMouseWheelUpDownEvent;
begin
result := FEdit.OnMouseWheelRight;
end;
procedure TBCMaterialFloatSpinEdit.SetOnEditMouseWheelHorz(AValue: TMouseWheelEvent);
begin
FEdit.OnMouseWheelHorz := AValue;
end;
procedure TBCMaterialFloatSpinEdit. SetOnEditMouseWheelLeft(AValue: TMouseWheelUpDownEvent);
begin
FEdit.OnMouseWheelLeft := AValue;
end;
procedure TBCMaterialFloatSpinEdit.SetOnEditMouseWheelRight(AValue: TMouseWheelUpDownEvent);
begin
FEdit.OnMouseWheelRight := AValue;
end;
end.