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);
|
procedure TJDBCurrencyEdit.DataChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if not Focused then
|
if FDataLink.Field <> nil then
|
||||||
formatInput
|
begin
|
||||||
|
if not Focused then
|
||||||
|
formatInput
|
||||||
|
else
|
||||||
|
Caption := FDataLink.Field.AsString;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
Caption := FDataLink.Field.AsString;
|
Text := '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TJDBCurrencyEdit.getDecimals: integer;
|
function TJDBCurrencyEdit.getDecimals: integer;
|
||||||
@ -157,23 +162,28 @@ procedure TJDBCurrencyEdit.UpdateData(Sender: TObject);
|
|||||||
var
|
var
|
||||||
theValue: currency;
|
theValue: currency;
|
||||||
begin
|
begin
|
||||||
if IsValidCurrency(Text) then
|
if FDataLink.Field <> nil then
|
||||||
begin
|
begin
|
||||||
theValue := StrToCurr(Text);
|
if IsValidCurrency(Text) then
|
||||||
theValue := ScaleTo(theValue, fDecimales);
|
begin
|
||||||
Text := CurrToStr(theValue);
|
theValue := StrToCurr(Text);
|
||||||
FDataLink.Field.Text := 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
|
end
|
||||||
else
|
else
|
||||||
begin
|
Text := '';
|
||||||
if FDataLink.Field <> nil then
|
|
||||||
begin
|
|
||||||
ShowMessage(Caption + ' no es un valor válido');
|
|
||||||
Caption := FDataLink.Field.AsString;
|
|
||||||
SelectAll;
|
|
||||||
SetFocus;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJDBCurrencyEdit.FocusRequest(Sender: TObject);
|
procedure TJDBCurrencyEdit.FocusRequest(Sender: TObject);
|
||||||
|
@ -130,10 +130,15 @@ end;
|
|||||||
|
|
||||||
procedure TJDBDateEdit.DataChange(Sender: TObject);
|
procedure TJDBDateEdit.DataChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
|
if FDataLink.Field <> nil then
|
||||||
|
begin
|
||||||
if not Focused then
|
if not Focused then
|
||||||
formatInput
|
formatInput
|
||||||
else
|
else
|
||||||
Caption := FDataLink.Field.AsString;
|
Caption := FDataLink.Field.AsString;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Text := '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJDBDateEdit.UpdateData(Sender: TObject);
|
procedure TJDBDateEdit.UpdateData(Sender: TObject);
|
||||||
@ -157,8 +162,9 @@ begin
|
|||||||
SelectAll;
|
SelectAll;
|
||||||
SetFocus;
|
SetFocus;
|
||||||
end;
|
end;
|
||||||
|
end
|
||||||
end;
|
else
|
||||||
|
Text := '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJDBDateEdit.FocusRequest(Sender: TObject);
|
procedure TJDBDateEdit.FocusRequest(Sender: TObject);
|
||||||
|
@ -128,10 +128,15 @@ end;
|
|||||||
|
|
||||||
procedure TJDBIntegerEdit.DataChange(Sender: TObject);
|
procedure TJDBIntegerEdit.DataChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if not Focused then
|
if FDataLink.Field <> nil then
|
||||||
formatInput
|
begin
|
||||||
|
if not Focused then
|
||||||
|
formatInput
|
||||||
|
else
|
||||||
|
Caption := FDataLink.Field.AsString;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
Caption := FDataLink.Field.AsString;
|
Text := '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -148,7 +153,9 @@ begin
|
|||||||
SelectAll;
|
SelectAll;
|
||||||
SetFocus;
|
SetFocus;
|
||||||
end;
|
end;
|
||||||
end;
|
end
|
||||||
|
else
|
||||||
|
Text := '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJDBIntegerEdit.FocusRequest(Sender: TObject);
|
procedure TJDBIntegerEdit.FocusRequest(Sender: TObject);
|
||||||
|
Reference in New Issue
Block a user