Jacek Caban : hhctrl.ocx: Fill content tree.
Module: wine Branch: master Commit: e9654359664c105fc0c96813763aa1f8f903002d URL: http://source.winehq.org/git/wine.git/?a=commit;h=e9654359664c105fc0c9681376... Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Feb 28 04:00:00 2007 +0100 hhctrl.ocx: Fill content tree. --- dlls/hhctrl.ocx/content.c | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/dlls/hhctrl.ocx/content.c b/dlls/hhctrl.ocx/content.c index b646868..093e6cd 100644 --- a/dlls/hhctrl.ocx/content.c +++ b/dlls/hhctrl.ocx/content.c @@ -351,6 +351,34 @@ static ContentItem *parse_hhc(HHInfo *info, IStream *str, insert_type_t *insert_ return ret; } +static void insert_content_item(HWND hwnd, ContentItem *parent, ContentItem *item) +{ + TVINSERTSTRUCTW tvis; + + memset(&tvis, 0, sizeof(tvis)); + tvis.u.item.mask = TVIF_TEXT|TVIF_PARAM; + tvis.u.item.cchTextMax = strlenW(item->name)+1; + tvis.u.item.pszText = item->name; + tvis.u.item.lParam = (LPARAM)item; + tvis.hParent = parent ? parent->id : 0; + tvis.hInsertAfter = TVI_LAST; + + item->id = (HTREEITEM)SendMessageW(hwnd, TVM_INSERTITEMW, 0, (LPARAM)&tvis); +} + +static void fill_content_tree(HWND hwnd, ContentItem *parent, ContentItem *item) +{ + while(item) { + if(item->name) { + insert_content_item(hwnd, parent, item); + fill_content_tree(hwnd, item, item->child); + }else { + fill_content_tree(hwnd, parent, item->child); + } + item = item->next; + } +} + static void set_item_parents(ContentItem *parent, ContentItem *item) { while(item) { @@ -380,6 +408,7 @@ void InitContent(HHInfo *info) IStream_Release(stream); set_item_parents(NULL, info->content); + fill_content_tree(info->tabs[TAB_CONTENTS].hwnd, NULL, info->content); } static void free_content_item(ContentItem *item)
participants (1)
-
Alexandre Julliard