RE: SETTVTEXT bug and Fix
- Posted by Derek Parnell <Derek.Parnell at SYD.RABOBANK.COM> Jun 24, 2002
- 435 views
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01C21BD6.DCDDF440 charset=iso-8859-1 Thanks Jordah, however this is not actually a bug. It is quite deliberately done this way. The reason is that for TreeViews, it is possible that the item you are setting is not visible due to it being inside a collapsed parent item. To force each item set to take focus might not be a desirable thing. If one wants this effect though, you can do it by calling setFocus() after you set the item. Example: setText ( {myTreeView, itema}, "New Text for A") setText ( {myTreeView, itemb}, "New Text for B") setFocus( {myTreeView, itema}) ----------- Derek. > -----Original Message----- > From: jordah ferguson [mailto:jorfergie03 at yahoo.com] > Sent: Tuesday, 25 June 2002 2:43 > To: EUforum > Subject: SETTVTEXT bug and Fix > > > > Hi Derek, > > I found out there was a bug in win32libs setTVText(). Apparently > the text only changed when the treeview would receive the next > TVN_GETDISPINFO > message. Below is a fix that forces it to change without having to > wait for the TVN_GETDISPINFO message. > > > global procedure setTVText( integer iItem, sequence pNewText ) > -- Start Jordah Ferguson > atom TV_ITEM > -- End Jordah Fergusom > if iItem > 0 and iItem <= length(tvitem_data) then > release_mem(tvitem_data[iItem][ktv_TextAddr]) > tvitem_data[iItem][ktv_TextAddr] = acquire_mem(0, pNewText ) > tvitem_data[iItem][ktv_TextSize] = length(pNewText) > -- Start Jordah Ferguson > TV_ITEM = struct_TVITEM( TVIF_TEXT, tvitem_handle[iItem], 0, > 0, "", 0, > 0, 0, iItem) > VOID = sendMessage(tvitem_owner[iItem], TVM_SETITEM, 0, TV_ITEM ) > -- End Jordah Ferguson > end if > end procedure > > > Happy coding(should be debugging) and Success to Win32lib! > Cheers, > Jordah Ferguson aka Sir LoJik > > > > ================================================================== De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. ================================================================== The information contained in this message may be confidential and is intended to be exclusively for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. ================================================================== ------_=_NextPart_000_01C21BD6.DCDDF440 Content-Type: application/ms-tnef