- }
-
- if ( tvItem.mask & TVIF_TEXT )
- {
- info.m_mask |= wxTREE_MASK_TEXT;
- info.m_text = tvItem.pszText;
- }
- if ( tvItem.mask & TVIF_IMAGE )
- {
- info.m_mask |= wxTREE_MASK_IMAGE;
- info.m_image = tvItem.iImage;
- }
- if ( tvItem.mask & TVIF_SELECTEDIMAGE )
- {
- info.m_mask |= wxTREE_MASK_SELECTED_IMAGE;
- info.m_selectedImage = tvItem.iSelectedImage;
- }
- if ( tvItem.mask & TVIF_CHILDREN )
- {
- info.m_mask |= wxTREE_MASK_CHILDREN;
- info.m_children = tvItem.cChildren;
- }
- if ( tvItem.mask & TVIF_PARAM )
- info.m_mask |= wxTREE_MASK_DATA;
-
- if (needText)
- {
- if (tvItem.pszText)
- delete[] tvItem.pszText;
- }
- tvItem.mask = oldMask ;
-}
-
-static void wxConvertToMSWTreeItem(wxTreeItem& info, TV_ITEM& tvItem)
-{
- tvItem.hItem = (HTREEITEM) info.m_itemId ;
-
- tvItem.iImage = info.m_image ;
- tvItem.iSelectedImage = info.m_selectedImage;
- tvItem.cChildren = info.m_children;
- tvItem.lParam = info.m_data;
- tvItem.mask = 0;
- tvItem.stateMask = 0;
- tvItem.state = 0;
-
- if (info.m_mask & wxTREE_MASK_HANDLE)
- tvItem.mask |= TVIF_HANDLE ;
- if (info.m_mask & wxTREE_MASK_STATE)
- tvItem.mask |= TVIF_STATE ;
- if (info.m_mask & wxTREE_MASK_TEXT)
- {
- tvItem.mask |= TVIF_TEXT ;
- tvItem.pszText = (char *) (const char *)info.m_text ;
- if ( tvItem.pszText )
- tvItem.cchTextMax = info.m_text.Length();
- else
- tvItem.cchTextMax = 0;
- }
- if (info.m_mask & wxTREE_MASK_IMAGE)
- tvItem.mask |= TVIF_IMAGE ;
- if (info.m_mask & wxTREE_MASK_SELECTED_IMAGE)
- tvItem.mask |= TVIF_SELECTEDIMAGE ;
- if (info.m_mask & wxTREE_MASK_CHILDREN)
- tvItem.mask |= TVIF_CHILDREN ;
- if (info.m_mask & wxTREE_MASK_DATA)
- tvItem.mask |= TVIF_PARAM ;
-
- if (info.m_stateMask & wxTREE_STATE_BOLD)
- {
- tvItem.stateMask |= TVIS_BOLD ;
- tvItem.state |= TVIS_BOLD;
- }
- if (info.m_stateMask & wxTREE_STATE_CUT)
- {
- tvItem.stateMask |= TVIS_CUT ;
- if ( info.m_state & wxTREE_STATE_CUT )
- tvItem.state |= TVIS_CUT;
- }
- if (info.m_stateMask & wxTREE_STATE_DROPHILITED)
- {
- tvItem.stateMask |= TVIS_DROPHILITED;
- if ( info.m_state & wxTREE_STATE_DROPHILITED )
- tvItem.state |= TVIS_DROPHILITED;
- }
- if (info.m_stateMask & wxTREE_STATE_EXPANDED)
- {
- tvItem.stateMask |= TVIS_EXPANDED;
- if ( info.m_state & wxTREE_STATE_EXPANDED )
- tvItem.state |= TVIS_EXPANDED;
- }
- if (info.m_stateMask & wxTREE_STATE_EXPANDEDONCE)
- {
- tvItem.stateMask |= TVIS_EXPANDEDONCE;
- if ( info.m_state & wxTREE_STATE_EXPANDEDONCE )
- tvItem.state |= TVIS_EXPANDEDONCE;
- }
- if (info.m_stateMask & wxTREE_STATE_FOCUSED)
- {
- tvItem.stateMask |= TVIS_FOCUSED;
- if ( info.m_state & wxTREE_STATE_FOCUSED )
- tvItem.state |= TVIS_FOCUSED;
- }
- if (info.m_stateMask & wxTREE_STATE_SELECTED)
- {
- tvItem.stateMask |= TVIS_SELECTED;
- if ( info.m_state & wxTREE_STATE_SELECTED )
- tvItem.state |= TVIS_SELECTED;
- }