Changeset 221:82b599d21983

Show
Ignore:
Timestamp:
05/18/08 19:08:45 (5 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Fix tooltips for normal controls and the tray.

Files:

Legend:

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

    r214 r221  
    114114    } 
    115115 
    116     private static int getNOTIFYICONDATAA_V2_SIZE (){ 
    117         // hm, NOTIFYICONDATAA.dwInfoFlags.offsetof did not compile 
    118         return IsWinCE ? NOTIFYICONDATAA.sizeof : cast(int)(&(cast(NOTIFYICONDATAA*)null).dwInfoFlags) + int.sizeof; 
    119     } 
    120  
    121     private static int getNOTIFYICONDATAW_V2_SIZE (){ 
    122         return IsWinCE ? NOTIFYICONDATAW.sizeof : cast(int)(&(cast(NOTIFYICONDATAW*)null).dwInfoFlags) + int.sizeof; 
    123     } 
     116//     private static int getNOTIFYICONDATAA_V2_SIZE (){ 
     117//         // hm, NOTIFYICONDATAA.dwInfoFlags.offsetof did not compile 
     118//         return IsWinCE ? NOTIFYICONDATAA.sizeof : cast(int)(&(cast(NOTIFYICONDATAA*)null).dwInfoFlags) + int.sizeof; 
     119//     } 
     120// 
     121//     private static int getNOTIFYICONDATAW_V2_SIZE (){ 
     122//         return IsWinCE ? NOTIFYICONDATAW.sizeof : cast(int)(&(cast(NOTIFYICONDATAW*)null).dwInfoFlags) + int.sizeof; 
     123//     } 
    124124 
    125125    /* 
  • dwt/internal/win32/WINTYPES.d

    r213 r221  
    1502915029    UINT uCallbackMessage; 
    1503015030    HICON hIcon; 
    15031     char szTip[64]
     15031    char szTip[128] = '\0'
    1503215032    DWORD dwState; 
    1503315033    DWORD dwStateMask; 
    15034     char szInfo[256]
    15035 //  union { 
    15036 //      UINT uTimeout; 
     15034    char szInfo[256] = '\0'
     15035    union { 
     15036        UINT uTimeout; 
    1503715037        UINT uVersion; 
    15038 //  }; 
    15039     char szInfoTitle[64]
     15038    }; 
     15039    char szInfoTitle[64] = '\0'
    1504015040    DWORD dwInfoFlags; 
    15041 //  GUID guidItem; 
     15041    //GUID guidItem; 
     15042    //HICON hBalloonIcon; 
    1504215043} alias NOTIFYICONDATAA* PNOTIFYICONDATAA, LPNOTIFYICONDATAA; 
    1504315044 
     
    1504915050    UINT uCallbackMessage; 
    1505015051    HICON hIcon; 
    15051     WCHAR szTip[64]
     15052    WCHAR szTip[128] = '\0'
    1505215053    DWORD dwState; 
    1505315054    DWORD dwStateMask; 
    15054     WCHAR szInfo[256]
    15055 //  union { 
    15056 //      UINT uTimeout; 
     15055    WCHAR szInfo[256] = '\0'
     15056    union { 
     15057        UINT uTimeout; 
    1505715058        UINT uVersion; 
    15058 //  }; 
    15059     WCHAR szInfoTitle[64]
     15059    } 
     15060    WCHAR szInfoTitle[64] = '\0'
    1506015061    DWORD dwInfoFlags; 
    15061 //  GUID guidItem; 
    15062 
     15062    //GUID guidItem; 
     15063    //HICON hBalloonIcon; 
     15064
     15065 
    1506315066alias NOTIFYICONDATAW* PNOTIFYICONDATAW, LPNOTIFYICONDATAW; 
    1506415067version(ANSI){ 
  • dwt/widgets/Composite.d

    r217 r221  
    17711771                        //OS.MoveMemory (lParam, cast(NMTTDISPINFOA)lpnmtdi, NMTTDISPINFOA.sizeof); 
    17721772                    } else { 
    1773                         shell.setToolTipText (lpnmtdi, chars); 
     1773                        shell.setToolTipText (lpnmtdi, StrToTCHARs(chars,true)); 
    17741774                        //OS.MoveMemory (lParam, cast(NMTTDISPINFOW)lpnmtdi, NMTTDISPINFOW.sizeof); 
    17751775                    } 
  • dwt/widgets/Display.d

    r214 r221  
    290290 
    291291    /* Message Only Window */ 
    292     //Callback messageCallback; 
    293292    HWND hwndMessage; 
    294     int messageProc_; 
    295293 
    296294    /* System Resources */ 
  • dwt/widgets/Shell.d

    r213 r221  
    16881688} 
    16891689 
    1690 void setToolTipText (NMTTDISPINFO* lpnmtdi, char [] buffer) { 
     1690void setToolTipText (NMTTDISPINFO* lpnmtdi, byte [] buffer) { 
    16911691    /* 
    16921692    * Ensure that the current position of the mouse 
     
    17141714    auto hHeap = OS.GetProcessHeap (); 
    17151715    if (lpstrTip !is null) OS.HeapFree (hHeap, 0, lpstrTip); 
    1716     TCHAR[] charz = buffer;//StrToTCHARs( 0, buffer ); 
    1717     int byteCount = charz.length * TCHAR.sizeof; 
     1716    int byteCount = buffer.length * 2; 
    17181717    lpstrTip = cast(TCHAR*)OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount); 
    1719     OS.MoveMemory (lpstrTip, charz.ptr, byteCount); 
     1718    OS.MoveMemory (lpstrTip, buffer.ptr, byteCount); 
    17201719    lpnmtdi.lpszText = lpstrTip; 
    17211720} 
     
    17421741    } 
    17431742    if (hwndToolTip is toolTipHandle_) { 
    1744         if (text is toolTitle || (toolTitle !is null && toolTitle ==/*eq*/text )) { 
     1743        if (text is toolTitle || (toolTitle !is null && toolTitle.equals (text) )) { 
    17451744            if (icon is toolIcon) return; 
    17461745        } 
     
    17491748    } else { 
    17501749        if (hwndToolTip is balloonTipHandle_) { 
    1751             if (text is balloonTitle || (balloonTitle !is null && balloonTitle==/*eq*/text)) { 
     1750            if (text is balloonTitle || (balloonTitle !is null && balloonTitle.equals (text))) { 
    17521751                if (icon is toolIcon) return; 
    17531752            } 
  • dwt/widgets/TrayItem.d

    r212 r221  
    2929 
    3030import dwt.dwthelper.utils; 
    31  
    3231 
    3332/** 
     
    470469    toolTipText = value; 
    471470    NOTIFYICONDATA iconData; 
    472     TCHAR[] buffer = StrToTCHARs (0, toolTipText is null ? "" : toolTipText, true); 
     471    TCHAR[] buffer = StrToTCHARs (0, toolTipText is null ? "X"[1..1] : toolTipText, true); 
     472    assert( buffer.ptr !is null ); 
    473473    /* 
    474474    * Note that the size of the szTip field is different in version 5.0 of shell32.dll. 
    475475    */ 
    476     int length = OS.SHELL32_MAJOR < 5 ? 64 : 128; 
     476    int length_ = OS.SHELL32_MAJOR < 5 ? 64 : 128; 
    477477    static if (OS.IsUnicode) { 
    478         TCHAR [] szTip = iconData.szTip
    479         length = Math.min (length - 1, buffer.length ); 
    480         System.arraycopy (buffer, 0, szTip, 0, length); 
     478        TCHAR [] szTip = iconData.szTip[]
     479        length_ = Math.min (length_ - 1, buffer.length ); 
     480        System.arraycopy (buffer, 0, szTip, 0, length_); 
    481481    } else { 
    482         TCHAR [] szTip = iconData.szTip
    483         length = Math.min (length - 1, buffer.length ); 
    484         System.arraycopy (buffer, 0, szTip, 0, length); 
     482        TCHAR [] szTip = iconData.szTip[]
     483        length_ = Math.min (length_ - 1, buffer.length ); 
     484        System.arraycopy (buffer, 0, szTip, 0, length_); 
    485485    } 
    486486    iconData.cbSize = NOTIFYICONDATA.sizeof;