You've already forked lazarus-ccr
Sanity checks
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1970 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -135,10 +135,15 @@ end;
|
||||
|
||||
procedure TJDBCurrencyEdit.DataChange(Sender: TObject);
|
||||
begin
|
||||
if not Focused then
|
||||
formatInput
|
||||
if FDataLink.Field <> nil then
|
||||
begin
|
||||
if not Focused then
|
||||
formatInput
|
||||
else
|
||||
Caption := FDataLink.Field.AsString;
|
||||
end
|
||||
else
|
||||
Caption := FDataLink.Field.AsString;
|
||||
Text := '';
|
||||
end;
|
||||
|
||||
function TJDBCurrencyEdit.getDecimals: integer;
|
||||
@ -157,23 +162,28 @@ procedure TJDBCurrencyEdit.UpdateData(Sender: TObject);
|
||||
var
|
||||
theValue: currency;
|
||||
begin
|
||||
if IsValidCurrency(Text) then
|
||||
if FDataLink.Field <> nil then
|
||||
begin
|
||||
theValue := StrToCurr(Text);
|
||||
theValue := ScaleTo(theValue, fDecimales);
|
||||
Text := CurrToStr(theValue);
|
||||
FDataLink.Field.Text := Text;
|
||||
if IsValidCurrency(Text) then
|
||||
begin
|
||||
theValue := StrToCurr(Text);
|
||||
theValue := ScaleTo(theValue, fDecimales);
|
||||
Text := CurrToStr(theValue);
|
||||
FDataLink.Field.Text := Text;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if FDataLink.Field <> nil then
|
||||
begin
|
||||
ShowMessage(Caption + ' no es un valor válido');
|
||||
Caption := FDataLink.Field.AsString;
|
||||
SelectAll;
|
||||
SetFocus;
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if FDataLink.Field <> nil then
|
||||
begin
|
||||
ShowMessage(Caption + ' no es un valor válido');
|
||||
Caption := FDataLink.Field.AsString;
|
||||
SelectAll;
|
||||
SetFocus;
|
||||
end;
|
||||
end;
|
||||
Text := '';
|
||||
end;
|
||||
|
||||
procedure TJDBCurrencyEdit.FocusRequest(Sender: TObject);
|
||||
|
@ -130,10 +130,15 @@ end;
|
||||
|
||||
procedure TJDBDateEdit.DataChange(Sender: TObject);
|
||||
begin
|
||||
if FDataLink.Field <> nil then
|
||||
begin
|
||||
if not Focused then
|
||||
formatInput
|
||||
else
|
||||
Caption := FDataLink.Field.AsString;
|
||||
end
|
||||
else
|
||||
Text := '';
|
||||
end;
|
||||
|
||||
procedure TJDBDateEdit.UpdateData(Sender: TObject);
|
||||
@ -157,8 +162,9 @@ begin
|
||||
SelectAll;
|
||||
SetFocus;
|
||||
end;
|
||||
|
||||
end;
|
||||
end
|
||||
else
|
||||
Text := '';
|
||||
end;
|
||||
|
||||
procedure TJDBDateEdit.FocusRequest(Sender: TObject);
|
||||
|
@ -128,10 +128,15 @@ end;
|
||||
|
||||
procedure TJDBIntegerEdit.DataChange(Sender: TObject);
|
||||
begin
|
||||
if not Focused then
|
||||
formatInput
|
||||
if FDataLink.Field <> nil then
|
||||
begin
|
||||
if not Focused then
|
||||
formatInput
|
||||
else
|
||||
Caption := FDataLink.Field.AsString;
|
||||
end
|
||||
else
|
||||
Caption := FDataLink.Field.AsString;
|
||||
Text := '';
|
||||
end;
|
||||
|
||||
|
||||
@ -148,7 +153,9 @@ begin
|
||||
SelectAll;
|
||||
SetFocus;
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
Text := '';
|
||||
end;
|
||||
|
||||
procedure TJDBIntegerEdit.FocusRequest(Sender: TObject);
|
||||
|
Reference in New Issue
Block a user