Mercurial > dwindows
comparison win/dw.c @ 863:b405182033a0
Removed leftover code from _HandleScroller copied incorrectly when debugging.
author | mhessling@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 03 Apr 2011 05:53:44 +0000 |
parents | 9750236bcdd5 |
children | 379b7e8c5c1c |
comparison
equal
deleted
inserted
replaced
862:9750236bcdd5 | 863:b405182033a0 |
---|---|
1375 int cy = height + vectory; | 1375 int cy = height + vectory; |
1376 int usedx = 0, usedy = 0, usedpadx = 0, usedpady = 0, depth = 0; | 1376 int usedx = 0, usedy = 0, usedpadx = 0, usedpady = 0, depth = 0; |
1377 Box *thisbox = (Box *)GetWindowLongPtr(cinfo->combo, GWLP_USERDATA); | 1377 Box *thisbox = (Box *)GetWindowLongPtr(cinfo->combo, GWLP_USERDATA); |
1378 SCROLLINFO hsi, vsi; | 1378 SCROLLINFO hsi, vsi; |
1379 RECT rect; | 1379 RECT rect; |
1380 | 1380 |
1381 vsi.cbSize = hsi.cbSize = sizeof(SCROLLINFO); | 1381 vsi.cbSize = hsi.cbSize = sizeof(SCROLLINFO); |
1382 vsi.fMask = hsi.fMask = SIF_POS; | 1382 vsi.fMask = hsi.fMask = SIF_POS; |
1383 | 1383 |
1384 /* Save the current scroll positions */ | 1384 /* Save the current scroll positions */ |
1385 GetScrollInfo(handle, SB_HORZ, &hsi); | 1385 GetScrollInfo(handle, SB_HORZ, &hsi); |
1393 cy = rect.bottom; | 1393 cy = rect.bottom; |
1394 | 1394 |
1395 | 1395 |
1396 /* Get the required space for the box */ | 1396 /* Get the required space for the box */ |
1397 _resize_box(thisbox, &depth, cx, cy, &usedx, &usedy, 1, &usedpadx, &usedpady); | 1397 _resize_box(thisbox, &depth, cx, cy, &usedx, &usedy, 1, &usedpadx, &usedpady); |
1398 | 1398 |
1399 if(cx < usedx) | 1399 if(cx < usedx) |
1400 { | 1400 { |
1401 cx = usedx; | 1401 cx = usedx; |
1402 } | 1402 } |
1403 if(cy < usedy) | 1403 if(cy < usedy) |
1549 si.cbSize = sizeof(SCROLLINFO); | 1549 si.cbSize = sizeof(SCROLLINFO); |
1550 si.fMask = SIF_ALL; | 1550 si.fMask = SIF_ALL; |
1551 | 1551 |
1552 SendMessage(handle, SBM_GETSCROLLINFO, 0, (LPARAM)&si); | 1552 SendMessage(handle, SBM_GETSCROLLINFO, 0, (LPARAM)&si); |
1553 | 1553 |
1554 ZeroMemory( &si, sizeof(si) ); | |
1555 si.cbSize = sizeof(SCROLLINFO); | |
1556 si.fMask = SIF_ALL; | |
1557 | |
1558 switch(which) | 1554 switch(which) |
1559 { | 1555 { |
1560 case SB_THUMBTRACK: | 1556 case SB_THUMBTRACK: |
1561 return pos; | 1557 return pos; |
1562 /*case SB_PAGEDOWN:*/ | 1558 /*case SB_PAGEUP:*/ |
1563 case SB_PAGELEFT: | 1559 case SB_PAGELEFT: |
1564 pos = si.nPos - si.nPage; | 1560 pos = si.nPos - si.nPage; |
1565 if(pos < si.nMin) | 1561 if(pos < si.nMin) |
1566 pos = si.nMin; | 1562 pos = si.nMin; |
1567 return pos; | 1563 return pos; |
1568 /*case SB_PAGEUP:*/ | 1564 /*case SB_PAGEDOWN:*/ |
1569 case SB_PAGERIGHT: | 1565 case SB_PAGERIGHT: |
1570 pos = si.nPos + si.nPage; | 1566 pos = si.nPos + si.nPage; |
1571 if(pos > (si.nMax - si.nPage) + 1) | 1567 if(pos > (si.nMax - si.nPage) + 1) |
1572 pos = (si.nMax - si.nPage) + 1; | 1568 pos = (si.nMax - si.nPage) + 1; |
1573 return pos; | 1569 return pos; |
1574 /*case SB_LINEDOWN:*/ | 1570 /*case SB_LINEUP:*/ |
1575 case SB_LINELEFT: | 1571 case SB_LINELEFT: |
1576 pos = si.nPos - 1; | 1572 pos = si.nPos - 1; |
1577 if(pos < si.nMin) | 1573 if(pos < si.nMin) |
1578 pos = si.nMin; | 1574 pos = si.nMin; |
1579 return pos; | 1575 return pos; |
1580 /*case SB_LINEUP:*/ | 1576 /*case SB_LINEDOWN:*/ |
1581 case SB_LINERIGHT: | 1577 case SB_LINERIGHT: |
1582 pos = si.nPos + 1; | 1578 pos = si.nPos + 1; |
1583 if(pos > (si.nMax - si.nPage) + 1) | 1579 if(pos > (si.nMax - si.nPage) + 1) |
1584 pos = (si.nMax - si.nPage) + 1; | 1580 pos = (si.nMax - si.nPage) + 1; |
1585 return pos; | 1581 return pos; |
7827 */ | 7823 */ |
7828 void API dw_filesystem_set_file(HWND handle, void *pointer, int row, char *filename, HICN icon) | 7824 void API dw_filesystem_set_file(HWND handle, void *pointer, int row, char *filename, HICN icon) |
7829 { | 7825 { |
7830 LV_ITEM lvi; | 7826 LV_ITEM lvi; |
7831 int item = 0; | 7827 int item = 0; |
7832 | 7828 |
7833 if(pointer) | 7829 if(pointer) |
7834 { | 7830 { |
7835 item = (int)dw_window_get_data(handle, "_dw_insertitem"); | 7831 item = (int)dw_window_get_data(handle, "_dw_insertitem"); |
7836 } | 7832 } |
7837 | 7833 |
7838 lvi.iItem = row + item; | 7834 lvi.iItem = row + item; |
7839 lvi.iSubItem = 0; | 7835 lvi.iSubItem = 0; |
7840 lvi.mask = LVIF_DI_SETITEM | LVIF_IMAGE | LVIF_TEXT; | 7836 lvi.mask = LVIF_DI_SETITEM | LVIF_IMAGE | LVIF_TEXT; |
7873 ContainerInfo *cinfo = (ContainerInfo *)GetWindowLongPtr(handle, GWLP_USERDATA); | 7869 ContainerInfo *cinfo = (ContainerInfo *)GetWindowLongPtr(handle, GWLP_USERDATA); |
7874 ULONG *flags; | 7870 ULONG *flags; |
7875 LV_ITEM lvi; | 7871 LV_ITEM lvi; |
7876 char textbuffer[100], *destptr = textbuffer; | 7872 char textbuffer[100], *destptr = textbuffer; |
7877 int item = 0; | 7873 int item = 0; |
7878 | 7874 |
7879 if(pointer) | 7875 if(pointer) |
7880 { | 7876 { |
7881 item = (int)dw_window_get_data(handle, "_dw_insertitem"); | 7877 item = (int)dw_window_get_data(handle, "_dw_insertitem"); |
7882 } | 7878 } |
7883 | 7879 |
7884 if(!cinfo || !cinfo->flags || !data) | 7880 if(!cinfo || !cinfo->flags || !data) |
7885 return; | 7881 return; |
7886 | 7882 |
8061 /* Internal version that handles both types */ | 8057 /* Internal version that handles both types */ |
8062 void _dw_container_set_row_title(HWND handle, void *pointer, int row, char *title) | 8058 void _dw_container_set_row_title(HWND handle, void *pointer, int row, char *title) |
8063 { | 8059 { |
8064 LV_ITEM lvi; | 8060 LV_ITEM lvi; |
8065 int item = 0; | 8061 int item = 0; |
8066 | 8062 |
8067 if(pointer) | 8063 if(pointer) |
8068 { | 8064 { |
8069 item = (int)dw_window_get_data(handle, "_dw_insertitem"); | 8065 item = (int)dw_window_get_data(handle, "_dw_insertitem"); |
8070 } | 8066 } |
8071 | 8067 |
8072 lvi.iItem = row + item; | 8068 lvi.iItem = row + item; |
8073 lvi.iSubItem = 0; | 8069 lvi.iSubItem = 0; |
8074 lvi.mask = LVIF_PARAM; | 8070 lvi.mask = LVIF_PARAM; |
8086 * row: Zero based row of data being set. | 8082 * row: Zero based row of data being set. |
8087 * title: String title of the item. | 8083 * title: String title of the item. |
8088 */ | 8084 */ |
8089 void API dw_container_set_row_title(void *pointer, int row, char *title) | 8085 void API dw_container_set_row_title(void *pointer, int row, char *title) |
8090 { | 8086 { |
8091 _dw_container_set_row_title(pointer, pointer, row, title); | 8087 _dw_container_set_row_title(pointer, pointer, row, title); |
8092 } | 8088 } |
8093 | 8089 |
8094 /* | 8090 /* |
8095 * Changes the title of a row already inserted in the container. | 8091 * Changes the title of a row already inserted in the container. |
8096 * Parameters: | 8092 * Parameters: |
8098 * row: Zero based row of data being set. | 8094 * row: Zero based row of data being set. |
8099 * title: String title of the item. | 8095 * title: String title of the item. |
8100 */ | 8096 */ |
8101 void API dw_container_change_row_title(HWND handle, int row, char *title) | 8097 void API dw_container_change_row_title(HWND handle, int row, char *title) |
8102 { | 8098 { |
8103 _dw_container_set_row_title(handle, NULL, row, title); | 8099 _dw_container_set_row_title(handle, NULL, row, title); |
8104 } | 8100 } |
8105 | 8101 |
8106 /* | 8102 /* |
8107 * Sets the title of a row in the container. | 8103 * Sets the title of a row in the container. |
8108 * Parameters: | 8104 * Parameters: |