Mercurial > projects > dwt2
comparison org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Combo.d @ 51:c01d033c633a
[swt lin]
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 27 Mar 2009 19:58:06 +0100 |
parents | f713da8bc051 |
children |
comparison
equal
deleted
inserted
replaced
50:d5075f5226e5 | 51:c01d033c633a |
---|---|
1043 public String getText () { | 1043 public String getText () { |
1044 checkWidget(); | 1044 checkWidget(); |
1045 if (entryHandle !is null) { | 1045 if (entryHandle !is null) { |
1046 auto str = OS.gtk_entry_get_text (entryHandle); | 1046 auto str = OS.gtk_entry_get_text (entryHandle); |
1047 if (str is null) return ""; | 1047 if (str is null) return ""; |
1048 return fromStringz(str).dup; | 1048 return fromStringz(str)._idup(); |
1049 } else { | 1049 } else { |
1050 int index = OS.gtk_combo_box_get_active (handle); | 1050 int index = OS.gtk_combo_box_get_active (handle); |
1051 return index !is -1 ? getItem (index) : ""; | 1051 return index !is -1 ? getItem (index) : ""; |
1052 } | 1052 } |
1053 } | 1053 } |
1165 return 0; | 1165 return 0; |
1166 } | 1166 } |
1167 } else { | 1167 } else { |
1168 if (!ignoreSelect) { | 1168 if (!ignoreSelect) { |
1169 auto ptr = OS.gtk_entry_get_text (entryHandle); | 1169 auto ptr = OS.gtk_entry_get_text (entryHandle); |
1170 String text = fromStringz(ptr).dup; | 1170 String text = fromStringz(ptr)._idup(); |
1171 for (int i = 0; i < items.length; i++) { | 1171 for (int i = 0; i < items.length; i++) { |
1172 if (items [i] ==/*eq*/ text) { | 1172 if (items [i] ==/*eq*/ text) { |
1173 postEvent (SWT.Selection); | 1173 postEvent (SWT.Selection); |
1174 break; | 1174 break; |
1175 } | 1175 } |
1322 OS.g_signal_stop_emission_by_name (entryHandle, OS.insert_text.ptr); | 1322 OS.g_signal_stop_emission_by_name (entryHandle, OS.insert_text.ptr); |
1323 return 0; | 1323 return 0; |
1324 } | 1324 } |
1325 if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0; | 1325 if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return 0; |
1326 if (new_text is null || new_text_length is 0) return 0; | 1326 if (new_text is null || new_text_length is 0) return 0; |
1327 String oldText = new_text[0..new_text_length]; | 1327 String oldText = new_text[0..new_text_length]._idup(); |
1328 int pos; | 1328 int pos; |
1329 pos = position; | 1329 pos = position; |
1330 if (pos is -1) { | 1330 if (pos is -1) { |
1331 auto ptr = OS.gtk_entry_get_text (entryHandle); | 1331 auto ptr = OS.gtk_entry_get_text (entryHandle); |
1332 pos = fromStringz(ptr).length; | 1332 pos = fromStringz(ptr).length; |