Now shows selection of window/panel when title bar is clicked.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@21502 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2005-07-19 03:50:29 +00:00
parent 7192134d1c
commit 3d4490ef38
3 changed files with 48 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2005-07-18 23:54 Gregory John Casamento <greg_casamento@yahoo.com>
* Palettes/1Windows/GormNSPanel.m
* Palettes/1Windows/GormNSWindow.m: Added override for
orderWindow:relativeTo: which causes selection of the window
by Gorm, if the title bar is clicked.
2005-07-17 15:47 Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormClassEditor.m: Added code to prevent memory leak

View file

@ -25,6 +25,7 @@
#include <AppKit/AppKit.h>
#include <GNUstepGUI/GSNibTemplates.h>
#include <InterfaceBuilder/InterfaceBuilder.h>
#include "GormNSPanel.h"
static unsigned int defaultStyleMask = NSTitledWindowMask | NSClosableWindowMask
@ -108,4 +109,23 @@ static unsigned int defaultStyleMask = NSTitledWindowMask | NSClosableWindowMask
{
autoPositionMask = mask;
}
- (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (int)otherWin
{
id<IBDocuments> document = [(id<IB>)NSApp documentForObject: self];
[super orderWindow: place relativeTo: otherWin];
if([NSApp isConnecting] == NO)
{
id editor = [document editorForObject: self create: NO];
// select myself.
if([editor respondsToSelector: @selector(selectObjects:)])
{
[editor selectObjects: [NSArray arrayWithObject: self]];
}
[document setSelectionFromEditor: editor];
[editor makeSelectionVisible: YES];
}
}
@end

View file

@ -22,7 +22,9 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
*/
#include <AppKit/AppKit.h>
#include <GNUstepGUI/GSNibTemplates.h>
#include <InterfaceBuilder/InterfaceBuilder.h>
#include "GormNSWindow.h"
// the default style mask we start with.
@ -129,4 +131,23 @@ static unsigned int defaultStyleMask = NSTitledWindowMask | NSClosableWindowMask
{
autoPositionMask = mask;
}
- (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (int)otherWin
{
id<IBDocuments> document = [(id<IB>)NSApp documentForObject: self];
[super orderWindow: place relativeTo: otherWin];
if([NSApp isConnecting] == NO)
{
id editor = [document editorForObject: self create: NO];
// select myself.
if([editor respondsToSelector: @selector(selectObjects:)])
{
[editor selectObjects: [NSArray arrayWithObject: self]];
}
[document setSelectionFromEditor: editor];
[editor makeSelectionVisible: YES];
}
}
@end