Jump to content
Sign in to follow this  
lynkfs

kodi grid

Recommended Posts

@lennart posted a reference to a scrollable grid in Delphi Developer.

See post here.

Since he produced this grid in Smart Pascal, it might be of interest to forum members.

This grid basically takes items of irregular dimensions and determines how to best fit those items in rows/columns. 

The code he posted doesn't work in my (latest) version of Smart, but with a few tweaks here and there I got it going. 

At least for strings that is.  Icons/images are not fully implemented in the source he posted, but I'll take another look. Won't be too difficult.

I like the marching ants selection.

See demo.

 

  kodi := TWbIconView.Create(self);
  kodi.setbounds(10,10,500,500);

  //by way of demo : just split any sentence into words and use these as variable length cell items
  var s : string := #'This grid basically takes items of irregular dimensions and determines how to best fit those items in rows/columns.';
  var a : array of string := StrSplit(s,' ');
  for var i := 0 to a.length-1 do begin
    kodi.AddText(a[i]);
  end;


 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×