Changeset 23

Show
Ignore:
Timestamp:
05/30/04 01:33:18 (4 years ago)
Author:
brad
Message:

Work on os.d - changed uints back to ints and cast(int)'ed the offenders.
Wored on decorations.d to compile outside of Eclipse, ran into windowProc() issue.
Uncommented big block of implementation in control.d and did requisite port tasks
Still forward references on scrollable.d

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/0.1/src/dwt/internal/win32/os.d

    r18 r23  
    3030} 
    3131 
    32 public static class OS { 
     32public class OS { 
    3333 
    3434    /* 
    3535     * DWT Windows flags. 
    3636     */ 
    37     int IsWin32s; 
     37    static int IsWin32s; 
    3838    const int IsWin95 = 0; 
    3939    const int IsWinNT = 1; 
    4040    const int IsWinCE = 0; 
    4141    static int IsPPC; 
    42     int IsHPC; 
     42    static int IsHPC; 
    4343    static int IsSP; 
    44     int IsDBLocale; 
     44    static int IsDBLocale; 
    4545    const int IsUnicode = 1; 
    4646    static int WIN32_MAJOR, WIN32_MINOR; 
     
    116116        IsWinNT = 1; //info.dwPlatformId == VER_PLATFORM_WIN32_NT; 
    117117        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; 
    121121    //  WIN32_MAJOR = info.dwMajorVersion; 
    122122    //  WIN32_MINOR = info.dwMinorVersion; 
     
    168168     +  casting from uint to int.  So, we changed the const declare to a uint. 
    169169     + 
    170      +  As of dmd 0.89, we may want 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; 
    171171     +  2004.5.23 BSA 
    172172     + 
     
    231231    public const int CB_ADDSTRING = 0x143; 
    232232    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; 
    235235    public const int CB_FINDSTRINGEXACT = 0x158; 
    236236    public const int CB_GETCOUNT = 0x146; 
     
    276276    public const int CFM_FACE = 0x20000000; 
    277277    public const int CFM_ITALIC = 0x2; 
    278     public const uint CFM_SIZE = 0x80000000; 
     278    public const int CFM_SIZE = cast(int)0x80000000; 
    279279    public const int CFM_STRIKEOUT = 0x8; 
    280280    public const int CFM_UNDERLINE = 0x4; 
     
    287287    public const int CF_UNICODETEXT = 13; 
    288288    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; 
    291291    public const int COLORONCOLOR = 0x3; 
    292292    public const int COLOR_3DDKSHADOW = 0x15 | SYS_COLOR_INDEX_FLAG; 
     
    324324    public const int CS_HREDRAW = 0x2; 
    325325    public const int CS_VREDRAW = 0x1; 
    326     public const uint CW_USEDEFAULT = 0x80000000; 
     326    public const int CW_USEDEFAULT = cast(int)0x80000000; 
    327327    public const int DCX_CACHE = 0x2; 
    328328    public const int DCX_CLIPCHILDREN = 0x8; 
     
    342342    public const int DFC_SCROLL = 0x3; 
    343343    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; 
    345345    public const int DI_NORMAL = 0x3; 
    346346    public const int DLGC_BUTTON = 0x2000; 
     
    426426    public const int GTL_PRECISE = 0x2; 
    427427    public const int GT_DEFAULT = 0x0; 
    428     public const uint GWL_EXSTYLE = 0xffffffec; 
     428    public const int GWL_EXSTYLE = cast(int)0xffffffec; 
    429429    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; 
    433433    public const int GW_CHILD = 0x5; 
    434434    public const int GW_HWNDFIRST = 0x0; 
     
    441441    public const int HDM_GETBITMAPMARGIN = HDM_FIRST + 21; 
    442442    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; 
    447447    public const int HDN_DIVIDERDBLCLICKA = HDN_FIRST - 5; 
    448448    public const int HDN_DIVIDERDBLCLICKW = HDN_FIRST - 25; 
    449449    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; 
    453453    public const int HDN_ITEMDBLCLICKW = HDN_FIRST - 23; 
    454454    public const int HDN_ITEMDBLCLICKA = HDN_FIRST - 3; 
     
    456456    public const int HEAP_ZERO_MEMORY = 0x8; 
    457457    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; 
    462462    public const int HORZRES = 0x8; 
    463463    public const int HTBORDER = 0x12; 
     
    469469    public const int HTNOWHERE = 0x0; 
    470470    public const int HTSYSMENU = 0x3; 
    471     public const uint HTTRANSPARENT = 0xffffffff; 
     471    public const int HTTRANSPARENT = cast(int)0xffffffff; 
    472472    public const int HTVSCROLL = 0x7; 
    473473    public const int HWND_BOTTOM = 0x1; 
    474474    public const int HWND_TOP = 0x0; 
    475     public const uint HWND_TOPMOST = 0xffffffff; 
     475    public const int HWND_TOPMOST = cast(int)0xffffffff; 
    476476    public const int HWND_NOTOPMOST = -2; 
    477477    public const int ICC_COOL_CLASSES = 0x400; 
     
    517517    public const int IME_CMODE_NATIVE = 0x1; 
    518518    public const int IME_CMODE_ROMAN = 0x10; 
    519     public const uint INFINITE = 0xffffffff; 
     519    public const int INFINITE = cast(int)0xffffffff; 
    520520    public const int KEY_ENUMERATE_SUB_KEYS = 0x8; 
    521521    public const int KEY_NOTIFY = 0x10; 
     
    531531    public const int LB_ADDSTRING = 0x180; 
    532532    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; 
    535535    public const int LB_FINDSTRINGEXACT = 0x1a2; 
    536536    public const int LB_GETCARETINDEX = 0x19f; 
     
    566566    public const int LOGPIXELSX = 0x58; 
    567567    public const int LOGPIXELSY = 0x5a; 
    568     public const uint LPSTR_TEXTCALLBACK = 0xffffffff; 
     568    public const int LPSTR_TEXTCALLBACK = cast(int)0xffffffff; 
    569569    public const int LR_DEFAULTCOLOR = 0x0; 
    570570    public const int LVCFMT_CENTER = 0x2; 
     
    635635    public const int LVNI_FOCUSED = 0x1; 
    636636    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; 
    641641    public const int LVN_GETDISPINFOA = LVN_FIRST - 50; 
    642642    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; 
    648648    public const int LVSICF_NOINVALIDATEALL = 0x1; 
    649649    public const int LVSICF_NOSCROLL = 0x2; 
     
    720720    public const int MWMO_INPUTAVAILABLE = 0x4; 
    721721    public const int NM_FIRST = 0x0; 
    722     public const uint NM_CLICK = 0xfffffffe; 
     722    public const int NM_CLICK = cast(int)0xfffffffe; 
    723723    public const int NM_CUSTOMDRAW = NM_FIRST - 12; 
    724     public const uint NM_DBLCLK = 0xfffffffd; 
     724    public const int NM_DBLCLK = cast(int)0xfffffffd; 
    725725    public const int NM_RECOGNIZEGESTURE = NM_FIRST - 16; 
    726     public const uint NM_RETURN = 0xfffffffc; 
     726    public const int NM_RETURN = cast(int)0xfffffffc; 
    727727    public const int NOTSRCCOPY = 0x330008; 
    728728    public const int NULLREGION = 0x1; 
     
    730730    public const int NULL_PEN = 0x8; 
    731731    public const int NUMRESERVED = 106; 
    732     public const uint OBJID_CLIENT = 0xFFFFFFFC; 
     732    public const int OBJID_CLIENT = cast(int)0xFFFFFFFC; 
    733733    public const int OBJ_FONT = 0x6; 
    734734    public const int OBJ_PEN = 0x1; 
     
    803803    public const int RBBS_USECHEVRON = 0x00000200; 
    804804    public const int RBBS_VARIABLEHEIGHT = 0x40; 
    805     public const uint RBN_FIRST = 0xfffffcc1; 
     805    public const int RBN_FIRST = cast(int)0xfffffcc1; 
    806806    public const int RBN_CHEVRONPUSHED = RBN_FIRST - 10; 
    807     public const uint RBN_HEIGHTCHANGE = 0xfffffcc1; 
     807    public const int RBN_HEIGHTCHANGE = cast(int)0xfffffcc1; 
    808808    public const int RBS_DBLCLKTOGGLE = 0x8000; 
    809809    public const int RBS_BANDBORDERS = 0x400; 
     
    972972    public const int TBM_SETRANGEMIN = 0x407; 
    973973    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; 
    976976    public const int TBSTATE_CHECKED = 0x1; 
    977977    public const int TBSTYLE_CUSTOMERASE = 0x2000; 
     
    10341034    public const int TCM_SETIMAGELIST = 0x1303; 
    10351035    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; 
    10381038    public const int TCS_BOTTOM = 0x0002; 
    10391039    public const int TCS_FOCUSNEVER = 0x8000; 
     
    10601060    public const int TTM_SETMAXTIPWIDTH = 0x418; 
    10611061    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; 
    10661066    public const int TTN_POP = TTN_FIRST - 2; 
    10671067    public const int TTN_SHOW = TTN_FIRST - 1; 
     
    10931093    public const int TVIS_SELECTED = 0x2; 
    10941094    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; 
    10981098    public const int TVM_DELETEITEM = 0x1101; 
    10991099    public const int TVM_ENSUREVISIBLE = 0x1114; 
     
    11171117    public const int TVM_SETITEM = IsUnicode ? 0x113f : 0x110d; 
    11181118    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; 
    11351135    public const int TVSIL_NORMAL = 0x0; 
    11361136    public const int TVSIL_STATE = 0x2; 
     
    12121212    public const char[] WC_TREEVIEW = "SysTreeView32"; //$NON-NLS-1$ 
    12131213    public const int WH_GETMESSAGE = 0x3; 
    1214     public const uint WH_MSGFILTER = 0xFFFFFFFF; 
     1214    public const int WH_MSGFILTER = cast(int)0xFFFFFFFF; 
    12151215    public const int WHEEL_DELTA = 120; 
    1216     public const uint WHEEL_PAGESCROLL = 0xFFFFFFFF; 
     1216    public const int WHEEL_PAGESCROLL = cast(int)0xFFFFFFFF; 
    12171217    public const int WM_ACTIVATE = 0x6; 
    12181218    public const int WM_ACTIVATEAPP = 0x1c; 
     
    13151315    public const int WS_CLIPCHILDREN = 0x2000000; 
    13161316    public const int WS_CLIPSIBLINGS = 0x4000000; 
    1317     public const uint WS_EX_CAPTIONOKBTN = 0x80000000; 
     1317    public const int WS_EX_CAPTIONOKBTN = cast(int)0x80000000; 
    13181318    public const int WS_EX_CLIENTEDGE = 0x200; 
    13191319    public const int WS_EX_DLGMODALFRAME = 0x1; 
     
    13331333    public const int WS_OVERLAPPED = IsWinCE ? WS_BORDER | WS_CAPTION : 0x0; 
    13341334    public const int WS_OVERLAPPEDWINDOW = 0xcf0000; 
    1335     public const uint WS_POPUP = 0x80000000; 
     1335    public const int WS_POPUP = cast(int)0x80000000; 
    13361336    public const int WS_SYSMENU = 0x80000; 
    13371337    public const int WS_TABSTOP = 0x10000; 
  • branches/0.1/src/dwt/internal/win32/types.d

    r17 r23  
    784784} 
    785785 
     786 
    786787struct 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  
    27582758} 
    27592759 
     2760 
    27602761/** 
    27612762 * Based on the argument, perform one of the expected platform 
     
    29842985 
    29852986abstract int windowProc (); 
    2986  
    2987 /+ TODO: looks like a lot of OS.* functions to uncomment... 
    29882987 
    29892988 
     
    30843083    */ 
    30853084    if (!OS.IsUnicode && OS.IsDBLocale) { 
    3086         byte lead = (byte) (wParam & 0xFF); 
     3085        byte lead = cast(byte) (wParam & 0xFF); 
    30873086        if (OS.IsDBCSLeadByte (lead)) return null; 
    30883087    } 
     
    31423141    if (lParam != -1) { 
    31433142        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); 
    31463145        OS.ScreenToClient (handle, pt); 
    31473146        RECT rect = new RECT (); 
     
    31503149    } else { 
    31513150        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); 
    31543153    } 
    31553154 
     
    31783177 
    31793178LRESULT WM_DRAWITEM (int wParam, int lParam) { 
    3180     DRAWITEMSTRUCT struct = new DRAWITEMSTRUCT ()
    3181     OS.MoveMemory (struct, lParam, DRAWITEMSTRUCT.sizeof); 
    3182     if (struct.CtlType == OS.ODT_MENU) { 
     3179    DRAWITEMSTRUCT strct
     3180    OS.MoveMemory (strct, lParam, DRAWITEMSTRUCT.sizeof); 
     3181    if (strct.CtlType == OS.ODT_MENU) { 
    31833182        Decorations shell = menuShell (); 
    3184         MenuItem item = shell.findMenuItem (struct.itemID); 
     3183        MenuItem item = shell.findMenuItem (strct.itemID); 
    31853184        if (item == null) return null; 
    31863185        return item.wmDrawChild (wParam, lParam); 
    31873186    } 
    3188     Control control = display.getControl (struct.hwndItem); 
     3187    Control control = display.getControl (strct.hwndItem); 
    31893188    if (control == null) return null; 
    31903189    return control.wmDrawChild (wParam, lParam); 
     
    33573356    */ 
    33583357    if (!OS.IsUnicode && OS.IsDBLocale) { 
    3359         byte lead = (byte) (wParam & 0xFF); 
     3358        byte lead = cast(byte) (wParam & 0xFF); 
    33603359        if (OS.IsDBCSLeadByte (lead)) return null; 
    33613360    } 
     
    34563455        * Shift was not pressed. 
    34573456        */ 
    3458         display.lastKey = OS.CharLower ((short) mapKey); 
     3457        display.lastKey = OS.CharLower (cast(short) mapKey); 
    34593458 
    34603459        /* 
     
    35153514            if (display.lastAscii == 0) display.lastAscii = mapKey; 
    35163515        } else { 
    3517             display.lastAscii = OS.CharLower ((short) mapKey); 
     3516            display.lastAscii = OS.CharLower (cast(short) mapKey); 
    35183517        } 
    35193518                 
     
    36693668            */ 
    36703669            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); 
    36733672            OS.ClientToScreen(handle, pt); 
    36743673            dragging = OS.DragDetect (handle, pt); 
     
    36863685        bit hasMenu = menu != null && !menu.isDisposed (); 
    36873686        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); 
    36903689            SHRGINFO shrg = new SHRGINFO (); 
    36913690            shrg.cbSize = SHRGINFO.sizeof; 
     
    37033702    if (dragging) { 
    37043703        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); 
    37073706        postEvent (DWT.DragDetect, event); 
    37083707    } else { 
     
    37833782 
    37843783LRESULT WM_MEASUREITEM (int wParam, int lParam) { 
    3785     MEASUREITEMSTRUCT struct = new MEASUREITEMSTRUCT ()
    3786     OS.MoveMemory (struct, lParam, MEASUREITEMSTRUCT.sizeof); 
    3787     if (struct.CtlType == OS.ODT_MENU) { 
     3784    MEASUREITEMSTRUCT strct
     3785    OS.MoveMemory (strct, lParam, MEASUREITEMSTRUCT.sizeof); 
     3786    if (strct.CtlType == OS.ODT_MENU) { 
    37883787        Decorations shell = menuShell (); 
    3789         MenuItem item = shell.findMenuItem (struct.itemID); 
     3788        MenuItem item = shell.findMenuItem (strct.itemID); 
    37903789        if (item == null) return null; 
    37913790        return item.wmMeasureChild (wParam, lParam); 
    37923791    } 
    3793     int hwnd = OS.GetDlgItem (handle, struct.CtlID); 
     3792    int hwnd = OS.GetDlgItem (handle, strct.CtlID); 
    37943793    Control control = display.getControl (hwnd); 
    37953794    if (control == null) return null; 
     
    39213920    int pos = OS.GetMessagePos (); 
    39223921    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);  
    39253924    OS.ScreenToClient (handle, pt); 
    39263925    lParam = pt.x | (pt.y << 16); 
     
    44014400        * Shift was not pressed. 
    44024401        */ 
    4403         display.lastKey = OS.CharLower ((short) mapKey); 
     4402        display.lastKey = OS.CharLower (cast(short) mapKey); 
    44044403 
    44054404        /* 
     
    44784477} 
    44794478 
    4480 +/ 
    4481  
    4482 } 
    4483  
     4479 
     4480 
     4481} 
     4482 
  • branches/0.1/src/dwt/widgets/decorations.d

    r18 r23  
    108108 
    109109    private import dwt.graphics.image; 
     110    private import dwt.graphics.imagedata; 
    110111    private import dwt.graphics.point; 
    111112    private import dwt.graphics.rectangle; 
     
    350351                if (parent == menuBar) { 
    351352                    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); 
    354355                    nAccel++; 
    355356                } 
     
    365366        accel.key = 'Q'; 
    366367        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); 
    369370        nAccel++; 
    370371    } 
     
    447448    if (!OS.IsWinCE) { 
    448449        if (OS.IsIconic (handle)) { 
    449             WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ()
     450            WINDOWPLACEMENT lpwndpl
    450451            lpwndpl.length = WINDOWPLACEMENT.sizeof; 
    451             OS.GetWindowPlacement (handle, lpwndpl); 
     452            OS.GetWindowPlacement (handle, &lpwndpl); 
    452453            int width = lpwndpl.right - lpwndpl.left; 
    453454            int height = lpwndpl.bottom - lpwndpl.top; 
     
    477478    if (!OS.IsWinCE) { 
    478479        if (OS.IsIconic (handle)) { 
    479             RECT rect = new RECT ()
    480             WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ()
     480            RECT rect
     481            WINDOWPLACEMENT lpwndpl
    481482            lpwndpl.length = WINDOWPLACEMENT.sizeof; 
    482             OS.GetWindowPlacement (handle, lpwndpl); 
     483            OS.GetWindowPlacement (handle, &lpwndpl); 
    483484            int width = lpwndpl.right - lpwndpl.left; 
    484485            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); 
    487488            return new Rectangle (0, 0, rect.right, rect.bottom); 
    488489        } 
     
    571572    if (!OS.IsWinCE) { 
    572573        if (OS.IsIconic (handle)) { 
    573             WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ()
     574            WINDOWPLACEMENT lpwndpl
    574575            lpwndpl.length = WINDOWPLACEMENT.sizeof; 
    575             OS.GetWindowPlacement (handle, lpwndpl); 
     576            OS.GetWindowPlacement (handle, &lpwndpl); 
    576577            return new Point (lpwndpl.left, lpwndpl.top); 
    577578        } 
     
    646647    if (!OS.IsWinCE) { 
    647648        if (OS.IsIconic (handle)) { 
    648             WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ()
     649            WINDOWPLACEMENT lpwndpl
    649650            lpwndpl.length = WINDOWPLACEMENT.sizeof; 
    650             OS.GetWindowPlacement (handle, lpwndpl); 
     651            OS.GetWindowPlacement (handle, &lpwndpl); 
    651652            int width = lpwndpl.right - lpwndpl.left; 
    652653            int height = lpwndpl.bottom - lpwndpl.top; 
     
    654655        } 
    655656    } 
    656     RECT rect = new RECT ()
    657     OS.GetWindowRect (handle, rect); 
     657    RECT rect
     658    OS.GetWindowRect (handle, &rect); 
    658659    int width = rect.right - rect.left; 
    659660    int height = rect.bottom - rect.top; 
     
    681682    TCHAR buffer = new TCHAR (0, length + 1); 
    682683    OS.GetWindowText (handle, buffer, length + 1); 
    683     return buffer.toString (0, length); 
     684    return buffer.toStringw (0, length); 
    684685} 
    685686 
     
    762763} 
    763764 
    764 bit restoreFocus () { 
     765bool restoreFocus () { 
    765766    if (display.ignoreRestoreFocus) return true; 
    766767    if (savedFocus != null && savedFocus.isDisposed ()) savedFocus = null; 
     
    774775//      if (defaultButton.setFocus ()) return true; 
    775776//  } 
     777/+ TODO: traverseGroup() is in control.d, use delegates 
    776778    return traverseGroup (true); 
     779+/ 
     780    return true; 
     781 
    777782} 
    778783 
     
    883888    if (image != null) { 
    884889        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)); 
    886891        smallIcon = image; 
    887         largeWidth = Math.abs (rect.width - OS.GetSystemMetrics (OS.SM_CXICON)); 
     892        largeWidth = abs (rect.width - OS.GetSystemMetrics (OS.SM_CXICON)); 
    888893        largeIcon = image; 
    889894    } 
     
    891896        for (int i = 0; i < images.length; i++) { 
    892897            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)); 
    894899            if (value < smallWidth) { 
    895900                smallWidth = value; 
    896901                smallIcon = images [i]; 
    897902            } 
    898             value = Math.abs (rect.width - OS.GetSystemMetrics (OS.SM_CXICON)); 
     903            value = abs (rect.width - OS.GetSystemMetrics (OS.SM_CXICON)); 
    899904            if (value < largeWidth) { 
    900905                largeWidth = value; 
     
    11771182 
    11781183void setPlacement (int x, int y, int width, int height, int flags) { 
    1179     WINDOWPLACEMENT lpwndpl = new WINDOWPLACEMENT ()
     1184    WINDOWPLACEMENT lpwndpl
    11801185    lpwndpl.length = WINDOWPLACEMENT.sizeof; 
    1181     OS.GetWindowPlacement (handle, lpwndpl); 
     1186    OS.GetWindowPlacement (handle, &lpwndpl); 
    11821187    lpwndpl.showCmd = OS.SW_SHOWNA; 
    11831188    if (OS.IsIconic (handle)) { 
     
    11981203        lpwndpl.bottom = lpwndpl.top + height; 
    11991204    } 
    1200     OS.SetWindowPlacement (handle, lpwndpl); 
     1205    OS.SetWindowPlacement (handle, &lpwndpl); 
    12011206} 
    12021207 
     
    12301235    if ((style & DWT.CLOSE) == 0 || newCount != oldCount) { 
    12311236        OS.DeleteMenu (hMenu, OS.SC_TASKLIST, OS.MF_BYCOMMAND); 
    1232         MENUITEMINFO info = new MENUITEMINFO ()
     1237        MENUITEMINFO info
    12331238        info.cbSize = MENUITEMINFO.sizeof; 
    12341239        info.fMask = OS.MIIM_ID; 
    12351240        int index = 0; 
    12361241        while (index < newCount) { 
    1237             if (OS.GetMenuItemInfo (hMenu, index, true, info)) { 
     1242            if (OS.GetMenuItemInfo (hMenu, index, true, &info)) { 
    12381243                if (info.wID == OS.SC_CLOSE) break; 
    12391244            } 
     
    12851290        * event.  If this happens, just return. 
    12861291        */ 
     1292/+ TODO: delegates 
    12871293        sendEvent (DWT.Show); 
     1294+/ 
    12881295        if (isDisposed ()) return; 
    12891296        if (OS.IsHPC) { 
     
    13281335            OS.ShowWindow (handle, OS.SW_HIDE); 
    13291336        } 
     1337/+ TODO: delegates 
    13301338        sendEvent (DWT.Hide); 
     1339+/ 
    13311340    } 
    13321341} 
     
    14161425 
    14171426CREATESTRUCT widgetCreateStruct () { 
    1418     return new CREATESTRUCT (); 
     1427    CREATESTRUCT cs; 
     1428    return cs; 
    14191429} 
    14201430 
     
    14341444int widgetParent () { 
    14351445    Shell shell = getShell (); 
    1436     return shell.hwndMDIClient ()
     1446    return shell.hwndMDIClient
    14371447} 
    14381448