mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 06:01:00 +00:00
Some coding standard changes for NSSearchField
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31788 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
030f54c33b
commit
4b51be5d18
3 changed files with 46 additions and 35 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2010-12-27 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/NSSearchField.m,
|
||||||
|
* Source/NSSearchFieldCell.m: Some coding standard changes.
|
||||||
|
|
||||||
2010-12-27 Fred Kiefer <FredKiefer@gmx.de>
|
2010-12-27 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/GSDragView.m: Check whether the drag source supports
|
* Source/GSDragView.m: Check whether the drag source supports
|
||||||
|
|
|
@ -27,10 +27,11 @@
|
||||||
Boston, MA 02110-1301, USA.
|
Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Foundation/NSString.h>
|
#import <Foundation/NSString.h>
|
||||||
#include <Foundation/NSArray.h>
|
#import <Foundation/NSArray.h>
|
||||||
#include <AppKit/NSSearchField.h>
|
|
||||||
#include <AppKit/NSSearchFieldCell.h>
|
#import "AppKit/NSSearchField.h"
|
||||||
|
#import "AppKit/NSSearchFieldCell.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class variables
|
* Class variables
|
||||||
|
@ -94,7 +95,8 @@ static Class usedCellClass;
|
||||||
|
|
||||||
- (void) delete: (id)sender
|
- (void) delete: (id)sender
|
||||||
{
|
{
|
||||||
[self setStringValue:@""]; // this may need to do more (like send action), but start here...
|
// this may need to do more (like send action), but start here...
|
||||||
|
[self setStringValue: @""];
|
||||||
[[self cell] performClick: self];
|
[[self cell] performClick: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,19 +29,20 @@
|
||||||
Boston, MA 02110-1301, USA.
|
Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Foundation/NSArray.h>
|
#import <Foundation/NSArray.h>
|
||||||
#include <Foundation/NSException.h>
|
#import <Foundation/NSException.h>
|
||||||
#include <Foundation/NSNotification.h>
|
#import <Foundation/NSNotification.h>
|
||||||
#include <Foundation/NSString.h>
|
#import <Foundation/NSString.h>
|
||||||
#include <Foundation/NSUserDefaults.h>
|
#import <Foundation/NSUserDefaults.h>
|
||||||
#include <AppKit/NSApplication.h>
|
|
||||||
#include <AppKit/NSButtonCell.h>
|
#import "AppKit/NSApplication.h"
|
||||||
#include <AppKit/NSEvent.h>
|
#import "AppKit/NSButtonCell.h"
|
||||||
#include <AppKit/NSImage.h>
|
#import "AppKit/NSEvent.h"
|
||||||
#include <AppKit/NSMenu.h>
|
#import "AppKit/NSImage.h"
|
||||||
#include "AppKit/NSMenuView.h"
|
#import "AppKit/NSMenu.h"
|
||||||
#include <AppKit/NSSearchFieldCell.h>
|
#import "AppKit/NSMenuView.h"
|
||||||
#include "AppKit/NSWindow.h"
|
#import "AppKit/NSSearchFieldCell.h"
|
||||||
|
#import "AppKit/NSWindow.h"
|
||||||
|
|
||||||
@interface NSSearchFieldCell (Private)
|
@interface NSSearchFieldCell (Private)
|
||||||
|
|
||||||
|
@ -82,8 +83,8 @@
|
||||||
|
|
||||||
//_recent_searches = [[NSMutableArray alloc] init];
|
//_recent_searches = [[NSMutableArray alloc] init];
|
||||||
//_recents_autosave_name = nil;
|
//_recents_autosave_name = nil;
|
||||||
[self _loadSearches];
|
|
||||||
_max_recents = 10;
|
_max_recents = 10;
|
||||||
|
[self _loadSearches];
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
@ -558,6 +559,7 @@
|
||||||
{
|
{
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) selectItemAtIndex:(int)anIndex
|
- (void) selectItemAtIndex:(int)anIndex
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
|
@ -572,7 +574,6 @@
|
||||||
NSRect cellFrame;
|
NSRect cellFrame;
|
||||||
int i;
|
int i;
|
||||||
int recentCount = [_recent_searches count];
|
int recentCount = [_recent_searches count];
|
||||||
// NSRect textRect;
|
|
||||||
|
|
||||||
template = [self searchMenuTemplate];
|
template = [self searchMenuTemplate];
|
||||||
popupmenu = [[NSMenu alloc] init];
|
popupmenu = [[NSMenu alloc] init];
|
||||||
|
@ -659,6 +660,7 @@
|
||||||
- (void) _searchForRecent: (id)sender
|
- (void) _searchForRecent: (id)sender
|
||||||
{
|
{
|
||||||
NSString *searchTerm = [sender title];
|
NSString *searchTerm = [sender title];
|
||||||
|
|
||||||
[(id)_control_view setStringValue: searchTerm];
|
[(id)_control_view setStringValue: searchTerm];
|
||||||
[self performClick: self]; // do the search
|
[self performClick: self]; // do the search
|
||||||
}
|
}
|
||||||
|
@ -672,6 +674,7 @@
|
||||||
{
|
{
|
||||||
NSArray *list;
|
NSArray *list;
|
||||||
NSString *name = [self recentsAutosaveName];
|
NSString *name = [self recentsAutosaveName];
|
||||||
|
|
||||||
if (name)
|
if (name)
|
||||||
{
|
{
|
||||||
list = [[NSUserDefaults standardUserDefaults]
|
list = [[NSUserDefaults standardUserDefaults]
|
||||||
|
@ -684,6 +687,7 @@
|
||||||
{
|
{
|
||||||
NSArray *list = [self recentSearches];
|
NSArray *list = [self recentSearches];
|
||||||
NSString *name = [self recentsAutosaveName];
|
NSString *name = [self recentsAutosaveName];
|
||||||
|
|
||||||
if (name && list)
|
if (name && list)
|
||||||
{
|
{
|
||||||
[[NSUserDefaults standardUserDefaults]
|
[[NSUserDefaults standardUserDefaults]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue