ReactOS 0.4.15-dev-7918-g2a2556c
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)
 

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 973 of file appview.cpp.

974{
975}

◆ ~CAppsListView()

CAppsListView::~CAppsListView ( )

Definition at line 977 of file appview.cpp.

978{
980 {
982 }
983}
HIMAGELIST m_hImageListView
Definition: appview.h:208
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928

Member Function Documentation

◆ AddApplication()

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

Definition at line 1285 of file appview.cpp.

1286{
1288 {
1289 /* Load icon from registry */
1290 HICON hIcon = NULL;
1291 CStringW szIconPath;
1292 int IconIndex;
1293 if (AppInfo->RetrieveIcon(szIconPath))
1294 {
1296 szIconPath.ReleaseBuffer();
1297
1298 ExtractIconExW(szIconPath.GetString(), IconIndex, &hIcon, NULL, 1);
1299 }
1300
1301 /* Use the default icon if none were found in the file, or if it is not supported (returned 1) */
1302 if (!hIcon || (hIcon == (HICON)1))
1303 {
1304 /* Load default icon */
1306 }
1307
1310
1311 int Index = AddItem(ItemCount, IconIndex, AppInfo->szDisplayName, (LPARAM)AppInfo);
1312 SetItemText(Index, 1, AppInfo->szDisplayVersion.IsEmpty() ? L"---" : AppInfo->szDisplayVersion);
1313 SetItemText(Index, 2, AppInfo->szComments.IsEmpty() ? L"---" : AppInfo->szComments);
1314
1315 ItemCount++;
1316 return TRUE;
1317 }
1319 {
1320 /* Load icon from file */
1321 HICON hIcon = NULL;
1322 CStringW szIconPath;
1323 if (AppInfo->RetrieveIcon(szIconPath))
1324 {
1327 }
1328
1329 if (!hIcon)
1330 {
1331 /* Load default icon */
1333 }
1334
1337
1338 int Index = AddItem(ItemCount, IconIndex, AppInfo->szDisplayName, (LPARAM)AppInfo);
1339
1340 if (InitialCheckState)
1341 {
1343 }
1344
1345 SetItemText(Index, 1, AppInfo->szDisplayVersion);
1346 SetItemText(Index, 2, AppInfo->szComments);
1347
1348 ItemCount++;
1349 return TRUE;
1350 }
1351 else
1352 {
1353 return FALSE;
1354 }
1355}
#define LISTVIEW_ICON_SIZE
Definition: appview.h:22
@ AppViewTypeInstalledApps
Definition: appview.h:72
@ AppViewTypeAvailableApps
Definition: appview.h:71
#define IDI_MAIN
Definition: resource.h:4
bool IsEmpty() const noexcept
Definition: atlsimpstr.h:394
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:387
PXSTR GetString() noexcept
Definition: atlsimpstr.h:367
virtual BOOL RetrieveIcon(CStringW &Path) const =0
CStringW szComments
Definition: appinfo.h:80
CStringW szDisplayName
Definition: appinfo.h:78
CStringW szDisplayVersion
Definition: appinfo.h:79
INT ItemCount
Definition: appview.h:200
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:206
VOID SetCheckState(INT item, BOOL fCheck)
Definition: appview.cpp:1178
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static const WCHAR IconIndex[]
Definition: install.c:52
int WINAPI PathParseIconLocationW(LPWSTR lpszPath)
Definition: path.c:1092
HINSTANCE hInst
Definition: dxdiag.c:13
UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons)
Definition: iconcache.cpp:849
static HICON
Definition: imagelist.c:84
HICON hIcon
Definition: msconfig.c:44
#define L(x)
Definition: ntvdm.h:50
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define AddItem
Definition: userenv.h:209
_In_ WDFCOLLECTION _In_ ULONG Index
LONG_PTR LPARAM
Definition: windef.h:208
#define LR_LOADFROMFILE
Definition: winuser.h:1092
#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:2203
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2075
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2053

Referenced by CApplicationView::AddApplication().

◆ AddColumn()

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

Definition at line 1065 of file appview.cpp.

1066{
1067 LVCOLUMNW Column;
1068
1069 ZeroMemory(&Column, sizeof(Column));
1070
1072 Column.iSubItem = Index;
1073 Column.pszText = const_cast<LPWSTR>(Text.GetString());
1074 Column.cx = Width;
1075 Column.fmt = Format;
1076
1077 return SendMessage(LVM_INSERTCOLUMN, Index, (LPARAM)(&Column));
1078}
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:5843
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by SetDisplayAppType().

◆ AddItem()

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

Definition at line 1088 of file appview.cpp.

1089{
1090 LVITEMW Item;
1091
1092 ZeroMemory(&Item, sizeof(Item));
1093
1095 Item.pszText = const_cast<LPWSTR>(lpText);
1096 Item.lParam = lParam;
1097 Item.iItem = ItemIndex;
1098 Item.iImage = IconIndex;
1099
1100 if (IconIndex >= 0)
1101 {
1102 Item.iImage = IconIndex;
1103 Item.mask |= LVIF_IMAGE;
1104 }
1105 return InsertItem(&Item);
1106}
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 1187 of file appview.cpp.

1188{
1189 if (bHasCheckboxes)
1190 {
1192 {
1193 // clear all
1194 SetCheckState(-1, FALSE);
1195 }
1196 else
1197 {
1198 // check all
1199 SetCheckState(-1, TRUE);
1200 }
1201 }
1202}
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 1025 of file appview.cpp.

1026{
1027 HWND hHeader;
1028 HDITEMW hColumn;
1029 INT nHeaderID = pnmv->iSubItem;
1030
1032 return;
1033
1034 hHeader = (HWND)SendMessage(LVM_GETHEADER, 0, 0);
1035 ZeroMemory(&hColumn, sizeof(hColumn));
1036
1037 /* If the sorting column changed, remove the sorting style from the old column */
1038 if ((nLastHeaderID != -1) && (nLastHeaderID != nHeaderID))
1039 {
1040 bIsAscending = TRUE; // also reset sorting method to ascending
1041 hColumn.mask = HDI_FORMAT;
1042 Header_GetItem(hHeader, nLastHeaderID, &hColumn);
1043 hColumn.fmt &= ~(HDF_SORTUP | HDF_SORTDOWN);
1044 Header_SetItem(hHeader, nLastHeaderID, &hColumn);
1045 }
1046
1047 /* Set the sorting style to the new column */
1048 hColumn.mask = HDI_FORMAT;
1049 Header_GetItem(hHeader, nHeaderID, &hColumn);
1050
1051 hColumn.fmt &= ~(HDF_SORTDOWN | HDF_SORTUP);
1052 hColumn.fmt |= (bIsAscending ? HDF_SORTUP : HDF_SORTDOWN);
1053 Header_SetItem(hHeader, nHeaderID, &hColumn);
1054
1055 /* Sort the list, using the current values of nHeaderID and bIsAscending */
1056 SortContext ctx = {this, nHeaderID};
1057 SortItems(s_CompareFunc, &ctx);
1058
1059 /* Save new values */
1060 nLastHeaderID = nHeaderID;
1062}
INT nLastHeaderID
Definition: appview.h:204
static INT CALLBACK s_CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: appview.cpp:1115
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 1122 of file appview.cpp.

1123{
1124 CStringW Item1, Item2;
1125 LVFINDINFOW IndexInfo;
1126 INT Index;
1127
1128 IndexInfo.flags = LVFI_PARAM;
1129
1130 IndexInfo.lParam = lParam1;
1131 Index = FindItem(-1, &IndexInfo);
1132 GetItemText(Index, iSubItem, Item1.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1133 Item1.ReleaseBuffer();
1134
1135 IndexInfo.lParam = lParam2;
1136 Index = FindItem(-1, &IndexInfo);
1137 GetItemText(Index, iSubItem, Item2.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1138 Item2.ReleaseBuffer();
1139
1140 return bIsAscending ? Item1.Compare(Item2) : Item2.Compare(Item1);
1141}
#define MAX_STR_LEN
Definition: defines.h:43
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 1144 of file appview.cpp.

1145{
1146 RECT r = {205, 28, 465, 250};
1149
1151
1152 if (hwnd)
1153 {
1155 }
1156
1158
1161
1162#pragma push_macro("SubclassWindow")
1163#undef SubclassWindow
1164 m_hWnd = NULL;
1166#pragma pop_macro("SubclassWindow")
1167
1168 return hwnd;
1169}
Arabic default style
Definition: afstyles.h:94
INT GetSystemColorDepth()
Definition: misc.cpp:321
VOID SetCheckboxesVisible(BOOL bIsVisible)
Definition: appview.cpp:1010
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
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static VOID SetImageList(HWND hwnd)
Definition: mplay32.c:238
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define LVSIL_SMALL
Definition: commctrl.h:2299
#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 ILC_MASK
Definition: commctrl.h:351
#define LVS_AUTOARRANGE
Definition: commctrl.h:2272
#define LVSIL_NORMAL
Definition: commctrl.h:2298
_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 1081 of file appview.cpp.

1082{
1084 return;
1085}
#define LVM_DELETECOLUMN
Definition: commctrl.h:2638

Referenced by SetDisplayAppType().

◆ GetCheckState()

BOOL CAppsListView::GetCheckState ( INT  item)

Definition at line 1172 of file appview.cpp.

1173{
1174 return (BOOL)(GetItemState(item, LVIS_STATEIMAGEMASK) >> 12) - 1;
1175}
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 1205 of file appview.cpp.

1206{
1207 INT item = GetSelectionMark();
1208 if (item == -1)
1209 {
1210 return (PVOID)0;
1211 }
1212 return (PVOID)GetItemData(item);
1213}

Referenced by CApplicationView::GetFocusedItemData().

◆ GetImageList()

HIMAGELIST CAppsListView::GetImageList ( int  iImageList)

Definition at line 1109 of file appview.cpp.

1110{
1111 return (HIMAGELIST)SendMessage(LVM_GETIMAGELIST, iImageList, 0);
1112}
#define LVM_GETIMAGELIST
Definition: commctrl.h:2295

◆ ItemCheckStateNotify()

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

Definition at line 1359 of file appview.cpp.

1360{
1361 if (bCheck)
1362 {
1364 }
1365 else
1366 {
1368 }
1369}

Referenced by CApplicationView::ProcessWindowMessage().

◆ OnEraseBackground()

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

Definition at line 986 of file appview.cpp.

987{
988 LRESULT lRes = this->DefWindowProc(uMsg, wParam, lParam);
989 if (!m_Watermark.IsEmpty())
990 {
991 RECT rc;
992 GetClientRect(&rc);
998 SelectFont(HDC(wParam), oldFont);
999 }
1000 return lRes;
1001}
int GetLength() const noexcept
Definition: atlsimpstr.h:362
CStringW m_Watermark
Definition: appview.h:209
WPARAM wParam
Definition: combotst.c:138
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 1115 of file appview.cpp.

1116{
1117 SortContext *ctx = ((SortContext *)lParamSort);
1118 return ctx->lvw->CompareFunc(lParam1, lParam2, ctx->iSubItem);
1119}

Referenced by ColumnClick().

◆ SetCheckboxesVisible()

VOID CAppsListView::SetCheckboxesVisible ( BOOL  bIsVisible)

Definition at line 1010 of file appview.cpp.

1011{
1012 if (bIsVisible)
1013 {
1014 SetExtendedListViewStyle(LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT);
1015 }
1016 else
1017 {
1018 SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);
1019 }
1020
1021 bHasCheckboxes = bIsVisible;
1022}
#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 1178 of file appview.cpp.

1179{
1180 if (bHasCheckboxes)
1181 {
1182 SetItemState(item, INDEXTOSTATEIMAGEMASK((fCheck) ? 2 : 1), LVIS_STATEIMAGEMASK);
1183 }
1184}
#define INDEXTOSTATEIMAGEMASK(i)
Definition: commctrl.h:2328

Referenced by AddApplication(), and CheckAll().

◆ SetDisplayAppType()

BOOL CAppsListView::SetDisplayAppType ( APPLICATION_VIEW_TYPE  AppType)

Definition at line 1216 of file appview.cpp.

1217{
1218 if (!DeleteAllItems())
1219 return FALSE;
1220 ApplicationViewType = AppType;
1221
1223
1224 ItemCount = 0;
1225 CheckedItemCount = 0;
1226
1227 // delete old columns
1228 while (ColumnCount)
1229 {
1231 }
1232
1234
1235 // add new columns
1236 CStringW szText;
1237 switch (AppType)
1238 {
1240
1241 /* Add columns to ListView */
1242 szText.LoadStringW(IDS_APP_NAME);
1243 AddColumn(ColumnCount++, szText, 250, LVCFMT_LEFT);
1244
1245 szText.LoadStringW(IDS_APP_INST_VERSION);
1246 AddColumn(ColumnCount++, szText, 90, LVCFMT_RIGHT);
1247
1248 szText.LoadStringW(IDS_APP_DESCRIPTION);
1249 AddColumn(ColumnCount++, szText, 300, LVCFMT_LEFT);
1250
1251 // disable checkboxes
1253 break;
1254
1256
1257 /* Add columns to ListView */
1258 szText.LoadStringW(IDS_APP_NAME);
1259 AddColumn(ColumnCount++, szText, 250, LVCFMT_LEFT);
1260
1261 szText.LoadStringW(IDS_APP_INST_VERSION);
1262 AddColumn(ColumnCount++, szText, 90, LVCFMT_RIGHT);
1263
1264 szText.LoadStringW(IDS_APP_DESCRIPTION);
1265 AddColumn(ColumnCount++, szText, 300, LVCFMT_LEFT);
1266
1267 // enable checkboxes
1269 break;
1270
1271 default:
1272 break;
1273 }
1274
1275 return TRUE;
1276}
#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:1081
INT ColumnCount
Definition: appview.h:202
BOOL AddColumn(INT Index, CStringW &Text, INT Width, INT Format)
Definition: appview.cpp:1065
#define ImageList_RemoveAll(himl)
Definition: commctrl.h:556
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define LVCFMT_RIGHT
Definition: commctrl.h:2599

Referenced by CApplicationView::SetDisplayAppType().

◆ SetViewMode()

BOOL CAppsListView::SetViewMode ( DWORD  ViewMode)

Definition at line 1279 of file appview.cpp.

1280{
1281 return SendMessage(LVM_SETVIEW, (WPARAM)ViewMode, 0) == 1;
1282}
#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 1004 of file appview.cpp.

1005{
1006 m_Watermark = Text;
1007}

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 AddApplication(), Create(), 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: