comparison win/dw.c @ 539:8f80ed604a89

Some splitbar optimizations, removed unneeded code and optimized crucial codepaths (window procedures) on OS/2 and Windows. I also figured out what the splitbar problem is on OS/2, but the fix is not yet finished. I have a somewhat working fix but it causes some other problems. So I have not committed it yet.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 01 Apr 2004 07:25:38 +0000
parents 222b0f32e7c9
children a95f39e81fe2
comparison
equal deleted inserted replaced
538:5c1ee7f6e7ff 539:8f80ed604a89
2712 newx = x - newx - SPLITBAR_WIDTH; 2712 newx = x - newx - SPLITBAR_WIDTH;
2713 2713
2714 MoveWindow(handle2, x - newx, 0, newx, y, FALSE); 2714 MoveWindow(handle2, x - newx, 0, newx, y, FALSE);
2715 _do_resize(tmp, newx - 1, y - 1); 2715 _do_resize(tmp, newx - 1, y - 1);
2716 2716
2717 ShowWindow(handle1, SW_SHOW);
2718 ShowWindow(handle2, SW_SHOW);
2719
2720 dw_window_set_data(hwnd, "_dw_start", (void *)newx); 2717 dw_window_set_data(hwnd, "_dw_start", (void *)newx);
2721 } 2718 }
2722 else 2719 else
2723 { 2720 {
2724 int newy = y; 2721 int newy = y;
2740 newy = y - newy - SPLITBAR_WIDTH; 2737 newy = y - newy - SPLITBAR_WIDTH;
2741 2738
2742 MoveWindow(handle2, 0, 0, x, newy, FALSE); 2739 MoveWindow(handle2, 0, 0, x, newy, FALSE);
2743 _do_resize(tmp, x - 1, newy - 1); 2740 _do_resize(tmp, x - 1, newy - 1);
2744 2741
2745 ShowWindow(handle1, SW_SHOW);
2746 ShowWindow(handle2, SW_SHOW);
2747
2748 dw_window_set_data(hwnd, "_dw_start", (void *)newy); 2742 dw_window_set_data(hwnd, "_dw_start", (void *)newy);
2749 } 2743 }
2744
2745 ShowWindow(handle1, SW_SHOW);
2746 ShowWindow(handle2, SW_SHOW);
2750 } 2747 }
2751 2748
2752 /* This handles any activity on the splitbars (sizers) */ 2749 /* This handles any activity on the splitbars (sizers) */
2753 BOOL CALLBACK _splitwndproc(HWND hwnd, UINT msg, WPARAM mp1, LPARAM mp2) 2750 BOOL CALLBACK _splitwndproc(HWND hwnd, UINT msg, WPARAM mp1, LPARAM mp2)
2754 { 2751 {
2755 float *percent = (float *)dw_window_get_data(hwnd, "_dw_percent");
2756 int type = (int)dw_window_get_data(hwnd, "_dw_type");
2757 int start = (int)dw_window_get_data(hwnd, "_dw_start");
2758
2759 switch (msg) 2752 switch (msg)
2760 { 2753 {
2761 case WM_ACTIVATE: 2754 case WM_ACTIVATE:
2762 case WM_SETFOCUS: 2755 case WM_SETFOCUS:
2763 return FALSE; 2756 return FALSE;
2764 2757
2765 case WM_PAINT: 2758 case WM_PAINT:
2766 { 2759 {
2767 PAINTSTRUCT ps; 2760 PAINTSTRUCT ps;
2768 HDC hdcPaint; 2761 HDC hdcPaint;
2762 int type = (int)dw_window_get_data(hwnd, "_dw_type");
2763 int start = (int)dw_window_get_data(hwnd, "_dw_start");
2769 2764
2770 BeginPaint(hwnd, &ps); 2765 BeginPaint(hwnd, &ps);
2771 2766
2772 if((hdcPaint = GetDC(hwnd)) != NULL) 2767 if((hdcPaint = GetDC(hwnd)) != NULL)
2773 { 2768 {
2800 ReleaseCapture(); 2795 ReleaseCapture();
2801 } 2796 }
2802 break; 2797 break;
2803 case WM_MOUSEMOVE: 2798 case WM_MOUSEMOVE:
2804 { 2799 {
2800 float *percent = (float *)dw_window_get_data(hwnd, "_dw_percent");
2801 int type = (int)dw_window_get_data(hwnd, "_dw_type");
2802 int start;
2803
2805 if(type == DW_HORZ) 2804 if(type == DW_HORZ)
2806 SetCursor(LoadCursor(NULL, IDC_SIZEWE)); 2805 SetCursor(LoadCursor(NULL, IDC_SIZEWE));
2807 else 2806 else
2808 SetCursor(LoadCursor(NULL, IDC_SIZENS)); 2807 SetCursor(LoadCursor(NULL, IDC_SIZENS));
2809 2808