comparison org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/widgets/MenuItem.d @ 38:2e09b0e6857a

work on phobosfication
author Frank Benoit <benoit@tionex.de>
date Wed, 25 Mar 2009 11:18:25 +0100
parents 6dd524f61e62
children 0ecb2b338560
comparison
equal deleted inserted replaced
37:46c5f8f56b41 38:2e09b0e6857a
913 int uFlags = OS.MF_BYPOSITION; 913 int uFlags = OS.MF_BYPOSITION;
914 if (menu !is null) { 914 if (menu !is null) {
915 uFlags |= OS.MF_POPUP; 915 uFlags |= OS.MF_POPUP;
916 uIDNewItem = cast(int)menu.handle; 916 uIDNewItem = cast(int)menu.handle;
917 } 917 }
918 TCHAR[] lpNewItem = StrToTCHARs (0, " ", true); 918 StringT lpNewItem = StrToTCHARs (0, " ", true);
919 success = OS.InsertMenu (hMenu, index, uFlags, uIDNewItem, lpNewItem.ptr) !is 0; 919 success = OS.InsertMenu (hMenu, index, uFlags, uIDNewItem, lpNewItem.ptr) !is 0;
920 if (success) { 920 if (success) {
921 info.fMask = OS.MIIM_DATA | OS.MIIM_TYPE; 921 info.fMask = OS.MIIM_DATA | OS.MIIM_TYPE;
922 success = OS.SetMenuItemInfo (hMenu, index, true, &info) !is 0; 922 success = OS.SetMenuItemInfo (hMenu, index, true, &info) !is 0;
923 if ((info.fState & (OS.MFS_DISABLED | OS.MFS_GRAYED)) !is 0) { 923 if ((info.fState & (OS.MFS_DISABLED | OS.MFS_GRAYED)) !is 0) {
1064 string.getChars( 0, length_, text, 0); 1064 string.getChars( 0, length_, text, 0);
1065 int i = 0, j = 0; 1065 int i = 0, j = 0;
1066 for (i=0; i<length_; i++) { 1066 for (i=0; i<length_; i++) {
1067 if (text[i] !is '&') text [j++] = text [i]; 1067 if (text[i] !is '&') text [j++] = text [i];
1068 } 1068 }
1069 if (j < i) string = text[ 0 .. j ].dup; 1069 if (j < i) string = text[ 0 .. j ].idup;
1070 } 1070 }
1071 /* Use the character encoding for the default locale */ 1071 /* Use the character encoding for the default locale */
1072 TCHAR[] buffer = StrToTCHARs (0, string, true); 1072 StringT buffer = StrToTCHARs (0, string, true);
1073 int byteCount = buffer.length * TCHAR.sizeof; 1073 int byteCount = buffer.length * TCHAR.sizeof;
1074 pszText = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount); 1074 pszText = cast(TCHAR*) OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
1075 OS.MoveMemory (pszText, buffer.ptr, byteCount); 1075 OS.MoveMemory (pszText, buffer.ptr, byteCount);
1076 auto hwndCB = parent.hwndCB; 1076 auto hwndCB = parent.hwndCB;
1077 TBBUTTONINFO info2; 1077 TBBUTTONINFO info2;
1083 MENUITEMINFO info; 1083 MENUITEMINFO info;
1084 info.cbSize = OS.MENUITEMINFO_sizeof; 1084 info.cbSize = OS.MENUITEMINFO_sizeof;
1085 auto hMenu = parent.handle; 1085 auto hMenu = parent.handle;
1086 1086
1087 /* Use the character encoding for the default locale */ 1087 /* Use the character encoding for the default locale */
1088 TCHAR[] buffer = StrToTCHARs (0, string, true); 1088 StringT buffer = StrToTCHARs (0, string, true);
1089 int byteCount = buffer.length * TCHAR.sizeof; 1089 int byteCount = buffer.length * TCHAR.sizeof;
1090 pszText = cast(TCHAR*)OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount); 1090 pszText = cast(TCHAR*)OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
1091 OS.MoveMemory (pszText, buffer.ptr, byteCount); 1091 OS.MoveMemory (pszText, buffer.ptr, byteCount);
1092 /* 1092 /*
1093 * Bug in Windows 2000. For some reason, when MIIM_TYPE is set 1093 * Bug in Windows 2000. For some reason, when MIIM_TYPE is set