From 3c163d1c720b725fbe68333206cedf5669194330 Mon Sep 17 00:00:00 2001 From: Fred Kiefer Date: Fri, 7 Mar 2008 23:11:02 +0000 Subject: [PATCH] New method used in window::::, stylewindow: and styleoffsets:::::. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@26243 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 +++++- Source/win32/WIN32Server.m | 46 ++++++++++++++++++-------------------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 85a0d5e..a266659 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-03-08 Fred Kiefer + + * Source\win32\WIN32Server.m (-exwindowStyleForGSStyle:): + New method used in window::::, stylewindow: and styleoffsets:::::. + 2008-03-06 Richard Frith-Macdonald * Headers\win32\WIN32Server.h: make 'orderedIn' and 'level' 32bit @@ -6,7 +11,7 @@ * Source\win32\w32_movesize.m: * Source\win32\WIN32Server.m: Change to accessing 'orderedIn' and 'level' directly using - GetWindowLong() and SetWindowLong() so that code weorks when windows + GetWindowLong() and SetWindowLong() so that code works when windows are owned by another app. 2008-03-06 Richard Frith-Macdonald diff --git a/Source/win32/WIN32Server.m b/Source/win32/WIN32Server.m index c9ca114..3bcc643 100644 --- a/Source/win32/WIN32Server.m +++ b/Source/win32/WIN32Server.m @@ -461,20 +461,26 @@ NSLog(@"Callback"); } //NSLog(@"Window wstyle %d for style %d", wstyle, style); - return wstyle; + return wstyle | WS_CLIPCHILDREN; } -- (void) resetForGSWindowStyle:(HWND)hwnd w32Style:(DWORD)aStyle +- (DWORD) exwindowStyleForGSStyle: (unsigned int) style { - // to be completed for styles - LONG result; + DWORD estyle = 0; - ShowWindow(hwnd, SW_HIDE); - SetLastError(0); - result = SetWindowLong(hwnd, GWL_EXSTYLE, WS_EX_APPWINDOW); - result = SetWindowLong(hwnd, GWL_STYLE, (LONG)aStyle); - // should check error here... - ShowWindow(hwnd, SW_SHOWNORMAL); + if ((style & NSMiniaturizableWindowMask) == NSMiniaturizableWindowMask) + { + if ([self usesNativeTaskbar]) + estyle = WS_EX_APPWINDOW; + else + estyle = WS_EX_TOOLWINDOW; + } + else + { + estyle = WS_EX_TOOLWINDOW; + } + + return estyle; } - (void) resizeBackingStoreFor: (HWND)hwnd @@ -865,19 +871,8 @@ NSLog(@"Callback"); flags.currentGS_Style = style; - wstyle = [self windowStyleForGSStyle: style] | WS_CLIPCHILDREN; - - if ((style & NSMiniaturizableWindowMask) == NSMiniaturizableWindowMask) - { - if ([self usesNativeTaskbar]) - estyle = WS_EX_APPWINDOW; - else - estyle = WS_EX_TOOLWINDOW; - } - else - { - estyle = WS_EX_TOOLWINDOW; - } + wstyle = [self windowStyleForGSStyle: style]; + estyle = [self exwindowStyleForGSStyle: style]; r = GSScreenRectToMS(frame, style, self); @@ -916,12 +911,14 @@ NSLog(@"Callback"); - (void) stylewindow: (unsigned int)style : (int) winNum { DWORD wstyle = [self windowStyleForGSStyle: style]; + DWORD estyle = [self exwindowStyleForGSStyle: style]; NSAssert([self handlesWindowDecorations], @"-stylewindow: : called when [self handlesWindowDecorations] == NO"); NSDebugLLog(@"WTrace", @"stylewindow: %d : %d", style, winNum); SetWindowLong((HWND)winNum, GWL_STYLE, wstyle); + SetWindowLong(hwnd, GWL_EXSTYLE, estyle); } - (void) setbackgroundcolor: (NSColor *)color : (int)win @@ -1406,9 +1403,10 @@ NSLog(@"Callback"); if ([self handlesWindowDecorations]) { DWORD wstyle = [self windowStyleForGSStyle: style]; + DWORD estyle = [self exwindowStyleForGSStyle: style]; RECT rect = {100, 100, 200, 200}; - AdjustWindowRectEx(&rect, wstyle, NO, 0); + AdjustWindowRectEx(&rect, wstyle, NO, estyle); *l = 100 - rect.left; *r = rect.right - 200;