Changeset 3415 for trunk/src/comctl32/listview.cpp
- Timestamp:
- Apr 17, 2000, 7:04:14 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/listview.cpp
r3410 r3415 1 /*$Id: listview.cpp,v 1.1 5 2000-04-16 18:52:39cbratschi Exp $*/1 /*$Id: listview.cpp,v 1.16 2000-04-17 17:04:12 cbratschi Exp $*/ 2 2 /* 3 3 * Listview control … … 18 18 * - work area not used 19 19 * - custom draw 20 * - drag'n'drop (-> treeview )20 * - drag'n'drop (-> treeview (CCBase: need drag'n'dop framework)) 21 21 * - edit timer 22 22 * - LISTVIEW_SetBkImage … … 40 40 * 41 41 * Data structure: 42 * LISTVIEW_SetItemCount : not completed42 * LISTVIEW_SetItemCount : not implemented 43 43 * 44 44 * Status: all messages done, many styles not (yet) implemented … … 47 47 48 48 /* 49 Most identical with: 49 50 - Corel 20000317 level 50 51 - (WINE 20000130 level) … … 60 61 #include "ctype.h" 61 62 62 /* 63 * constants 64 */ 65 66 /* maximum size of a label */ 67 #define DISP_TEXT_SIZE 128 68 69 /* padding for items in list and small icon display modes */ 70 #define WIDTH_PADDING 12 71 72 /* padding for items in list, report and small icon display modes */ 73 #define HEIGHT_PADDING 1 74 75 /* offset of items in report display mode */ 76 #define REPORT_MARGINX 2 77 78 /* padding for icon in large icon display mode */ 79 #define ICON_TOP_PADDING 2 63 /* constants */ 64 65 #define DISP_TEXT_SIZE 128 // maximum size of a label 66 67 #define WIDTH_PADDING 12 // padding for items in list and small icon display modes 68 #define HEIGHT_PADDING 1 // padding for items in list, report and small icon display modes 69 #define REPORT_MARGINX 2 // offset of items in report display mode 70 #define ICON_TOP_PADDING 2 // padding for icon in large icon display mode 80 71 #define ICON_BOTTOM_PADDING 2 81 82 /* padding for label in large icon display mode */ 83 #define LABEL_VERT_OFFSET 2 84 85 /* default label width for items in list and small icon display modes */ 86 #define DEFAULT_LABEL_WIDTH 40 87 88 /* default column width for items in list display mode */ 89 #define DEFAULT_COLUMN_WIDTH 96 90 91 /* Increment size of the horizontal scroll bar */ 92 #define LISTVIEW_SCROLL_DIV_SIZE 1 93 94 #define DEFAULT_HOVERTIME 500 95 #define LV_ISEARCH_DELAY 1000 //documented in ListView_Message_Processing.htm 96 97 /* 98 * macros 99 */ 100 101 /* retrieve the number of items in the listview */ 102 #define GETITEMCOUNT(infoPtr) ((infoPtr)->hdpaItems->nItemCount) 103 104 HWND CreateEditLabel(LPCSTR text, DWORD style, INT x, INT y, 105 INT width, INT height, HWND parent, HINSTANCE hinst, 106 EditlblCallback EditLblCb, DWORD param); 107 72 #define LABEL_VERT_OFFSET 2 // padding for label in large icon display mode 73 #define DEFAULT_LABEL_WIDTH 40 // default label width for items in list and small icon display modes 74 #define DEFAULT_COLUMN_WIDTH 96 // default column width for items in list display mode 75 #define LISTVIEW_SCROLL_DIV_SIZE 1 // Increment size of the horizontal scroll bar 76 #define DEFAULT_HOVERTIME 500 // hover delay 77 #define LV_ISEARCH_DELAY 1000 // documented in ListView_Message_Processing.htm 78 79 /* macros */ 80 81 #define GETITEMCOUNT(infoPtr) ((infoPtr)->hdpaItems->nItemCount) // retrieve the number of items in the listview 108 82 #define LISTVIEW_GetInfoPtr(hwnd) ((LISTVIEW_INFO*)getInfoPtr(hwnd)) 109 83 110 /* 111 * forward declarations 112 */ 84 /* forward declarations */ 85 86 HWND CreateEditLabel(LPCSTR text,DWORD style,INT x,INT y,INT width,INT height,HWND parent,HINSTANCE hinst,EditlblCallback EditLblCb,DWORD param); 113 87 114 88 static INT LISTVIEW_HitTestItem(HWND, LPLVHITTESTINFO); … … 116 90 static INT LISTVIEW_GetCountPerRow(HWND); 117 91 static INT LISTVIEW_GetCountPerColumn(HWND); 118 static VOID LISTVIEW_AlignLeft(HWND);119 static VOID LISTVIEW_AlignTop(HWND);120 static VOID LISTVIEW_AddGroupSelection(HWND, INT);121 static VOID LISTVIEW_AddSelection(HWND, INT);122 92 static LISTVIEW_ITEMDATA* LISTVIEW_GetItemData(HDPA hdpaSubItems,INT nSubItem); 123 static INT LISTVIEW_FindInsertPosition(HDPA, INT);124 static INT LISTVIEW_GetItemHeight(HWND);125 93 static BOOL LISTVIEW_GetItemPosition(HWND, INT, LPPOINT); 126 94 static LRESULT LISTVIEW_GetItemRect(HWND hwnd,INT nItem,LPRECT lprc,INT code); 127 static INT LISTVIEW_GetItemWidth(HWND);128 95 static INT LISTVIEW_GetLabelWidth(HWND,INT,INT); 129 96 static LRESULT LISTVIEW_GetOrigin(HWND, LPPOINT); 130 static INT LISTVIEW_CalculateWidth(HWND hwnd, INT nItem);131 97 static LRESULT LISTVIEW_GetViewRect(HWND, LPRECT); 132 static BOOL LISTVIEW_InitItem(HWND, LISTVIEW_ITEM *, LPLVITEMW,BOOL);133 static LRESULT LISTVIEW_MouseSelection(HWND, POINT);134 static BOOL LISTVIEW_RemoveColumn(HDPA, INT);135 98 static VOID LISTVIEW_RemoveSelections(HWND, INT, INT); 136 99 static BOOL LISTVIEW_RemoveItemData(HDPA,INT); 137 static VOID LISTVIEW_SetGroupSelection(HWND, INT);138 static LRESULT LISTVIEW_SetItem(HWND, LPLVITEMW,BOOL);139 100 static BOOL LISTVIEW_SetItemFocus(HWND, INT); 140 101 static BOOL LISTVIEW_SetItemPosition(HWND,INT,INT,INT,BOOL); 141 static VOID LISTVIEW_UpdateScroll(HWND);142 static VOID LISTVIEW_SetSelection(HWND, INT);143 102 static VOID LISTVIEW_UpdateSize(HWND); 144 static BOOL LISTVIEW_SetSubItem(HWND, LPLVITEMW,BOOL);145 103 static LRESULT LISTVIEW_SetViewRect(HWND, LPRECT); 146 static BOOL LISTVIEW_ToggleSelection(HWND, INT);147 static HWND LISTVIEW_EditLabel(HWND hwnd,INT nItem,BOOL unicode);148 static BOOL LISTVIEW_EndEditLabel(HWND hwnd,LPSTR pszText,DWORD nItem,BOOL cancel);149 static LRESULT LISTVIEW_Command(HWND hwnd, WPARAM wParam, LPARAM lParam);150 static LRESULT LISTVIEW_SortItems(HWND hwnd, WPARAM wParam, LPARAM lParam);151 104 static LRESULT LISTVIEW_GetItem(HWND hwnd,LPLVITEMW lpLVItem,BOOL unicode,BOOL internal); 152 105 static INT LISTVIEW_GetTopIndex(HWND hwnd); … … 156 109 static BOOL LISTVIEW_EnsureVisible(HWND hwnd,INT nItem,BOOL bPartial); 157 110 static VOID LISTVIEW_UpdateHeaderSize(HWND hwnd,INT nNewScrollPos,INT xScroll); 111 112 /* code */ 158 113 159 114 static VOID LISTVIEW_Refresh(HWND hwnd)
Note:
See TracChangeset
for help on using the changeset viewer.