comparison dwt/internal/cocoa/NSSearchField.d @ 45:d8635bb48c7c

Merge with SWT 3.5
author Jacob Carlborg <doob@me.com>
date Mon, 01 Dec 2008 17:07:00 +0100
parents f565d3a95c0a
children
comparison
equal deleted inserted replaced
44:ca5e494f2bbf 45:d8635bb48c7c
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2007 IBM Corporation and others. 2 * Copyright (c) 2000, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * 10 *
11 * Port to the D programming language: 11 * Port to the D programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com> 12 * Jacob Carlborg <doob@me.com>
13 *******************************************************************************/ 13 *******************************************************************************/
14 module dwt.internal.cocoa.NSSearchField; 14 module dwt.internal.cocoa.NSSearchField;
15 15
16 import dwt.dwthelper.utils;
17 import cocoa = dwt.internal.cocoa.id;
16 import dwt.internal.cocoa.NSArray; 18 import dwt.internal.cocoa.NSArray;
17 import dwt.internal.cocoa.NSString;
18 import dwt.internal.cocoa.NSTextField; 19 import dwt.internal.cocoa.NSTextField;
19 import dwt.internal.cocoa.OS; 20 import dwt.internal.cocoa.OS;
20 import objc = dwt.internal.objc.runtime; 21 import objc = dwt.internal.objc.runtime;
21 22
22 public class NSSearchField : NSTextField 23 public class NSSearchField : NSTextField {
23 {
24 24
25 public this () 25 public this() {
26 { 26 super();
27 super(); 27 }
28 }
29 28
30 public this (objc.id id) 29 public this(objc.id id) {
31 { 30 super(id);
32 super(id); 31 }
33 }
34 32
35 public NSArray recentSearches () 33 public this(cocoa.id id) {
36 { 34 super(id);
37 objc.id result = OS.objc_msgSend(this.id_, OS.sel_recentSearches); 35 }
38 return result !is null ? new NSArray(result) : null;
39 }
40 36
41 public NSString recentsAutosaveName () 37 public NSArray recentSearches() {
42 { 38 objc.id result = OS.objc_msgSend(this.id, OS.sel_recentSearches);
43 objc.id result = OS.objc_msgSend(this.id_, OS.sel_recentsAutosaveName); 39 return result !is null ? new NSArray(result) : null;
44 return result !is null ? new NSString(result) : null; 40 }
45 }
46 41
47 public void setRecentSearches (NSArray searches) 42 public static objc.Class cellClass() {
48 { 43 return cast(objc.Class) OS.objc_msgSend(OS.class_NSSearchField, OS.sel_cellClass);
49 OS.objc_msgSend(this.id_, OS.sel_setRecentSearches_1, searches !is null ? searches.id_ : null); 44 }
50 }
51 45
52 public void setRecentsAutosaveName (NSString string) 46 public static void setCellClass(objc.Class factoryId) {
53 { 47 OS.objc_msgSend(OS.class_NSSearchField, OS.sel_setCellClass_, factoryId);
54 OS.objc_msgSend(this.id_, OS.sel_setRecentsAutosaveName_1, string !is null ? string.id_ : null); 48 }
55 }
56 49
57 } 50 }