ReactOS 0.4.15-dev-8434-g155a7c7
CAppsListView Class Reference

#include <appview.h>

Inheritance diagram for CAppsListView:
Collaboration diagram for CAppsListView:

Classes

struct  SortContext
 

Public Member Functions

 CAppsListView ()
 
 ~CAppsListView ()
 
VOID SetWatermark (const CStringW &Text)
 
VOID SetCheckboxesVisible (BOOL bIsVisible)
 
VOID ColumnClick (LPNMLISTVIEW pnmv)
 
BOOL AddColumn (INT Index, CStringW &Text, INT Width, INT Format)
 
void DeleteColumn (INT Index)
 
INT AddItem (INT ItemIndex, INT IconIndex, LPCWSTR lpText, LPARAM lParam)
 
HIMAGELIST GetImageList (int iImageList)
 
INT CompareFunc (LPARAM lParam1, LPARAM lParam2, INT iSubItem)
 
HWND Create (HWND hwndParent)
 
BOOL GetCheckState (INT item)
 
VOID SetCheckState (INT item, BOOL fCheck)
 
VOID CheckAll ()
 
PVOID GetFocusedItemData ()
 
BOOL SetDisplayAppType (APPLICATION_VIEW_TYPE AppType)
 
BOOL SetViewMode (DWORD ViewMode)
 
BOOL AddApplication (CAppInfo *AppInfo, BOOL InitialCheckState)
 
VOID ItemCheckStateNotify (int iItem, BOOL bCheck)
 
- Public Member Functions inherited from CUiWindow< CWindowImpl< CAppsListView, CListView > >
virtual CUiBoxAsBox ()
 
HWND GetWindow ()
 
virtual VOID ComputeMinimalSize (SIZE *size)
 
virtual VOID ComputeContentBounds (RECT *rect)
 
virtual DWORD_PTR CountSizableChildren ()
 
virtual HDWP OnParentSize (RECT parentRect, HDWP hDwp)
 
virtual VOID AppendTabOrderWindow (int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
 
virtual ~CUiWindow ()
 
VOID GetWindowTextW (CStringW &szText)
 
- Public Member Functions inherited from CUiPrimitive
virtual ~CUiPrimitive ()
 
virtual CUiBoxAsBox ()
 
virtual VOID ComputeMinimalSize (SIZE *size)
 
virtual VOID ComputeContentBounds (RECT *rect)
 
virtual DWORD_PTR CountSizableChildren ()
 
virtual HDWP OnParentSize (RECT parentRect, HDWP hDwp)
 

Static Public Member Functions

static INT CALLBACK s_CompareFunc (LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
 

Private Member Functions

LRESULT OnEraseBackground (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnAsyncIcon (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 

Private Attributes

BOOL bIsAscending = TRUE
 
BOOL bHasCheckboxes = FALSE
 
INT ItemCount = 0
 
INT CheckedItemCount = 0
 
INT ColumnCount = 0
 
INT nLastHeaderID = -1
 
APPLICATION_VIEW_TYPE ApplicationViewType = AppViewTypeAvailableApps
 
HIMAGELIST m_hImageListView = NULL
 
CStringW m_Watermark
 

Additional Inherited Members

- Public Attributes inherited from CUiBox
CUiMargin m_Margin
 
CUiAlignment m_HorizontalAlignment
 
CUiAlignment m_VerticalAlignment
 
- Protected Member Functions inherited from CUiBox
 CUiBox ()
 
virtual VOID ComputeRect (RECT parentRect, RECT currentRect, RECT *newRect)
 
- Protected Attributes inherited from CUiPrimitive
CUiPrimitivem_Parent
 

Detailed Description

Definition at line 189 of file appview.h.

Constructor & Destructor Documentation

◆ CAppsListView()

CAppsListView::CAppsListView ( )

Definition at line 1048 of file appview.cpp.

1049{
1050 m_hImageListView = 0;
1051}
HIMAGELIST m_hImageListView
Definition: appview.h:208

◆ ~CAppsListView()

CAppsListView::~CAppsListView ( )

Definition at line 1053 of file appview.cpp.

1054{
1055 if (m_hImageListView)
1059}
HICON g_hDefaultPackageIcon
Definition: appview.cpp:16
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2097

Member Function Documentation

◆ AddApplication()

BOOL CAppsListView::AddApplication ( CAppInfo AppInfo,
BOOL  InitialCheckState 
)

Definition at line 1399 of file appview.cpp.

1400{
1401 if (!AppInfo)
1402 {
1404 return TRUE;
1405 }
1406
1409 {
1410 int Index = AddItem(ItemCount, IconIndex, AppInfo->szDisplayName, (LPARAM)AppInfo);
1411 if (Index == -1)
1412 return FALSE;
1413 CAsyncLoadIcon::Queue(m_hWnd, *AppInfo, true);
1414
1415 SetItemText(Index, 1, AppInfo->szDisplayVersion.IsEmpty() ? L"---" : AppInfo->szDisplayVersion);
1416 SetItemText(Index, 2, AppInfo->szComments.IsEmpty() ? L"---" : AppInfo->szComments);
1417
1418 ItemCount++;
1419 return TRUE;
1420 }
1422 {
1423 int Index = AddItem(ItemCount, IconIndex, AppInfo->szDisplayName, (LPARAM)AppInfo);
1424 if (Index == -1)
1425 return FALSE;
1426 CAsyncLoadIcon::Queue(m_hWnd, *AppInfo, false);
1427
1428 if (InitialCheckState)
1429 {
1431 }
1432
1433 SetItemText(Index, 1, AppInfo->szDisplayVersion);
1434 SetItemText(Index, 2, AppInfo->szComments);
1435
1436 ItemCount++;
1437 return TRUE;
1438 }
1439 else
1440 {
1441 return FALSE;
1442 }
1443}
static int g_DefaultPackageIconILIdx
Definition: appview.cpp:17
@ AppViewTypeInstalledApps
Definition: appview.h:72
@ AppViewTypeAvailableApps
Definition: appview.h:71
bool IsEmpty() const noexcept
Definition: atlsimpstr.h:394
CStringW szComments
Definition: appinfo.h:104
CStringW szDisplayName
Definition: appinfo.h:102
CStringW szDisplayVersion
Definition: appinfo.h:103
INT ItemCount
Definition: appview.h:200
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:206
VOID SetCheckState(INT item, BOOL fCheck)
Definition: appview.cpp:1275
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static const WCHAR IconIndex[]
Definition: install.c:52
#define L(x)
Definition: ntvdm.h:50
static void StartTasks()
Definition: appview.cpp:1038
static CAsyncLoadIcon * Queue(HWND hAppsList, CAppInfo &AppInfo, bool Parse)
Definition: appview.cpp:1016
#define AddItem
Definition: userenv.h:209
_In_ WDFCOLLECTION _In_ ULONG Index
LONG_PTR LPARAM
Definition: windef.h:208

Referenced by CApplicationView::AddApplication().

◆ AddColumn()

BOOL CAppsListView::AddColumn ( INT  Index,
CStringW Text,
INT  Width,
INT  Format 
)

Definition at line 1167 of file appview.cpp.

1168{
1169 LVCOLUMNW Column;
1170
1171 ZeroMemory(&Column, sizeof(Column));
1172
1174 Column.iSubItem = Index;
1175 Column.pszText = const_cast<LPWSTR>(Text.GetString());
1176 Column.cx = Width;
1177 Column.fmt = Format;
1178
1179 return SendMessage(LVM_INSERTCOLUMN, Index, (LPARAM)(&Column));
1180}
char * Text
Definition: combotst.c:136
#define LVCF_WIDTH
Definition: commctrl.h:2587
#define LVM_INSERTCOLUMN
Definition: commctrl.h:2634
#define LVCF_FMT
Definition: commctrl.h:2586
#define LVCF_SUBITEM
Definition: commctrl.h:2589
#define LVCF_TEXT
Definition: commctrl.h:2588
LPWSTR pszText
Definition: commctrl.h:2567
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
#define ZeroMemory
Definition: winbase.h:1712
#define SendMessage
Definition: winuser.h:5852
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by SetDisplayAppType().

◆ AddItem()

INT CAppsListView::AddItem ( INT  ItemIndex,
INT  IconIndex,
LPCWSTR  lpText,
LPARAM  lParam 
)

Definition at line 1190 of file appview.cpp.

1191{
1192 LVITEMW Item;
1193
1194 ZeroMemory(&Item, sizeof(Item));
1195
1197 Item.pszText = const_cast<LPWSTR>(lpText);
1198 Item.lParam = lParam;
1199 Item.iItem = ItemIndex;
1200 Item.iImage = IconIndex;
1201
1202 if (IconIndex >= 0)
1203 {
1204 Item.iImage = IconIndex;
1205 Item.mask |= LVIF_IMAGE;
1206 }
1207 return InsertItem(&Item);
1208}
HTREEITEM InsertItem(HWND hTree, LPCWSTR szName, HTREEITEM hParent, HTREEITEM hInsertAfter)
Definition: treeview.c:95
LPARAM lParam
Definition: combotst.c:139
#define LVIF_STATE
Definition: commctrl.h:2312
#define LVIF_PARAM
Definition: commctrl.h:2311
#define LVIF_TEXT
Definition: commctrl.h:2309
#define LVIF_IMAGE
Definition: commctrl.h:2310
_In_ WDFCOLLECTION _In_ WDFOBJECT Item

◆ CheckAll()

VOID CAppsListView::CheckAll ( )

Definition at line 1284 of file appview.cpp.

1285{
1286 if (bHasCheckboxes)
1287 {
1289 {
1290 // clear all
1291 SetCheckState(-1, FALSE);
1292 }
1293 else
1294 {
1295 // check all
1296 SetCheckState(-1, TRUE);
1297 }
1298 }
1299}
BOOL bHasCheckboxes
Definition: appview.h:198
INT CheckedItemCount
Definition: appview.h:201

Referenced by CApplicationView::CheckAll().

◆ ColumnClick()

VOID CAppsListView::ColumnClick ( LPNMLISTVIEW  pnmv)

Definition at line 1127 of file appview.cpp.

1128{
1129 HWND hHeader;
1130 HDITEMW hColumn;
1131 INT nHeaderID = pnmv->iSubItem;
1132
1134 return;
1135
1136 hHeader = (HWND)SendMessage(LVM_GETHEADER, 0, 0);
1137 ZeroMemory(&hColumn, sizeof(hColumn));
1138
1139 /* If the sorting column changed, remove the sorting style from the old column */
1140 if ((nLastHeaderID != -1) && (nLastHeaderID != nHeaderID))
1141 {
1142 bIsAscending = TRUE; // also reset sorting method to ascending
1143 hColumn.mask = HDI_FORMAT;
1144 Header_GetItem(hHeader, nLastHeaderID, &hColumn);
1145 hColumn.fmt &= ~(HDF_SORTUP | HDF_SORTDOWN);
1146 Header_SetItem(hHeader, nLastHeaderID, &hColumn);
1147 }
1148
1149 /* Set the sorting style to the new column */
1150 hColumn.mask = HDI_FORMAT;
1151 Header_GetItem(hHeader, nHeaderID, &hColumn);
1152
1153 hColumn.fmt &= ~(HDF_SORTDOWN | HDF_SORTUP);
1154 hColumn.fmt |= (bIsAscending ? HDF_SORTUP : HDF_SORTDOWN);
1155 Header_SetItem(hHeader, nHeaderID, &hColumn);
1156
1157 /* Sort the list, using the current values of nHeaderID and bIsAscending */
1158 SortContext ctx = {this, nHeaderID};
1159 SortItems(s_CompareFunc, &ctx);
1160
1161 /* Save new values */
1162 nLastHeaderID = nHeaderID;
1164}
INT nLastHeaderID
Definition: appview.h:204
static INT CALLBACK s_CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: appview.cpp:1217
BOOL bIsAscending
Definition: appview.h:197
HANDLE HWND
Definition: compat.h:19
#define Header_GetItem(hwndHD, i, phdi)
Definition: commctrl.h:751
#define LVM_GETHEADER
Definition: commctrl.h:2650
#define Header_SetItem(hwndHD, i, phdi)
Definition: commctrl.h:758
#define HDF_SORTUP
Definition: commctrl.h:724
#define HDI_FORMAT
Definition: commctrl.h:705
#define LVS_NOSORTHEADER
Definition: commctrl.h:2285
#define HDF_SORTDOWN
Definition: commctrl.h:725
UINT mask
Definition: commctrl.h:684
int fmt
Definition: commctrl.h:689
#define GetWindowLongPtr
Definition: treelist.c:73
int32_t INT
Definition: typedefs.h:58
#define GWL_STYLE
Definition: winuser.h:852

Referenced by CApplicationView::ProcessWindowMessage().

◆ CompareFunc()

INT CAppsListView::CompareFunc ( LPARAM  lParam1,
LPARAM  lParam2,
INT  iSubItem 
)

Definition at line 1224 of file appview.cpp.

1225{
1226 CStringW Item1, Item2;
1227 LVFINDINFOW IndexInfo;
1228 INT Index;
1229
1230 IndexInfo.flags = LVFI_PARAM;
1231
1232 IndexInfo.lParam = lParam1;
1233 Index = FindItem(-1, &IndexInfo);
1234 GetItemText(Index, iSubItem, Item1.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1235 Item1.ReleaseBuffer();
1236
1237 IndexInfo.lParam = lParam2;
1238 Index = FindItem(-1, &IndexInfo);
1239 GetItemText(Index, iSubItem, Item2.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1240 Item2.ReleaseBuffer();
1241
1242 return bIsAscending ? Item1.Compare(Item2) : Item2.Compare(Item1);
1243}
#define MAX_STR_LEN
Definition: defines.h:43
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:387
int Compare(_In_z_ PCXSTR psz) const
Definition: cstringt.h:738
#define LVFI_PARAM
Definition: commctrl.h:2436
LPARAM lParam
Definition: commctrl.h:2458

◆ Create()

HWND CAppsListView::Create ( HWND  hwndParent)

Definition at line 1246 of file appview.cpp.

1247{
1248 RECT r = {205, 28, 465, 250};
1251
1253
1254 if (hwnd)
1255 {
1257 }
1258
1259#pragma push_macro("SubclassWindow")
1260#undef SubclassWindow
1261 m_hWnd = NULL;
1263#pragma pop_macro("SubclassWindow")
1264
1265 return hwnd;
1266}
Arabic default style
Definition: afstyles.h:94
VOID SetCheckboxesVisible(BOOL bIsVisible)
Definition: appview.cpp:1112
HWND Create(HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: rosctrls.h:8
static HWND hwndParent
Definition: cryptui.c:300
#define NULL
Definition: types.h:112
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define LVS_SINGLESEL
Definition: commctrl.h:2266
#define LVS_SHAREIMAGELISTS
Definition: commctrl.h:2270
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2267
#define LVS_REPORT
Definition: commctrl.h:2262
#define LVS_SORTASCENDING
Definition: commctrl.h:2268
#define LVS_AUTOARRANGE
Definition: commctrl.h:2272
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define SubclassWindow(hwnd, lpfn)
Definition: windowsx.h:542
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384

Referenced by CApplicationView::CreateListView().

◆ DeleteColumn()

void CAppsListView::DeleteColumn ( INT  Index)

Definition at line 1183 of file appview.cpp.

1184{
1186 return;
1187}
#define LVM_DELETECOLUMN
Definition: commctrl.h:2638

Referenced by SetDisplayAppType().

◆ GetCheckState()

BOOL CAppsListView::GetCheckState ( INT  item)

Definition at line 1269 of file appview.cpp.

1270{
1271 return (BOOL)(GetItemState(item, LVIS_STATEIMAGEMASK) >> 12) - 1;
1272}
unsigned int BOOL
Definition: ntddk_ex.h:94
static ATOM item
Definition: dde.c:856
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2326

◆ GetFocusedItemData()

PVOID CAppsListView::GetFocusedItemData ( )

Definition at line 1302 of file appview.cpp.

1303{
1304 INT item = GetSelectionMark();
1305 if (item == -1)
1306 {
1307 return (PVOID)0;
1308 }
1309 return (PVOID)GetItemData(item);
1310}

Referenced by CApplicationView::GetFocusedItemData().

◆ GetImageList()

HIMAGELIST CAppsListView::GetImageList ( int  iImageList)

Definition at line 1211 of file appview.cpp.

1212{
1213 return (HIMAGELIST)SendMessage(LVM_GETIMAGELIST, iImageList, 0);
1214}
#define LVM_GETIMAGELIST
Definition: commctrl.h:2295

◆ ItemCheckStateNotify()

VOID CAppsListView::ItemCheckStateNotify ( int  iItem,
BOOL  bCheck 
)

Definition at line 1447 of file appview.cpp.

1448{
1449 if (bCheck)
1450 {
1452 }
1453 else
1454 {
1456 }
1457}

Referenced by CApplicationView::ProcessWindowMessage().

◆ OnAsyncIcon()

LRESULT CAppsListView::OnAsyncIcon ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 1080 of file appview.cpp.

1081{
1083 bHandled = TRUE;
1084 if (task->TaskId == g_AsyncIconTaskId)
1085 {
1086 LVITEM lvi;
1087 LVFINDINFO lvfi;
1088 lvfi.flags = LVFI_PARAM;
1089 lvfi.lParam = (LPARAM)task->AppInfo;
1090 lvi.iItem = ListView_FindItem(m_hWnd, -1, &lvfi);
1091 if (lvi.iItem != -1)
1092 {
1094 if (lvi.iImage != -1)
1095 {
1096 lvi.mask = LVIF_IMAGE;
1097 lvi.iSubItem = 0;
1098 ListView_SetItem(m_hWnd, &lvi);
1099 }
1100 }
1101 }
1102 return 0;
1103}
static UINT g_AsyncIconTaskId
Definition: appview.cpp:988
WPARAM wParam
Definition: combotst.c:138
static HICON
Definition: imagelist.c:84
#define LVFINDINFO
Definition: commctrl.h:2463
#define LVITEM
Definition: commctrl.h:2375
#define ListView_SetItem(hwnd, pitem)
Definition: commctrl.h:2401
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define ListView_FindItem(hwnd, iStart, plvfi)
Definition: commctrl.h:2470
CAppInfo * AppInfo
Definition: appview.cpp:979

◆ OnEraseBackground()

LRESULT CAppsListView::OnEraseBackground ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 1062 of file appview.cpp.

1063{
1064 LRESULT lRes = this->DefWindowProc(uMsg, wParam, lParam);
1065 if (!m_Watermark.IsEmpty())
1066 {
1067 RECT rc;
1068 GetClientRect(&rc);
1074 SelectFont(HDC(wParam), oldFont);
1075 }
1076 return lRes;
1077}
PXSTR GetString() noexcept
Definition: atlsimpstr.h:367
int GetLength() const noexcept
Definition: atlsimpstr.h:362
CStringW m_Watermark
Definition: appview.h:209
int WINAPI DrawShadowText(HDC hdc, LPCWSTR pszText, UINT cch, RECT *prc, DWORD dwFlags, COLORREF crText, COLORREF crShadow, int ixOffset, int iyOffset)
Definition: commctrl.c:1845
static HDC
Definition: imagelist.c:92
#define DefWindowProc
Definition: ros2win.h:31
LONG_PTR LRESULT
Definition: windef.h:209
#define SelectFont(hdc, hfont)
Definition: windowsx.h:516
#define GetStockFont(i)
Definition: windowsx.h:308
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
DWORD WINAPI GetSysColor(_In_ int)
#define DT_NOPREFIX
Definition: winuser.h:537
#define COLOR_GRAYTEXT
Definition: winuser.h:932
#define DT_CENTER
Definition: winuser.h:527
#define DT_SINGLELINE
Definition: winuser.h:540
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define DT_VCENTER
Definition: winuser.h:543

◆ s_CompareFunc()

INT CALLBACK CAppsListView::s_CompareFunc ( LPARAM  lParam1,
LPARAM  lParam2,
LPARAM  lParamSort 
)
static

Definition at line 1217 of file appview.cpp.

1218{
1219 SortContext *ctx = ((SortContext *)lParamSort);
1220 return ctx->lvw->CompareFunc(lParam1, lParam2, ctx->iSubItem);
1221}

Referenced by ColumnClick().

◆ SetCheckboxesVisible()

VOID CAppsListView::SetCheckboxesVisible ( BOOL  bIsVisible)

Definition at line 1112 of file appview.cpp.

1113{
1114 if (bIsVisible)
1115 {
1116 SetExtendedListViewStyle(LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT);
1117 }
1118 else
1119 {
1120 SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);
1121 }
1122
1123 bHasCheckboxes = bIsVisible;
1124}
#define LVS_EX_CHECKBOXES
Definition: commctrl.h:2731
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2734

Referenced by Create(), and SetDisplayAppType().

◆ SetCheckState()

VOID CAppsListView::SetCheckState ( INT  item,
BOOL  fCheck 
)

Definition at line 1275 of file appview.cpp.

1276{
1277 if (bHasCheckboxes)
1278 {
1279 SetItemState(item, INDEXTOSTATEIMAGEMASK((fCheck) ? 2 : 1), LVIS_STATEIMAGEMASK);
1280 }
1281}
#define INDEXTOSTATEIMAGEMASK(i)
Definition: commctrl.h:2328

Referenced by AddApplication(), and CheckAll().

◆ SetDisplayAppType()

BOOL CAppsListView::SetDisplayAppType ( APPLICATION_VIEW_TYPE  AppType)

Definition at line 1313 of file appview.cpp.

1314{
1315 ++g_AsyncIconTaskId; // Stop loading icons that are now invalid
1316 if (!DeleteAllItems())
1317 return FALSE;
1318
1319 ApplicationViewType = AppType;
1321 ItemCount = 0;
1322 CheckedItemCount = 0;
1323
1324 ListView_Scroll(m_hWnd, 0, 0x7fff * -1); // FIXME: a bug in Wine ComCtl32 where VScroll is not reset after deleting items
1325
1326 // delete old columns
1327 while (ColumnCount)
1328 {
1330 }
1331
1333 {
1335 UINT IconSize = GetSystemMetrics(SM_CXICON);
1337 m_hImageListView = ImageList_Create(IconSize, IconSize, ilc, 0, 1);
1341 IMAGE_ICON, IconSize, IconSize, LR_SHARED);
1342 }
1344
1346 if (g_DefaultPackageIconILIdx == -1)
1348
1349 // add new columns
1350 CStringW szText;
1351 switch (AppType)
1352 {
1354
1355 /* Add columns to ListView */
1356 szText.LoadStringW(IDS_APP_NAME);
1357 AddColumn(ColumnCount++, szText, 250, LVCFMT_LEFT);
1358
1359 szText.LoadStringW(IDS_APP_INST_VERSION);
1360 AddColumn(ColumnCount++, szText, 90, LVCFMT_RIGHT);
1361
1362 szText.LoadStringW(IDS_APP_DESCRIPTION);
1363 AddColumn(ColumnCount++, szText, 300, LVCFMT_LEFT);
1364
1365 // disable checkboxes
1367 break;
1368
1370
1371 /* Add columns to ListView */
1372 szText.LoadStringW(IDS_APP_NAME);
1373 AddColumn(ColumnCount++, szText, 250, LVCFMT_LEFT);
1374
1375 szText.LoadStringW(IDS_APP_INST_VERSION);
1376 AddColumn(ColumnCount++, szText, 90, LVCFMT_RIGHT);
1377
1378 szText.LoadStringW(IDS_APP_DESCRIPTION);
1379 AddColumn(ColumnCount++, szText, 300, LVCFMT_LEFT);
1380
1381 // enable checkboxes
1383 break;
1384
1385 default:
1386 break;
1387 }
1388
1389 return TRUE;
1390}
#define IDI_MAIN
Definition: resource.h:4
INT GetSystemColorDepth()
Definition: misc.cpp:300
#define IDS_APP_DESCRIPTION
Definition: resource.h:139
#define IDS_APP_INST_VERSION
Definition: resource.h:138
#define IDS_APP_NAME
Definition: resource.h:137
void DeleteColumn(INT Index)
Definition: appview.cpp:1183
INT ColumnCount
Definition: appview.h:202
BOOL AddColumn(INT Index, CStringW &Text, INT Width, INT Format)
Definition: appview.cpp:1167
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
HINSTANCE hInst
Definition: dxdiag.c:13
static VOID SetImageList(HWND hwnd)
Definition: mplay32.c:238
unsigned int UINT
Definition: ndis.h:50
#define LVSIL_SMALL
Definition: commctrl.h:2299
#define ListView_Scroll(hwndLV, dx, dy)
Definition: commctrl.h:2522
#define ImageList_RemoveAll(himl)
Definition: commctrl.h:556
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define ILC_MASK
Definition: commctrl.h:351
#define LVCFMT_RIGHT
Definition: commctrl.h:2599
#define I_IMAGENONE
Definition: commctrl.h:2386
#define LVSIL_NORMAL
Definition: commctrl.h:2298
#define IMAGE_ICON
Definition: winuser.h:212
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2247
#define LR_SHARED
Definition: winuser.h:1100
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define SM_CXICON
Definition: winuser.h:972
int WINAPI GetSystemMetrics(_In_ int)

Referenced by CApplicationView::SetDisplayAppType().

◆ SetViewMode()

BOOL CAppsListView::SetViewMode ( DWORD  ViewMode)

Definition at line 1393 of file appview.cpp.

1394{
1395 return SendMessage(LVM_SETVIEW, (WPARAM)ViewMode, 0) == 1;
1396}
#define LVM_SETVIEW
Definition: commctrl.h:2846
UINT_PTR WPARAM
Definition: windef.h:207

Referenced by CApplicationView::OnCommand().

◆ SetWatermark()

VOID CAppsListView::SetWatermark ( const CStringW Text)

Definition at line 1106 of file appview.cpp.

1107{
1108 m_Watermark = Text;
1109}

Referenced by CApplicationView::SetWatermark().

Member Data Documentation

◆ ApplicationViewType

APPLICATION_VIEW_TYPE CAppsListView::ApplicationViewType = AppViewTypeAvailableApps
private

Definition at line 206 of file appview.h.

Referenced by AddApplication(), and SetDisplayAppType().

◆ bHasCheckboxes

BOOL CAppsListView::bHasCheckboxes = FALSE
private

Definition at line 198 of file appview.h.

Referenced by CheckAll(), SetCheckboxesVisible(), and SetCheckState().

◆ bIsAscending

BOOL CAppsListView::bIsAscending = TRUE
private

Definition at line 197 of file appview.h.

Referenced by ColumnClick(), CompareFunc(), and SetDisplayAppType().

◆ CheckedItemCount

INT CAppsListView::CheckedItemCount = 0
private

Definition at line 201 of file appview.h.

Referenced by CheckAll(), ItemCheckStateNotify(), and SetDisplayAppType().

◆ ColumnCount

INT CAppsListView::ColumnCount = 0
private

Definition at line 202 of file appview.h.

Referenced by SetDisplayAppType().

◆ ItemCount

INT CAppsListView::ItemCount = 0
private

Definition at line 200 of file appview.h.

Referenced by AddApplication(), CheckAll(), and SetDisplayAppType().

◆ m_hImageListView

HIMAGELIST CAppsListView::m_hImageListView = NULL
private

Definition at line 208 of file appview.h.

Referenced by CAppsListView(), OnAsyncIcon(), SetDisplayAppType(), and ~CAppsListView().

◆ m_Watermark

CStringW CAppsListView::m_Watermark
private

Definition at line 209 of file appview.h.

Referenced by OnEraseBackground(), and SetWatermark().

◆ nLastHeaderID

INT CAppsListView::nLastHeaderID = -1
private

Definition at line 204 of file appview.h.

Referenced by ColumnClick().


The documentation for this class was generated from the following files: