Mercurial > projects > dwt-win
comparison dwt/widgets/Control.d @ 212:ab60f3309436
reverted the char[] to String and use the an alias.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 05 May 2008 00:12:38 +0200 |
parents | 0a02d6d3466b |
children | 36f5cb12e1a2 |
comparison
equal
deleted
inserted
replaced
211:ff59aeb96cac | 212:ab60f3309436 |
---|---|
95 */ | 95 */ |
96 public HANDLE handle; | 96 public HANDLE handle; |
97 Composite parent; | 97 Composite parent; |
98 Cursor cursor; | 98 Cursor cursor; |
99 Menu menu; | 99 Menu menu; |
100 char[] toolTipText_; | 100 String toolTipText_; |
101 Object layoutData; | 101 Object layoutData; |
102 Accessible accessible; | 102 Accessible accessible; |
103 Image backgroundImage; | 103 Image backgroundImage; |
104 int drawCount, foreground, background; | 104 int drawCount, foreground, background; |
105 | 105 |
941 Menu [] findMenus (Control control) { | 941 Menu [] findMenus (Control control) { |
942 if (menu !is null && this !is control) return [menu]; | 942 if (menu !is null && this !is control) return [menu]; |
943 return new Menu [0]; | 943 return new Menu [0]; |
944 } | 944 } |
945 | 945 |
946 char findMnemonic (char[] string) { | 946 char findMnemonic (String string) { |
947 int index = 0; | 947 int index = 0; |
948 int length_ = string.length; | 948 int length_ = string.length; |
949 do { | 949 do { |
950 while (index < length_ && string.charAt (index) !is '&') index++; | 950 while (index < length_ && string.charAt (index) !is '&') index++; |
951 if (++index >= length_) return '\0'; | 951 if (++index >= length_) return '\0'; |
1156 return lpCs [1]; | 1156 return lpCs [1]; |
1157 } | 1157 } |
1158 return OS.GetACP (); | 1158 return OS.GetACP (); |
1159 } | 1159 } |
1160 | 1160 |
1161 char[] getClipboardText () { | 1161 String getClipboardText () { |
1162 char[] string = ""; | 1162 String string = ""; |
1163 if (OS.OpenClipboard (null)) { | 1163 if (OS.OpenClipboard (null)) { |
1164 auto hMem = OS.GetClipboardData (OS.IsUnicode ? OS.CF_UNICODETEXT : OS.CF_TEXT); | 1164 auto hMem = OS.GetClipboardData (OS.IsUnicode ? OS.CF_UNICODETEXT : OS.CF_TEXT); |
1165 if (hMem !is null) { | 1165 if (hMem !is null) { |
1166 /* Ensure byteCount is a multiple of 2 bytes on UNICODE platforms */ | 1166 /* Ensure byteCount is a multiple of 2 bytes on UNICODE platforms */ |
1167 int byteCount = OS.GlobalSize (hMem) / TCHAR.sizeof * TCHAR.sizeof; | 1167 int byteCount = OS.GlobalSize (hMem) / TCHAR.sizeof * TCHAR.sizeof; |
1443 * @exception DWTException <ul> | 1443 * @exception DWTException <ul> |
1444 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | 1444 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
1445 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 1445 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
1446 * </ul> | 1446 * </ul> |
1447 */ | 1447 */ |
1448 public char[] getToolTipText () { | 1448 public String getToolTipText () { |
1449 checkWidget (); | 1449 checkWidget (); |
1450 return toolTipText_; | 1450 return toolTipText_; |
1451 } | 1451 } |
1452 | 1452 |
1453 /** | 1453 /** |
3078 * @exception DWTException <ul> | 3078 * @exception DWTException <ul> |
3079 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | 3079 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
3080 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 3080 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
3081 * </ul> | 3081 * </ul> |
3082 */ | 3082 */ |
3083 public void setToolTipText (char[] string) { | 3083 public void setToolTipText (String string) { |
3084 checkWidget (); | 3084 checkWidget (); |
3085 toolTipText_ = string; | 3085 toolTipText_ = string; |
3086 setToolTipText (getShell (), string); | 3086 setToolTipText (getShell (), string); |
3087 } | 3087 } |
3088 | 3088 |
3089 void setToolTipText (Shell shell, char[] string) { | 3089 void setToolTipText (Shell shell, String string) { |
3090 shell.setToolTipText (handle, string); | 3090 shell.setToolTipText (handle, string); |
3091 } | 3091 } |
3092 | 3092 |
3093 /** | 3093 /** |
3094 * Marks the receiver as visible if the argument is <code>true</code>, | 3094 * Marks the receiver as visible if the argument is <code>true</code>, |
3707 int flags = OS.SWP_NOSIZE | OS.SWP_NOMOVE | OS.SWP_NOACTIVATE; | 3707 int flags = OS.SWP_NOSIZE | OS.SWP_NOMOVE | OS.SWP_NOACTIVATE; |
3708 SetWindowPos (topHandle_, cast(HWND)OS.HWND_BOTTOM, 0, 0, 0, 0, flags); | 3708 SetWindowPos (topHandle_, cast(HWND)OS.HWND_BOTTOM, 0, 0, 0, 0, flags); |
3709 return true; | 3709 return true; |
3710 } | 3710 } |
3711 | 3711 |
3712 abstract char[] windowClass (); | 3712 abstract String windowClass (); |
3713 | 3713 |
3714 abstract int windowProc (); | 3714 abstract int windowProc (); |
3715 | 3715 |
3716 int windowProc (HWND hwnd, int msg, int wParam, int lParam) { | 3716 int windowProc (HWND hwnd, int msg, int wParam, int lParam) { |
3717 LRESULT result = null; | 3717 LRESULT result = null; |
4432 if (key !is 0) { | 4432 if (key !is 0) { |
4433 key = CharacterToLower (key); | 4433 key = CharacterToLower (key); |
4434 MenuItem [] items = menu.getItems (); | 4434 MenuItem [] items = menu.getItems (); |
4435 for (int i=0; i<items.length; i++) { | 4435 for (int i=0; i<items.length; i++) { |
4436 MenuItem item = items [i]; | 4436 MenuItem item = items [i]; |
4437 char[] text = item.getText (); | 4437 String text = item.getText (); |
4438 char mnemonic = findMnemonic (text); | 4438 char mnemonic = findMnemonic (text); |
4439 if (text.length > 0 && mnemonic is 0) { | 4439 if (text.length > 0 && mnemonic is 0) { |
4440 char ch = text.charAt (0); | 4440 char ch = text.charAt (0); |
4441 if (CharacterToLower (ch) is key) { | 4441 if (CharacterToLower (ch) is key) { |
4442 display.mnemonicKeyHit = false; | 4442 display.mnemonicKeyHit = false; |