Jump to content

Recommended Posts

  • Moderators

@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;


 

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...