Minor tidying

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3435 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1998-12-12 10:03:44 +00:00
parent 0ee2f21566
commit 01ac1e8035
2 changed files with 39 additions and 33 deletions

View file

@ -1,14 +1,14 @@
/* /*
NSPanel.m NSPanel.m
Panel window class and related functions Panel window class and related functions
Copyright (C) 1996 Free Software Foundation, Inc. Copyright (C) 1996 Free Software Foundation, Inc.
NSPanel implementation NSPanel implementation
Author: Scott Christley <scottc@net-community.com> Author: Scott Christley <scottc@net-community.com>
Date: 1996 Date: 1996
GSAlertPanel and alert panel functions implementation GSAlertPanel and alert panel functions implementation
Author: Richard Frith-Macdonald <richard@brainstorm.co.uk> Author: Richard Frith-Macdonald <richard@brainstorm.co.uk>
Date: 1998 Date: 1998
@ -19,7 +19,7 @@
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@ -29,7 +29,7 @@
License along with this library; see the file COPYING.LIB. License along with this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation, If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include <gnustep/gui/config.h> #include <gnustep/gui/config.h>
@ -50,7 +50,7 @@
//***************************************************************************** //*****************************************************************************
// //
// NSPanel // NSPanel
// //
//***************************************************************************** //*****************************************************************************
@ -61,8 +61,10 @@
// //
+ (void)initialize + (void)initialize
{ {
if (self == [NSPanel class]) if (self == [NSPanel class])
[self setVersion:1]; {
[self setVersion:1];
}
} }
// //
@ -70,16 +72,16 @@
// //
- init - init
{ {
int style = NSTitledWindowMask | NSClosableWindowMask; int style = NSTitledWindowMask | NSClosableWindowMask;
return [self initWithContentRect:NSZeroRect return [self initWithContentRect: NSZeroRect
styleMask:style styleMask: style
backing:NSBackingStoreBuffered backing: NSBackingStoreBuffered
defer:NO]; defer: NO];
} }
// //
// Determining the Panel's Behavior // Determining the Panel's Behavior
// //
- (BOOL)isFloatingPanel { return _isFloatingPanel; } - (BOOL)isFloatingPanel { return _isFloatingPanel; }
- (void)setFloatingPanel:(BOOL)flag { _isFloatingPanel = flag; } - (void)setFloatingPanel:(BOOL)flag { _isFloatingPanel = flag; }
@ -89,7 +91,7 @@ int style = NSTitledWindowMask | NSClosableWindowMask;
- (void)setBecomesKeyOnlyIfNeeded:(BOOL)flag - (void)setBecomesKeyOnlyIfNeeded:(BOOL)flag
{ {
_becomesKeyOnlyIfNeeded = flag; _becomesKeyOnlyIfNeeded = flag;
} }
// //
@ -111,12 +113,12 @@ int style = NSTitledWindowMask | NSClosableWindowMask;
//***************************************************************************** //*****************************************************************************
// //
// GSAlertPanel // GSAlertPanel
// //
//***************************************************************************** //*****************************************************************************
#define PANX 362.0 #define PANX 362.0
#define PANY 191.0 #define PANY 161.0
@class GSAlertPanel; @class GSAlertPanel;
@ -151,8 +153,10 @@ static GSAlertPanel *reusableAlertPanel = nil;
// //
+ (void)initialize + (void)initialize
{ {
if (self == [GSAlertPanel class]) if (self == [GSAlertPanel class])
[self setVersion:1]; {
[self setVersion:1];
}
} }
- (void) buttonAction: (id)sender - (void) buttonAction: (id)sender
@ -215,6 +219,7 @@ static GSAlertPanel *reusableAlertPanel = nil;
if (self) if (self)
{ {
NSView *content; NSView *content;
NSImage *image;
unsigned bs = 10.0; /* Inter-button space */ unsigned bs = 10.0; /* Inter-button space */
unsigned bh = 24.0; /* Button height. */ unsigned bh = 24.0; /* Button height. */
unsigned bw = 72.0; /* Button width. */ unsigned bw = 72.0; /* Button width. */
@ -225,7 +230,7 @@ static GSAlertPanel *reusableAlertPanel = nil;
[self setMinSize: r.size]; [self setMinSize: r.size];
[self setTitle: @" "]; [self setTitle: @" "];
content = [self contentView]; content = [self contentView];
rect.size.height = 2.0; rect.size.height = 2.0;
rect.size.width = 362.0; rect.size.width = 362.0;
@ -280,8 +285,8 @@ static GSAlertPanel *reusableAlertPanel = nil;
[icoButton setBordered: NO]; [icoButton setBordered: NO];
[icoButton setEnabled: NO]; [icoButton setEnabled: NO];
[icoButton setImagePosition: NSImageOnly]; [icoButton setImagePosition: NSImageOnly];
[icoButton setImage: image = [[NSApplication sharedApplication] applicationIconImage];
[[NSApplication sharedApplication] applicationIconImage]]; [icoButton setImage: image];
rect.size.height = 36.0; rect.size.height = 36.0;
rect.size.width = 344.0; rect.size.width = 344.0;
@ -294,6 +299,7 @@ static GSAlertPanel *reusableAlertPanel = nil;
[messageField setSelectable: NO]; [messageField setSelectable: NO];
[messageField setBordered: NO]; [messageField setBordered: NO];
[messageField setDrawsBackground: NO]; [messageField setDrawsBackground: NO];
[messageField setAlignment: NSCenterTextAlignment];
[messageField setStringValue: @""]; [messageField setStringValue: @""];
[messageField setFont: [NSFont systemFontOfSize: 14.0]]; [messageField setFont: [NSFont systemFontOfSize: 14.0]];
@ -413,7 +419,7 @@ static GSAlertPanel *reusableAlertPanel = nil;
//***************************************************************************** //*****************************************************************************
// //
// Alert panel functions // Alert panel functions
// //
//***************************************************************************** //*****************************************************************************

View file

@ -643,12 +643,12 @@ PSMatrix* matrix;
changey = [super_view bounds].size.height - oldSize.height; changey = [super_view bounds].size.height - oldSize.height;
// adjust the X axis // adjust the X axis
fprintf (stderr, "NSView resizeWithOldSuperviewSize: \n"); // fprintf (stderr, "NSView resizeWithOldSuperviewSize: \n");
fprintf (stderr, "Change x,y (%1.2f, %1.2f)\n", changex, changey); // fprintf (stderr, "Change x,y (%1.2f, %1.2f)\n", changex, changey);
fprintf (stderr, // fprintf (stderr,
"NSView: old origin (%1.2f, %1.2f), size (%1.2f, %1.2f)\n", // "NSView: old origin (%1.2f, %1.2f), size (%1.2f, %1.2f)\n",
frame.origin.x, frame.origin.y, // frame.origin.x, frame.origin.y,
frame.size.width, frame.size.height); // frame.size.width, frame.size.height);
if (changex) if (changex)
{ {
@ -742,10 +742,10 @@ PSMatrix* matrix;
} }
} }
fprintf (stderr, // fprintf (stderr,
"NSView: new origin (%1.2f, %1.2f), size (%1.2f, %1.2f)\n", // "NSView: new origin (%1.2f, %1.2f), size (%1.2f, %1.2f)\n",
frame.origin.x, frame.origin.y, // frame.origin.x, frame.origin.y,
frame.size.width, frame.size.height); // frame.size.width, frame.size.height);
/* FIXME /* FIXME
* The lines containing 'floor()' ensure that the frame sizes are an integer * The lines containing 'floor()' ensure that the frame sizes are an integer