Changeset 165:07ed83d51a19

Show
Ignore:
Timestamp:
02/21/08 11:40:30 (7 months ago)
Author:
davelzg@gmail.com
branch:
default
Message:

Fix tooltip bugs. by Zhiguang Liang
1).tailed by 0XFF string do a conversion of utf8-> utf16 string would throw exception by tango. We need to nullify the last byte of the chars string.
2).the function finger print doesn't keep consistency. setToolTipText in Shell.d

Note:
in the NMTTDISPINFO lpnmtdi struct from message, the field hinst should be forced to null.
but from the test experience, it now keeps always 0, let it be the same as java code.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/internal/win32/OS.d

    r161 r165  
    727727    public static const int CS_VREDRAW = 0x1; 
    728728    public static const int CW_USEDEFAULT = 0x80000000; 
    729     public static const char[] DATETIMEPICK_CLASS = "SysDateTimePick32"; //$NON-NLS-1$ 
     729    public static const TCHAR[] DATETIMEPICK_CLASS = "SysDateTimePick32"; //$NON-NLS-1$ 
    730730    public static const int DATE_LONGDATE = 0x00000002; 
    731731    public static const int DATE_SHORTDATE = 0x00000001; 
     
    13351335    public static const int MONITOR_DEFAULTTONEAREST = 0x2; 
    13361336    public static const int MONITORINFOF_PRIMARY = 0x1; 
    1337     public static const char[] MONTHCAL_CLASS = "SysMonthCal32"; //$NON-NLS-1$ 
     1337    public static const TCHAR[] MONTHCAL_CLASS = "SysMonthCal32"; //$NON-NLS-1$ 
    13381338    public static const int MOUSEEVENTF_ABSOLUTE = 0x8000; 
    13391339    public static const int MOUSEEVENTF_LEFTDOWN = 0x0002; 
     
    40304030    alias WINAPI.GetClassNameA GetClassName; 
    40314031    alias WINAPI.GetClipboardFormatNameA GetClipboardFormatName; 
     4032    alias WINAPI.GetDateFormatA GetDateFormat; 
     4033    alias WINAPI.GetTimeFormatA GetTimeFormat; 
    40324034    alias WINAPI.GetKeyNameTextA GetKeyNameText; 
    40334035    alias WINAPI.GetLocaleInfoA GetLocaleInfo; 
     
    41294131    alias WINAPI.GetClassNameW GetClassName; 
    41304132    alias WINAPI.GetClipboardFormatNameW GetClipboardFormatName; 
     4133    alias WINAPI.GetDateFormatW GetDateFormat; 
     4134    alias WINAPI.GetTimeFormatW GetTimeFormat; 
    41314135    alias WINAPI.GetKeyNameTextW GetKeyNameText; 
    41324136    alias WINAPI.GetLocaleInfoW GetLocaleInfo; 
  • dwt/internal/win32/WINAPI.d

    r143 r165  
    340340//     int GetLocaleInfoA(LCID, LCTYPE, LPSTR, int); 
    341341//     WINBOOL SetLocaleInfoA(LCID, LCTYPE, LPCSTR); 
    342 //     int GetTimeFormatA(LCID, DWORD, LPSYSTEMTIME, LPCSTR, LPSTR, int); 
    343 //     int GetDateFormatA(LCID, DWORD, LPSYSTEMTIME, LPCSTR, LPSTR, int); 
     342     int GetTimeFormatA(LCID, DWORD, LPSYSTEMTIME, LPCSTR, LPSTR, int); 
     343     int GetDateFormatA(LCID, DWORD, LPSYSTEMTIME, LPCSTR, LPSTR, int); 
    344344//     int GetNumberFormatA(LCID, DWORD, LPCSTR, PNUMBERFMT, LPSTR, int); 
    345345//     int GetCurrencyFormatA(LCID, DWORD, LPCSTR, PCURRENCYFMT, LPSTR, int); 
     
    733733//     int GetLocaleInfoW(LCID, LCTYPE, LPWSTR, int); 
    734734//     WINBOOL SetLocaleInfoW(LCID, LCTYPE, LPCWSTR); 
    735 //     int GetTimeFormatW(LCID, DWORD, LPSYSTEMTIME, LPCWSTR, LPWSTR, int); 
    736 //     int GetDateFormatW(LCID, DWORD, LPSYSTEMTIME, LPCWSTR, LPWSTR, int); 
     735     int GetTimeFormatW(LCID, DWORD, LPSYSTEMTIME, LPCWSTR, LPWSTR, int); 
     736     int GetDateFormatW(LCID, DWORD, LPSYSTEMTIME, LPCWSTR, LPWSTR, int); 
    737737//     int GetNumberFormatW(LCID, DWORD, LPCWSTR, PNUMBERFMT, LPWSTR, int); 
    738738//     int GetCurrencyFormatW(LCID, DWORD, LPCWSTR, PCURRENCYFMT, LPWSTR, int); 
  • dwt/widgets/Composite.d

    r117 r165  
    15721572                    char [] chars = new char [length_ + 1]; 
    15731573                    string.getChars (0, length_, chars, 0); 
     1574                    chars[$-1] = 0; // d initialize it to 0xFF, we need to make it null terminated 
    15741575 
    15751576                    /* 
  • dwt/widgets/Shell.d

    r128 r165  
    15391539} 
    15401540 
    1541 void setToolTipText (NMTTDISPINFO lpnmtdi, char [] buffer) { 
     1541void setToolTipText (NMTTDISPINFO* lpnmtdi, char [] buffer) { 
    15421542    /* 
    15431543    * Ensure that the current position of the mouse