< prev index next >

src/java.desktop/windows/native/libawt/windows/awt_Component.cpp

Print this page




 941         || ((::GetWindowLong(wnd, GWL_STYLE) & WS_CHILD) == 0))
 942     {
 943         return ::SetWindowPos(wnd, after, x, y, w, h, flags);
 944     }
 945     WINDOWPLACEMENT wp;
 946     ::ZeroMemory(&wp, sizeof(wp));
 947 
 948     wp.length = sizeof(wp);
 949     ::GetWindowPlacement(wnd, &wp);
 950     wp.rcNormalPosition.left = x;
 951     wp.rcNormalPosition.top = y;
 952     wp.rcNormalPosition.right = x + w;
 953     wp.rcNormalPosition.bottom = y + h;
 954     if ( flags & SWP_NOACTIVATE ) {
 955         wp.showCmd = SW_SHOWNOACTIVATE;
 956     }
 957     ::SetWindowPlacement(wnd, &wp);
 958     return 1;
 959 }
 960 



 961 
 962 void AwtComponent::Reshape(int x, int y, int w, int h)
 963 {
 964 #if defined(DEBUG)
 965     RECT        rc;
 966     ::GetWindowRect(GetHWnd(), &rc);
 967     ::MapWindowPoints(HWND_DESKTOP, ::GetParent(GetHWnd()), (LPPOINT)&rc, 2);
 968     DTRACE_PRINTLN4("AwtComponent::Reshape from %d, %d, %d, %d", rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top);
 969 #endif
 970 
 971     x = ScaleUpX(x);
 972     y = ScaleUpY(y);
 973     w = ScaleUpX(w);
 974     h = ScaleUpY(h);
 975 
 976     AwtWindow* container = GetContainer();
 977     AwtComponent* parent = GetParent();
 978     if (container != NULL && container == parent) {
 979         container->SubtractInsetPoint(x, y);
 980     }
 981     DTRACE_PRINTLN4("AwtComponent::Reshape to %d, %d, %d, %d", x, y, w, h);
 982     UINT flags = SWP_NOACTIVATE | SWP_NOZORDER;
 983 
 984     RECT        r;
 985 
 986     ::GetWindowRect(GetHWnd(), &r);
 987     // if the component size is changing , don't copy window bits
 988     if (r.right - r.left != w || r.bottom - r.top != h) {
 989         flags |= SWP_NOCOPYBITS;
 990     }
 991 
 992     if (parent && _tcscmp(parent->GetClassName(), TEXT("SunAwtScrollPane")) == 0) {
 993         if (x > 0) {
 994             x = 0;




 941         || ((::GetWindowLong(wnd, GWL_STYLE) & WS_CHILD) == 0))
 942     {
 943         return ::SetWindowPos(wnd, after, x, y, w, h, flags);
 944     }
 945     WINDOWPLACEMENT wp;
 946     ::ZeroMemory(&wp, sizeof(wp));
 947 
 948     wp.length = sizeof(wp);
 949     ::GetWindowPlacement(wnd, &wp);
 950     wp.rcNormalPosition.left = x;
 951     wp.rcNormalPosition.top = y;
 952     wp.rcNormalPosition.right = x + w;
 953     wp.rcNormalPosition.bottom = y + h;
 954     if ( flags & SWP_NOACTIVATE ) {
 955         wp.showCmd = SW_SHOWNOACTIVATE;
 956     }
 957     ::SetWindowPlacement(wnd, &wp);
 958     return 1;
 959 }
 960 
 961 void AwtComponent::Reshape(int x, int y, int w, int h) {
 962     ReshapeNoScale(ScaleUpX(x), ScaleUpY(y), ScaleUpX(w), ScaleUpY(h));
 963 }
 964 
 965 void AwtComponent::ReshapeNoScale(int x, int y, int w, int h)
 966 {
 967 #if defined(DEBUG)
 968     RECT        rc;
 969     ::GetWindowRect(GetHWnd(), &rc);
 970     ::MapWindowPoints(HWND_DESKTOP, ::GetParent(GetHWnd()), (LPPOINT)&rc, 2);
 971     DTRACE_PRINTLN4("AwtComponent::Reshape from %d, %d, %d, %d", rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top);
 972 #endif





 973 
 974     AwtWindow* container = GetContainer();
 975     AwtComponent* parent = GetParent();
 976     if (container != NULL && container == parent) {
 977         container->SubtractInsetPoint(x, y);
 978     }
 979     DTRACE_PRINTLN4("AwtComponent::Reshape to %d, %d, %d, %d", x, y, w, h);
 980     UINT flags = SWP_NOACTIVATE | SWP_NOZORDER;
 981 
 982     RECT        r;
 983 
 984     ::GetWindowRect(GetHWnd(), &r);
 985     // if the component size is changing , don't copy window bits
 986     if (r.right - r.left != w || r.bottom - r.top != h) {
 987         flags |= SWP_NOCOPYBITS;
 988     }
 989 
 990     if (parent && _tcscmp(parent->GetClassName(), TEXT("SunAwtScrollPane")) == 0) {
 991         if (x > 0) {
 992             x = 0;


< prev index next >