49 |
|
uses |
50 |
|
{$IFDEF WINDOWS } |
51 |
|
Windows, |
52 |
< |
{$ELSE} |
52 |
> |
{$ENDIF} |
53 |
> |
{$IFDEF UNIX} |
54 |
|
unix, |
55 |
|
{$ENDIF} |
56 |
|
SysUtils, Classes, IBDatabase, IBExternals, IB, IBSQL, Db, |
1158 |
|
3, {Assume UNICODE_FSS is really UTF8} |
1159 |
|
4: {Include GB18030 - assuming UTF8 routines work for this codeset} |
1160 |
|
if DisplayWidth = 0 then |
1161 |
+ |
{$if not defined(ValidUTF8String)} |
1162 |
+ |
Result := Utf8EscapeControlChars(TextToSingleLine(Result)) |
1163 |
+ |
{$else} |
1164 |
|
Result := ValidUTF8String(TextToSingleLine(Result)) |
1165 |
+ |
{$endif} |
1166 |
|
else |
1167 |
|
if UTF8Length(Result) > DisplayWidth then {Show truncation with elipses} |
1168 |
+ |
{$if not defined(ValidUTF8String)} |
1169 |
+ |
Result := Utf8EscapeControlChars(TextToSingleLine(UTF8Copy(Result,1,DisplayWidth-3))) + '...'; |
1170 |
+ |
{$else} |
1171 |
|
Result := ValidUTF8String(TextToSingleLine(UTF8Copy(Result,1,DisplayWidth-3))) + '...'; |
1172 |
+ |
{$endif} |
1173 |
|
end; |
1174 |
|
end |
1175 |
|
end; |
1420 |
|
inherited Create; |
1421 |
|
FDataSet := ADataSet; |
1422 |
|
FTimer := TFPTimer.Create(nil); |
1423 |
< |
FTimer.Enabled := true; |
1423 |
> |
FTimer.Enabled := false; |
1424 |
|
FTimer.Interval := 0; |
1425 |
|
FTimer.OnTimer := HandleRefreshTimer; |
1426 |
|
FDelayTimerValue := 0; |
1435 |
|
|
1436 |
|
procedure TIBDataLink.HandleRefreshTimer(Sender: TObject); |
1437 |
|
begin |
1438 |
< |
FTimer.StopTimer; |
1438 |
> |
FTimer.Enabled := false; |
1439 |
|
if FDataSet.Active then |
1440 |
|
FDataSet.RefreshParams; |
1441 |
|
end; |
1444 |
|
begin |
1445 |
|
if FDelayTimerValue = AValue then Exit; |
1446 |
|
FDelayTimerValue := AValue; |
1447 |
+ |
{$IF FPC_FULLVERSION >= 30002} |
1448 |
+ |
if (AValue > 0) and not IsMultiThread then |
1449 |
+ |
IBError(ibxeMultiThreadRequired,['TIBQuery/TIBDataset MasterDetailDelay']); |
1450 |
|
FTimer.Interval := FDelayTimerValue; |
1451 |
+ |
{$IFEND} |
1452 |
|
end; |
1453 |
|
|
1454 |
|
procedure TIBDataLink.ActiveChanged; |
1469 |
|
begin |
1470 |
|
{$IF FPC_FULLVERSION >= 30002} |
1471 |
|
if FDelayTimerValue > 0 then |
1472 |
< |
FTimer.StartTimer |
1472 |
> |
with FTimer do |
1473 |
> |
begin |
1474 |
> |
CheckSynchronize; {Ensure not waiting on Synchronize} |
1475 |
> |
if Enabled then |
1476 |
> |
begin |
1477 |
> |
StopTimer; |
1478 |
> |
StartTimer; |
1479 |
> |
end |
1480 |
> |
else |
1481 |
> |
Enabled := true; |
1482 |
> |
end |
1483 |
|
else |
1484 |
|
{$IFEND} |
1485 |
|
FDataSet.RefreshParams; |
5106 |
|
function TIBDataSetUpdateObject.GetRowsAffected( |
5107 |
|
var SelectCount, InsertCount, UpdateCount, DeleteCount: integer): boolean; |
5108 |
|
begin |
5109 |
+ |
Result := true; |
5110 |
|
SelectCount := 0; |
5111 |
|
InsertCount := 0; |
5112 |
|
UpdateCount := 0; |