Jump to content


Photo

Alpha Release TW3Listbox?


  • Please log in to reply
7 replies to this topic

#1 ielite

ielite
  • Members
  • 723 posts

Posted 21 September 2017 - 06:17 PM


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

#2 ielite

ielite
  • Members
  • 723 posts

Posted 21 September 2017 - 09:06 PM

BTW, the Listbox demo does not compile in the new Alpha release. Has it even been updated? \Featured Demos\Forms & Components\ListBox Control



#3 jarto

jarto
  • Administrators
  • 72 posts
  • LocationVaasa, Finland
  • Enterprise Edition

Posted 22 September 2017 - 12:05 PM

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

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.
  • ielite likes this

#4 ielite

ielite
  • Members
  • 723 posts

Posted 22 September 2017 - 04:32 PM

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!!!
  • Czar, jarto, andreasp and 1 other like this

#5 Czar

Czar
  • Members
  • 165 posts

Posted 23 September 2017 - 09:17 AM

I total agree. Information on how to use SMS is scattered all over the internet.

#6 Dennis07

Dennis07
  • Administrators
  • 40 posts
  • LocationBerlin, Germany
  • Enterprise Edition

Posted 26 September 2017 - 12:14 AM

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 :)
  • Czar likes this

#7 ielite

ielite
  • Members
  • 723 posts

Posted 30 September 2017 - 08:48 PM

.

#8 Dennis07

Dennis07
  • Administrators
  • 40 posts
  • LocationBerlin, Germany
  • Enterprise Edition

Posted 12 October 2017 - 12:56 PM

.


Interesting... :D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users