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
This commit is contained in:
Fred Kiefer 2008-03-07 23:11:02 +00:00
parent cef51849f7
commit 3c163d1c72
2 changed files with 28 additions and 25 deletions

View file

@ -1,3 +1,8 @@
2008-03-08 Fred Kiefer <FredKiefer@gmx.de>
* Source\win32\WIN32Server.m (-exwindowStyleForGSStyle:):
New method used in window::::, stylewindow: and styleoffsets:::::.
2008-03-06 Richard Frith-Macdonald <rfm@gnu.org> 2008-03-06 Richard Frith-Macdonald <rfm@gnu.org>
* Headers\win32\WIN32Server.h: make 'orderedIn' and 'level' 32bit * Headers\win32\WIN32Server.h: make 'orderedIn' and 'level' 32bit
@ -6,7 +11,7 @@
* Source\win32\w32_movesize.m: * Source\win32\w32_movesize.m:
* Source\win32\WIN32Server.m: * Source\win32\WIN32Server.m:
Change to accessing 'orderedIn' and 'level' directly using 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. are owned by another app.
2008-03-06 Richard Frith-Macdonald <rfm@gnu.org> 2008-03-06 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -461,20 +461,26 @@ NSLog(@"Callback");
} }
//NSLog(@"Window wstyle %d for style %d", wstyle, style); //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 DWORD estyle = 0;
LONG result;
ShowWindow(hwnd, SW_HIDE); if ((style & NSMiniaturizableWindowMask) == NSMiniaturizableWindowMask)
SetLastError(0); {
result = SetWindowLong(hwnd, GWL_EXSTYLE, WS_EX_APPWINDOW); if ([self usesNativeTaskbar])
result = SetWindowLong(hwnd, GWL_STYLE, (LONG)aStyle); estyle = WS_EX_APPWINDOW;
// should check error here... else
ShowWindow(hwnd, SW_SHOWNORMAL); estyle = WS_EX_TOOLWINDOW;
}
else
{
estyle = WS_EX_TOOLWINDOW;
}
return estyle;
} }
- (void) resizeBackingStoreFor: (HWND)hwnd - (void) resizeBackingStoreFor: (HWND)hwnd
@ -865,19 +871,8 @@ NSLog(@"Callback");
flags.currentGS_Style = style; flags.currentGS_Style = style;
wstyle = [self windowStyleForGSStyle: style] | WS_CLIPCHILDREN; wstyle = [self windowStyleForGSStyle: style];
estyle = [self exwindowStyleForGSStyle: style];
if ((style & NSMiniaturizableWindowMask) == NSMiniaturizableWindowMask)
{
if ([self usesNativeTaskbar])
estyle = WS_EX_APPWINDOW;
else
estyle = WS_EX_TOOLWINDOW;
}
else
{
estyle = WS_EX_TOOLWINDOW;
}
r = GSScreenRectToMS(frame, style, self); r = GSScreenRectToMS(frame, style, self);
@ -916,12 +911,14 @@ NSLog(@"Callback");
- (void) stylewindow: (unsigned int)style : (int) winNum - (void) stylewindow: (unsigned int)style : (int) winNum
{ {
DWORD wstyle = [self windowStyleForGSStyle: style]; DWORD wstyle = [self windowStyleForGSStyle: style];
DWORD estyle = [self exwindowStyleForGSStyle: style];
NSAssert([self handlesWindowDecorations], NSAssert([self handlesWindowDecorations],
@"-stylewindow: : called when [self handlesWindowDecorations] == NO"); @"-stylewindow: : called when [self handlesWindowDecorations] == NO");
NSDebugLLog(@"WTrace", @"stylewindow: %d : %d", style, winNum); NSDebugLLog(@"WTrace", @"stylewindow: %d : %d", style, winNum);
SetWindowLong((HWND)winNum, GWL_STYLE, wstyle); SetWindowLong((HWND)winNum, GWL_STYLE, wstyle);
SetWindowLong(hwnd, GWL_EXSTYLE, estyle);
} }
- (void) setbackgroundcolor: (NSColor *)color : (int)win - (void) setbackgroundcolor: (NSColor *)color : (int)win
@ -1406,9 +1403,10 @@ NSLog(@"Callback");
if ([self handlesWindowDecorations]) if ([self handlesWindowDecorations])
{ {
DWORD wstyle = [self windowStyleForGSStyle: style]; DWORD wstyle = [self windowStyleForGSStyle: style];
DWORD estyle = [self exwindowStyleForGSStyle: style];
RECT rect = {100, 100, 200, 200}; RECT rect = {100, 100, 200, 200};
AdjustWindowRectEx(&rect, wstyle, NO, 0); AdjustWindowRectEx(&rect, wstyle, NO, estyle);
*l = 100 - rect.left; *l = 100 - rect.left;
*r = rect.right - 200; *r = rect.right - 200;