Commit d5f9f27c authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/listview: Implement LVM_GETVIEW.

parent b13cd52b
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
* -- LVM_GETTILEINFO, LVM_SETTILEINFO * -- LVM_GETTILEINFO, LVM_SETTILEINFO
* -- LVM_GETTILEVIEWINFO, LVM_SETTILEVIEWINFO * -- LVM_GETTILEVIEWINFO, LVM_SETTILEVIEWINFO
* -- LVM_GETUNICODEFORMAT, LVM_SETUNICODEFORMAT * -- LVM_GETUNICODEFORMAT, LVM_SETUNICODEFORMAT
* -- LVM_GETVIEW, LVM_SETVIEW * -- LVM_SETVIEW
* -- LVM_GETWORKAREAS, LVM_SETWORKAREAS * -- LVM_GETWORKAREAS, LVM_SETWORKAREAS
* -- LVM_HASGROUP, LVM_INSERTGROUP, LVM_REMOVEGROUP, LVM_REMOVEALLGROUPS * -- LVM_HASGROUP, LVM_INSERTGROUP, LVM_REMOVEGROUP, LVM_REMOVEALLGROUPS
* -- LVM_INSERTGROUPSORTED * -- LVM_INSERTGROUPSORTED
...@@ -280,6 +280,7 @@ typedef struct tagLISTVIEW_INFO ...@@ -280,6 +280,7 @@ typedef struct tagLISTVIEW_INFO
RECT rcFocus; RECT rcFocus;
DWORD dwStyle; /* the cached window GWL_STYLE */ DWORD dwStyle; /* the cached window GWL_STYLE */
DWORD dwLvExStyle; /* extended listview style */ DWORD dwLvExStyle; /* extended listview style */
DWORD uView; /* current view available through LVM_[G,S]ETVIEW */
INT nItemCount; /* the number of items in the list */ INT nItemCount; /* the number of items in the list */
HDPA hdpaItems; /* array ITEM_INFO pointers */ HDPA hdpaItems; /* array ITEM_INFO pointers */
HDPA hdpaPosX; /* maintains the (X, Y) coordinates of the */ HDPA hdpaPosX; /* maintains the (X, Y) coordinates of the */
...@@ -1351,6 +1352,26 @@ static void toggle_checkbox_state(LISTVIEW_INFO *infoPtr, INT nItem) ...@@ -1351,6 +1352,26 @@ static void toggle_checkbox_state(LISTVIEW_INFO *infoPtr, INT nItem)
} }
} }
/* this should be called after window style got updated,
it used to reset view state to match current window style */
static inline void map_style_view(LISTVIEW_INFO *infoPtr)
{
switch (infoPtr->dwStyle & LVS_TYPEMASK)
{
case LVS_ICON:
infoPtr->uView = LV_VIEW_ICON;
break;
case LVS_REPORT:
infoPtr->uView = LV_VIEW_DETAILS;
break;
case LVS_SMALLICON:
infoPtr->uView = LV_VIEW_SMALLICON;
break;
case LVS_LIST:
infoPtr->uView = LV_VIEW_LIST;
}
}
/******** Internal API functions ************************************/ /******** Internal API functions ************************************/
static inline COLUMN_INFO * LISTVIEW_GetColumnInfo(const LISTVIEW_INFO *infoPtr, INT nSubItem) static inline COLUMN_INFO * LISTVIEW_GetColumnInfo(const LISTVIEW_INFO *infoPtr, INT nSubItem)
...@@ -8293,6 +8314,8 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs) ...@@ -8293,6 +8314,8 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
LISTVIEW_UpdateScroll(infoPtr); LISTVIEW_UpdateScroll(infoPtr);
} }
map_style_view(infoPtr);
OpenThemeData(hwnd, themeClass); OpenThemeData(hwnd, themeClass);
/* initialize the icon sizes */ /* initialize the icon sizes */
...@@ -9723,6 +9746,8 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType, ...@@ -9723,6 +9746,8 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
((lpss->styleNew & WS_VSCROLL) == 0)) ((lpss->styleNew & WS_VSCROLL) == 0))
ShowScrollBar(infoPtr->hwndSelf, SB_VERT, FALSE); ShowScrollBar(infoPtr->hwndSelf, SB_VERT, FALSE);
map_style_view(infoPtr);
if (uNewView != uOldView) if (uNewView != uOldView)
{ {
SIZE oldIconSize = infoPtr->iconSize; SIZE oldIconSize = infoPtr->iconSize;
...@@ -10094,7 +10119,8 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -10094,7 +10119,8 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case LVM_GETUNICODEFORMAT: case LVM_GETUNICODEFORMAT:
return (infoPtr->notifyFormat == NFR_UNICODE); return (infoPtr->notifyFormat == NFR_UNICODE);
/* case LVM_GETVIEW: */ case LVM_GETVIEW:
return infoPtr->uView;
case LVM_GETVIEWRECT: case LVM_GETVIEWRECT:
return LISTVIEW_GetViewRect(infoPtr, (LPRECT)lParam); return LISTVIEW_GetViewRect(infoPtr, (LPRECT)lParam);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment