[Bug 2123] New: comctl32 tab.c size of the rect in the WM_DRAWITEM message incorrect

Wine Bugs wine-bugs at winehq.org
Tue Mar 23 10:58:18 CST 2004


http://bugs.winehq.org/show_bug.cgi?id=2123

           Summary: comctl32 tab.c size of the rect in the WM_DRAWITEM
                    message incorrect
           Product: Wine
           Version: 20040309
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: wine-winelib
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: r.kessel at metrodata.de


The screenoutput of the tab control is ugly, because the size of the draw area
(rcItem) given in the WM_DRAWITEM message is too large. Apps will usually clear
up the entire space, which clears the nicely painted borders as well.

I would suggest to add some lines in TAB_DrawItemInterior()
...
    /*
     * put together the DRAWITEMSTRUCT
     */
    dis.CtlType    = ODT_TAB;
    dis.CtlID      = id;
    dis.itemID     = iItem;
    dis.itemAction = ODA_DRAWENTIRE;
    dis.itemState = 0;
    if ( iItem == infoPtr->iSelected )
      dis.itemState |= ODS_SELECTED;
    if (infoPtr->uFocus == iItem)
      dis.itemState |= ODS_FOCUS;
    dis.hwndItem = hwnd;		/* */
    dis.hDC      = hdc;
    CopyRect(&dis.rcItem,drawRect);
    /*
     * adjustments to the size of the user draw area should be added here
     */
	dis.rcItem->left   += 2;
	dis.rcItem->top    += 2;
	dis.rcItem->right  -= 2;

    dis.itemData = infoPtr->items[iItem].lParam;

    /*
     * send the draw message
     */
    SendMessageA( infoPtr->hwndNotify, WM_DRAWITEM, (WPARAM)id, (LPARAM)&dis );
...

The orginal windows dehaviour is quite complex. if the tab is not selected, the
user draw area is (left+4, top+2, right, bottom). If the tab is selected, the
user draw area is (left, top, right+4, bottom+4).
The main difference between the winelib tab-ctrl and the windows tab-ctrl is
that wine paints the frame BEFORE the WM_DRAWITEM message and Windows paints the
frame AFTER the tab content is draw by the WM_DrawITEM message. The windows
behaviour prevents that the frame got overwritten by the user drawings. This
could be am issue in cases where ownerdrawing is supported.
Additionally I have observed that the winelib tab draws the tab 10 points wider
than given in the tabsize (and the windows version).

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wine-bugs mailing list