MustangpeakEasyListview

Today I got a pull request from a user for the MustangpeakEasyListview component. There was an issue that the context menu did not disappear after clicking on an item. The issue is now fixed.

Posted in Delphi, RAD Studio 11 Alexandria, TurboPack | Comments Off on MustangpeakEasyListview

SysTools

I received a pull request for the SysTools library. This request includes full support for Lazarus. I’m really impressed and say many thanks for this great work!

Posted in C++-Builder, Delphi, RAD Studio 11 Alexandria, TurboPack | Comments Off on SysTools

Abbrevia

As I often mentioned I’m maintaining the TurboPack components in my spare time. Today I fixed an issue in Abbrevia. There was a problem compiling under POSIX.

Posted in C++-Builder, Delphi, FireMonkey, RAD Studio 11 Alexandria, TurboPack | Comments Off on Abbrevia

LockBox3

I just compiled the LockBox3 library for the different platforms Widows32, Windows64, macOS64 Intel, macOS64 ARM, Linux64, iOS64, Android32 and Android 64. It is incredible how powerful RAD Studio 11 Alexandria is.

Posted in Delphi, RAD Studio 11 Alexandria, TurboPack, Uncategorized | Comments Off on LockBox3

PNG Components

Today I also fixed two hints in the PNG Components library. I never used them in a real application so that I cannot say if I can recommend them or not.

Posted in C++-Builder, Delphi, RAD Studio 11 Alexandria, TurboPack | Comments Off on PNG Components

OnGuard FMX

After a long time I found some time and fixed an issue in the TurboPack component OnGuard FMX. As usual I can only recommend this library for legacy projects, but anyway I hope I could help this user.

Posted in C++-Builder, Delphi, RAD Studio 11 Alexandria, TurboPack | Comments Off on OnGuard FMX

UltraEdit

Maybe most of you already heard it but Idera has acquired UltraEdit!

I’m using UltraEdit for many years. It is a very powerful text editor which many features. I mostly like the hex editor.

Anyway, maybe in the future UltraEdit will be written in Delphi. 😉

Posted in Delphi, Tips and Tricks, Uncategorized | Comments Off on UltraEdit

TMS Web Core v1.8 Sirolo is released

Last week the new TMS Web Core Sirolo has been released. As always the release has been named after a stop of the famous Mille Miglia rally back in 1955. Sirolo is a beautiful town in Italy, located at the Adriatic coast.

But anyway, let’s come back to the technical stuff: The most important new feature of Sirolo is the multi-platform support for Miletus. As many of you already know, Miletus is a HTML, CSS and JavaScript based Desktop framework. This wonderful framework is now available for Win32, Win64, macOS and Linux. As I already described in former posts, it is possible to write so-called Hybrid TMS Web Core applications, that now run as a regular Web, PJU, Electron and Miletus application. I would say that now there is something for everyone! 🙂

Posted in CSS, Delphi, HTML, JavaScript, TMS Software, TMS Web Core | Comments Off on TMS Web Core v1.8 Sirolo is released

TBytesStream

I guess that you all already worked with a TBytesStream. It is derived from a TMemoryStream and offers direct access to the underlying TBytes:

  
...
TBytesStream = class(TMemoryStream)
  private
  ...
    property Bytes: TBytes read FBytes;
  end;
...

So far so good, the problem is that a TMemoryStream allocates more memory than the current Size. The reason is that not necessary to realloc memory for every write operation. You can see this in the Realloc method

...
const
  MemoryDelta = $2000; { Must be a power of 2 }
...
function TBytesStream.Realloc(var NewCapacity: Longint): Pointer;
begin
  if (NewCapacity > 0) and (NewCapacity <> FSize) then
    NewCapacity := (NewCapacity + (MemoryDelta - 1)) and not (MemoryDelta - 1);
  Result := Pointer(FBytes);
  if NewCapacity <> FCapacity then
  begin
    SetLength(FBytes, NewCapacity);
    Result := Pointer(FBytes);
  ...
  end;
end;
...

As you can see the NewCapacity is larger than the Size of the Stream. If you look deeper at the code you can see that the NewCapacity is of power of 2.

But anyway, the point is that the property Bytes can include more bytes than the Size of the Stream. That’s why you must be very careful if you want to access directly to the Bytes property.

In order to avoid any issues I created a record helper for TBytes with the property BytesReal that includes the used bytes:

...
  TBytesStreamHelper = class helper for TBytesStream
  strict private
    function get_BytesReal: TBytes; 
  public
    property BytesReal: TBytes read get_BytesReal;
  end;
...
function TBytesStreamHelper.get_BytesReal: TBytes;
begin
  if Capacity > Size then
    Result := Copy(Bytes, 0, Size)
  else
    Result := Bytes;
end;
...

If you like than add the TBytesStreamHelper to your project and use the new property BytesReal.
 

Posted in Delphi, RAD Studio 10.4 Sydney, Tips and Tricks, Uncategorized | Comments Off on TBytesStream

Improved the Demo for Web Application

Today we updated our TMS Web Core demo application. If you are interested to see it, don’t hesitate to contact us.

Posted in Uncategorized | Comments Off on Improved the Demo for Web Application