Jump to content

Alpha Release TW3Listbox?


Recommended Posts

 

<p>

I can add items to a listbox with the following code:

 

procedure TForm1.InitializeObject;

begin

inherited;

{$I 'Form1:impl'}

for var I:= 1 to 10 do

begin

var lbitem:= W3ListBox1.Items[W3ListBox1.Add] as TW3ListBoxItem;

lbitem.Caption:= inttostr(I);

end;

end;

 

How do I add my own custom class (e.g. TMyListboxItem)? When I do the following:

 

W3ListBox1.ItemClass:= TListBoxItem;

for var I:= 1 to 10 do

begin

var lbitem:= W3ListBox1.Items[W3ListBox1.Add] as TListBoxItem;

lbitem.Text:= inttostr(I);

end;

 

 

I get a typecast error

 

</p>

Link to post
Share on other sites
  • Administrators

First of all, that "ListBox Control" demo is done with the old ListBox. So it doesn't work. Out of Featured demos, the TabControl, Scrolling and ListBoxes -demo uses the new controls and is a nice, simple example.

 

This post also explains how to use the new ListBox: https://www.facebook.com/SmartMobileStudio/posts/1600674109995939

 

Normal usage:

 

ListBox.BeginUpdate;

try

for a:=0 to 500 do

ListBox.Add('Line number '+IntToStr(a));

finally

ListBox.EndUpdate;

end;

 

If you use your own TMyListboxItem:

 

Item:=ListBox.AddItem('Text you want');

Then use: Item.TagValue or Item.TagObject for pointing to your own internal information, that you use while filling any information in TMyListboxItem.

 

And set ListBox.OnShowItem into a procedure, which actually fills TMyListboxItem with proper values.

Link to post
Share on other sites

Thanks, that is what i was looking for.....but social media should only be a shared resource of what is on this site. Why isn't this important information posted here on this sites BLOG and then shared to social media? When people purchase from this site, they expect to come back to this site for the goodies too . We shouldn't have to rely on Facebook!!!

Link to post
Share on other sites
  • Administrators

Thanks, that is what i was looking for.....but social media should only be a shared resource of what is on this site. Why isn't this important information posted here on this sites BLOG and then shared to social media? When people purchase from this site, they expect to come back to this site for the goodies too . We shouldn't have to rely on Facebook!!!

True, and you are right: This is something we should have done, but unfortunately we've missed it due to our strict and tight time table we have at the moment. As wished by our community and by so many of our customers, it's No. 1 priority at the moment to publish the update, and we're doing our very best to get this done the best possible way as soon as possible. Please excuse, if this sometimes means we're just not getting some of the stuff done the way that would be best to do. At least we're trying to re-activate this forum once again to offer you the best possible support for SMS :)

Link to post
Share on other sites
  • 2 weeks later...

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...