/[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 36 by werner, Thu Oct 27 15:25:13 2005 UTC revision 129 by twoaday, Fri Dec 30 13:56:10 2005 UTC
# Line 18  Line 18 
18   * along with WinPT; if not, write to the Free Software Foundation,   * along with WinPT; if not, write to the Free Software Foundation,
19   * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA   * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20   */   */
21    
22  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
23  #include <config.h>  #include <config.h>
24  #endif  #endif
25    
26  #include <stdio.h>  #include <stdio.h>
 #include <stdio.h>  
27  #include <windows.h>  #include <windows.h>
28  #include <commctrl.h>  #include <commctrl.h>
29    
# Line 34  Line 34 
34  #include "wptTypes.h"  #include "wptTypes.h"
35  #include "wptGPG.h"  #include "wptGPG.h"
36  #include "wptKeylist.h"  #include "wptKeylist.h"
37  #include "../resource.h"  #include "resource.h"
38    
39    
40  int  int
# Line 182  listview_count_items( listview_ctrl_t ct Line 182  listview_count_items( listview_ctrl_t ct
182    
183    
184  int  int
185    listview_del_column (listview_ctrl_t ctx, int pos)
186    {
187        ctx->cols--;
188        return ListView_DeleteColumn (ctx->ctrl, pos)? 0 : 1;
189    }
190    
191    
192    int
193  listview_del_item( listview_ctrl_t ctx, int pos )  listview_del_item( listview_ctrl_t ctx, int pos )
194  {  {
195      int rc = 0;      int rc = 0;
# Line 314  listview_select_all (listview_ctrl_t ctx Line 322  listview_select_all (listview_ctrl_t ctx
322    
323    
324  void  void
325    listview_deselect_all (listview_ctrl_t ctx)
326    {
327        ListView_SetItemState (ctx->ctrl, -1, ~LVNI_SELECTED, LVNI_SELECTED);
328    }
329    
330    
331    void
332  listview_select_one (listview_ctrl_t ctx, int pos)  listview_select_one (listview_ctrl_t ctx, int pos)
333  {  {
334      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 345  listview_find (listview_ctrl_t ctx, cons Line 360  listview_find (listview_ctrl_t ctx, cons
360      return pos;      return pos;
361  }  }
362    
 /** 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 );  
363    
364      return 0;  void
365  } /* treeview_add_item */  listview_setview (listview_ctrl_t ctx, DWORD view)
366    {
367        DWORD style = GetWindowLong (ctx->ctrl, GWL_STYLE);
368        if ((style & LVS_TYPEMASK) != view)
369            SetWindowLong (ctx->ctrl, GWL_STYLE, (style & ~LVS_TYPEMASK) | view);
370    }

Legend:
Removed from v.36  
changed lines
  Added in v.129

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26