mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 04:10:38 +00:00
Drawing change on NSBox.
Changed handling of buttons in save and open panel, this was possible after using different values for the run loop constants. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18708 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7362c7c275
commit
419cde509b
5 changed files with 37 additions and 24 deletions
|
@ -65,12 +65,10 @@
|
|||
{
|
||||
[super initWithFrame: frameRect];
|
||||
|
||||
_cell = [[NSTextFieldCell alloc] initTextCell: @"Title"];
|
||||
_cell = [[NSCell alloc] initTextCell: @"Title"];
|
||||
[_cell setAlignment: NSCenterTextAlignment];
|
||||
[_cell setBordered: NO];
|
||||
[_cell setEditable: NO];
|
||||
[_cell setDrawsBackground: YES];
|
||||
//[_cell setBackgroundColor: [NSColor controlColor]];
|
||||
_offsets.width = 5;
|
||||
_offsets.height = 5;
|
||||
_border_rect = _bounds;
|
||||
|
@ -381,7 +379,14 @@
|
|||
// Draw title
|
||||
if (_title_position != NSNoTitle)
|
||||
{
|
||||
[_cell setBackgroundColor: color];
|
||||
// If the title is on the border, clip a hole in the later
|
||||
if ((_border_type != NSNoBorder) &&
|
||||
((_title_position == NSAtTop) ||
|
||||
(_title_position == NSAtBottom)))
|
||||
{
|
||||
[color set];
|
||||
NSRectFill(_title_rect);
|
||||
}
|
||||
[_cell drawWithFrame: _title_rect inView: self];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -557,7 +557,7 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
|
|||
}
|
||||
|
||||
_OKButtonPressed = YES;
|
||||
[NSApp stopModal];
|
||||
[NSApp stopModalWithCode: NSOKButton];
|
||||
|
||||
[self close];
|
||||
}
|
||||
|
|
|
@ -891,12 +891,7 @@ selectCellWithString: (NSString*)title
|
|||
- (int) runModalForDirectory: (NSString*)path file: (NSString*)filename
|
||||
{
|
||||
[self _setupForDirectory: path file: filename];
|
||||
[NSApp runModalForWindow: self];
|
||||
|
||||
if (_OKButtonPressed)
|
||||
return NSOKButton;
|
||||
else
|
||||
return NSCancelButton;
|
||||
return [NSApp runModalForWindow: self];
|
||||
}
|
||||
|
||||
- (int) runModalForDirectory: (NSString *)path
|
||||
|
@ -904,13 +899,8 @@ selectCellWithString: (NSString*)title
|
|||
relativeToWindow: (NSWindow*)window
|
||||
{
|
||||
[self _setupForDirectory: path file: filename];
|
||||
[NSApp runModalForWindow: self
|
||||
relativeToWindow: window];
|
||||
|
||||
if (_OKButtonPressed)
|
||||
return NSOKButton;
|
||||
else
|
||||
return NSCancelButton;
|
||||
return [NSApp runModalForWindow: self
|
||||
relativeToWindow: window];
|
||||
}
|
||||
|
||||
- (void) beginSheetForDirectory: (NSString *)path
|
||||
|
@ -973,7 +963,7 @@ selectCellWithString: (NSString*)title
|
|||
{
|
||||
_fullFileName = nil;
|
||||
_directory = nil;
|
||||
[NSApp stopModal];
|
||||
[NSApp stopModalWithCode: NSCancelButton];
|
||||
[self close];
|
||||
}
|
||||
|
||||
|
@ -1083,7 +1073,7 @@ selectCellWithString: (NSString*)title
|
|||
return;
|
||||
|
||||
_OKButtonPressed = YES;
|
||||
[NSApp stopModal];
|
||||
[NSApp stopModalWithCode: NSOKButton];
|
||||
[self close];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue