ReactOS 0.4.16-dev-853-g88d9285
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 ShowCheckboxes (bool bShow)
 
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 187 of file appview.h.

Constructor & Destructor Documentation

◆ CAppsListView()

CAppsListView::CAppsListView ( )

Definition at line 1119 of file appview.cpp.

1120{
1121 m_hImageListView = 0;
1122}
HIMAGELIST m_hImageListView
Definition: appview.h:206

◆ ~CAppsListView()

CAppsListView::~CAppsListView ( )

Definition at line 1124 of file appview.cpp.

1125{
1126 if (m_hImageListView)
1130}
HICON g_hDefaultPackageIcon
Definition: appview.cpp:16
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2139

Member Function Documentation

◆ AddApplication()

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

Definition at line 1465 of file appview.cpp.

1466{
1467 if (!AppInfo)
1468 {
1470 return TRUE;
1471 }
1472
1475 {
1476 int Index = AddItem(ItemCount, IconIndex, AppInfo->szDisplayName, (LPARAM)AppInfo);
1477 if (Index == -1)
1478 return FALSE;
1479 CAsyncLoadIcon::Queue(m_hWnd, *AppInfo, true);
1480
1481 SetItemText(Index, 1, AppInfo->szDisplayVersion.IsEmpty() ? L"---" : AppInfo->szDisplayVersion);
1482 SetItemText(Index, 2, AppInfo->szComments.IsEmpty() ? L"---" : AppInfo->szComments);
1483
1484 ItemCount++;
1485 return TRUE;
1486 }
1488 {
1489 int Index = AddItem(ItemCount, IconIndex, AppInfo->szDisplayName, (LPARAM)AppInfo);
1490 if (Index == -1)
1491 return FALSE;
1492 CAsyncLoadIcon::Queue(m_hWnd, *AppInfo, false);
1493
1494 if (InitialCheckState)
1495 {
1497 }
1498
1499 SetItemText(Index, 1, AppInfo->szDisplayVersion);
1500 SetItemText(Index, 2, AppInfo->szComments);
1501
1502 ItemCount++;
1503 return TRUE;
1504 }
1505 else
1506 {
1507 return FALSE;
1508 }
1509}
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:114
CStringW szDisplayName
Definition: appinfo.h:112
CStringW szDisplayVersion
Definition: appinfo.h:113
INT ItemCount
Definition: appview.h:198
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:204
VOID SetCheckState(INT item, BOOL fCheck)
Definition: appview.cpp:1338
#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:1109
static CAsyncLoadIcon * Queue(HWND hAppsList, CAppInfo &AppInfo, bool Parse)
Definition: appview.cpp:1087
#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 1230 of file appview.cpp.

1231{
1232 LVCOLUMNW Column;
1233
1234 ZeroMemory(&Column, sizeof(Column));
1235
1237 Column.iSubItem = Index;
1238 Column.pszText = const_cast<LPWSTR>(Text.GetString());
1239 Column.cx = Width;
1240 Column.fmt = Format;
1241
1242 return SendMessage(LVM_INSERTCOLUMN, Index, (LPARAM)(&Column));
1243}
char * Text
Definition: combotst.c:136
#define LVCF_WIDTH
Definition: commctrl.h:2592
#define LVM_INSERTCOLUMN
Definition: commctrl.h:2639
#define LVCF_FMT
Definition: commctrl.h:2591
#define LVCF_SUBITEM
Definition: commctrl.h:2594
#define LVCF_TEXT
Definition: commctrl.h:2593
LPWSTR pszText
Definition: commctrl.h:2572
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
#define ZeroMemory
Definition: winbase.h:1737
#define SendMessage
Definition: winuser.h:5855
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by SetDisplayAppType().

◆ AddItem()

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

Definition at line 1253 of file appview.cpp.

1254{
1255 LVITEMW Item;
1256
1257 ZeroMemory(&Item, sizeof(Item));
1258
1260 Item.pszText = const_cast<LPWSTR>(lpText);
1261 Item.lParam = lParam;
1262 Item.iItem = ItemIndex;
1263 Item.iImage = IconIndex;
1264
1265 if (IconIndex >= 0)
1266 {
1267 Item.iImage = IconIndex;
1268 Item.mask |= LVIF_IMAGE;
1269 }
1270 return InsertItem(&Item);
1271}
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:2317
#define LVIF_PARAM
Definition: commctrl.h:2316
#define LVIF_TEXT
Definition: commctrl.h:2314
#define LVIF_IMAGE
Definition: commctrl.h:2315
_In_ WDFCOLLECTION _In_ WDFOBJECT Item

◆ CheckAll()

VOID CAppsListView::CheckAll ( )

Definition at line 1347 of file appview.cpp.

1348{
1349 if (bHasCheckboxes)
1350 {
1352 {
1353 // clear all
1354 SetCheckState(-1, FALSE);
1355 }
1356 else
1357 {
1358 // check all
1359 SetCheckState(-1, TRUE);
1360 }
1361 }
1362}
bool bHasCheckboxes
Definition: appview.h:196
INT CheckedItemCount
Definition: appview.h:199

Referenced by CApplicationView::CheckAll().

◆ ColumnClick()

VOID CAppsListView::ColumnClick ( LPNMLISTVIEW  pnmv)

Definition at line 1190 of file appview.cpp.

1191{
1192 HWND hHeader;
1193 HDITEMW hColumn;
1194 INT nHeaderID = pnmv->iSubItem;
1195
1197 return;
1198
1199 hHeader = (HWND)SendMessage(LVM_GETHEADER, 0, 0);
1200 ZeroMemory(&hColumn, sizeof(hColumn));
1201
1202 /* If the sorting column changed, remove the sorting style from the old column */
1203 if ((nLastHeaderID != -1) && (nLastHeaderID != nHeaderID))
1204 {
1205 bIsAscending = TRUE; // also reset sorting method to ascending
1206 hColumn.mask = HDI_FORMAT;
1207 Header_GetItem(hHeader, nLastHeaderID, &hColumn);
1208 hColumn.fmt &= ~(HDF_SORTUP | HDF_SORTDOWN);
1209 Header_SetItem(hHeader, nLastHeaderID, &hColumn);
1210 }
1211
1212 /* Set the sorting style to the new column */
1213 hColumn.mask = HDI_FORMAT;
1214 Header_GetItem(hHeader, nHeaderID, &hColumn);
1215
1216 hColumn.fmt &= ~(HDF_SORTDOWN | HDF_SORTUP);
1217 hColumn.fmt |= (bIsAscending ? HDF_SORTUP : HDF_SORTDOWN);
1218 Header_SetItem(hHeader, nHeaderID, &hColumn);
1219
1220 /* Sort the list, using the current values of nHeaderID and bIsAscending */
1221 SortContext ctx = {this, nHeaderID};
1222 SortItems(s_CompareFunc, &ctx);
1223
1224 /* Save new values */
1225 nLastHeaderID = nHeaderID;
1227}
INT nLastHeaderID
Definition: appview.h:202
static INT CALLBACK s_CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: appview.cpp:1280
BOOL bIsAscending
Definition: appview.h:195
HANDLE HWND
Definition: compat.h:19
#define Header_GetItem(hwndHD, i, phdi)
Definition: commctrl.h:751
#define LVM_GETHEADER
Definition: commctrl.h:2655
#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:2290
#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:855

Referenced by CApplicationView::ProcessWindowMessage().

◆ CompareFunc()

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

Definition at line 1287 of file appview.cpp.

1288{
1289 CStringW Item1, Item2;
1290 LVFINDINFOW IndexInfo;
1291 INT Index;
1292
1293 IndexInfo.flags = LVFI_PARAM;
1294
1295 IndexInfo.lParam = lParam1;
1296 Index = FindItem(-1, &IndexInfo);
1297 GetItemText(Index, iSubItem, Item1.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1298 Item1.ReleaseBuffer();
1299
1300 IndexInfo.lParam = lParam2;
1301 Index = FindItem(-1, &IndexInfo);
1302 GetItemText(Index, iSubItem, Item2.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1303 Item2.ReleaseBuffer();
1304
1305 return bIsAscending ? Item1.Compare(Item2) : Item2.Compare(Item1);
1306}
#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:2441
LPARAM lParam
Definition: commctrl.h:2463

◆ Create()

HWND CAppsListView::Create ( HWND  hwndParent)

Definition at line 1309 of file appview.cpp.

1310{
1311 RECT r = {205, 28, 465, 250};
1314
1316
1317 if (hwnd)
1318 {
1319 ShowCheckboxes(false);
1320 }
1321
1322#pragma push_macro("SubclassWindow")
1323#undef SubclassWindow
1324 m_hWnd = NULL;
1326#pragma pop_macro("SubclassWindow")
1327
1328 return hwnd;
1329}
Arabic default style
Definition: afstyles.h:94
void ShowCheckboxes(bool bShow)
Definition: appview.cpp:1183
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:2271
#define LVS_SHAREIMAGELISTS
Definition: commctrl.h:2275
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2272
#define LVS_REPORT
Definition: commctrl.h:2267
#define LVS_SORTASCENDING
Definition: commctrl.h:2273
#define LVS_AUTOARRANGE
Definition: commctrl.h:2277
_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 1246 of file appview.cpp.

1247{
1249 return;
1250}
#define LVM_DELETECOLUMN
Definition: commctrl.h:2643

Referenced by SetDisplayAppType().

◆ GetCheckState()

BOOL CAppsListView::GetCheckState ( INT  item)

Definition at line 1332 of file appview.cpp.

1333{
1334 return (BOOL)(GetItemState(item, LVIS_STATEIMAGEMASK) >> 12) - 1;
1335}
unsigned int BOOL
Definition: ntddk_ex.h:94
static ATOM item
Definition: dde.c:856
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2331

◆ GetFocusedItemData()

PVOID CAppsListView::GetFocusedItemData ( )

Definition at line 1365 of file appview.cpp.

1366{
1367 INT item = GetSelectionMark();
1368 if (item == -1)
1369 {
1370 return (PVOID)0;
1371 }
1372 return (PVOID)GetItemData(item);
1373}

Referenced by CApplicationView::GetFocusedItemData().

◆ GetImageList()

HIMAGELIST CAppsListView::GetImageList ( int  iImageList)

Definition at line 1274 of file appview.cpp.

1275{
1276 return (HIMAGELIST)SendMessage(LVM_GETIMAGELIST, iImageList, 0);
1277}
#define LVM_GETIMAGELIST
Definition: commctrl.h:2300

◆ ItemCheckStateNotify()

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

Definition at line 1513 of file appview.cpp.

1514{
1515 if (bCheck)
1516 {
1518 }
1519 else
1520 {
1522 }
1523}

Referenced by CApplicationView::ProcessWindowMessage().

◆ OnAsyncIcon()

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

Definition at line 1151 of file appview.cpp.

1152{
1154 bHandled = TRUE;
1155 if (task->TaskId == g_AsyncIconTaskId)
1156 {
1157 LVITEM lvi;
1158 LVFINDINFO lvfi;
1159 lvfi.flags = LVFI_PARAM;
1160 lvfi.lParam = (LPARAM)task->AppInfo;
1161 lvi.iItem = ListView_FindItem(m_hWnd, -1, &lvfi);
1162 if (lvi.iItem != -1)
1163 {
1165 if (lvi.iImage != -1)
1166 {
1167 lvi.mask = LVIF_IMAGE;
1168 lvi.iSubItem = 0;
1169 ListView_SetItem(m_hWnd, &lvi);
1170 }
1171 }
1172 }
1173 return 0;
1174}
static UINT g_AsyncIconTaskId
Definition: appview.cpp:1057
WPARAM wParam
Definition: combotst.c:138
static HICON
Definition: imagelist.c:80
#define LVFINDINFO
Definition: commctrl.h:2468
#define LVITEM
Definition: commctrl.h:2380
#define ListView_SetItem(hwnd, pitem)
Definition: commctrl.h:2406
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define ListView_FindItem(hwnd, iStart, plvfi)
Definition: commctrl.h:2475
CAppInfo * AppInfo
Definition: appview.cpp:1048

◆ OnEraseBackground()

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

Definition at line 1133 of file appview.cpp.

1134{
1135 LRESULT lRes = this->DefWindowProc(uMsg, wParam, lParam);
1136 if (!m_Watermark.IsEmpty())
1137 {
1138 RECT rc;
1139 GetClientRect(&rc);
1145 SelectFont(HDC(wParam), oldFont);
1146 }
1147 return lRes;
1148}
PXSTR GetString() noexcept
Definition: atlsimpstr.h:367
int GetLength() const noexcept
Definition: atlsimpstr.h:362
CStringW m_Watermark
Definition: appview.h:207
int WINAPI DrawShadowText(HDC hdc, LPCWSTR pszText, UINT cch, RECT *prc, DWORD dwFlags, COLORREF crText, COLORREF crShadow, int ixOffset, int iyOffset)
Definition: commctrl.c:1852
static HDC
Definition: imagelist.c:88
#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:935
#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 1280 of file appview.cpp.

1281{
1282 SortContext *ctx = ((SortContext *)lParamSort);
1283 return ctx->lvw->CompareFunc(lParam1, lParam2, ctx->iSubItem);
1284}

Referenced by ColumnClick().

◆ SetCheckState()

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

Definition at line 1338 of file appview.cpp.

1339{
1340 if (bHasCheckboxes)
1341 {
1342 SetItemState(item, INDEXTOSTATEIMAGEMASK((fCheck) ? 2 : 1), LVIS_STATEIMAGEMASK);
1343 }
1344}
#define INDEXTOSTATEIMAGEMASK(i)
Definition: commctrl.h:2333

Referenced by AddApplication(), and CheckAll().

◆ SetDisplayAppType()

BOOL CAppsListView::SetDisplayAppType ( APPLICATION_VIEW_TYPE  AppType)

Definition at line 1376 of file appview.cpp.

1377{
1378 ++g_AsyncIconTaskId; // Stop loading icons that are now invalid
1379 if (!DeleteAllItems())
1380 return FALSE;
1381
1382 ApplicationViewType = AppType;
1384 ItemCount = 0;
1385 CheckedItemCount = 0;
1386
1387 ListView_Scroll(m_hWnd, 0, 0x7fff * -1); // FIXME: a bug in Wine ComCtl32 where VScroll is not reset after deleting items
1388
1389 // delete old columns
1390 while (ColumnCount)
1391 {
1393 }
1394
1396 {
1406 }
1408
1410 if (g_DefaultPackageIconILIdx == -1)
1412
1413 // add new columns
1414 CStringW szText;
1415 switch (AppType)
1416 {
1418
1419 /* Add columns to ListView */
1420 szText.LoadStringW(IDS_APP_NAME);
1421 AddColumn(ColumnCount++, szText, 368, LVCFMT_LEFT);
1422
1423 szText.LoadStringW(IDS_APP_INST_VERSION);
1424 AddColumn(ColumnCount++, szText, 90, LVCFMT_RIGHT);
1425
1426#if 0 // This column is not currently useful for installed apps.
1427 szText.LoadStringW(IDS_APP_DESCRIPTION);
1428 AddColumn(ColumnCount++, szText, 300, LVCFMT_LEFT);
1429#endif
1430
1431 // Disable checkboxes
1432 ShowCheckboxes(false);
1433 break;
1434
1436
1437 /* Add columns to ListView */
1438 szText.LoadStringW(IDS_APP_NAME);
1439 AddColumn(ColumnCount++, szText, 250, LVCFMT_LEFT);
1440
1441 szText.LoadStringW(IDS_APP_INST_VERSION);
1442 AddColumn(ColumnCount++, szText, 90, LVCFMT_RIGHT);
1443
1444 szText.LoadStringW(IDS_APP_DESCRIPTION);
1445 AddColumn(ColumnCount++, szText, 300, LVCFMT_LEFT);
1446
1447 // Enable checkboxes
1448 ShowCheckboxes(true);
1449 break;
1450
1451 default:
1452 break;
1453 }
1454
1455 return TRUE;
1456}
UINT g_IconSize
Definition: appview.cpp:18
#define IDI_MAIN
Definition: resource.h:4
INT GetSystemColorDepth()
Definition: misc.cpp:395
#define IDS_APP_DESCRIPTION
Definition: resource.h:149
#define IDS_APP_INST_VERSION
Definition: resource.h:148
#define IDS_APP_NAME
Definition: resource.h:147
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:21
void DeleteColumn(INT Index)
Definition: appview.cpp:1246
INT ColumnCount
Definition: appview.h:200
BOOL AddColumn(INT Index, CStringW &Text, INT Width, INT Format)
Definition: appview.cpp:1230
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
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:2304
#define ListView_Scroll(hwndLV, dx, dy)
Definition: commctrl.h:2527
#define ImageList_RemoveAll(himl)
Definition: commctrl.h:556
#define LVCFMT_LEFT
Definition: commctrl.h:2603
#define ILC_MASK
Definition: commctrl.h:351
#define LVCFMT_RIGHT
Definition: commctrl.h:2604
#define I_IMAGENONE
Definition: commctrl.h:2391
#define LVSIL_NORMAL
Definition: commctrl.h:2303
BOOL bSmallIcons
Definition: settings.h:12
#define max(a, b)
Definition: svc.c:63
#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:2289
#define SM_CXSMICON
Definition: winuser.h:1015
#define LR_SHARED
Definition: winuser.h:1103
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define SM_CXICON
Definition: winuser.h:975
int WINAPI GetSystemMetrics(_In_ int)

Referenced by CApplicationView::SetDisplayAppType().

◆ SetViewMode()

BOOL CAppsListView::SetViewMode ( DWORD  ViewMode)

Definition at line 1459 of file appview.cpp.

1460{
1461 return SendMessage(LVM_SETVIEW, (WPARAM)ViewMode, 0) == 1;
1462}
#define LVM_SETVIEW
Definition: commctrl.h:2851
UINT_PTR WPARAM
Definition: windef.h:207

Referenced by CApplicationView::OnCommand().

◆ SetWatermark()

VOID CAppsListView::SetWatermark ( const CStringW Text)

Definition at line 1177 of file appview.cpp.

1178{
1179 m_Watermark = Text;
1180}

Referenced by CApplicationView::SetWatermark().

◆ ShowCheckboxes()

void CAppsListView::ShowCheckboxes ( bool  bShow)

Definition at line 1183 of file appview.cpp.

1184{
1185 SetExtendedListViewStyle((bShow ? LVS_EX_CHECKBOXES : 0) | LVS_EX_FULLROWSELECT);
1186 bHasCheckboxes = bShow;
1187}
#define LVS_EX_CHECKBOXES
Definition: commctrl.h:2736
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2739

Referenced by Create(), and SetDisplayAppType().

Member Data Documentation

◆ ApplicationViewType

APPLICATION_VIEW_TYPE CAppsListView::ApplicationViewType = AppViewTypeAvailableApps
private

Definition at line 204 of file appview.h.

Referenced by AddApplication(), and SetDisplayAppType().

◆ bHasCheckboxes

bool CAppsListView::bHasCheckboxes = false
private

Definition at line 196 of file appview.h.

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

◆ bIsAscending

BOOL CAppsListView::bIsAscending = TRUE
private

Definition at line 195 of file appview.h.

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

◆ CheckedItemCount

INT CAppsListView::CheckedItemCount = 0
private

Definition at line 199 of file appview.h.

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

◆ ColumnCount

INT CAppsListView::ColumnCount = 0
private

Definition at line 200 of file appview.h.

Referenced by SetDisplayAppType().

◆ ItemCount

INT CAppsListView::ItemCount = 0
private

Definition at line 198 of file appview.h.

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

◆ m_hImageListView

HIMAGELIST CAppsListView::m_hImageListView = NULL
private

Definition at line 206 of file appview.h.

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

◆ m_Watermark

CStringW CAppsListView::m_Watermark
private

Definition at line 207 of file appview.h.

Referenced by OnEraseBackground(), and SetWatermark().

◆ nLastHeaderID

INT CAppsListView::nLastHeaderID = -1
private

Definition at line 202 of file appview.h.

Referenced by ColumnClick().


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