Jump to content
Sign in to follow this  
IElite

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>

Share this post


Link to post
Share on other sites

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.

Share this post


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

Share this post


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

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 :)

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  

×