mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 18:11:06 +00:00
Implement methods for resizing subviews.
Some minor bug fixes. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@1637 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
64f0e88fd0
commit
9ce655f2c1
6 changed files with 65 additions and 9 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
Wed Jun 19 14:25:46 1996 Scott Christley <scottc@net-community.com>
|
||||
|
||||
* Source/NSView.m (resizeSubviewsWithOldSize:): Implement method.
|
||||
(setFrame:): Notify subviews that size has changed.
|
||||
(initWithFrame:): Automatically resize subviews.
|
||||
* Source/Makefile.sed.nt: Have the library automatically contain
|
||||
COFF debugging information.
|
||||
* Source/NSButton.m (mouseDown:): Ignore the mouse if the button
|
||||
is not enabled.
|
||||
* Source/NSFont.m (MB_USER_FIXED_FONT, MB_USER_FONT): Rename
|
||||
global variables to correspond with coding standards.
|
||||
|
||||
Thu Jun 6 09:20:51 1996 GNUstep Development <gnustep@duncan.ocbi.com>
|
||||
|
||||
* Headers/gnustep/gui/NSApplication.h (-context): New method.
|
||||
|
|
|
@ -20,7 +20,7 @@ s/INIT_FILE =/INIT_FILE = gnustep_gui_init_runtime/
|
|||
s/@LDFLAGS@/-align:0x1000 -entry:WinMainCRTStartup -stack:1000000,1000000/
|
||||
s/LD = ld/LD = ld -subsystem:windows/
|
||||
s/LDOUT =/LDOUT = -out:/
|
||||
s/LIB = ar/LIB = lib/
|
||||
s/LIB = ar/LIB = lib -debugtype:coff/
|
||||
s/LIBFLAGS = rc/LIBFLAGS =/
|
||||
s/LIBOUT =/LIBOUT = -out:/
|
||||
s/@RANLIB@/touch/
|
||||
|
|
|
@ -102,6 +102,14 @@ id MB_NSBUTTON_CLASS;
|
|||
[self display];
|
||||
}
|
||||
|
||||
//
|
||||
// Identifying the Selected Cell
|
||||
//
|
||||
- (id)selectedCell
|
||||
{
|
||||
return cell;
|
||||
}
|
||||
|
||||
//
|
||||
// Setting the State
|
||||
//
|
||||
|
@ -257,6 +265,10 @@ id MB_NSBUTTON_CLASS;
|
|||
|
||||
NSDebugLog(@"NSButton mouseDown\n");
|
||||
|
||||
// If we are not enabled then ignore the mouse
|
||||
if (![self isEnabled])
|
||||
return;
|
||||
|
||||
// capture mouse
|
||||
[[self window] captureMouse: self];
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
#include <gnustep/gui/NSFont.h>
|
||||
#include <gnustep/gui/NSFontManager.h>
|
||||
|
||||
NSFont *MB_USER_FIXED_FONT;
|
||||
NSFont *MB_USER_FONT;
|
||||
NSFont *gnustep_gui_user_fixed_font;
|
||||
NSFont *gnustep_gui_user_font;
|
||||
|
||||
// Global Strings
|
||||
NSString *NSAFMAscender;
|
||||
|
@ -110,13 +110,13 @@ NSString *NSAFMXHeight;
|
|||
+ (NSFont *)userFixedPitchFontOfSize:(float)fontSize
|
||||
{
|
||||
NSFontManager *fm = [NSFontManager sharedFontManager];
|
||||
return [fm convertFont:MB_USER_FIXED_FONT toSize:fontSize];
|
||||
return [fm convertFont:gnustep_gui_user_fixed_font toSize:fontSize];
|
||||
}
|
||||
|
||||
+ (NSFont *)userFontOfSize:(float)fontSize
|
||||
{
|
||||
NSFontManager *fm = [NSFontManager sharedFontManager];
|
||||
return [fm convertFont:MB_USER_FONT toSize:fontSize];
|
||||
return [fm convertFont:gnustep_gui_user_font toSize:fontSize];
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -124,12 +124,12 @@ NSString *NSAFMXHeight;
|
|||
//
|
||||
+ (void)setUserFixedPitchFont:(NSFont *)aFont
|
||||
{
|
||||
MB_USER_FIXED_FONT = aFont;
|
||||
gnustep_gui_user_fixed_font = aFont;
|
||||
}
|
||||
|
||||
+ (void)setUserFont:(NSFont *)aFont
|
||||
{
|
||||
MB_USER_FONT = aFont;
|
||||
gnustep_gui_user_font = aFont;
|
||||
}
|
||||
|
||||
+ (void)useFont:(NSString *)fontName
|
||||
|
|
|
@ -154,7 +154,7 @@ NSString *NSViewFocusChangedNotification;
|
|||
disable_autodisplay = NO;
|
||||
needs_display = YES;
|
||||
post_frame_changes = NO;
|
||||
autoresize_subviews = NO;
|
||||
autoresize_subviews = YES;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
@ -365,8 +365,13 @@ NSString *NSViewFocusChangedNotification;
|
|||
|
||||
- (void)setFrame:(NSRect)frameRect
|
||||
{
|
||||
NSSize old_size = bounds.size;
|
||||
|
||||
frame = frameRect;
|
||||
bounds.size = frame.size;
|
||||
|
||||
// Resize subviews
|
||||
[self resizeSubviewsWithOldSize: old_size];
|
||||
}
|
||||
|
||||
- (void)setFrameOrigin:(NSPoint)newOrigin
|
||||
|
@ -379,8 +384,13 @@ NSString *NSViewFocusChangedNotification;
|
|||
|
||||
- (void)setFrameSize:(NSSize)newSize
|
||||
{
|
||||
NSSize old_size = bounds.size;
|
||||
|
||||
frame.size = newSize;
|
||||
bounds.size = newSize;
|
||||
|
||||
// Resize subviews
|
||||
[self resizeSubviewsWithOldSize: old_size];
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -524,7 +534,27 @@ NSString *NSViewFocusChangedNotification;
|
|||
// Resizing Subviews
|
||||
//
|
||||
- (void)resizeSubviewsWithOldSize:(NSSize)oldSize
|
||||
{}
|
||||
{
|
||||
id e, o;
|
||||
|
||||
// Are we suppose to resize our subviews?
|
||||
if (![self autoresizesSubviews])
|
||||
return;
|
||||
|
||||
e = [sub_views objectEnumerator];
|
||||
o = [e nextObject];
|
||||
while (o)
|
||||
{
|
||||
NSRect b = [o bounds];
|
||||
NSSize old_size = b.size;
|
||||
|
||||
// Resize the subview
|
||||
// Then tell it to resize its subviews
|
||||
[o resizeWithOldSuperviewSize: oldSize];
|
||||
[o resizeSubviewsWithOldSize: old_size];
|
||||
o = [e nextObject];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setAutoresizesSubviews:(BOOL)flag
|
||||
{
|
||||
|
|
|
@ -1270,6 +1270,8 @@ pasteboard:(NSPasteboard *)pboard
|
|||
[aDecoder decodeValueOfObjCType:@encode(BOOL) at: &menu_exclude];
|
||||
|
||||
// Register ourselves with the Application object
|
||||
// +++ we shouldn't do this because coding may not be done?
|
||||
// better to do it in the awakeFromCoder method
|
||||
theApp = [NSApplication sharedApplication];
|
||||
[theApp addWindowsItem:self title:nil filename:NO];
|
||||
NSLog(@"NSWindow: finish decoding\n");
|
||||
|
|
Loading…
Reference in a new issue