Mercurial > dwindows
comparison os2/dw.c @ 510:710f82598210
Change function names to be inline with Mark Hessling's Rexx/DW.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 09 Mar 2004 03:27:39 +0000 |
parents | 078a40ba2e41 |
children | 80dbd5a1f403 |
comparison
equal
deleted
inserted
replaced
509:a9cfbc5ad01e | 510:710f82598210 |
---|---|
540 } | 540 } |
541 else if(strncmp(tmpbuf, "#40", 4)==0) /* Notebook */ | 541 else if(strncmp(tmpbuf, "#40", 4)==0) /* Notebook */ |
542 { | 542 { |
543 Box *notebox; | 543 Box *notebox; |
544 HWND page = (HWND)WinSendMsg(box->items[z].hwnd, BKM_QUERYPAGEWINDOWHWND, | 544 HWND page = (HWND)WinSendMsg(box->items[z].hwnd, BKM_QUERYPAGEWINDOWHWND, |
545 (MPARAM)dw_notebook_page_query(box->items[z].hwnd), 0); | 545 (MPARAM)dw_notebook_page_get(box->items[z].hwnd), 0); |
546 | 546 |
547 if(page) | 547 if(page) |
548 { | 548 { |
549 notebox = (Box *)WinQueryWindowPtr(page, QWP_USER); | 549 notebox = (Box *)WinQueryWindowPtr(page, QWP_USER); |
550 | 550 |
668 } | 668 } |
669 else if(strncmp(tmpbuf, "#40", 4)==0) /* Notebook */ | 669 else if(strncmp(tmpbuf, "#40", 4)==0) /* Notebook */ |
670 { | 670 { |
671 Box *notebox; | 671 Box *notebox; |
672 HWND page = (HWND)WinSendMsg(box->items[z].hwnd, BKM_QUERYPAGEWINDOWHWND, | 672 HWND page = (HWND)WinSendMsg(box->items[z].hwnd, BKM_QUERYPAGEWINDOWHWND, |
673 (MPARAM)dw_notebook_page_query(box->items[z].hwnd), 0); | 673 (MPARAM)dw_notebook_page_get(box->items[z].hwnd), 0); |
674 | 674 |
675 if(page) | 675 if(page) |
676 { | 676 { |
677 notebox = (Box *)WinQueryWindowPtr(page, QWP_USER); | 677 notebox = (Box *)WinQueryWindowPtr(page, QWP_USER); |
678 | 678 |
1750 } | 1750 } |
1751 | 1751 |
1752 int _dw_int_pos(HWND hwnd) | 1752 int _dw_int_pos(HWND hwnd) |
1753 { | 1753 { |
1754 int pos = (int)dw_window_get_data(hwnd, "_dw_percent_value"); | 1754 int pos = (int)dw_window_get_data(hwnd, "_dw_percent_value"); |
1755 int range = dw_percent_query_range(hwnd); | 1755 int range = dw_percent_get_range(hwnd); |
1756 float fpos = (float)pos; | 1756 float fpos = (float)pos; |
1757 float frange = (float)range; | 1757 float frange = (float)range; |
1758 float fnew = (fpos/1000.0)*frange; | 1758 float fnew = (fpos/1000.0)*frange; |
1759 return (int)fnew; | 1759 return (int)fnew; |
1760 } | 1760 } |
1761 | 1761 |
1762 void _dw_int_set(HWND hwnd, int pos) | 1762 void _dw_int_set(HWND hwnd, int pos) |
1763 { | 1763 { |
1764 int inew, range = dw_percent_query_range(hwnd); | 1764 int inew, range = dw_percent_get_range(hwnd); |
1765 if(range) | 1765 if(range) |
1766 { | 1766 { |
1767 float fpos = (float)pos; | 1767 float fpos = (float)pos; |
1768 float frange = (float)range; | 1768 float frange = (float)range; |
1769 float fnew = (fpos/frange)*1000.0; | 1769 float fnew = (fpos/frange)*1000.0; |
1933 int min, max, page; | 1933 int min, max, page; |
1934 | 1934 |
1935 if(which == SB_SLIDERTRACK) | 1935 if(which == SB_SLIDERTRACK) |
1936 return pos; | 1936 return pos; |
1937 | 1937 |
1938 pos = dw_scrollbar_query_pos(handle); | 1938 pos = dw_scrollbar_get_pos(handle); |
1939 res = WinSendMsg(handle, SBM_QUERYRANGE, 0, 0); | 1939 res = WinSendMsg(handle, SBM_QUERYRANGE, 0, 0); |
1940 | 1940 |
1941 min = SHORT1FROMMP(res); | 1941 min = SHORT1FROMMP(res); |
1942 max = SHORT2FROMMP(res); | 1942 max = SHORT2FROMMP(res); |
1943 page = (int)dw_window_get_data(handle, "_dw_scrollbar_visible"); | 1943 page = (int)dw_window_get_data(handle, "_dw_scrollbar_visible"); |
2395 if(_recursing == 0 && (tmp->window == conthwnd || (!id && tmp->window == (HWND)mp2))) | 2395 if(_recursing == 0 && (tmp->window == conthwnd || (!id && tmp->window == (HWND)mp2))) |
2396 { | 2396 { |
2397 char buf1[500]; | 2397 char buf1[500]; |
2398 unsigned int index = dw_listbox_selected(tmp->window); | 2398 unsigned int index = dw_listbox_selected(tmp->window); |
2399 | 2399 |
2400 dw_listbox_query_text(tmp->window, index, buf1, 500); | 2400 dw_listbox_get_text(tmp->window, index, buf1, 500); |
2401 | 2401 |
2402 _recursing = 1; | 2402 _recursing = 1; |
2403 | 2403 |
2404 if(id && strncmp(classbuf, "#2", 3)==0) | 2404 if(id && strncmp(classbuf, "#2", 3)==0) |
2405 { | 2405 { |
3822 * Changes the appearance of the mouse pointer. | 3822 * Changes the appearance of the mouse pointer. |
3823 * Parameters: | 3823 * Parameters: |
3824 * handle: Handle to widget for which to change. | 3824 * handle: Handle to widget for which to change. |
3825 * cursortype: ID of the pointer you want. | 3825 * cursortype: ID of the pointer you want. |
3826 */ | 3826 */ |
3827 void API dw_window_pointer(HWND handle, int pointertype) | 3827 void API dw_window_set_pointer(HWND handle, int pointertype) |
3828 { | 3828 { |
3829 if(handle == HWND_DESKTOP) | 3829 if(handle == HWND_DESKTOP) |
3830 WinSetPointer(handle, WinQuerySysPointer(HWND_DESKTOP,pointertype, FALSE)); | 3830 WinSetPointer(handle, WinQuerySysPointer(HWND_DESKTOP,pointertype, FALSE)); |
3831 else | 3831 else |
3832 dw_window_set_data(handle, "_dw_pointer", | 3832 dw_window_set_data(handle, "_dw_pointer", |
5265 * Parameters: | 5265 * Parameters: |
5266 * handle: Window (widget) handle. | 5266 * handle: Window (widget) handle. |
5267 * width: New width in pixels. | 5267 * width: New width in pixels. |
5268 * height: New height in pixels. | 5268 * height: New height in pixels. |
5269 */ | 5269 */ |
5270 void API dw_window_set_usize(HWND handle, ULONG width, ULONG height) | 5270 void API dw_window_set_size(HWND handle, ULONG width, ULONG height) |
5271 { | 5271 { |
5272 WinSetWindowPos(handle, NULLHANDLE, 0, 0, width, height, SWP_SHOW | SWP_SIZE); | 5272 WinSetWindowPos(handle, NULLHANDLE, 0, 0, width, height, SWP_SHOW | SWP_SIZE); |
5273 } | 5273 } |
5274 | 5274 |
5275 /* | 5275 /* |
5393 /* | 5393 /* |
5394 * Queries the currently visible page ID. | 5394 * Queries the currently visible page ID. |
5395 * Parameters: | 5395 * Parameters: |
5396 * handle: Handle to the notebook widget. | 5396 * handle: Handle to the notebook widget. |
5397 */ | 5397 */ |
5398 unsigned long API dw_notebook_page_query(HWND handle) | 5398 unsigned long API dw_notebook_page_get(HWND handle) |
5399 { | 5399 { |
5400 return (unsigned long)WinSendMsg(handle, BKM_QUERYPAGEID,0L, MPFROM2SHORT(BKA_TOP, BKA_MAJOR)); | 5400 return (unsigned long)WinSendMsg(handle, BKM_QUERYPAGEID,0L, MPFROM2SHORT(BKA_TOP, BKA_MAJOR)); |
5401 } | 5401 } |
5402 | 5402 |
5403 /* | 5403 /* |
5510 * handle: Handle to the listbox to be queried. | 5510 * handle: Handle to the listbox to be queried. |
5511 * index: Index into the list to be queried. | 5511 * index: Index into the list to be queried. |
5512 * buffer: Buffer where text will be copied. | 5512 * buffer: Buffer where text will be copied. |
5513 * length: Length of the buffer (including NULL). | 5513 * length: Length of the buffer (including NULL). |
5514 */ | 5514 */ |
5515 void API dw_listbox_query_text(HWND handle, unsigned int index, char *buffer, unsigned int length) | 5515 void API dw_listbox_get_text(HWND handle, unsigned int index, char *buffer, unsigned int length) |
5516 { | 5516 { |
5517 WinSendMsg(handle, LM_QUERYITEMTEXT, MPFROM2SHORT(index, length), (MPARAM)buffer); | 5517 WinSendMsg(handle, LM_QUERYITEMTEXT, MPFROM2SHORT(index, length), (MPARAM)buffer); |
5518 } | 5518 } |
5519 | 5519 |
5520 /* | 5520 /* |
5677 * Parameters: | 5677 * Parameters: |
5678 * handle: Handle to the MLE to be queried. | 5678 * handle: Handle to the MLE to be queried. |
5679 * bytes: A pointer to a variable to return the total bytes. | 5679 * bytes: A pointer to a variable to return the total bytes. |
5680 * lines: A pointer to a variable to return the number of lines. | 5680 * lines: A pointer to a variable to return the number of lines. |
5681 */ | 5681 */ |
5682 void API dw_mle_query(HWND handle, unsigned long *bytes, unsigned long *lines) | 5682 void API dw_mle_get_size(HWND handle, unsigned long *bytes, unsigned long *lines) |
5683 { | 5683 { |
5684 if(bytes) | 5684 if(bytes) |
5685 *bytes = (unsigned long)WinSendMsg(handle, MLM_QUERYTEXTLENGTH, 0, 0); | 5685 *bytes = (unsigned long)WinSendMsg(handle, MLM_QUERYTEXTLENGTH, 0, 0); |
5686 if(lines) | 5686 if(lines) |
5687 *lines = (unsigned long)WinSendMsg(handle, MLM_QUERYLINECOUNT, 0, 0); | 5687 *lines = (unsigned long)WinSendMsg(handle, MLM_QUERYLINECOUNT, 0, 0); |
5717 */ | 5717 */ |
5718 void API dw_mle_clear(HWND handle) | 5718 void API dw_mle_clear(HWND handle) |
5719 { | 5719 { |
5720 unsigned long bytes; | 5720 unsigned long bytes; |
5721 | 5721 |
5722 dw_mle_query(handle, &bytes, NULL); | 5722 dw_mle_get_size(handle, &bytes, NULL); |
5723 | 5723 |
5724 WinSendMsg(handle, MLM_DELETE, MPFROMLONG(0), MPFROMLONG(bytes)); | 5724 WinSendMsg(handle, MLM_DELETE, MPFROMLONG(0), MPFROMLONG(bytes)); |
5725 } | 5725 } |
5726 | 5726 |
5727 /* | 5727 /* |
5728 * Sets the visible line of an MLE box. | 5728 * Sets the visible line of an MLE box. |
5729 * Parameters: | 5729 * Parameters: |
5730 * handle: Handle to the MLE to be positioned. | 5730 * handle: Handle to the MLE to be positioned. |
5731 * line: Line to be visible. | 5731 * line: Line to be visible. |
5732 */ | 5732 */ |
5733 void API dw_mle_set_visible(HWND handle, int line) | 5733 void API dw_mle_set_cursor_visible(HWND handle, int line) |
5734 { | 5734 { |
5735 int tmppnt = (int)WinSendMsg(handle, MLM_CHARFROMLINE, MPFROMLONG(line), 0); | 5735 int tmppnt = (int)WinSendMsg(handle, MLM_CHARFROMLINE, MPFROMLONG(line), 0); |
5736 WinSendMsg(handle, MLM_SETSEL, MPFROMLONG(tmppnt), MPFROMLONG(tmppnt)); | 5736 WinSendMsg(handle, MLM_SETSEL, MPFROMLONG(tmppnt), MPFROMLONG(tmppnt)); |
5737 } | 5737 } |
5738 | 5738 |
5740 * Sets the editablity of an MLE box. | 5740 * Sets the editablity of an MLE box. |
5741 * Parameters: | 5741 * Parameters: |
5742 * handle: Handle to the MLE. | 5742 * handle: Handle to the MLE. |
5743 * state: TRUE if it can be edited, FALSE for readonly. | 5743 * state: TRUE if it can be edited, FALSE for readonly. |
5744 */ | 5744 */ |
5745 void API dw_mle_set_editable(HWND handle, int state) | 5745 void API dw_mle_set_cursor_editable(HWND handle, int state) |
5746 { | 5746 { |
5747 WinSendMsg(handle, MLM_SETREADONLY, MPFROMLONG(state ? FALSE : TRUE), 0); | 5747 WinSendMsg(handle, MLM_SETREADONLY, MPFROMLONG(state ? FALSE : TRUE), 0); |
5748 } | 5748 } |
5749 | 5749 |
5750 /* | 5750 /* |
5751 * Sets the word wrap state of an MLE box. | 5751 * Sets the word wrap state of an MLE box. |
5752 * Parameters: | 5752 * Parameters: |
5753 * handle: Handle to the MLE. | 5753 * handle: Handle to the MLE. |
5754 * state: TRUE if it wraps, FALSE if it doesn't. | 5754 * state: TRUE if it wraps, FALSE if it doesn't. |
5755 */ | 5755 */ |
5756 void API dw_mle_set_word_wrap(HWND handle, int state) | 5756 void API dw_mle_set_cursor_word_wrap(HWND handle, int state) |
5757 { | 5757 { |
5758 WinSendMsg(handle, MLM_SETWRAP, MPFROMLONG(state), 0); | 5758 WinSendMsg(handle, MLM_SETWRAP, MPFROMLONG(state), 0); |
5759 } | 5759 } |
5760 | 5760 |
5761 /* | 5761 /* |
5762 * Sets the current cursor position of an MLE box. | 5762 * Sets the current cursor position of an MLE box. |
5763 * Parameters: | 5763 * Parameters: |
5764 * handle: Handle to the MLE to be positioned. | 5764 * handle: Handle to the MLE to be positioned. |
5765 * point: Point to position cursor. | 5765 * point: Point to position cursor. |
5766 */ | 5766 */ |
5767 void API dw_mle_set(HWND handle, int point) | 5767 void API dw_mle_set_cursor(HWND handle, int point) |
5768 { | 5768 { |
5769 WinSendMsg(handle, MLM_SETSEL, MPFROMLONG(point), MPFROMLONG(point)); | 5769 WinSendMsg(handle, MLM_SETSEL, MPFROMLONG(point), MPFROMLONG(point)); |
5770 } | 5770 } |
5771 | 5771 |
5772 /* | 5772 /* |
5820 /* | 5820 /* |
5821 * Returns the range of the percent bar. | 5821 * Returns the range of the percent bar. |
5822 * Parameters: | 5822 * Parameters: |
5823 * handle: Handle to the percent bar to be queried. | 5823 * handle: Handle to the percent bar to be queried. |
5824 */ | 5824 */ |
5825 unsigned int API dw_percent_query_range(HWND handle) | 5825 unsigned int API dw_percent_get_range(HWND handle) |
5826 { | 5826 { |
5827 return SHORT2FROMMP(WinSendMsg(handle, SLM_QUERYSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_RANGEVALUE), 0)); | 5827 return SHORT2FROMMP(WinSendMsg(handle, SLM_QUERYSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_RANGEVALUE), 0)); |
5828 } | 5828 } |
5829 | 5829 |
5830 /* | 5830 /* |
5842 /* | 5842 /* |
5843 * Returns the position of the slider. | 5843 * Returns the position of the slider. |
5844 * Parameters: | 5844 * Parameters: |
5845 * handle: Handle to the slider to be queried. | 5845 * handle: Handle to the slider to be queried. |
5846 */ | 5846 */ |
5847 unsigned int API dw_slider_query_pos(HWND handle) | 5847 unsigned int API dw_slider_get_pos(HWND handle) |
5848 { | 5848 { |
5849 return (unsigned int)WinSendMsg(handle, SLM_QUERYSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), 0); | 5849 return (unsigned int)WinSendMsg(handle, SLM_QUERYSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), 0); |
5850 } | 5850 } |
5851 | 5851 |
5852 /* | 5852 /* |
5864 /* | 5864 /* |
5865 * Returns the position of the scrollbar. | 5865 * Returns the position of the scrollbar. |
5866 * Parameters: | 5866 * Parameters: |
5867 * handle: Handle to the scrollbar to be queried. | 5867 * handle: Handle to the scrollbar to be queried. |
5868 */ | 5868 */ |
5869 unsigned int API dw_scrollbar_query_pos(HWND handle) | 5869 unsigned int API dw_scrollbar_get_pos(HWND handle) |
5870 { | 5870 { |
5871 return (unsigned int)WinSendMsg(handle, SBM_QUERYPOS, 0, 0); | 5871 return (unsigned int)WinSendMsg(handle, SBM_QUERYPOS, 0, 0); |
5872 } | 5872 } |
5873 | 5873 |
5874 /* | 5874 /* |
5936 /* | 5936 /* |
5937 * Returns the current value of the spinbutton. | 5937 * Returns the current value of the spinbutton. |
5938 * Parameters: | 5938 * Parameters: |
5939 * handle: Handle to the spinbutton to be queried. | 5939 * handle: Handle to the spinbutton to be queried. |
5940 */ | 5940 */ |
5941 long API dw_spinbutton_query(HWND handle) | 5941 long API dw_spinbutton_get_pos(HWND handle) |
5942 { | 5942 { |
5943 long tmpval = 0L; | 5943 long tmpval = 0L; |
5944 | 5944 |
5945 WinSendMsg(handle, SPBM_QUERYVALUE, (MPARAM)&tmpval,0L); | 5945 WinSendMsg(handle, SPBM_QUERYVALUE, (MPARAM)&tmpval,0L); |
5946 return tmpval; | 5946 return tmpval; |
5949 /* | 5949 /* |
5950 * Returns the state of the checkbox. | 5950 * Returns the state of the checkbox. |
5951 * Parameters: | 5951 * Parameters: |
5952 * handle: Handle to the checkbox to be queried. | 5952 * handle: Handle to the checkbox to be queried. |
5953 */ | 5953 */ |
5954 int API dw_checkbox_query(HWND handle) | 5954 int API dw_checkbox_get(HWND handle) |
5955 { | 5955 { |
5956 return (int)WinSendMsg(handle,BM_QUERYCHECK,0,0); | 5956 return (int)WinSendMsg(handle,BM_QUERYCHECK,0,0); |
5957 } | 5957 } |
5958 | 5958 |
5959 /* | 5959 /* |
6046 * handle: Handle to the tree containing the item. | 6046 * handle: Handle to the tree containing the item. |
6047 * item: Handle of the item to be modified. | 6047 * item: Handle of the item to be modified. |
6048 * title: The text title of the entry. | 6048 * title: The text title of the entry. |
6049 * icon: Handle to coresponding icon. | 6049 * icon: Handle to coresponding icon. |
6050 */ | 6050 */ |
6051 void API dw_tree_set(HWND handle, HTREEITEM item, char *title, unsigned long icon) | 6051 void API dw_tree_item_change(HWND handle, HTREEITEM item, char *title, unsigned long icon) |
6052 { | 6052 { |
6053 PCNRITEM pci = (PCNRITEM)item; | 6053 PCNRITEM pci = (PCNRITEM)item; |
6054 | 6054 |
6055 if(!pci) | 6055 if(!pci) |
6056 return; | 6056 return; |
6103 * Parameters: | 6103 * Parameters: |
6104 * handle: Handle to the tree containing the item. | 6104 * handle: Handle to the tree containing the item. |
6105 * item: Handle of the item to be modified. | 6105 * item: Handle of the item to be modified. |
6106 * itemdata: User defined data to be associated with item. | 6106 * itemdata: User defined data to be associated with item. |
6107 */ | 6107 */ |
6108 void API dw_tree_set_data(HWND handle, HTREEITEM item, void *itemdata) | 6108 void API dw_tree_item_change_data(HWND handle, HTREEITEM item, void *itemdata) |
6109 { | 6109 { |
6110 PCNRITEM pci = (PCNRITEM)item; | 6110 PCNRITEM pci = (PCNRITEM)item; |
6111 | 6111 |
6112 handle = handle; /* keep compiler happy */ | 6112 handle = handle; /* keep compiler happy */ |
6113 if(!pci) | 6113 if(!pci) |
6120 * Gets the item data of a tree item. | 6120 * Gets the item data of a tree item. |
6121 * Parameters: | 6121 * Parameters: |
6122 * handle: Handle to the tree containing the item. | 6122 * handle: Handle to the tree containing the item. |
6123 * item: Handle of the item to be modified. | 6123 * item: Handle of the item to be modified. |
6124 */ | 6124 */ |
6125 void * API dw_tree_get_data(HWND handle, HTREEITEM item) | 6125 void * API dw_tree_item_get_data(HWND handle, HTREEITEM item) |
6126 { | 6126 { |
6127 PCNRITEM pci = (PCNRITEM)item; | 6127 PCNRITEM pci = (PCNRITEM)item; |
6128 | 6128 |
6129 handle = handle; /* keep compiler happy */ | 6129 handle = handle; /* keep compiler happy */ |
6130 if(!pci) | 6130 if(!pci) |
6167 * Expands a node on a tree. | 6167 * Expands a node on a tree. |
6168 * Parameters: | 6168 * Parameters: |
6169 * handle: Handle to the tree window (widget). | 6169 * handle: Handle to the tree window (widget). |
6170 * item: Handle to node to be expanded. | 6170 * item: Handle to node to be expanded. |
6171 */ | 6171 */ |
6172 void API dw_tree_expand(HWND handle, HTREEITEM item) | 6172 void API dw_tree_item_expand(HWND handle, HTREEITEM item) |
6173 { | 6173 { |
6174 WinSendMsg(handle, CM_EXPANDTREE, MPFROMP(item), 0); | 6174 WinSendMsg(handle, CM_EXPANDTREE, MPFROMP(item), 0); |
6175 } | 6175 } |
6176 | 6176 |
6177 /* | 6177 /* |
6178 * Collapses a node on a tree. | 6178 * Collapses a node on a tree. |
6179 * Parameters: | 6179 * Parameters: |
6180 * handle: Handle to the tree window (widget). | 6180 * handle: Handle to the tree window (widget). |
6181 * item: Handle to node to be collapsed. | 6181 * item: Handle to node to be collapsed. |
6182 */ | 6182 */ |
6183 void API dw_tree_collapse(HWND handle, HTREEITEM item) | 6183 void API dw_tree_item_collapse(HWND handle, HTREEITEM item) |
6184 { | 6184 { |
6185 WinSendMsg(handle, CM_COLLAPSETREE, MPFROMP(item), 0); | 6185 WinSendMsg(handle, CM_COLLAPSETREE, MPFROMP(item), 0); |
6186 } | 6186 } |
6187 | 6187 |
6188 /* | 6188 /* |
6189 * Removes a node from a tree. | 6189 * Removes a node from a tree. |
6190 * Parameters: | 6190 * Parameters: |
6191 * handle: Handle to the window (widget) to be cleared. | 6191 * handle: Handle to the window (widget) to be cleared. |
6192 * item: Handle to node to be deleted. | 6192 * item: Handle to node to be deleted. |
6193 */ | 6193 */ |
6194 void API dw_tree_delete(HWND handle, HTREEITEM item) | 6194 void API dw_tree_item_delete(HWND handle, HTREEITEM item) |
6195 { | 6195 { |
6196 PCNRITEM pci = (PCNRITEM)item; | 6196 PCNRITEM pci = (PCNRITEM)item; |
6197 | 6197 |
6198 if(!item) | 6198 if(!item) |
6199 return; | 6199 return; |
8218 strcpy(folder, path); | 8218 strcpy(folder, path); |
8219 strcpy(&folder[len-1], ffbuf.achName); | 8219 strcpy(&folder[len-1], ffbuf.achName); |
8220 | 8220 |
8221 item = dw_tree_insert(tree, ffbuf.achName, WinLoadFileIcon(folder, TRUE), parent, (void *)parent); | 8221 item = dw_tree_insert(tree, ffbuf.achName, WinLoadFileIcon(folder, TRUE), parent, (void *)parent); |
8222 tempitem = dw_tree_insert(tree, "", 0, item, 0); | 8222 tempitem = dw_tree_insert(tree, "", 0, item, 0); |
8223 dw_tree_set_data(tree, item, (void *)tempitem); | 8223 dw_tree_item_change_data(tree, item, (void *)tempitem); |
8224 } | 8224 } |
8225 } | 8225 } |
8226 DosFindClose(hdir); | 8226 DosFindClose(hdir); |
8227 } | 8227 } |
8228 } | 8228 } |
8247 | 8247 |
8248 folder[0] = name[6] = 'A' + drive; | 8248 folder[0] = name[6] = 'A' + drive; |
8249 | 8249 |
8250 items[drive] = dw_tree_insert(tree, name, WinLoadFileIcon(folder, TRUE), NULL, 0); | 8250 items[drive] = dw_tree_insert(tree, name, WinLoadFileIcon(folder, TRUE), NULL, 0); |
8251 tempitem = dw_tree_insert(tree, "", 0, items[drive], 0); | 8251 tempitem = dw_tree_insert(tree, "", 0, items[drive], 0); |
8252 dw_tree_set_data(tree, items[drive], (void *)tempitem); | 8252 dw_tree_item_change_data(tree, items[drive], (void *)tempitem); |
8253 } | 8253 } |
8254 else | 8254 else |
8255 items[drive] = 0; | 8255 items[drive] = 0; |
8256 } | 8256 } |
8257 dw_mutex_unlock(mtx); | 8257 dw_mutex_unlock(mtx); |
8334 return FALSE; | 8334 return FALSE; |
8335 } | 8335 } |
8336 | 8336 |
8337 int DWSIGNAL _tree_expand(HWND window, HTREEITEM item, void *data) | 8337 int DWSIGNAL _tree_expand(HWND window, HTREEITEM item, void *data) |
8338 { | 8338 { |
8339 HTREEITEM tempitem = (HTREEITEM)dw_tree_get_data(window, item); | 8339 HTREEITEM tempitem = (HTREEITEM)dw_tree_item_get_data(window, item); |
8340 | 8340 |
8341 data = data; | 8341 data = data; |
8342 if(tempitem) | 8342 if(tempitem) |
8343 { | 8343 { |
8344 char *folder = _tree_folder(window, item); | 8344 char *folder = _tree_folder(window, item); |
8345 | 8345 |
8346 dw_tree_set_data(window, item, 0); | 8346 dw_tree_item_change_data(window, item, 0); |
8347 dw_tree_delete(window, tempitem); | 8347 dw_tree_item_delete(window, tempitem); |
8348 | 8348 |
8349 if(*folder) | 8349 if(*folder) |
8350 { | 8350 { |
8351 strcat(folder, "*"); | 8351 strcat(folder, "*"); |
8352 _populate_directory(window, item, folder); | 8352 _populate_directory(window, item, folder); |
8404 | 8404 |
8405 button = dw_button_new("Cancel", 1002L); | 8405 button = dw_button_new("Cancel", 1002L); |
8406 dw_box_pack_start(hbox, button, 50, 30, TRUE, FALSE, 3); | 8406 dw_box_pack_start(hbox, button, 50, 30, TRUE, FALSE, 3); |
8407 dw_signal_connect(button, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_cancel_func), (void *)dwwait); | 8407 dw_signal_connect(button, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_cancel_func), (void *)dwwait); |
8408 | 8408 |
8409 dw_window_set_usize(window, 225, 300); | 8409 dw_window_set_size(window, 225, 300); |
8410 dw_window_show(window); | 8410 dw_window_show(window); |
8411 | 8411 |
8412 dw_thread_new((void *)_populate_tree_thread, (void *)window, 0xff); | 8412 dw_thread_new((void *)_populate_tree_thread, (void *)window, 0xff); |
8413 return (char *)dw_dialog_wait(dwwait); | 8413 return (char *)dw_dialog_wait(dwwait); |
8414 } | 8414 } |