/[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 173 by twoaday, Wed Jan 18 11:52:45 2006 UTC revision 174 by twoaday, Thu Feb 2 08:20:50 2006 UTC
# Line 49  listview_new (listview_ctrl_t *ctx) Line 49  listview_new (listview_ctrl_t *ctx)
49      c->items = 0;      c->items = 0;
50      c->ctrl = NULL;      c->ctrl = NULL;
51      c->hil = NULL;      c->hil = NULL;
52        c->ext_chkbox = 0;
53      *ctx = c;      *ctx = c;
54      return 0;      return 0;
55  } /* listview_new */  }
56    
57    
58  void  void
# Line 247  listview_del_all_items (listview_ctrl_t Line 248  listview_del_all_items (listview_ctrl_t
248  }  }
249    
250    
251    /* Return if the given element is selected or if the ext
252       style is used, if the checkbox is activated. */
253  int  int
254  listview_get_item_state( listview_ctrl_t ctx, int pos )  listview_get_item_state (listview_ctrl_t ctx, int pos)
255  {        {
256      return ListView_GetItemState( ctx->ctrl, pos, LVIS_SELECTED );      int ret;
257  } /* listview_get_item_state */      if (ctx->ext_chkbox)
258            ret = ListView_GetCheckState (ctx->ctrl, pos);
259        else
260            ret = ListView_GetItemState (ctx->ctrl, pos, LVIS_SELECTED);
261        return ret;
262    }
263    
264    
265  int  int
# Line 321  listview_get_item_text (listview_ctrl_t Line 329  listview_get_item_text (listview_ctrl_t
329  } /* listview_get_item_text */  } /* listview_get_item_text */
330    
331    
332    /* Use extended style with checkboxes for each item. */
333    void
334    listview_set_chkbox_style (listview_ctrl_t ctx)
335    {
336        ListView_SetExtendedListViewStyle (ctx->ctrl, LVS_EX_CHECKBOXES);
337        ctx->ext_chkbox = 1;
338    }
339    
340    
341    /* Use extended style to select the entire row. */
342  void  void
343  listview_set_ext_style( listview_ctrl_t ctx )  listview_set_ext_style (listview_ctrl_t ctx)
344  {        {      
345      ListView_SetExtendedListViewStyle( ctx->ctrl, LVS_EX_FULLROWSELECT );      ListView_SetExtendedListViewStyle (ctx->ctrl, LVS_EX_FULLROWSELECT);
346  } /* listview_set_ext_style */  }
347    
348    
349  int  int

Legend:
Removed from v.173  
changed lines
  Added in v.174

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26