/[winpt]/trunk/Src/wptListView.cpp
ViewVC logotype

Diff of /trunk/Src/wptListView.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 48 by werner, Mon Oct 31 21:14:11 2005 UTC revision 121 by twoaday, Mon Dec 12 11:19:56 2005 UTC
# Line 22  Line 22 
22  #include <config.h>  #include <config.h>
23  #endif  #endif
24    
 #ifdef __MINGW32__  
 #include <w32api.h>  
 #define _WIN32_IE IE401  
 #endif  
   
 #include <stdio.h>  
25  #include <stdio.h>  #include <stdio.h>
26  #include <windows.h>  #include <windows.h>
27  #include <commctrl.h>  #include <commctrl.h>
# Line 319  listview_select_all (listview_ctrl_t ctx Line 313  listview_select_all (listview_ctrl_t ctx
313    
314    
315  void  void
316    listview_deselect_all (listview_ctrl_t ctx)
317    {
318        ListView_SetItemState (ctx->ctrl, -1, ~LVNI_SELECTED, LVNI_SELECTED);
319    }
320    
321    
322    void
323  listview_select_one (listview_ctrl_t ctx, int pos)  listview_select_one (listview_ctrl_t ctx, int pos)
324  {  {
325      ListView_SetItemState (ctx->ctrl, pos, LVIS_SELECTED|LVIS_FOCUSED, LVIS_FOCUSED|LVIS_SELECTED);      ListView_SetItemState (ctx->ctrl, pos, LVIS_SELECTED|LVIS_FOCUSED, LVIS_FOCUSED|LVIS_SELECTED);
# Line 350  listview_find (listview_ctrl_t ctx, cons Line 351  listview_find (listview_ctrl_t ctx, cons
351      return pos;      return pos;
352  }  }
353    
 /** Some functions to make the handling with TreeView Controls easier **/  
 int  
 treeview_add_item( HWND tree, HTREEITEM parent, const char *text )  
 {        
     TVINSERTSTRUCT tvis;  
           
     memset( &tvis, 0, sizeof tvis );  
     tvis.hParent = parent;  
     tvis.hInsertAfter = TVI_LAST;  
     tvis.item.mask = TVIF_TEXT;  
     tvis.item.pszText = (char *)text;  
     TreeView_InsertItem( tree, &tvis );  
   
     return 0;  
 } /* treeview_add_item */  

Legend:
Removed from v.48  
changed lines
  Added in v.121

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26