Mercurial > dwindows
comparison win/dw.c @ 542:a95f39e81fe2
Fixed optimization errors on Windows.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 01 Apr 2004 07:48:52 +0000 |
parents | 8f80ed604a89 |
children | 536b32eb0cb0 |
comparison
equal
deleted
inserted
replaced
541:f65fc3a049ff | 542:a95f39e81fe2 |
---|---|
2689 } | 2689 } |
2690 } | 2690 } |
2691 | 2691 |
2692 void _handle_splitbar_resize(HWND hwnd, float percent, int type, int x, int y) | 2692 void _handle_splitbar_resize(HWND hwnd, float percent, int type, int x, int y) |
2693 { | 2693 { |
2694 HWND handle1, handle2; | |
2695 Box *tmp; | |
2696 | |
2694 if(type == DW_HORZ) | 2697 if(type == DW_HORZ) |
2695 { | 2698 { |
2696 int newx = x; | 2699 int newx = x; |
2697 float ratio = (float)percent/(float)100.0; | 2700 float ratio = (float)percent/(float)100.0; |
2698 HWND handle1 = (HWND)dw_window_get_data(hwnd, "_dw_topleft"); | 2701 |
2699 HWND handle2 = (HWND)dw_window_get_data(hwnd, "_dw_bottomright"); | 2702 handle1 = (HWND)dw_window_get_data(hwnd, "_dw_topleft"); |
2700 Box *tmp = (Box *)GetWindowLongPtr(handle1, GWLP_USERDATA); | 2703 handle2 = (HWND)dw_window_get_data(hwnd, "_dw_bottomright"); |
2704 tmp = (Box *)GetWindowLongPtr(handle1, GWLP_USERDATA); | |
2701 | 2705 |
2702 newx = (int)((float)newx * ratio) - (SPLITBAR_WIDTH/2); | 2706 newx = (int)((float)newx * ratio) - (SPLITBAR_WIDTH/2); |
2703 | 2707 |
2704 ShowWindow(handle1, SW_HIDE); | 2708 ShowWindow(handle1, SW_HIDE); |
2705 ShowWindow(handle2, SW_HIDE); | 2709 ShowWindow(handle2, SW_HIDE); |
2718 } | 2722 } |
2719 else | 2723 else |
2720 { | 2724 { |
2721 int newy = y; | 2725 int newy = y; |
2722 float ratio = (float)(100.0-percent)/(float)100.0; | 2726 float ratio = (float)(100.0-percent)/(float)100.0; |
2723 HWND handle1 = (HWND)dw_window_get_data(hwnd, "_dw_bottomright"); | 2727 |
2724 HWND handle2 = (HWND)dw_window_get_data(hwnd, "_dw_topleft"); | 2728 handle1 = (HWND)dw_window_get_data(hwnd, "_dw_bottomright"); |
2725 Box *tmp = (Box *)GetWindowLongPtr(handle1, GWLP_USERDATA); | 2729 handle2 = (HWND)dw_window_get_data(hwnd, "_dw_topleft"); |
2730 tmp = (Box *)GetWindowLongPtr(handle1, GWLP_USERDATA); | |
2726 | 2731 |
2727 newy = (int)((float)newy * ratio) - (SPLITBAR_WIDTH/2); | 2732 newy = (int)((float)newy * ratio) - (SPLITBAR_WIDTH/2); |
2728 | 2733 |
2729 ShowWindow(handle1, SW_HIDE); | 2734 ShowWindow(handle1, SW_HIDE); |
2730 ShowWindow(handle2, SW_HIDE); | 2735 ShowWindow(handle2, SW_HIDE); |