You've already forked lazarus-ccr
RxFPC:RxDBGrid - check numeric field MinValue and MaxValue on RxDBGrid rxUpDown editor
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7386 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -2533,6 +2533,7 @@ var
|
|||||||
Col:TRxColumn;
|
Col:TRxColumn;
|
||||||
|
|
||||||
msg: TGridMessage;
|
msg: TGridMessage;
|
||||||
|
V: Boolean;
|
||||||
begin
|
begin
|
||||||
Col:=TRxColumnEditButtons(Collection).FOwner as TRxColumn;
|
Col:=TRxColumnEditButtons(Collection).FOwner as TRxColumn;
|
||||||
F:=Col.Field;
|
F:=Col.Field;
|
||||||
@@ -2545,7 +2546,16 @@ begin
|
|||||||
if F.IsNull then
|
if F.IsNull then
|
||||||
F.Value:=0;
|
F.Value:=0;
|
||||||
|
|
||||||
F.Value:=F.Value - 1;
|
if F is TLongintField then
|
||||||
|
V:=(TLongintField(F).MinValue <> 0) and (TLongintField(F).MaxValue <> 0) and (TLongintField(F).MinValue < F.Value)
|
||||||
|
else
|
||||||
|
if F is TFloatField then
|
||||||
|
V:=(TFloatField(F).MinValue <> 0) and (TFloatField(F).MaxValue <> 0) and (TFloatField(F).MinValue < F.Value)
|
||||||
|
else
|
||||||
|
V:=true;
|
||||||
|
|
||||||
|
if V then
|
||||||
|
F.Value:=F.Value - 1;
|
||||||
|
|
||||||
Msg.LclMsg.msg:=GM_SETVALUE;
|
Msg.LclMsg.msg:=GM_SETVALUE;
|
||||||
Msg.Grid:=Col.Grid;
|
Msg.Grid:=Col.Grid;
|
||||||
@@ -2561,6 +2571,7 @@ var
|
|||||||
Col:TRxColumn;
|
Col:TRxColumn;
|
||||||
|
|
||||||
msg: TGridMessage;
|
msg: TGridMessage;
|
||||||
|
V: Boolean;
|
||||||
begin
|
begin
|
||||||
Col:=TRxColumnEditButtons(Collection).FOwner as TRxColumn;
|
Col:=TRxColumnEditButtons(Collection).FOwner as TRxColumn;
|
||||||
F:=Col.Field;
|
F:=Col.Field;
|
||||||
@@ -2572,7 +2583,17 @@ begin
|
|||||||
|
|
||||||
if F.IsNull then
|
if F.IsNull then
|
||||||
F.Value:=0;
|
F.Value:=0;
|
||||||
F.Value:=F.Value + 1;
|
|
||||||
|
if F is TLongintField then
|
||||||
|
V:=(TLongintField(F).MinValue <> 0) and (TLongintField(F).MaxValue <> 0) and (TLongintField(F).MaxValue > F.Value)
|
||||||
|
else
|
||||||
|
if F is TFloatField then
|
||||||
|
V:=(TFloatField(F).MinValue <> 0) and (TFloatField(F).MaxValue <> 0) and (TFloatField(F).MaxValue < F.Value)
|
||||||
|
else
|
||||||
|
V:=true;
|
||||||
|
|
||||||
|
if V then
|
||||||
|
F.Value:=F.Value + 1;
|
||||||
|
|
||||||
Msg.LclMsg.msg:=GM_SETVALUE;
|
Msg.LclMsg.msg:=GM_SETVALUE;
|
||||||
Msg.Grid:=Col.Grid;
|
Msg.Grid:=Col.Grid;
|
||||||
|
Reference in New Issue
Block a user