mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 13:10:52 +00:00
Added code to deal with editing in the form the file name.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5180 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1a279340e7
commit
2eb27c30f7
1 changed files with 23 additions and 4 deletions
|
@ -172,9 +172,8 @@ static NSSavePanel *_gs_gui_save_panel = nil;
|
|||
[_bottomView addSubview: _prompt];
|
||||
[_prompt release];
|
||||
|
||||
// The gmodel says (44, 40, 226, 22), but that makes the upper border
|
||||
// clipped.
|
||||
_form = [[NSTextField alloc] initWithFrame: NSMakeRect (48, 39, 251, 21)];
|
||||
[_form setDelegate: self];
|
||||
[_form setEditable: YES];
|
||||
[_form setBordered: NO];
|
||||
[_form setBezeled: YES];
|
||||
|
@ -196,7 +195,7 @@ static NSSavePanel *_gs_gui_save_panel = nil;
|
|||
[button setImagePosition: NSImageOnly];
|
||||
[button setTarget: self];
|
||||
[button setAction: @selector(_setHomeDirectory)];
|
||||
// [_form setNextView: button];
|
||||
// [_form setNextKeyView: button];
|
||||
[button setAutoresizingMask: 1];
|
||||
[button setTag: NSFileHandlingPanelHomeButton];
|
||||
[_bottomView addSubview: button];
|
||||
|
@ -246,7 +245,7 @@ static NSSavePanel *_gs_gui_save_panel = nil;
|
|||
[_okButton setImagePosition: NSNoImage];
|
||||
[_okButton setTarget: self];
|
||||
[_okButton setAction: @selector(ok:)];
|
||||
// [_okButton setNextView: _form];
|
||||
// [_okButton setNextKeyView: _form];
|
||||
[_okButton setAutoresizingMask: 1];
|
||||
[_okButton setTag: NSFileHandlingPanelOKButton];
|
||||
[_bottomView addSubview: _okButton];
|
||||
|
@ -763,6 +762,26 @@ selectCellWithString: (NSString *)title
|
|||
column:(int)column
|
||||
{
|
||||
}
|
||||
@end
|
||||
|
||||
//
|
||||
// NSTextField delegate methods
|
||||
//
|
||||
@interface NSSavePanel (TextFieldDelegate)
|
||||
- (void) controlTextDidEndEditing: (NSNotification *)aNotification;
|
||||
@end
|
||||
@implementation NSSavePanel (TextFieldDelegate)
|
||||
- (void) controlTextDidEndEditing: (NSNotification *)aNotification
|
||||
{
|
||||
if ([aNotification object] == _form)
|
||||
{
|
||||
NSString *s;
|
||||
|
||||
s = [self directory];
|
||||
s = [s stringByAppendingPathComponent: [_form stringValue]];
|
||||
ASSIGN (_fullFileName, s);
|
||||
}
|
||||
}
|
||||
@end /* NSSavePanel */
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue