/[winpt]/trunk/Include/wptListView.h
ViewVC logotype

Diff of /trunk/Include/wptListView.h

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

revision 2 by twoaday, Mon Jan 31 11:02:21 2005 UTC revision 73 by twoaday, Tue Nov 8 07:15:13 2005 UTC
# Line 1  Line 1 
 /* wptListView.h - Dynamic list view control  
  *      Copyright (C) 2001-2005 Timo Schulz  
  *  
  * This file is part of WinPT.  
  *  
  * WinPT is free software; you can redistribute it and/or  
  * modify it under the terms of the GNU General Public License  
  * as published by the Free Software Foundation; either version 2  
  * of the License, or (at your option) any later version.  
  *    
  * WinPT is distributed in the hope that it will be useful,  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU  
  * General Public License for more details.  
  *  
  * You should have received a copy of the GNU General Public License  
  * along with WinPT; if not, write to the Free Software Foundation,  
  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA  
  */  
   
 #ifndef WPT_LISTVIEW_H  
 #define WPT_LISTVIEW_H  
   
 #define KEYLIST_SORT_DESC 0x8000  
   
 typedef int (CALLBACK *listview_cmp) (LPARAM lParam1, LPARAM lParam2,  
                                       LPARAM lParamSort);  
 struct listview_column_s {  
     int pos;  
     int width;  
     char *fieldname;  
 };  
 typedef struct listview_column_s * listview_column_t;  
   
 struct listview_ctrl_s {  
     HWND ctrl;  
     int cols;  
     int items;  
 };  
 typedef struct listview_ctrl_s * listview_ctrl_t;  
   
 int listview_new( listview_ctrl_t *ctx );  
 void listview_release( listview_ctrl_t ctx );  
 int listview_add_column( listview_ctrl_t ctx, listview_column_t col );  
 int listview_add_item( listview_ctrl_t ctx, const char *text );  
 int listview_add_item2( listview_ctrl_t ctx, const char * text, void * magic );  
 void listview_add_sub_item( listview_ctrl_t ctx, int pos, int col,  
                                                     const char *text );  
 int listview_count_items( listview_ctrl_t ctx, int curr_sel );  
 int listview_del_item( listview_ctrl_t ctx, int pos );  
 int listview_del_all( listview_ctrl_t ctx );  
 int listview_get_item_state( listview_ctrl_t ctx, int pos );  
 int listview_sort_items( listview_ctrl_t ctx, int sortby,  
                          listview_cmp sort_cb );  
 int listview_get_curr_pos( listview_ctrl_t ctx );  
 int listview_get_item_text (listview_ctrl_t ctx, int entry, int pos,  
                             char *text, int maxbytes);  
 void listview_set_ext_style( listview_ctrl_t ctx );  
 int listview_set_column_order( listview_ctrl_t ctx, int *array );  
 int listview_del_items( listview_ctrl_t ctx );  
 void listview_select_all( listview_ctrl_t ctx );  
   
 #endif /* WPT_LISTVIEW_H */  
1    /* wptListView.h - Dynamic list view control
2     *      Copyright (C) 2001-2005 Timo Schulz
3     *
4     * This file is part of WinPT.
5     *
6     * WinPT is free software; you can redistribute it and/or
7     * modify it under the terms of the GNU General Public License
8     * as published by the Free Software Foundation; either version 2
9     * of the License, or (at your option) any later version.
10     *  
11     * WinPT is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14     * General Public License for more details.
15     *
16     * You should have received a copy of the GNU General Public License
17     * along with WinPT; if not, write to the Free Software Foundation,
18     * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19     */
20    
21    #ifndef WPT_LISTVIEW_H
22    #define WPT_LISTVIEW_H
23    
24    #define KEYLIST_SORT_DESC 0x8000
25    
26    typedef int (CALLBACK *listview_cmp) (LPARAM lParam1, LPARAM lParam2,
27                                          LPARAM lParamSort);
28    struct listview_column_s {
29        int pos;
30        int width;
31        char *fieldname;
32    };
33    typedef struct listview_column_s * listview_column_t;
34    
35    struct listview_ctrl_s {
36        HWND ctrl;
37        int cols;
38        int items;
39    };
40    typedef struct listview_ctrl_s * listview_ctrl_t;
41    
42    int  listview_new( listview_ctrl_t *ctx );
43    void listview_release( listview_ctrl_t ctx );
44    int  listview_add_column( listview_ctrl_t ctx, listview_column_t col );
45    
46    int  listview_add_item( listview_ctrl_t ctx, const char *text );
47    int  listview_add_item2( listview_ctrl_t ctx, const char * text, void * magic );
48    void listview_add_sub_item( listview_ctrl_t ctx, int pos, int col,
49                                                        const char *text );
50    int listview_count_items( listview_ctrl_t ctx, int curr_sel );
51    int listview_del_item( listview_ctrl_t ctx, int pos );
52    int listview_del_all( listview_ctrl_t ctx );
53    int listview_get_item_state( listview_ctrl_t ctx, int pos );
54    int listview_sort_items( listview_ctrl_t ctx, int sortby,
55                             listview_cmp sort_cb );
56    int listview_get_curr_pos( listview_ctrl_t ctx );
57    int listview_get_item_text (listview_ctrl_t ctx, int entry, int pos,
58                                char *text, int maxbytes);
59    void listview_set_ext_style( listview_ctrl_t ctx );
60    int listview_set_column_order( listview_ctrl_t ctx, int *array );
61    int listview_del_items( listview_ctrl_t ctx );
62    void listview_select_all( listview_ctrl_t ctx );
63    
64    #endif /* WPT_LISTVIEW_H */

Legend:
Removed from v.2  
changed lines
  Added in v.73

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26