listview_helper.h

Go to the documentation of this file.
00001 namespace listview_helper
00002 {
00003         unsigned insert_item(HWND p_listview,unsigned p_index,const char * p_name,LPARAM p_param);//returns index of new item on success, infinite on failure
00004 
00005         unsigned insert_column(HWND p_listview,unsigned p_index,const char * p_name,unsigned p_width_dlu);//returns index of new item on success, infinite on failure
00006 
00007         bool set_item_text(HWND p_listview,unsigned p_index,unsigned p_column,const char * p_name);
00008 
00009         bool is_item_selected(HWND p_listview,unsigned p_index);
00010 
00011         void set_item_selection(HWND p_listview,unsigned p_index,bool p_state);
00012 
00013         bool select_single_item(HWND p_listview,unsigned p_index);
00014 
00015         bool ensure_visible(HWND p_listview,unsigned p_index);
00016 
00017         void get_item_text(HWND p_listview,unsigned p_index,unsigned p_column,pfc::string_base & p_out);
00018 
00019 };
00020 
00021 static int ListView_GetFirstSelection(HWND p_listview) {
00022         return ListView_GetNextItem(p_listview,-1,LVNI_SELECTED);
00023 }
00024 
00025 static int ListView_GetSingleSelection(HWND p_listview) {
00026         if (ListView_GetSelectedCount(p_listview) != 1) return -1;
00027         return ListView_GetFirstSelection(p_listview);
00028 }
00029 
00030 static int ListView_GetFocusItem(HWND p_listview) {
00031         return ListView_GetNextItem(p_listview,-1,LVNI_FOCUSED);
00032 }
00033 
00034 static bool ListView_IsItemSelected(HWND p_listview,int p_index) {
00035         return ListView_GetItemState(p_listview,p_index,LVIS_SELECTED) != 0;
00036 }
00037 
00038 void ListView_GetContextMenuPoint(HWND p_list,LPARAM p_coords,POINT & p_point,int & p_selection);
00039 
00040 int ListView_GetColumnCount(HWND listView);

Generated on Fri Apr 25 18:49:33 2008 for foobar2000 SDK by  doxygen 1.5.5