Changeset 23
- Timestamp:
- 05/30/04 01:33:18 (4 years ago)
- Files:
-
- branches/0.1/src/dwt/graphics/drawable.d (deleted)
- branches/0.1/src/dwt/internal/win32/os.d (modified) (27 diffs)
- branches/0.1/src/dwt/internal/win32/types.d (modified) (1 diff)
- branches/0.1/src/dwt/widgets/control.d (modified) (16 diffs)
- branches/0.1/src/dwt/widgets/decorations.d (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/0.1/src/dwt/internal/win32/os.d
r18 r23 30 30 } 31 31 32 public staticclass OS {32 public class OS { 33 33 34 34 /* 35 35 * DWT Windows flags. 36 36 */ 37 int IsWin32s;37 static int IsWin32s; 38 38 const int IsWin95 = 0; 39 39 const int IsWinNT = 1; 40 40 const int IsWinCE = 0; 41 41 static int IsPPC; 42 int IsHPC;42 static int IsHPC; 43 43 static int IsSP; 44 int IsDBLocale;44 static int IsDBLocale; 45 45 const int IsUnicode = 1; 46 46 static int WIN32_MAJOR, WIN32_MINOR; … … 116 116 IsWinNT = 1; //info.dwPlatformId == VER_PLATFORM_WIN32_NT; 117 117 IsWinCE = 0; //info.dwPlatformId == VER_PLATFORM_WIN32_CE; 118 //IsSP = IsSP();119 //IsPPC = IsPPC();120 //IsHPC = IsWinCE && !IsPPC && !IsSP;118 IsSP = IsSP(); 119 IsPPC = IsPPC(); 120 IsHPC = IsWinCE && !IsPPC && !IsSP; 121 121 // WIN32_MAJOR = info.dwMajorVersion; 122 122 // WIN32_MINOR = info.dwMinorVersion; … … 168 168 + casting from uint to int. So, we changed the const declare to a uint. 169 169 + 170 + As of dmd 0.89, we maywant to just do a const int XXX = cast(int)0xff000000;170 + As of dmd 0.89, we want to just do a const int XXX = cast(int)0xff000000; 171 171 + 2004.5.23 BSA 172 172 + … … 231 231 public const int CB_ADDSTRING = 0x143; 232 232 public const int CB_DELETESTRING = 0x144; 233 public const uint CB_ERR =0xffffffff;234 public const uint CB_ERRSPACE =0xfffffffe;233 public const int CB_ERR = cast(int)0xffffffff; 234 public const int CB_ERRSPACE = cast(int)0xfffffffe; 235 235 public const int CB_FINDSTRINGEXACT = 0x158; 236 236 public const int CB_GETCOUNT = 0x146; … … 276 276 public const int CFM_FACE = 0x20000000; 277 277 public const int CFM_ITALIC = 0x2; 278 public const uint CFM_SIZE =0x80000000;278 public const int CFM_SIZE = cast(int)0x80000000; 279 279 public const int CFM_STRIKEOUT = 0x8; 280 280 public const int CFM_UNDERLINE = 0x4; … … 287 287 public const int CF_UNICODETEXT = 13; 288 288 public const int CF_USESTYLE = 0x80; 289 public const uint CLR_DEFAULT =0xff000000;290 public const uint CLR_INVALID =0xffffffff;289 public const int CLR_DEFAULT = cast(int)0xff000000; 290 public const int CLR_INVALID = cast(int)0xffffffff; 291 291 public const int COLORONCOLOR = 0x3; 292 292 public const int COLOR_3DDKSHADOW = 0x15 | SYS_COLOR_INDEX_FLAG; … … 324 324 public const int CS_HREDRAW = 0x2; 325 325 public const int CS_VREDRAW = 0x1; 326 public const uint CW_USEDEFAULT =0x80000000;326 public const int CW_USEDEFAULT = cast(int)0x80000000; 327 327 public const int DCX_CACHE = 0x2; 328 328 public const int DCX_CLIPCHILDREN = 0x8; … … 342 342 public const int DFC_SCROLL = 0x3; 343 343 public const int DIB_RGB_COLORS = 0x0; 344 public const uint DISP_E_EXCEPTION =0x80020009;344 public const int DISP_E_EXCEPTION = cast(int)0x80020009; 345 345 public const int DI_NORMAL = 0x3; 346 346 public const int DLGC_BUTTON = 0x2000; … … 426 426 public const int GTL_PRECISE = 0x2; 427 427 public const int GT_DEFAULT = 0x0; 428 public const uint GWL_EXSTYLE =0xffffffec;428 public const int GWL_EXSTYLE = cast(int)0xffffffec; 429 429 public const int GWL_ID = -12; 430 public const uint GWL_STYLE =0xfffffff0;431 public const uint GWL_USERDATA =0xffffffeb;432 public const uint GWL_WNDPROC =0xfffffffc;430 public const int GWL_STYLE = cast(int)0xfffffff0; 431 public const int GWL_USERDATA = cast(int)0xffffffeb; 432 public const int GWL_WNDPROC = cast(int)0xfffffffc; 433 433 public const int GW_CHILD = 0x5; 434 434 public const int GW_HWNDFIRST = 0x0; … … 441 441 public const int HDM_GETBITMAPMARGIN = HDM_FIRST + 21; 442 442 public const int HDM_GETITEMCOUNT = 0x1200; 443 public const uint HDN_FIRST =0xfffffed4;444 public const uint HDN_BEGINTRACK = IsUnicode ? 0xfffffeba :0xfffffece;445 public const uint HDN_BEGINTRACKW =0xfffffeba;446 public const uint HDN_BEGINTRACKA =0xfffffece;443 public const int HDN_FIRST = cast(int)0xfffffed4; 444 public const int HDN_BEGINTRACK = IsUnicode ? cast(int)0xfffffeba : cast(int)0xfffffece; 445 public const int HDN_BEGINTRACKW = cast(int)0xfffffeba; 446 public const int HDN_BEGINTRACKA = cast(int)0xfffffece; 447 447 public const int HDN_DIVIDERDBLCLICKA = HDN_FIRST - 5; 448 448 public const int HDN_DIVIDERDBLCLICKW = HDN_FIRST - 25; 449 449 public const int HDN_DIVIDERDBLCLICK = IsUnicode ? HDN_DIVIDERDBLCLICKW : HDN_DIVIDERDBLCLICKA; 450 public const uint HDN_ITEMCHANGED = IsUnicode ? 0xfffffebf :0xfffffed3;451 public const uint HDN_ITEMCHANGEDW =0xfffffebf;452 public const uint HDN_ITEMCHANGEDA =0xfffffed3;450 public const int HDN_ITEMCHANGED = IsUnicode ? cast(int)0xfffffebf : cast(int)0xfffffed3; 451 public const int HDN_ITEMCHANGEDW = cast(int)0xfffffebf; 452 public const int HDN_ITEMCHANGEDA = cast(int)0xfffffed3; 453 453 public const int HDN_ITEMDBLCLICKW = HDN_FIRST - 23; 454 454 public const int HDN_ITEMDBLCLICKA = HDN_FIRST - 3; … … 456 456 public const int HEAP_ZERO_MEMORY = 0x8; 457 457 public const int HELPINFO_MENUITEM = 0x2; 458 public const uint HINST_COMMCTRL =0xffffffff;459 public const uint HKEY_CLASSES_ROOT =0x80000000;460 public const uint HKEY_CURRENT_USER =0x80000001;461 public const uint HKEY_LOCAL_MACHINE =0x80000002;458 public const int HINST_COMMCTRL = cast(int)0xffffffff; 459 public const int HKEY_CLASSES_ROOT = cast(int)0x80000000; 460 public const int HKEY_CURRENT_USER = cast(int)0x80000001; 461 public const int HKEY_LOCAL_MACHINE = cast(int)0x80000002; 462 462 public const int HORZRES = 0x8; 463 463 public const int HTBORDER = 0x12; … … 469 469 public const int HTNOWHERE = 0x0; 470 470 public const int HTSYSMENU = 0x3; 471 public const uint HTTRANSPARENT =0xffffffff;471 public const int HTTRANSPARENT = cast(int)0xffffffff; 472 472 public const int HTVSCROLL = 0x7; 473 473 public const int HWND_BOTTOM = 0x1; 474 474 public const int HWND_TOP = 0x0; 475 public const uint HWND_TOPMOST =0xffffffff;475 public const int HWND_TOPMOST = cast(int)0xffffffff; 476 476 public const int HWND_NOTOPMOST = -2; 477 477 public const int ICC_COOL_CLASSES = 0x400; … … 517 517 public const int IME_CMODE_NATIVE = 0x1; 518 518 public const int IME_CMODE_ROMAN = 0x10; 519 public const uint INFINITE =0xffffffff;519 public const int INFINITE = cast(int)0xffffffff; 520 520 public const int KEY_ENUMERATE_SUB_KEYS = 0x8; 521 521 public const int KEY_NOTIFY = 0x10; … … 531 531 public const int LB_ADDSTRING = 0x180; 532 532 public const int LB_DELETESTRING = 0x182; 533 public const uint LB_ERR =0xffffffff;534 public const uint LB_ERRSPACE =0xfffffffe;533 public const int LB_ERR = cast(int)0xffffffff; 534 public const int LB_ERRSPACE = cast(int)0xfffffffe; 535 535 public const int LB_FINDSTRINGEXACT = 0x1a2; 536 536 public const int LB_GETCARETINDEX = 0x19f; … … 566 566 public const int LOGPIXELSX = 0x58; 567 567 public const int LOGPIXELSY = 0x5a; 568 public const uint LPSTR_TEXTCALLBACK =0xffffffff;568 public const int LPSTR_TEXTCALLBACK = cast(int)0xffffffff; 569 569 public const int LR_DEFAULTCOLOR = 0x0; 570 570 public const int LVCFMT_CENTER = 0x2; … … 635 635 public const int LVNI_FOCUSED = 0x1; 636 636 public const int LVNI_SELECTED = 0x2; 637 public const uint LVN_BEGINDRAG =0xffffff93;638 public const uint LVN_BEGINRDRAG =0xffffff91;639 public const uint LVN_COLUMNCLICK =0xffffff94;640 public const uint LVN_FIRST =0xffffff9c;637 public const int LVN_BEGINDRAG = cast(int)0xffffff93; 638 public const int LVN_BEGINRDRAG = cast(int)0xffffff91; 639 public const int LVN_COLUMNCLICK = cast(int)0xffffff94; 640 public const int LVN_FIRST = cast(int)0xffffff9c; 641 641 public const int LVN_GETDISPINFOA = LVN_FIRST - 50; 642 642 public const int LVN_GETDISPINFOW = LVN_FIRST - 77; 643 public const uint LVN_ITEMACTIVATE =0xffffff8e;644 public const uint LVN_ITEMCHANGED =0xffffff9b;645 public const uint LVN_MARQUEEBEGIN =0xffffff64;646 public const uint LVSCW_AUTOSIZE =0xffffffff;647 public const uint LVSCW_AUTOSIZE_USEHEADER =0xfffffffe;643 public const int LVN_ITEMACTIVATE = cast(int)0xffffff8e; 644 public const int LVN_ITEMCHANGED = cast(int)0xffffff9b; 645 public const int LVN_MARQUEEBEGIN = cast(int)0xffffff64; 646 public const int LVSCW_AUTOSIZE = cast(int)0xffffffff; 647 public const int LVSCW_AUTOSIZE_USEHEADER = cast(int)0xfffffffe; 648 648 public const int LVSICF_NOINVALIDATEALL = 0x1; 649 649 public const int LVSICF_NOSCROLL = 0x2; … … 720 720 public const int MWMO_INPUTAVAILABLE = 0x4; 721 721 public const int NM_FIRST = 0x0; 722 public const uint NM_CLICK =0xfffffffe;722 public const int NM_CLICK = cast(int)0xfffffffe; 723 723 public const int NM_CUSTOMDRAW = NM_FIRST - 12; 724 public const uint NM_DBLCLK =0xfffffffd;724 public const int NM_DBLCLK = cast(int)0xfffffffd; 725 725 public const int NM_RECOGNIZEGESTURE = NM_FIRST - 16; 726 public const uint NM_RETURN =0xfffffffc;726 public const int NM_RETURN = cast(int)0xfffffffc; 727 727 public const int NOTSRCCOPY = 0x330008; 728 728 public const int NULLREGION = 0x1; … … 730 730 public const int NULL_PEN = 0x8; 731 731 public const int NUMRESERVED = 106; 732 public const uint OBJID_CLIENT =0xFFFFFFFC;732 public const int OBJID_CLIENT = cast(int)0xFFFFFFFC; 733 733 public const int OBJ_FONT = 0x6; 734 734 public const int OBJ_PEN = 0x1; … … 803 803 public const int RBBS_USECHEVRON = 0x00000200; 804 804 public const int RBBS_VARIABLEHEIGHT = 0x40; 805 public const uint RBN_FIRST =0xfffffcc1;805 public const int RBN_FIRST = cast(int)0xfffffcc1; 806 806 public const int RBN_CHEVRONPUSHED = RBN_FIRST - 10; 807 public const uint RBN_HEIGHTCHANGE =0xfffffcc1;807 public const int RBN_HEIGHTCHANGE = cast(int)0xfffffcc1; 808 808 public const int RBS_DBLCLKTOGGLE = 0x8000; 809 809 public const int RBS_BANDBORDERS = 0x400; … … 972 972 public const int TBM_SETRANGEMIN = 0x407; 973 973 public const int TBM_SETTICFREQ = 0x414; 974 public const uint TBN_DROPDOWN =0xfffffd3a;975 public const uint TBN_FIRST =0xfffffd44;974 public const int TBN_DROPDOWN = cast(int)0xfffffd3a; 975 public const int TBN_FIRST = cast(int)0xfffffd44; 976 976 public const int TBSTATE_CHECKED = 0x1; 977 977 public const int TBSTYLE_CUSTOMERASE = 0x2000; … … 1034 1034 public const int TCM_SETIMAGELIST = 0x1303; 1035 1035 public const int TCM_SETITEM = IsUnicode ? 0x133d : 0x1306; 1036 public const uint TCN_SELCHANGE =0xfffffdd9;1037 public const uint TCN_SELCHANGING =0xfffffdd8;1036 public const int TCN_SELCHANGE = cast(int)0xfffffdd9; 1037 public const int TCN_SELCHANGING = cast(int)0xfffffdd8; 1038 1038 public const int TCS_BOTTOM = 0x0002; 1039 1039 public const int TCS_FOCUSNEVER = 0x8000; … … 1060 1060 public const int TTM_SETMAXTIPWIDTH = 0x418; 1061 1061 public const int TTM_UPDATE = 0x41D; 1062 public const uint TTN_FIRST =0xfffffdf8;1063 public const uint TTN_GETDISPINFO = IsUnicode ? 0xfffffdee :0xfffffdf8;1064 public const uint TTN_GETDISPINFOW =0xfffffdee;1065 public const uint TTN_GETDISPINFOA =0xfffffdf8;1062 public const int TTN_FIRST = cast(int)0xfffffdf8; 1063 public const int TTN_GETDISPINFO = IsUnicode ? cast(int)0xfffffdee : cast(int)0xfffffdf8; 1064 public const int TTN_GETDISPINFOW = cast(int)0xfffffdee; 1065 public const int TTN_GETDISPINFOA = cast(int)0xfffffdf8; 1066 1066 public const int TTN_POP = TTN_FIRST - 2; 1067 1067 public const int TTN_SHOW = TTN_FIRST - 1; … … 1093 1093 public const int TVIS_SELECTED = 0x2; 1094 1094 public const int TVIS_STATEIMAGEMASK = 0xf000; 1095 public const uint TVI_FIRST =0xffff0001;1096 public const uint TVI_LAST =0xffff0002;1097 public const uint TVI_ROOT =0xffff0000;1095 public const int TVI_FIRST = cast(int)0xffff0001; 1096 public const int TVI_LAST = cast(int)0xffff0002; 1097 public const int TVI_ROOT = cast(int)0xffff0000; 1098 1098 public const int TVM_DELETEITEM = 0x1101; 1099 1099 public const int TVM_ENSUREVISIBLE = 0x1114; … … 1117 1117 public const int TVM_SETITEM = IsUnicode ? 0x113f : 0x110d; 1118 1118 public const int TVM_SETTEXTCOLOR = 0x111e; 1119 public const uint TVN_BEGINDRAG = IsUnicode ? 0xfffffe38 :0xfffffe69;1120 public const uint TVN_BEGINDRAGW =0xfffffe38;1121 public const uint TVN_BEGINDRAGA =0xfffffe69;1122 public const uint TVN_BEGINRDRAG = IsUnicode ? 0xfffffe37 :0xfffffe68;1123 public const uint TVN_BEGINRDRAGW =0xfffffe37;1124 public const uint TVN_BEGINRDRAGA =0xfffffe68;1125 public const uint TVN_FIRST =0xfffffe70;1126 public const uint TVN_ITEMEXPANDING = IsUnicode ? 0xfffffe3a :0xfffffe6b;1127 public const uint TVN_ITEMEXPANDINGW =0xfffffe3a;1128 public const uint TVN_ITEMEXPANDINGA =0xfffffe6b;1129 public const uint TVN_SELCHANGED = IsUnicode ? 0xfffffe3d :0xfffffe6e;1130 public const uint TVN_SELCHANGEDW =0xfffffe3d;1131 public const uint TVN_SELCHANGEDA =0xfffffe6e;1132 public const uint TVN_SELCHANGING = IsUnicode ? 0xfffffe3e :0xfffffe6f;1133 public const uint TVN_SELCHANGINGW =0xfffffe3e;1134 public const uint TVN_SELCHANGINGA =0xfffffe6f;1119 public const int TVN_BEGINDRAG = IsUnicode ? cast(int)0xfffffe38 : cast(int)0xfffffe69; 1120 public const int TVN_BEGINDRAGW = cast(int)0xfffffe38; 1121 public const int TVN_BEGINDRAGA = cast(int)0xfffffe69; 1122 public const int TVN_BEGINRDRAG = IsUnicode ? cast(int)0xfffffe37 : cast(int)0xfffffe68; 1123 public const int TVN_BEGINRDRAGW = cast(int)0xfffffe37; 1124 public const int TVN_BEGINRDRAGA = cast(int)0xfffffe68; 1125 public const int TVN_FIRST = cast(int)0xfffffe70; 1126 public const int TVN_ITEMEXPANDING = IsUnicode ? cast(int)0xfffffe3a : cast(int)0xfffffe6b; 1127 public const int TVN_ITEMEXPANDINGW = cast(int)0xfffffe3a; 1128 public const int TVN_ITEMEXPANDINGA = cast(int)0xfffffe6b; 1129 public const int TVN_SELCHANGED = IsUnicode ? cast(int)0xfffffe3d : cast(int)0xfffffe6e; 1130 public const int TVN_SELCHANGEDW = cast(int)0xfffffe3d; 1131 public const int TVN_SELCHANGEDA = cast(int)0xfffffe6e; 1132 public const int TVN_SELCHANGING = IsUnicode ? cast(int)0xfffffe3e : cast(int)0xfffffe6f; 1133 public const int TVN_SELCHANGINGW = cast(int)0xfffffe3e; 1134 public const int TVN_SELCHANGINGA = cast(int)0xfffffe6f; 1135 1135 public const int TVSIL_NORMAL = 0x0; 1136 1136 public const int TVSIL_STATE = 0x2; … … 1212 1212 public const char[] WC_TREEVIEW = "SysTreeView32"; //$NON-NLS-1$ 1213 1213 public const int WH_GETMESSAGE = 0x3; 1214 public const uint WH_MSGFILTER =0xFFFFFFFF;1214 public const int WH_MSGFILTER = cast(int)0xFFFFFFFF; 1215 1215 public const int WHEEL_DELTA = 120; 1216 public const uint WHEEL_PAGESCROLL =0xFFFFFFFF;1216 public const int WHEEL_PAGESCROLL = cast(int)0xFFFFFFFF; 1217 1217 public const int WM_ACTIVATE = 0x6; 1218 1218 public const int WM_ACTIVATEAPP = 0x1c; … … 1315 1315 public const int WS_CLIPCHILDREN = 0x2000000; 1316 1316 public const int WS_CLIPSIBLINGS = 0x4000000; 1317 public const uint WS_EX_CAPTIONOKBTN =0x80000000;1317 public const int WS_EX_CAPTIONOKBTN = cast(int)0x80000000; 1318 1318 public const int WS_EX_CLIENTEDGE = 0x200; 1319 1319 public const int WS_EX_DLGMODALFRAME = 0x1; … … 1333 1333 public const int WS_OVERLAPPED = IsWinCE ? WS_BORDER | WS_CAPTION : 0x0; 1334 1334 public const int WS_OVERLAPPEDWINDOW = 0xcf0000; 1335 public const uint WS_POPUP =0x80000000;1335 public const int WS_POPUP = cast(int)0x80000000; 1336 1336 public const int WS_SYSMENU = 0x80000; 1337 1337 public const int WS_TABSTOP = 0x10000; branches/0.1/src/dwt/internal/win32/types.d
r17 r23 784 784 } 785 785 786 786 787 struct WINDOWPLACEMENT { 787 uint length; 788 uint flags; 789 uint showCmd; 790 POINT ptMinPosition; 791 POINT ptMaxPosition; 792 RECT rcNormalPosition; 793 } 794 795 796 797 798 799 788 int length; 789 int flags; 790 int showCmd; 791 // POINT ptMinPosition; 792 int ptMinPosition_x; 793 int ptMinPosition_y; 794 // POINT ptMaxPosition; 795 int ptMaxPosition_x; 796 int ptMaxPosition_y; 797 // RECT rcNormalPosition; 798 int left; 799 int top; 800 int right; 801 int bottom; 802 } 803 804 805 806 branches/0.1/src/dwt/widgets/control.d
r17 r23 2758 2758 } 2759 2759 2760 2760 2761 /** 2761 2762 * Based on the argument, perform one of the expected platform … … 2984 2985 2985 2986 abstract int windowProc (); 2986 2987 /+ TODO: looks like a lot of OS.* functions to uncomment...2988 2987 2989 2988 … … 3084 3083 */ 3085 3084 if (!OS.IsUnicode && OS.IsDBLocale) { 3086 byte lead = (byte) (wParam & 0xFF);3085 byte lead = cast(byte) (wParam & 0xFF); 3087 3086 if (OS.IsDBCSLeadByte (lead)) return null; 3088 3087 } … … 3142 3141 if (lParam != -1) { 3143 3142 POINT pt = new POINT (); 3144 x = pt.x = (short) (lParam & 0xFFFF);3145 y = pt.y = (short) (lParam >> 16);3143 x = pt.x = cast(short) (lParam & 0xFFFF); 3144 y = pt.y = cast(short) (lParam >> 16); 3146 3145 OS.ScreenToClient (handle, pt); 3147 3146 RECT rect = new RECT (); … … 3150 3149 } else { 3151 3150 int pos = OS.GetMessagePos (); 3152 x = (short) (pos & 0xFFFF);3153 y = (short) (pos >> 16);3151 x = cast(short) (pos & 0xFFFF); 3152 y = cast(short) (pos >> 16); 3154 3153 } 3155 3154 … … 3178 3177 3179 3178 LRESULT WM_DRAWITEM (int wParam, int lParam) { 3180 DRAWITEMSTRUCT str uct = new DRAWITEMSTRUCT ();3181 OS.MoveMemory (str uct, lParam, DRAWITEMSTRUCT.sizeof);3182 if (str uct.CtlType == OS.ODT_MENU) {3179 DRAWITEMSTRUCT strct; 3180 OS.MoveMemory (strct, lParam, DRAWITEMSTRUCT.sizeof); 3181 if (strct.CtlType == OS.ODT_MENU) { 3183 3182 Decorations shell = menuShell (); 3184 MenuItem item = shell.findMenuItem (str uct.itemID);3183 MenuItem item = shell.findMenuItem (strct.itemID); 3185 3184 if (item == null) return null; 3186 3185 return item.wmDrawChild (wParam, lParam); 3187 3186 } 3188 Control control = display.getControl (str uct.hwndItem);3187 Control control = display.getControl (strct.hwndItem); 3189 3188 if (control == null) return null; 3190 3189 return control.wmDrawChild (wParam, lParam); … … 3357 3356 */ 3358 3357 if (!OS.IsUnicode && OS.IsDBLocale) { 3359 byte lead = (byte) (wParam & 0xFF);3358 byte lead = cast(byte) (wParam & 0xFF); 3360 3359 if (OS.IsDBCSLeadByte (lead)) return null; 3361 3360 } … … 3456 3455 * Shift was not pressed. 3457 3456 */ 3458 display.lastKey = OS.CharLower ( (short) mapKey);3457 display.lastKey = OS.CharLower (cast(short) mapKey); 3459 3458 3460 3459 /* … … 3515 3514 if (display.lastAscii == 0) display.lastAscii = mapKey; 3516 3515 } else { 3517 display.lastAscii = OS.CharLower ( (short) mapKey);3516 display.lastAscii = OS.CharLower (cast(short) mapKey); 3518 3517 } 3519 3518 … … 3669 3668 */ 3670 3669 POINT pt = new POINT (); 3671 pt.x = (short) (lParam & 0xFFFF);3672 pt.y = (short) (lParam >> 16);3670 pt.x = cast(short) (lParam & 0xFFFF); 3671 pt.y = cast(short) (lParam >> 16); 3673 3672 OS.ClientToScreen(handle, pt); 3674 3673 dragging = OS.DragDetect (handle, pt); … … 3686 3685 bit hasMenu = menu != null && !menu.isDisposed (); 3687 3686 if (hasMenu || hooks (DWT.MenuDetect)) { 3688 int x = (short) (lParam & 0xFFFF);3689 int y = (short) (lParam >> 16);3687 int x = cast(short) (lParam & 0xFFFF); 3688 int y = cast(short) (lParam >> 16); 3690 3689 SHRGINFO shrg = new SHRGINFO (); 3691 3690 shrg.cbSize = SHRGINFO.sizeof; … … 3703 3702 if (dragging) { 3704 3703 Event event = new Event (); 3705 event.x = (short) (lParam & 0xFFFF);3706 event.y = (short) (lParam >> 16);3704 event.x = cast(short) (lParam & 0xFFFF); 3705 event.y = cast(short) (lParam >> 16); 3707 3706 postEvent (DWT.DragDetect, event); 3708 3707 } else { … … 3783 3782 3784 3783 LRESULT WM_MEASUREITEM (int wParam, int lParam) { 3785 MEASUREITEMSTRUCT str uct = new MEASUREITEMSTRUCT ();3786 OS.MoveMemory (str uct, lParam, MEASUREITEMSTRUCT.sizeof);3787 if (str uct.CtlType == OS.ODT_MENU) {3784 MEASUREITEMSTRUCT strct; 3785 OS.MoveMemory (strct, lParam, MEASUREITEMSTRUCT.sizeof); 3786 if (strct.CtlType == OS.ODT_MENU) { 3788 3787 Decorations shell = menuShell (); 3789 MenuItem item = shell.findMenuItem (str uct.itemID);3788 MenuItem item = shell.findMenuItem (strct.itemID); 3790 3789 if (item == null) return null; 3791 3790 return item.wmMeasureChild (wParam, lParam); 3792 3791 } 3793 int hwnd = OS.GetDlgItem (handle, str uct.CtlID);3792 int hwnd = OS.GetDlgItem (handle, strct.CtlID); 3794 3793 Control control = display.getControl (hwnd); 3795 3794 if (control == null) return null; … … 3921 3920 int pos = OS.GetMessagePos (); 3922 3921 POINT pt = new POINT (); 3923 pt.x = (short) (pos & 0xFFFF);3924 pt.y = (short) (pos >> 16);3922 pt.x = cast(short) (pos & 0xFFFF); 3923 pt.y = cast(short) (pos >> 16); 3925 3924 OS.ScreenToClient (handle, pt); 3926 3925 lParam = pt.x | (pt.y << 16); … … 4401 4400 * Shift was not pressed. 4402 4401 */ 4403 display.lastKey = OS.CharLower ( (short) mapKey);4402 display.lastKey = OS.CharLower (cast(short) mapKey); 4404 4403 4405 4404 /* … … 4478 4477 } 4479 4478 4480 +/ 4481 4482 } 4483 4479 4480 4481 } 4482 branches/0.1/src/dwt/widgets/decorations.d
r18 r23 108 108 109 109 private import dwt.graphics.image; 110 private import dwt.graphics.imagedata; 110 111 private import dwt.graphics.point; 111 112 private import dwt.graphics.rectangle; … … 350 351 if (parent == menuBar) { 351 352 item.fillAccel (accel); 352 OS.MoveMemory ( buffer1, accel, size);353 System.arraycopy (buffer1, 0, buffer2, nAccel * size, size);353 OS.MoveMemory (cast(char*)buffer1, accel, size); 354 // TODO: arraycopy System.arraycopy (buffer1, 0, buffer2, nAccel * size, size); 354 355 nAccel++; 355 356 } … … 365 366 accel.key = 'Q'; 366 367 accel.cmd = OS.IDOK; 367 OS.MoveMemory ( buffer1, accel, size);368 System.arraycopy (buffer1, 0, buffer2, nAccel * size, size);368 OS.MoveMemory (cast(char*)buffer1, accel, size); 369 // TODO: arraycopy System.arraycopy (buffer1, 0, buffer2, nAccel * size, size); 369 370 nAccel++; 370 371 } … … 447 448 if (!OS.IsWinCE) { 448 449 if (OS.IsIconic (handle)) { 449 WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ();450 WINDOWPLACEMENT lpwndpl; 450 451 lpwndpl.length = WINDOWPLACEMENT.sizeof; 451 OS.GetWindowPlacement (handle, lpwndpl);452 OS.GetWindowPlacement (handle, &lpwndpl); 452 453 int width = lpwndpl.right - lpwndpl.left; 453 454 int height = lpwndpl.bottom - lpwndpl.top; … … 477 478 if (!OS.IsWinCE) { 478 479 if (OS.IsIconic (handle)) { 479 RECT rect = new RECT ();480 WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ();480 RECT rect; 481 WINDOWPLACEMENT lpwndpl; 481 482 lpwndpl.length = WINDOWPLACEMENT.sizeof; 482 OS.GetWindowPlacement (handle, lpwndpl);483 OS.GetWindowPlacement (handle, &lpwndpl); 483 484 int width = lpwndpl.right - lpwndpl.left; 484 485 int height = lpwndpl.bottom - lpwndpl.top; 485 OS.SetRect ( rect, 0, 0, width, height);486 OS.SendMessage (handle, OS.WM_NCCALCSIZE, 0, rect);486 OS.SetRect (&rect, 0, 0, width, height); 487 OS.SendMessage (handle, OS.WM_NCCALCSIZE, 0, &rect); 487 488 return new Rectangle (0, 0, rect.right, rect.bottom); 488 489 } … … 571 572 if (!OS.IsWinCE) { 572 573 if (OS.IsIconic (handle)) { 573 WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ();574 WINDOWPLACEMENT lpwndpl; 574 575 lpwndpl.length = WINDOWPLACEMENT.sizeof; 575 OS.GetWindowPlacement (handle, lpwndpl);576 OS.GetWindowPlacement (handle, &lpwndpl); 576 577 return new Point (lpwndpl.left, lpwndpl.top); 577 578 } … … 646 647 if (!OS.IsWinCE) { 647 648 if (OS.IsIconic (handle)) { 648 WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ();649 WINDOWPLACEMENT lpwndpl; 649 650 lpwndpl.length = WINDOWPLACEMENT.sizeof; 650 OS.GetWindowPlacement (handle, lpwndpl);651 OS.GetWindowPlacement (handle, &lpwndpl); 651 652 int width = lpwndpl.right - lpwndpl.left; 652 653 int height = lpwndpl.bottom - lpwndpl.top; … … 654 655 } 655 656 } 656 RECT rect = new RECT ();657 OS.GetWindowRect (handle, rect);657 RECT rect; 658 OS.GetWindowRect (handle, &rect); 658 659 int width = rect.right - rect.left; 659 660 int height = rect.bottom - rect.top; … … 681 682 TCHAR buffer = new TCHAR (0, length + 1); 682 683 OS.GetWindowText (handle, buffer, length + 1); 683 return buffer.toString (0, length);684 return buffer.toStringw (0, length); 684 685 } 685 686 … … 762 763 } 763 764 764 b itrestoreFocus () {765 bool restoreFocus () { 765 766 if (display.ignoreRestoreFocus) return true; 766 767 if (savedFocus != null && savedFocus.isDisposed ()) savedFocus = null; … … 774 775 // if (defaultButton.setFocus ()) return true; 775 776 // } 777 /+ TODO: traverseGroup() is in control.d, use delegates 776 778 return traverseGroup (true); 779 +/ 780 return true; 781 777 782 } 778 783 … … 883 888 if (image != null) { 884 889 Rectangle rect = image.getBounds (); 885 smallWidth = Math.abs (rect.width - OS.GetSystemMetrics (OS.SM_CXSMICON));890 smallWidth = abs (rect.width - OS.GetSystemMetrics (OS.SM_CXSMICON)); 886 891 smallIcon = image; 887 largeWidth = Math.abs (rect.width - OS.GetSystemMetrics (OS.SM_CXICON));892 largeWidth = abs (rect.width - OS.GetSystemMetrics (OS.SM_CXICON)); 888 893 largeIcon = image; 889 894 } … … 891 896 for (int i = 0; i < images.length; i++) { 892 897 Rectangle rect = images [i].getBounds (); 893 int value = Math.abs (rect.width - OS.GetSystemMetrics (OS.SM_CXSMICON));898 int value = abs (rect.width - OS.GetSystemMetrics (OS.SM_CXSMICON)); 894 899 if (value < smallWidth) { 895 900 smallWidth = value; 896 901 smallIcon = images [i]; 897 902 } 898 value = Math.abs (rect.width - OS.GetSystemMetrics (OS.SM_CXICON));903 value = abs (rect.width - OS.GetSystemMetrics (OS.SM_CXICON)); 899 904 if (value < largeWidth) { 900 905 largeWidth = value; … … 1177 1182 1178 1183 void setPlacement (int x, int y, int width, int height, int flags) { 1179 WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ();1184 WINDOWPLACEMENT lpwndpl; 1180 1185 lpwndpl.length = WINDOWPLACEMENT.sizeof; 1181 OS.GetWindowPlacement (handle, lpwndpl);1186 OS.GetWindowPlacement (handle, &lpwndpl); 1182 1187 lpwndpl.showCmd = OS.SW_SHOWNA; 1183 1188 if (OS.IsIconic (handle)) { … … 1198 1203 lpwndpl.bottom = lpwndpl.top + height; 1199 1204 } 1200 OS.SetWindowPlacement (handle, lpwndpl);1205 OS.SetWindowPlacement (handle, &lpwndpl); 1201 1206 } 1202 1207 … … 1230 1235 if ((style & DWT.CLOSE) == 0 || newCount != oldCount) { 1231 1236 OS.DeleteMenu (hMenu, OS.SC_TASKLIST, OS.MF_BYCOMMAND); 1232 MENUITEMINFO info = new MENUITEMINFO ();1237 MENUITEMINFO info; 1233 1238 info.cbSize = MENUITEMINFO.sizeof; 1234 1239 info.fMask = OS.MIIM_ID; 1235 1240 int index = 0; 1236 1241 while (index < newCount) { 1237 if (OS.GetMenuItemInfo (hMenu, index, true, info)) {1242 if (OS.GetMenuItemInfo (hMenu, index, true, &info)) { 1238 1243 if (info.wID == OS.SC_CLOSE) break; 1239 1244 } … … 1285 1290 * event. If this happens, just return. 1286 1291 */ 1292 /+ TODO: delegates 1287 1293 sendEvent (DWT.Show); 1294 +/ 1288 1295 if (isDisposed ()) return; 1289 1296 if (OS.IsHPC) { … … 1328 1335 OS.ShowWindow (handle, OS.SW_HIDE); 1329 1336 } 1337 /+ TODO: delegates 1330 1338 sendEvent (DWT.Hide); 1339 +/ 1331 1340 } 1332 1341 } … … 1416 1425 1417 1426 CREATESTRUCT widgetCreateStruct () { 1418 return new CREATESTRUCT (); 1427 CREATESTRUCT cs; 1428 return cs; 1419 1429 } 1420 1430 … … 1434 1444 int widgetParent () { 1435 1445 Shell shell = getShell (); 1436 return shell.hwndMDIClient ();1446 return shell.hwndMDIClient; 1437 1447 } 1438 1448
