Jump to content


Shaman

Member Since 21 Jan 2005
Offline Last Active Apr 22 2018 06:24 PM
-----

Posts I've Made

In Topic: RAD 2010 support

06 November 2009 - 08:32 PM

Hello Boki.

There are some suggestions for 2009-2010 versions of Delphi:
1. I don't understand why in
CODE
Windows.DrawText(Canvas.Handle, PAnsiChar(StringText), Length(StringText), ARect, Flags);

you use casting to PAnsiChar. Second parameter in DrawText has PWideChar type in Unicode versions of Delphi. PChar would be enough.

2. You can use CharInSet function when you check symbols instead of IN operator. Better way - using TCharacter class for standard tasks (IsNumber and so on), direct comparison for easy checks (... = '$') and real WideCharSet for complex checks (see DeHL for example).

3. CodeGear implements a warnings on the dangerous Thread.Suspend and Thread.Resume at last. You use those methods in not so harmful scenarios, but warnings are the evil.

Thanks.

In Topic: Next Grid - last edit

14 April 2009 - 09:37 PM

Hi.

EndEditing method helps me.

In Topic: Wrong ScrollBar Visibility

29 March 2009 - 10:29 AM

Hello Boki.

Example is very easy (See attachment. Run and change form height).

I search the trivial solution by changing the order of strings in GetClientCount:
CODE
function TNxCustomInspector.GetClientCount: Integer;
var
i, Y: Integer;
begin
Result := 0;
Y := 0;
for i := VertScrollBar.Position to Pred(FItems.NodesCount) do
begin
if not FItems.Node[i].Hidden then
begin

//Old strings:
// Inc(Result);
// Inc(Y, RowHeight + GetGridSpace);
// if Y > ClientHeight then Exit;

// New strings:
Inc(Y, RowHeight + GetGridSpace);
if Y > ClientHeight then Exit;
Inc(Result);

end;
end;
end;
Check this out, please.

Best regards.