Last time I checked the TListBox was working well. I'll look why was the internal list changed back to TStringList - it makes no sense. The TGtkListStringList was created and should be used as a counterpart to TListBoxStrings found in Delphi, which looks up the strings in the underlying Win32 list box. This way, the list box items are not held twice in memory. Since the TListBoxStrings is Win32 specific, hence the need for TGtkListStringList. Note that the TListBox only knows in has TStrings, it does not now about concrete descendant, which is determined in the interface object.
The same technique is used for items of TComboBox.
I'll try to fix it today for GTK. Other platform maintainers can just create plain TStringList in their interface objects, if they don't feel like interfacing with their own native GUI controls. I also check the crash, maybe this happens because the creation order of various things changed.
I am not sure about the Changed handler (you mean OnChange of TStrings?) but that should be pretty straightforward to implement.
About the OwnerDraw : I thought about this a long time, and still am not really sure how to implement this. Maybe we could recheck this once the TCanvas is propbably working, so that we can supply our own canvas for GTK. If you have any ideas what would be the best way, feel free to implement them or suggest something :-)
Regards,
Michal Bukovjan
"Shane Miller" wroteThe Listbox.Items.Add should notify the control that an item was added.
Once that occurs, a sendmessage is required to add the new item to the gtkListbox.
In windows, the Add calls a "Changed" message handler (Not actually sure
what it's called off hand). The changed message is passed to the highest level handler, which in this case would be TListbox. Once that occurs, TListbox would call a SendItemDlgMessage or one of those API calls to actually add the item to the "Windows" control. This needs to be done by us in the LCL. In our case, the sendmessage gets called, then in WIN32 case the API function gets called. In GTK's case it calls gtkobject.inc and it's handled there.
To update CVS, please simply post your new files to the borad (remember to
do a cvs update first so you have the latest changes merged into your code). Once we see your changes and test them we will eventually give you write access to the CVS tree.
Show quoted text 23 lines
and
Show quoted text 12 lines
the call to getitems should be used to get the items in the listbox. But initially the create of a blank TStringList seems to be correct.
When FItems is created as TStringList and you call then ListBox.Items.Add()
to put something into the listbox, it is only added to the StringList but not to the gtk widget, so you don't get any lines in your listbox. When FItems are
created as TGtkListStringList (not in TListBox.Create, that gives a crash,
but at first use), then ListBox.Items.Add() works as expected.
Show quoted text 13 lines
TListBox at this point. I am working on getting the editor up and running. The TListbox will be needed for this, but it's not a needed part at this point.
> > Feel free to look at it and find methods for improving/finishing the
TListbox. We need all the help we can get.
I'll check what I can do. I got the latest sources from CVS, could you let
me know what I have to do when I have some code ready to deliver?
Show quoted text 22 lines
____________________________________________________________________ Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.
