Aric Stewart : comctl32: Implement LISTVIEW_ApproximateViewRect for icon.
Alexandre Julliard
julliard at winehq.org
Wed Oct 7 09:46:04 CDT 2009
Module: wine
Branch: master
Commit: 8e8c5130f7a4eecaa185137f2ed5f842c4d53f42
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8e8c5130f7a4eecaa185137f2ed5f842c4d53f42
Author: Aric Stewart <aric at codeweavers.com>
Date: Mon Oct 5 20:41:43 2009 -0500
comctl32: Implement LISTVIEW_ApproximateViewRect for icon.
---
dlls/comctl32/listview.c | 40 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 2f30e9a..e1e8f96 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -4857,10 +4857,46 @@ static DWORD LISTVIEW_ApproximateViewRect(const LISTVIEW_INFO *infoPtr, INT nIte
dwViewRect = MAKELONG(wWidth, wHeight);
}
+ else if (infoPtr->uView == LV_VIEW_ICON)
+ {
+ UINT rows,cols;
+ UINT nItemWidth;
+ UINT nItemHeight;
+
+ nItemWidth = infoPtr->iconSpacing.cx;
+ nItemHeight = infoPtr->iconSpacing.cy;
+
+ if (nItemCount == -1)
+ nItemCount = infoPtr->nItemCount;
+
+ if (wWidth == 0xffff)
+ wWidth = infoPtr->rcList.right - infoPtr->rcList.left;
+
+ if (wWidth < nItemWidth)
+ wWidth = nItemWidth;
+
+ cols = wWidth / nItemWidth;
+ if (cols > nItemCount)
+ cols = nItemCount;
+ if (cols < 1)
+ cols = 1;
+
+ if (nItemCount)
+ {
+ rows = nItemCount / cols;
+ if (nItemCount % cols)
+ rows++;
+ }
+ else
+ rows = 0;
+
+ wHeight = (nItemHeight * rows)+2;
+ wWidth = (nItemWidth * cols)+2;
+
+ dwViewRect = MAKELONG(wWidth, wHeight);
+ }
else if (infoPtr->uView == LV_VIEW_SMALLICON)
FIXME("uView == LV_VIEW_SMALLICON: not implemented\n");
- else if (infoPtr->uView == LV_VIEW_ICON)
- FIXME("uView == LV_VIEW_ICON: not implemented\n");
return dwViewRect;
}
More information about the wine-cvs
mailing list