Mercurial > dwindows
comparison win/dw.c @ 17:f26eced21a30
Some more updates.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Wed, 18 Jul 2001 22:32:45 +0000 |
parents | 81833f25b1aa |
children | 6a246b3bb14f |
comparison
equal
deleted
inserted
replaced
16:ca7a8215487a | 17:f26eced21a30 |
---|---|
843 GetClassName(handle, tmpbuf, 99); | 843 GetClassName(handle, tmpbuf, 99); |
844 | 844 |
845 if(strnicmp(tmpbuf, COMBOBOXCLASSNAME, strlen(COMBOBOXCLASSNAME))==0) | 845 if(strnicmp(tmpbuf, COMBOBOXCLASSNAME, strlen(COMBOBOXCLASSNAME))==0) |
846 { | 846 { |
847 /* Handle special case Combobox */ | 847 /* Handle special case Combobox */ |
848 SetWindowPos(handle, HWND_TOP, currentx + pad, currenty + pad, | 848 MoveWindow(handle, currentx + pad, currenty + pad, |
849 width + vectorx, (height + vectory) + 400, 0); | 849 width + vectorx, (height + vectory) + 400, TRUE); |
850 } | 850 } |
851 else if(strnicmp(tmpbuf, UPDOWN_CLASS, strlen(UPDOWN_CLASS))==0) | 851 else if(strnicmp(tmpbuf, UPDOWN_CLASS, strlen(UPDOWN_CLASS))==0) |
852 { | 852 { |
853 /* Handle special case Spinbutton */ | 853 /* Handle special case Spinbutton */ |
854 ColorInfo *cinfo = (ColorInfo *)GetWindowLong(handle, GWL_USERDATA); | 854 ColorInfo *cinfo = (ColorInfo *)GetWindowLong(handle, GWL_USERDATA); |
855 | 855 |
856 SetWindowPos(handle, HWND_TOP, currentx + pad + ((width + vectorx) - 20), currenty + pad, | 856 MoveWindow(handle, currentx + pad + ((width + vectorx) - 20), currenty + pad, |
857 20, height + vectory, 0); | 857 20, height + vectory, TRUE); |
858 | 858 |
859 if(cinfo) | 859 if(cinfo) |
860 { | 860 { |
861 SetWindowPos(cinfo->buddy, HWND_TOP, currentx + pad, currenty + pad, | 861 MoveWindow(cinfo->buddy, currentx + pad, currenty + pad, |
862 (width + vectorx) - 20, height + vectory, 0); | 862 (width + vectorx) - 20, height + vectory, TRUE); |
863 } | 863 } |
864 } | 864 } |
865 else | 865 else |
866 { | 866 { |
867 /* Everything else */ | 867 /* Everything else */ |
868 SetWindowPos(handle, HWND_TOP, currentx + pad, currenty + pad, | 868 MoveWindow(handle, currentx + pad, currenty + pad, |
869 width + vectorx, height + vectory, 0); | 869 width + vectorx, height + vectory, TRUE); |
870 if(thisbox->items[z].type == TYPEBOX) | 870 if(thisbox->items[z].type == TYPEBOX) |
871 { | 871 { |
872 Box *boxinfo = (Box *)GetWindowLong(handle, GWL_USERDATA); | 872 Box *boxinfo = (Box *)GetWindowLong(handle, GWL_USERDATA); |
873 | 873 |
874 if(boxinfo && boxinfo->grouphwnd) | 874 if(boxinfo && boxinfo->grouphwnd) |
875 SetWindowPos(boxinfo->grouphwnd, HWND_TOP, 0, 0, | 875 MoveWindow(boxinfo->grouphwnd, 0, 0, |
876 width + vectorx, height + vectory, 0); | 876 width + vectorx, height + vectory, TRUE); |
877 | 877 |
878 } | 878 } |
879 } | 879 } |
880 | 880 |
881 /* Notebook dialog requires additional processing */ | 881 /* Notebook dialog requires additional processing */ |
887 | 887 |
888 if(pageid > -1 && array && array[pageid]) | 888 if(pageid > -1 && array && array[pageid]) |
889 { | 889 { |
890 GetClientRect(handle,&rect); | 890 GetClientRect(handle,&rect); |
891 TabCtrl_AdjustRect(handle,FALSE,&rect); | 891 TabCtrl_AdjustRect(handle,FALSE,&rect); |
892 MoveWindow(array[pageid]->hwnd,rect.left,rect.top, | 892 MoveWindow(array[pageid]->hwnd, rect.left, rect.top, |
893 rect.right - rect.left,rect.bottom-rect.top, | 893 rect.right - rect.left, rect.bottom-rect.top, TRUE); |
894 TRUE); | |
895 ShowWindow(array[pageid]->hwnd,SW_SHOWNORMAL); | |
896 } | 894 } |
897 } | 895 } |
898 | 896 |
899 #ifdef DWDEBUG | 897 #ifdef DWDEBUG |
900 fprintf(f, "Window Pos depth %d\r\ncurrentx = %d, currenty = %d, pad = %d, width = %d, height = %d, vectorx = %d, vectory = %d, Box type = %s\r\n\r\n", | 898 fprintf(f, "Window Pos depth %d\r\ncurrentx = %d, currenty = %d, pad = %d, width = %d, height = %d, vectorx = %d, vectory = %d, Box type = %s\r\n\r\n", |
912 return 0; | 910 return 0; |
913 } | 911 } |
914 | 912 |
915 void _do_resize(Box *thisbox, int x, int y) | 913 void _do_resize(Box *thisbox, int x, int y) |
916 { | 914 { |
917 if(x != 0 && y != 0) { | 915 if(x != 0 && y != 0) |
916 { | |
918 if(thisbox) | 917 if(thisbox) |
919 { | 918 { |
920 int usedx = 0, usedy = 0, depth = 0, usedpadx = 0, usedpady = 0; | 919 int usedx = 0, usedy = 0, depth = 0, usedpadx = 0, usedpady = 0; |
921 | 920 |
922 _resize_box(thisbox, &depth, x, y, &usedx, &usedy, 1, &usedpadx, &usedpady); | 921 _resize_box(thisbox, &depth, x, y, &usedx, &usedy, 1, &usedpadx, &usedpady); |
931 #endif | 930 #endif |
932 | 931 |
933 usedpadx = usedpady = usedx = usedy = depth = 0; | 932 usedpadx = usedpady = usedx = usedy = depth = 0; |
934 | 933 |
935 _resize_box(thisbox, &depth, x, y, &usedx, &usedy, 2, &usedpadx, &usedpady); | 934 _resize_box(thisbox, &depth, x, y, &usedx, &usedy, 2, &usedpadx, &usedpady); |
935 | |
936 #ifdef DWDEBUG | 936 #ifdef DWDEBUG |
937 fprintf(f, "WM_SIZE Resize Box Pass 2\r\nx = %d, y = %d, usedx = %d, usedy = %d, usedpadx = %d, usedpady = %d\r\n", | 937 fprintf(f, "WM_SIZE Resize Box Pass 2\r\nx = %d, y = %d, usedx = %d, usedy = %d, usedpadx = %d, usedpady = %d\r\n", |
938 x, y, usedx, usedy, usedpadx, usedpady); | 938 x, y, usedx, usedy, usedpadx, usedpady); |
939 reopen(); | 939 reopen(); |
940 #endif | 940 #endif |
1162 | 1162 |
1163 if(lastx != LOWORD(mp2) || lasty != HIWORD(mp2) || lasthwnd != hWnd) | 1163 if(lastx != LOWORD(mp2) || lasty != HIWORD(mp2) || lasthwnd != hWnd) |
1164 { | 1164 { |
1165 Box *mybox = (Box *)GetWindowLong(hWnd, GWL_USERDATA); | 1165 Box *mybox = (Box *)GetWindowLong(hWnd, GWL_USERDATA); |
1166 | 1166 |
1167 lastx = LOWORD(mp2); | 1167 if(mybox && mybox->count) |
1168 lasty = HIWORD(mp2); | 1168 { |
1169 lasthwnd = hWnd; | 1169 lastx = LOWORD(mp2); |
1170 | 1170 lasty = HIWORD(mp2); |
1171 _do_resize(mybox,LOWORD(mp2),HIWORD(mp2)); | 1171 lasthwnd = hWnd; |
1172 | |
1173 ShowWindow(mybox->items[0].hwnd, SW_HIDE); | |
1174 _do_resize(mybox,LOWORD(mp2),HIWORD(mp2)); | |
1175 ShowWindow(mybox->items[0].hwnd, SW_SHOW); | |
1176 return 0; | |
1177 } | |
1172 } | 1178 } |
1173 } | 1179 } |
1174 break; | 1180 break; |
1175 case WM_CHAR: | 1181 case WM_CHAR: |
1176 if(LOWORD(mp1) == '\t') | 1182 if(LOWORD(mp1) == '\t') |
1413 _blue[thiscinfo->fore])); | 1419 _blue[thiscinfo->fore])); |
1414 SetBkColor((HDC)mp1, RGB(_red[thiscinfo->back], | 1420 SetBkColor((HDC)mp1, RGB(_red[thiscinfo->back], |
1415 _green[thiscinfo->back], | 1421 _green[thiscinfo->back], |
1416 _blue[thiscinfo->back])); | 1422 _blue[thiscinfo->back])); |
1417 SelectObject((HDC)mp1, _colors[thiscinfo->back]); | 1423 SelectObject((HDC)mp1, _colors[thiscinfo->back]); |
1418 return (LRESULT)_colors[thiscinfo->back]; | 1424 return (LONG)_colors[thiscinfo->back]; |
1419 } | 1425 } |
1420 if((thiscinfo->fore & DW_RGB_COLOR) == DW_RGB_COLOR && (thiscinfo->back & DW_RGB_COLOR) == DW_RGB_COLOR) | 1426 if((thiscinfo->fore & DW_RGB_COLOR) == DW_RGB_COLOR && (thiscinfo->back & DW_RGB_COLOR) == DW_RGB_COLOR) |
1421 { | 1427 { |
1422 SetTextColor((HDC)mp1, RGB(DW_RED_VALUE(thiscinfo->fore), | 1428 SetTextColor((HDC)mp1, RGB(DW_RED_VALUE(thiscinfo->fore), |
1423 DW_GREEN_VALUE(thiscinfo->fore), | 1429 DW_GREEN_VALUE(thiscinfo->fore), |
1427 DW_BLUE_VALUE(thiscinfo->back))); | 1433 DW_BLUE_VALUE(thiscinfo->back))); |
1428 DeleteObject(thiscinfo->hbrush); | 1434 DeleteObject(thiscinfo->hbrush); |
1429 thiscinfo->hbrush = CreateSolidBrush(RGB(DW_RED_VALUE(thiscinfo->back), | 1435 thiscinfo->hbrush = CreateSolidBrush(RGB(DW_RED_VALUE(thiscinfo->back), |
1430 DW_GREEN_VALUE(thiscinfo->back), | 1436 DW_GREEN_VALUE(thiscinfo->back), |
1431 DW_BLUE_VALUE(thiscinfo->back))); | 1437 DW_BLUE_VALUE(thiscinfo->back))); |
1432 return (LRESULT)thiscinfo->hbrush; | 1438 SelectObject((HDC)mp1, thiscinfo->hbrush); |
1439 return (LONG)thiscinfo->hbrush; | |
1433 } | 1440 } |
1434 } | 1441 } |
1435 | 1442 |
1436 } | 1443 } |
1437 break; | 1444 break; |
1931 | 1938 |
1932 case WM_MOUSEMOVE: | 1939 case WM_MOUSEMOVE: |
1933 GetCursorPos(&point); | 1940 GetCursorPos(&point); |
1934 GetWindowRect(hwnd, &rect); | 1941 GetWindowRect(hwnd, &rect); |
1935 | 1942 |
1936 if(PtInRect(&rect, point)){ | 1943 if(PtInRect(&rect, point)) |
1937 if(hwnd != GetCapture()){ | 1944 { |
1945 if(hwnd != GetCapture()) | |
1946 { | |
1938 SetCapture(hwnd); | 1947 SetCapture(hwnd); |
1939 } | 1948 } |
1940 if(!bMouseOver){ | 1949 if(!bMouseOver) |
1950 { | |
1941 bMouseOver = 1; | 1951 bMouseOver = 1; |
1942 if(!*bubble->bubbletext) | 1952 if(!*bubble->bubbletext) |
1943 break; | 1953 break; |
1944 | 1954 |
1945 if(hwndBubble) | 1955 if(hwndBubble) |
2005 /* Calling ReleaseCapture in Win95 also causes WM_CAPTURECHANGED | 2015 /* Calling ReleaseCapture in Win95 also causes WM_CAPTURECHANGED |
2006 * to be sent. Be sure to account for that. | 2016 * to be sent. Be sure to account for that. |
2007 */ | 2017 */ |
2008 ReleaseCapture(); | 2018 ReleaseCapture(); |
2009 | 2019 |
2010 if(bMouseOver){ | 2020 if(bMouseOver) |
2021 { | |
2011 bMouseOver = 0; | 2022 bMouseOver = 0; |
2012 DestroyWindow(hwndBubble); | 2023 DestroyWindow(hwndBubble); |
2013 hwndBubble = 0; | 2024 hwndBubble = 0; |
2014 KillTimer(hwndBubbleLast, 1); | 2025 KillTimer(hwndBubbleLast, 1); |
2015 } | 2026 } |
2018 case WM_CAPTURECHANGED: | 2029 case WM_CAPTURECHANGED: |
2019 /* This message means we are losing the capture for some reason | 2030 /* This message means we are losing the capture for some reason |
2020 * Either because we intentionally lost it or another window | 2031 * Either because we intentionally lost it or another window |
2021 * stole it | 2032 * stole it |
2022 */ | 2033 */ |
2023 if(bMouseOver){ | 2034 if(bMouseOver) |
2035 { | |
2024 bMouseOver = 0; | 2036 bMouseOver = 0; |
2025 DestroyWindow(hwndBubble); | 2037 DestroyWindow(hwndBubble); |
2026 hwndBubble = 0; | 2038 hwndBubble = 0; |
2027 KillTimer(hwndBubbleLast, 1); | 2039 KillTimer(hwndBubbleLast, 1); |
2028 } | 2040 } |
2032 if(!bubble->pOldProc) | 2044 if(!bubble->pOldProc) |
2033 return DefWindowProc(hwnd, msg, mp1, mp2); | 2045 return DefWindowProc(hwnd, msg, mp1, mp2); |
2034 return CallWindowProc(bubble->pOldProc, hwnd, msg, mp1, mp2); | 2046 return CallWindowProc(bubble->pOldProc, hwnd, msg, mp1, mp2); |
2035 } | 2047 } |
2036 | 2048 |
2049 /* This function recalculates a notebook page for example | |
2050 * during switching of notebook pages. | |
2051 */ | |
2037 void _resize_notebook_page(HWND handle, int pageid) | 2052 void _resize_notebook_page(HWND handle, int pageid) |
2038 { | 2053 { |
2039 RECT rect; | 2054 RECT rect; |
2040 NotebookPage **array = (NotebookPage **)GetWindowLong(handle, GWL_USERDATA); | 2055 NotebookPage **array = (NotebookPage **)GetWindowLong(handle, GWL_USERDATA); |
2041 | 2056 |
2043 { | 2058 { |
2044 Box *box = (Box *)GetWindowLong(array[pageid]->hwnd, GWL_USERDATA); | 2059 Box *box = (Box *)GetWindowLong(array[pageid]->hwnd, GWL_USERDATA); |
2045 | 2060 |
2046 GetClientRect(handle,&rect); | 2061 GetClientRect(handle,&rect); |
2047 TabCtrl_AdjustRect(handle,FALSE,&rect); | 2062 TabCtrl_AdjustRect(handle,FALSE,&rect); |
2048 MoveWindow(array[pageid]->hwnd,rect.left,rect.top, | 2063 MoveWindow(array[pageid]->hwnd, rect.left, rect.top, |
2049 rect.right - rect.left,rect.bottom-rect.top, | 2064 rect.right - rect.left, rect.bottom-rect.top, TRUE); |
2050 TRUE); | 2065 if(box && box->count) |
2051 if(box) | 2066 { |
2067 ShowWindow(box->items[0].hwnd, SW_HIDE); | |
2052 _do_resize(box, rect.right - rect.left, rect.bottom - rect.top); | 2068 _do_resize(box, rect.right - rect.left, rect.bottom - rect.top); |
2053 | 2069 ShowWindow(box->items[0].hwnd, SW_SHOW); |
2054 ShowWindow(array[pageid]->hwnd,SW_SHOWNORMAL); | 2070 } |
2071 | |
2072 ShowWindow(array[pageid]->hwnd, SW_SHOWNORMAL); | |
2055 } | 2073 } |
2056 } | 2074 } |
2057 | 2075 |
2058 /* | 2076 /* |
2059 * Initializes the Dynamic Windows engine. | 2077 * Initializes the Dynamic Windows engine. |
2072 | 2090 |
2073 InitCommonControlsEx(&icc); | 2091 InitCommonControlsEx(&icc); |
2074 | 2092 |
2075 memset(lookup, 0, sizeof(HICON) * ICON_INDEX_LIMIT); | 2093 memset(lookup, 0, sizeof(HICON) * ICON_INDEX_LIMIT); |
2076 | 2094 |
2095 /* Register the generic Dynamic Windows class */ | |
2077 memset(&wc, 0, sizeof(WNDCLASS)); | 2096 memset(&wc, 0, sizeof(WNDCLASS)); |
2078 wc.style = CS_DBLCLKS /*| CS_HREDRAW | CS_VREDRAW*/; | 2097 wc.style = CS_DBLCLKS; |
2079 wc.lpfnWndProc = (WNDPROC)_wndproc; | 2098 wc.lpfnWndProc = (WNDPROC)_wndproc; |
2080 wc.cbClsExtra = 0; | 2099 wc.cbClsExtra = 0; |
2081 wc.cbWndExtra = 32; | 2100 wc.cbWndExtra = 32; |
2082 wc.hbrBackground = NULL; | 2101 wc.hbrBackground = NULL; |
2083 wc.lpszMenuName = NULL; | 2102 wc.lpszMenuName = NULL; |
2084 wc.lpszClassName = ClassName; | 2103 wc.lpszClassName = ClassName; |
2085 | 2104 |
2086 RegisterClass(&wc); | 2105 RegisterClass(&wc); |
2087 | 2106 |
2107 /* Register the splitbar control */ | |
2088 memset(&wc, 0, sizeof(WNDCLASS)); | 2108 memset(&wc, 0, sizeof(WNDCLASS)); |
2089 wc.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; | 2109 wc.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; |
2090 wc.lpfnWndProc = (WNDPROC)_splitwndproc; | 2110 wc.lpfnWndProc = (WNDPROC)_splitwndproc; |
2091 wc.cbClsExtra = 0; | 2111 wc.cbClsExtra = 0; |
2092 wc.cbWndExtra = 0; | 2112 wc.cbWndExtra = 0; |
2094 wc.lpszMenuName = NULL; | 2114 wc.lpszMenuName = NULL; |
2095 wc.lpszClassName = SplitbarClassName; | 2115 wc.lpszClassName = SplitbarClassName; |
2096 | 2116 |
2097 RegisterClass(&wc); | 2117 RegisterClass(&wc); |
2098 | 2118 |
2119 /* Register a frame control like on OS/2 */ | |
2099 memset(&wc, 0, sizeof(WNDCLASS)); | 2120 memset(&wc, 0, sizeof(WNDCLASS)); |
2100 wc.style = CS_DBLCLKS /*| CS_HREDRAW | CS_VREDRAW*/; | 2121 wc.style = CS_DBLCLKS; |
2101 wc.lpfnWndProc = (WNDPROC)_framewndproc; | 2122 wc.lpfnWndProc = (WNDPROC)_framewndproc; |
2102 wc.cbClsExtra = 0; | 2123 wc.cbClsExtra = 0; |
2103 wc.cbWndExtra = 32; | 2124 wc.cbWndExtra = 32; |
2104 wc.hbrBackground = (HBRUSH)COLOR_WINDOW; | 2125 wc.hbrBackground = (HBRUSH)COLOR_WINDOW; |
2105 wc.hCursor = LoadCursor(NULL, IDC_ARROW); | 2126 wc.hCursor = LoadCursor(NULL, IDC_ARROW); |
2106 wc.lpszMenuName = NULL; | 2127 wc.lpszMenuName = NULL; |
2107 wc.lpszClassName = FRAMECLASSNAME; | 2128 wc.lpszClassName = FRAMECLASSNAME; |
2108 | 2129 |
2130 RegisterClass(&wc); | |
2131 | |
2132 /* Create a set of brushes using the default OS/2 and DOS colors */ | |
2109 for(z=0;z<18;z++) | 2133 for(z=0;z<18;z++) |
2110 _colors[z] = CreateSolidBrush(RGB(_red[z],_green[z],_blue[z])); | 2134 _colors[z] = CreateSolidBrush(RGB(_red[z],_green[z],_blue[z])); |
2111 | 2135 |
2112 RegisterClass(&wc); | 2136 /* Register an Object Windows class like OS/2 and Win2k+ |
2113 | 2137 * so similar functionality can be used on earlier releases |
2138 * of Windows. | |
2139 */ | |
2114 memset(&wc, 0, sizeof(WNDCLASS)); | 2140 memset(&wc, 0, sizeof(WNDCLASS)); |
2115 wc.style = 0; | 2141 wc.style = 0; |
2116 wc.lpfnWndProc = (WNDPROC)_wndproc; | 2142 wc.lpfnWndProc = (WNDPROC)_wndproc; |
2117 wc.cbClsExtra = 0; | 2143 wc.cbClsExtra = 0; |
2118 wc.cbWndExtra = 0; | 2144 wc.cbWndExtra = 0; |
2299 * Parameters: | 2325 * Parameters: |
2300 * handle: The window handle to make visible. | 2326 * handle: The window handle to make visible. |
2301 */ | 2327 */ |
2302 int dw_window_show(HWND handle) | 2328 int dw_window_show(HWND handle) |
2303 { | 2329 { |
2304 int rc = ShowWindow(handle, TRUE); | 2330 int rc = ShowWindow(handle, SW_SHOW); |
2305 SetFocus(handle); | 2331 SetFocus(handle); |
2306 _initial_focus(handle); | 2332 _initial_focus(handle); |
2307 return rc; | 2333 return rc; |
2308 } | 2334 } |
2309 | 2335 |
2312 * Parameters: | 2338 * Parameters: |
2313 * handle: The window handle to make visible. | 2339 * handle: The window handle to make visible. |
2314 */ | 2340 */ |
2315 int dw_window_hide(HWND handle) | 2341 int dw_window_hide(HWND handle) |
2316 { | 2342 { |
2317 return ShowWindow(handle, FALSE); | 2343 return ShowWindow(handle, SW_HIDE); |
2318 } | 2344 } |
2319 | 2345 |
2320 /* | 2346 /* |
2321 * Destroys a window and all of it's children. | 2347 * Destroys a window and all of it's children. |
2322 * Parameters: | 2348 * Parameters: |
3759 int pageid; | 3785 int pageid; |
3760 | 3786 |
3761 if(!array) | 3787 if(!array) |
3762 return; | 3788 return; |
3763 | 3789 |
3764 pageid= _findnotebookid(array, pageidx); | 3790 pageid = _findnotebookid(array, pageidx); |
3765 | 3791 |
3766 if(pageid > -1 && pageid < 256) | 3792 if(pageid > -1 && pageid < 256) |
3793 { | |
3794 int oldpage = TabCtrl_GetCurSel(handle); | |
3795 | |
3796 if(oldpage > -1 && array && array[oldpage]) | |
3797 SetParent(array[oldpage]->hwnd, DW_HWND_OBJECT); | |
3798 | |
3767 TabCtrl_SetCurSel(handle, pageid); | 3799 TabCtrl_SetCurSel(handle, pageid); |
3800 | |
3801 SetParent(array[pageid]->hwnd, handle); | |
3802 _resize_notebook_page(handle, pageid); | |
3803 } | |
3768 } | 3804 } |
3769 | 3805 |
3770 /* | 3806 /* |
3771 * Appends the specified text to the listbox's (or combobox) entry list. | 3807 * Appends the specified text to the listbox's (or combobox) entry list. |
3772 * Parameters: | 3808 * Parameters: |
4675 * Returns: | 4711 * Returns: |
4676 * A handle to the widget or NULL on failure. | 4712 * A handle to the widget or NULL on failure. |
4677 */ | 4713 */ |
4678 HWND dw_render_new(unsigned long id) | 4714 HWND dw_render_new(unsigned long id) |
4679 { | 4715 { |
4716 Box *newbox = malloc(sizeof(Box)); | |
4680 HWND tmp = CreateWindow(ObjectClassName, | 4717 HWND tmp = CreateWindow(ObjectClassName, |
4681 "", | 4718 "", |
4682 WS_CHILD | WS_CLIPCHILDREN, | 4719 WS_CHILD | WS_CLIPCHILDREN, |
4683 0,0,2000,1000, | 4720 0,0,2000,1000, |
4684 DW_HWND_OBJECT, | 4721 DW_HWND_OBJECT, |
4685 NULL, | 4722 NULL, |
4686 NULL, | 4723 NULL, |
4687 NULL); | 4724 NULL); |
4688 SubclassWindow(tmp, _rendwndproc); | 4725 newbox->pad = 0; |
4726 newbox->type = 0; | |
4727 newbox->count = 0; | |
4728 newbox->grouphwnd = (HWND)NULL; | |
4729 newbox->cinfo.pOldProc = SubclassWindow(tmp, _rendwndproc); | |
4730 newbox->cinfo.fore = newbox->cinfo.back = -1; | |
4731 | |
4732 SetWindowLong(tmp, GWL_USERDATA, (ULONG)newbox); | |
4689 return tmp; | 4733 return tmp; |
4690 } | 4734 } |
4691 | 4735 |
4692 /* Sets the current foreground drawing color. | 4736 /* Sets the current foreground drawing color. |
4693 * Parameters: | 4737 * Parameters: |
4841 | 4885 |
4842 if(threadid < 0 || threadid >= THREAD_LIMIT) | 4886 if(threadid < 0 || threadid >= THREAD_LIMIT) |
4843 threadid = 0; | 4887 threadid = 0; |
4844 | 4888 |
4845 if(handle) | 4889 if(handle) |
4846 { | |
4847 hdc = GetDC(handle); | 4890 hdc = GetDC(handle); |
4848 hFont = (HFONT)SendMessage(handle, WM_GETFONT, 0, 0); | |
4849 } | |
4850 else if(pixmap) | 4891 else if(pixmap) |
4851 { | |
4852 hdc = pixmap->hdc; | 4892 hdc = pixmap->hdc; |
4853 hFont = (HFONT)SendMessage(pixmap->handle, WM_GETFONT, 0, 0); | |
4854 } | |
4855 else | 4893 else |
4856 return; | 4894 return; |
4857 | 4895 |
4858 if(!hFont) | |
4859 { | 4896 { |
4860 ColorInfo *cinfo; | 4897 ColorInfo *cinfo; |
4861 | 4898 |
4862 if(handle) | 4899 if(handle) |
4863 cinfo = (ColorInfo *)GetWindowLong(handle, GWL_USERDATA); | 4900 cinfo = (ColorInfo *)GetWindowLong(handle, GWL_USERDATA); |