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:
fredkiefer 2008-03-07 23:11:02 +00:00
parent 46a1bbe6fa
commit 15571447d9
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>
* 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 <rfm@gnu.org>

View file

@ -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;