ReactOS  0.4.15-dev-994-ga9f6032
CAppsListView Class Reference

#include <appview.h>

Inheritance diagram for CAppsListView:
Collaboration diagram for CAppsListView:

Classes

struct  SortContext
 

Public Member Functions

 CAppsListView ()
 
VOID SetCheckboxesVisible (BOOL bIsVisible)
 
VOID ColumnClick (LPNMLISTVIEW pnmv)
 
BOOL AddColumn (INT Index, ATL::CStringW &Text, INT Width, INT Format)
 
int AddColumn (INT Index, LPWSTR lpText, 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 AddInstalledApplication (CInstalledApplicationInfo *InstAppInfo, LPVOID CallbackParam)
 
BOOL AddAvailableApplication (CAvailableApplicationInfo *AvlbAppInfo, BOOL InitCheckState, LPVOID CallbackParam)
 
VOID ItemCheckStateNotify (int iItem, BOOL bCheck)
 
- Public Member Functions inherited from CUiWindow< 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 (ATL::CStringW &szText)
 
- Public Member Functions inherited from CUiPrimitive
virtual ~CUiPrimitive ()
 
- Public Member Functions inherited from CListView
HWND Create (HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
void SetRedraw (BOOL redraw)
 
BOOL SetTextBkColor (COLORREF cr)
 
BOOL SetBkColor (COLORREF cr)
 
BOOL SetTextColor (COLORREF cr)
 
DWORD SetExtendedListViewStyle (DWORD dw, DWORD dwMask=0)
 
int InsertColumn (int iCol, LV_COLUMN *pcol)
 
int InsertColumn (int iCol, LPWSTR pszText, int fmt, int width=-1, int iSubItem=-1, int iImage=-1, int iOrder=-1)
 
int GetColumnWidth (int iCol)
 
HIMAGELIST SetImageList (HIMAGELIST himl, int iImageList)
 
int InsertItem (const LV_ITEM *pitem)
 
BOOL DeleteItem (int i)
 
BOOL GetItem (LV_ITEM *pitem)
 
BOOL SetItem (const LV_ITEM *pitem)
 
BOOL FindItem (int iStart, const LV_FINDINFO *plvfi)
 
int GetItemCount ()
 
BOOL DeleteAllItems ()
 
BOOL Update (int i)
 
UINT GetSelectedCount ()
 
BOOL SortItems (PFNLVCOMPARE pfnCompare, PVOID lParam)
 
BOOL EnsureVisible (int i, BOOL fPartialOK)
 
HWND EditLabel (int i)
 
int GetSelectionMark ()
 
int GetNextItem (int i, WORD flags)
 
void GetItemSpacing (SIZE &spacing, BOOL bSmallIconView=FALSE)
 
UINT GetItemState (int i, UINT mask)
 
void SetItemState (int i, UINT state, UINT mask)
 
BOOL SetItemText (int i, int subItem, LPCWSTR text)
 
void SetCheckState (int i, BOOL check)
 
int HitTest (LV_HITTESTINFO *phtInfo)
 
DWORD_PTR GetItemData (int i)
 
BOOL GetSelectedItem (LV_ITEM *pItem)
 
void GetItemText (int iItem, int iSubItem, LPTSTR pszText, int cchTextMax)
 
BOOL GetItemPosition (int nItem, POINT *pPoint)
 
BOOL SetItemPosition (int nItem, POINT *pPoint)
 
BOOL Arrange (UINT nCode)
 

Static Public Member Functions

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

Private Attributes

BOOL bIsAscending = TRUE
 
BOOL bHasCheckboxes
 
INT ItemCount = 0
 
INT CheckedItemCount = 0
 
INT ColumnCount = 0
 
INT nLastHeaderID
 
APPLICATION_VIEW_TYPE ApplicationViewType = AppViewTypeEmpty
 
HIMAGELIST m_hImageListView
 

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 204 of file appview.h.

Constructor & Destructor Documentation

◆ CAppsListView()

CAppsListView::CAppsListView ( )

Definition at line 1109 of file appview.cpp.

1109  :
1111  nLastHeaderID(-1)
1112 {
1113 }
INT nLastHeaderID
Definition: appview.h:220
#define FALSE
Definition: types.h:117
BOOL bHasCheckboxes
Definition: appview.h:214

Member Function Documentation

◆ AddAvailableApplication()

BOOL CAppsListView::AddAvailableApplication ( CAvailableApplicationInfo AvlbAppInfo,
BOOL  InitCheckState,
LPVOID  CallbackParam 
)

Definition at line 1398 of file appview.cpp.

1399 {
1401  {
1402  return FALSE;
1403  }
1404 
1405  /* Load icon from file */
1406  HICON hIcon = NULL;
1407  ATL::CStringW szIconPath;
1408  if (AvlbAppInfo->RetrieveIcon(szIconPath))
1409  {
1411  szIconPath.GetString(),
1412  IMAGE_ICON,
1415  LR_LOADFROMFILE);
1416  }
1417 
1418  if (!hIcon || GetLastError() != ERROR_SUCCESS)
1419  {
1420  /* Load default icon */
1422  }
1423 
1425  DestroyIcon(hIcon);
1426 
1427  int Index = AddItem(ItemCount, IconIndex, AvlbAppInfo->m_szName, (LPARAM)CallbackParam);
1428 
1429  if (InitCheckState)
1430  {
1432  }
1433 
1434  SetItemText(Index, 1, AvlbAppInfo->m_szVersion);
1435  SetItemText(Index, 2, AvlbAppInfo->m_szDesc);
1436 
1437  ItemCount++;
1438  return TRUE;
1439 }
static HICON
Definition: imagelist.c:84
#define IMAGE_ICON
Definition: winuser.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define TRUE
Definition: types.h:120
#define LISTVIEW_ICON_SIZE
Definition: appview.h:23
#define LR_LOADFROMFILE
Definition: winuser.h:1082
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
ATL::CStringW m_szDesc
Definition: available.h:50
BOOL SetItemText(int i, int subItem, LPCWSTR text)
Definition: rosctrls.h:186
#define FALSE
Definition: types.h:117
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
INT AddItem(INT ItemIndex, INT IconIndex, LPCWSTR lpText, LPARAM lParam)
Definition: appview.cpp:1194
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
VOID SetCheckState(INT item, BOOL fCheck)
Definition: appview.cpp:1275
HIMAGELIST m_hImageListView
Definition: appview.h:224
INT ItemCount
Definition: appview.h:216
ATL::CStringW m_szVersion
Definition: available.h:48
PCXSTR GetString() const
Definition: atlsimpstr.h:361
static const UCHAR Index[8]
Definition: usbohci.c:18
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:540
static const WCHAR IconIndex[]
Definition: install.c:52
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:222
#define IDI_MAIN
Definition: resource.h:4
ATL::CStringW m_szName
Definition: available.h:46
HINSTANCE hInst
Definition: dxdiag.c:13
HICON hIcon
Definition: msconfig.c:44
BOOL RetrieveIcon(ATL::CStringW &IconLocation) const
Definition: available.cpp:275
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by CApplicationView::AddAvailableApplication().

◆ AddColumn() [1/2]

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

Definition at line 1168 of file appview.cpp.

1169 {
1170  return AddColumn(Index, const_cast<LPWSTR>(Text.GetString()), Width, Format);
1171 }
BOOL AddColumn(INT Index, ATL::CStringW &Text, INT Width, INT Format)
Definition: appview.cpp:1168
static const UCHAR Index[8]
Definition: usbohci.c:18
char * Text
Definition: combotst.c:136

Referenced by SetDisplayAppType().

◆ AddColumn() [2/2]

int CAppsListView::AddColumn ( INT  Index,
LPWSTR  lpText,
INT  Width,
INT  Format 
)

Definition at line 1173 of file appview.cpp.

1174 {
1175  LVCOLUMNW Column;
1176 
1177  ZeroMemory(&Column, sizeof(Column));
1178 
1180  Column.iSubItem = Index;
1181  Column.pszText = lpText;
1182  Column.cx = Width;
1183  Column.fmt = Format;
1184 
1185  return SendMessage(LVM_INSERTCOLUMN, Index, (LPARAM)(&Column));
1186 }
#define LVCF_WIDTH
Definition: commctrl.h:2583
#define LVCF_TEXT
Definition: commctrl.h:2584
#define ZeroMemory
Definition: winbase.h:1648
#define LVCF_SUBITEM
Definition: commctrl.h:2585
#define LVM_INSERTCOLUMN
Definition: commctrl.h:2630
LONG_PTR LPARAM
Definition: windef.h:208
static const UCHAR Index[8]
Definition: usbohci.c:18
LPWSTR pszText
Definition: commctrl.h:2563
#define LVCF_FMT
Definition: commctrl.h:2582
#define SendMessage
Definition: winuser.h:5818
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char * Format
Definition: acpixf.h:1216

◆ AddInstalledApplication()

BOOL CAppsListView::AddInstalledApplication ( CInstalledApplicationInfo InstAppInfo,
LPVOID  CallbackParam 
)

Definition at line 1378 of file appview.cpp.

1379 {
1381  {
1382  return FALSE;
1383  }
1384 
1386 
1388  DestroyIcon(hIcon);
1389 
1390  int Index = AddItem(ItemCount, IconIndex, InstAppInfo->szDisplayName, (LPARAM)CallbackParam);
1391  SetItemText(Index, 1, InstAppInfo->szDisplayVersion.IsEmpty() ? L"---" : InstAppInfo->szDisplayVersion);
1392  SetItemText(Index, 2, InstAppInfo->szComments.IsEmpty() ? L"---" : InstAppInfo->szComments);
1393 
1394  ItemCount++;
1395  return TRUE;
1396 }
static HICON
Definition: imagelist.c:84
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define TRUE
Definition: types.h:120
ATL::CStringW szDisplayVersion
Definition: installed.h:23
ATL::CStringW szDisplayName
Definition: installed.h:22
BOOL SetItemText(int i, int subItem, LPCWSTR text)
Definition: rosctrls.h:186
#define FALSE
Definition: types.h:117
INT AddItem(INT ItemIndex, INT IconIndex, LPCWSTR lpText, LPARAM lParam)
Definition: appview.cpp:1194
LONG_PTR LPARAM
Definition: windef.h:208
ATL::CStringW szComments
Definition: installed.h:33
HIMAGELIST m_hImageListView
Definition: appview.h:224
INT ItemCount
Definition: appview.h:216
static const UCHAR Index[8]
Definition: usbohci.c:18
INT WINAPI ImageList_AddIcon(HIMAGELIST himl, HICON hIcon)
Definition: imagelist.c:540
static const WCHAR IconIndex[]
Definition: install.c:52
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:222
static const WCHAR L[]
Definition: oid.c:1250
#define IDI_MAIN
Definition: resource.h:4
bool IsEmpty() const
Definition: atlsimpstr.h:379
HINSTANCE hInst
Definition: dxdiag.c:13
HICON hIcon
Definition: msconfig.c:44
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by CApplicationView::AddInstalledApplication().

◆ AddItem()

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

Definition at line 1194 of file appview.cpp.

1195 {
1196  LVITEMW Item;
1197 
1198  ZeroMemory(&Item, sizeof(Item));
1199 
1200  Item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE;
1201  Item.pszText = const_cast<LPWSTR>(lpText);
1202  Item.lParam = lParam;
1203  Item.iItem = ItemIndex;
1204  Item.iImage = IconIndex;
1205 
1206  if (IconIndex >= 0)
1207  {
1208  Item.iImage = IconIndex;
1209  Item.mask |= LVIF_IMAGE;
1210  }
1211  return InsertItem(&Item);
1212 }
int iImage
Definition: commctrl.h:2363
#define ZeroMemory
Definition: winbase.h:1648
#define LVIF_TEXT
Definition: commctrl.h:2305
LPARAM lParam
Definition: commctrl.h:2364
LPWSTR pszText
Definition: commctrl.h:2361
#define LVIF_IMAGE
Definition: commctrl.h:2306
UINT mask
Definition: commctrl.h:2356
static const WCHAR IconIndex[]
Definition: install.c:52
int InsertItem(const LV_ITEM *pitem)
Definition: rosctrls.h:96
#define LVIF_PARAM
Definition: commctrl.h:2307
#define LVIF_STATE
Definition: commctrl.h:2308
LPARAM lParam
Definition: combotst.c:139

Referenced by AddAvailableApplication(), and AddInstalledApplication().

◆ CheckAll()

VOID CAppsListView::CheckAll ( )

Definition at line 1283 of file appview.cpp.

1284 {
1285  if (bHasCheckboxes)
1286  {
1287  if (CheckedItemCount == ItemCount)
1288  {
1289  // clear all
1290  SetCheckState(-1, FALSE);
1291  }
1292  else
1293  {
1294  // check all
1295  SetCheckState(-1, TRUE);
1296  }
1297  }
1298 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
VOID SetCheckState(INT item, BOOL fCheck)
Definition: appview.cpp:1275
BOOL bHasCheckboxes
Definition: appview.h:214
INT ItemCount
Definition: appview.h:216
INT CheckedItemCount
Definition: appview.h:217

Referenced by CApplicationView::CheckAll().

◆ ColumnClick()

VOID CAppsListView::ColumnClick ( LPNMLISTVIEW  pnmv)

Definition at line 1129 of file appview.cpp.

1130 {
1131  HWND hHeader;
1132  HDITEMW hColumn;
1133  INT nHeaderID = pnmv->iSubItem;
1134 
1136  return;
1137 
1138  hHeader = (HWND)SendMessage(LVM_GETHEADER, 0, 0);
1139  ZeroMemory(&hColumn, sizeof(hColumn));
1140 
1141  /* If the sorting column changed, remove the sorting style from the old column */
1142  if ((nLastHeaderID != -1) && (nLastHeaderID != nHeaderID))
1143  {
1144  bIsAscending = TRUE; // also reset sorting method to ascending
1145  hColumn.mask = HDI_FORMAT;
1146  Header_GetItem(hHeader, nLastHeaderID, &hColumn);
1147  hColumn.fmt &= ~(HDF_SORTUP | HDF_SORTDOWN);
1148  Header_SetItem(hHeader, nLastHeaderID, &hColumn);
1149  }
1150 
1151  /* Set the sorting style to the new column */
1152  hColumn.mask = HDI_FORMAT;
1153  Header_GetItem(hHeader, nHeaderID, &hColumn);
1154 
1155  hColumn.fmt &= ~(HDF_SORTDOWN | HDF_SORTUP);
1156  hColumn.fmt |= (bIsAscending ? HDF_SORTUP : HDF_SORTDOWN);
1157  Header_SetItem(hHeader, nHeaderID, &hColumn);
1158 
1159  /* Sort the list, using the current values of nHeaderID and bIsAscending */
1160  SortContext ctx = { this, nHeaderID };
1162 
1163  /* Save new values */
1164  nLastHeaderID = nHeaderID;
1166 }
BOOL bIsAscending
Definition: appview.h:213
INT nLastHeaderID
Definition: appview.h:220
#define TRUE
Definition: types.h:120
HANDLE HWND
Definition: compat.h:19
#define ZeroMemory
Definition: winbase.h:1648
#define HDF_SORTUP
Definition: commctrl.h:720
int32_t INT
Definition: typedefs.h:58
#define HDI_FORMAT
Definition: commctrl.h:701
#define Header_GetItem(hwndHD, i, phdi)
Definition: commctrl.h:747
static INT CALLBACK s_CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
Definition: appview.cpp:1219
#define HDF_SORTDOWN
Definition: commctrl.h:721
#define GWL_STYLE
Definition: winuser.h:846
UINT mask
Definition: commctrl.h:680
#define LVM_GETHEADER
Definition: commctrl.h:2646
#define SendMessage
Definition: winuser.h:5818
#define LVS_NOSORTHEADER
Definition: commctrl.h:2281
#define GetWindowLongPtr
Definition: treelist.c:73
#define Header_SetItem(hwndHD, i, phdi)
Definition: commctrl.h:754
int fmt
Definition: commctrl.h:685
BOOL SortItems(PFNLVCOMPARE pfnCompare, PVOID lParam)
Definition: rosctrls.h:141

Referenced by CApplicationView::ProcessWindowMessage().

◆ CompareFunc()

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

Definition at line 1225 of file appview.cpp.

1226 {
1227  ATL::CStringW Item1, Item2;
1228  LVFINDINFOW IndexInfo;
1229  INT Index;
1230 
1231  IndexInfo.flags = LVFI_PARAM;
1232 
1233  IndexInfo.lParam = lParam1;
1234  Index = FindItem(-1, &IndexInfo);
1235  GetItemText(Index, iSubItem, Item1.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1236  Item1.ReleaseBuffer();
1237 
1238  IndexInfo.lParam = lParam2;
1239  Index = FindItem(-1, &IndexInfo);
1240  GetItemText(Index, iSubItem, Item2.GetBuffer(MAX_STR_LEN), MAX_STR_LEN);
1241  Item2.ReleaseBuffer();
1242 
1243  return bIsAscending ? Item1.Compare(Item2) : Item2.Compare(Item1);
1244 }
BOOL bIsAscending
Definition: appview.h:213
LPARAM lParam
Definition: commctrl.h:2454
int32_t INT
Definition: typedefs.h:58
#define LVFI_PARAM
Definition: commctrl.h:2432
void ReleaseBuffer(_In_ int nNewLength=-1)
Definition: atlsimpstr.h:372
void GetItemText(int iItem, int iSubItem, LPTSTR pszText, int cchTextMax)
Definition: rosctrls.h:221
static const UCHAR Index[8]
Definition: usbohci.c:18
BOOL FindItem(int iStart, const LV_FINDINFO *plvfi)
Definition: rosctrls.h:116
#define MAX_STR_LEN
Definition: defines.h:34
int Compare(_In_z_ PCXSTR psz) const
Definition: cstringt.h:653

◆ Create()

HWND CAppsListView::Create ( HWND  hwndParent)

Definition at line 1246 of file appview.cpp.

1247 {
1248  RECT r = { 205, 28, 465, 250 };
1250 
1252 
1253  if (hwnd)
1254  {
1256  }
1257 
1261  0, 1);
1262 
1263  // currently, this two Imagelist is the same one.
1266 
1267  return hwnd;
1268 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define LVSIL_SMALL
Definition: commctrl.h:2295
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2263
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define LISTVIEW_ICON_SIZE
Definition: appview.h:23
#define LVS_REPORT
Definition: commctrl.h:2258
#define WS_CHILD
Definition: pedump.c:617
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
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define FALSE
Definition: types.h:117
#define LVS_SORTASCENDING
Definition: commctrl.h:2264
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
#define LVS_AUTOARRANGE
Definition: commctrl.h:2268
INT GetSystemColorDepth()
Definition: misc.cpp:489
HIMAGELIST m_hImageListView
Definition: appview.h:224
#define LVS_SINGLESEL
Definition: commctrl.h:2262
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ILC_MASK
Definition: commctrl.h:347
#define LVSIL_NORMAL
Definition: commctrl.h:2294
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
HIMAGELIST SetImageList(HIMAGELIST himl, int iImageList)
Definition: rosctrls.h:91
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
VOID SetCheckboxesVisible(BOOL bIsVisible)
Definition: appview.cpp:1115

Referenced by CApplicationView::CreateListView().

◆ DeleteColumn()

void CAppsListView::DeleteColumn ( INT  Index)

Definition at line 1188 of file appview.cpp.

1189 {
1191  return;
1192 }
static const UCHAR Index[8]
Definition: usbohci.c:18
#define LVM_DELETECOLUMN
Definition: commctrl.h:2634
#define SendMessage
Definition: winuser.h:5818

Referenced by SetDisplayAppType().

◆ GetCheckState()

BOOL CAppsListView::GetCheckState ( INT  item)

Definition at line 1270 of file appview.cpp.

1271 {
1272  return (BOOL)(GetItemState(item, LVIS_STATEIMAGEMASK) >> 12) - 1;
1273 }
unsigned int BOOL
Definition: ntddk_ex.h:94
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2322
UINT GetItemState(int i, UINT mask)
Definition: rosctrls.h:173
static ATOM item
Definition: dde.c:856

◆ GetFocusedItemData()

PVOID CAppsListView::GetFocusedItemData ( )

Definition at line 1300 of file appview.cpp.

1301 {
1303  if (item == -1)
1304  {
1305  return (PVOID)0;
1306  }
1307  return (PVOID)GetItemData(item);
1308 }
DWORD_PTR GetItemData(int i)
Definition: rosctrls.h:204
int GetSelectionMark()
Definition: rosctrls.h:156
int32_t INT
Definition: typedefs.h:58
static ATOM item
Definition: dde.c:856

Referenced by CApplicationView::GetFocusedItemData().

◆ GetImageList()

HIMAGELIST CAppsListView::GetImageList ( int  iImageList)

Definition at line 1214 of file appview.cpp.

1215 {
1216  return (HIMAGELIST)SendMessage(LVM_GETIMAGELIST, iImageList, 0);
1217 }
#define LVM_GETIMAGELIST
Definition: commctrl.h:2291
#define SendMessage
Definition: winuser.h:5818

◆ ItemCheckStateNotify()

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

Definition at line 1442 of file appview.cpp.

1443 {
1444  if (bCheck)
1445  {
1446  CheckedItemCount++;
1447  }
1448  else
1449  {
1450  CheckedItemCount--;
1451  }
1452 }
INT CheckedItemCount
Definition: appview.h:217

Referenced by CApplicationView::ProcessWindowMessage().

◆ s_CompareFunc()

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

Definition at line 1219 of file appview.cpp.

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

Referenced by ColumnClick().

◆ SetCheckboxesVisible()

VOID CAppsListView::SetCheckboxesVisible ( BOOL  bIsVisible)

Definition at line 1115 of file appview.cpp.

1116 {
1117  if (bIsVisible)
1118  {
1120  }
1121  else
1122  {
1124  }
1125 
1126  bHasCheckboxes = bIsVisible;
1127 }
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2730
DWORD SetExtendedListViewStyle(DWORD dw, DWORD dwMask=0)
Definition: rosctrls.h:47
BOOL bHasCheckboxes
Definition: appview.h:214
#define LVS_EX_CHECKBOXES
Definition: commctrl.h:2727

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  {
1280  }
1281 }
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2322
BOOL bHasCheckboxes
Definition: appview.h:214
#define INDEXTOSTATEIMAGEMASK(i)
Definition: commctrl.h:2324
static ATOM item
Definition: dde.c:856
void SetItemState(int i, UINT state, UINT mask)
Definition: rosctrls.h:178

Referenced by AddAvailableApplication(), and CheckAll().

◆ SetDisplayAppType()

BOOL CAppsListView::SetDisplayAppType ( APPLICATION_VIEW_TYPE  AppType)

Definition at line 1310 of file appview.cpp.

1311 {
1312  if (!DeleteAllItems()) return FALSE;
1313  ApplicationViewType = AppType;
1314 
1315  bIsAscending = TRUE;
1316 
1317  ItemCount = 0;
1318  CheckedItemCount = 0;
1319 
1320  // delete old columns
1321  while (ColumnCount)
1322  {
1324  }
1325 
1327 
1328  // add new columns
1330  switch (AppType)
1331  {
1333 
1334  /* Add columns to ListView */
1335  szText.LoadStringW(IDS_APP_NAME);
1337 
1338  szText.LoadStringW(IDS_APP_INST_VERSION);
1340 
1341  szText.LoadStringW(IDS_APP_DESCRIPTION);
1343 
1344  // disable checkboxes
1346  break;
1347 
1349 
1350  /* Add columns to ListView */
1351  szText.LoadStringW(IDS_APP_NAME);
1353 
1354  szText.LoadStringW(IDS_APP_INST_VERSION);
1356 
1357  szText.LoadStringW(IDS_APP_DESCRIPTION);
1359 
1360  // enable checkboxes
1362  break;
1363 
1364  case AppViewTypeEmpty:
1365  default:
1366  break;
1367  }
1368 
1369 
1370  return TRUE;
1371 }
BOOL bIsAscending
Definition: appview.h:213
#define TRUE
Definition: types.h:120
void DeleteColumn(INT Index)
Definition: appview.cpp:1188
#define LVCFMT_RIGHT
Definition: commctrl.h:2595
#define LVCFMT_LEFT
Definition: commctrl.h:2594
#define ImageList_RemoveAll(himl)
Definition: commctrl.h:552
BOOL DeleteAllItems()
Definition: rosctrls.h:126
#define FALSE
Definition: types.h:117
static const WCHAR szText[]
Definition: dialog.c:139
#define IDS_APP_DESCRIPTION
Definition: resource.h:139
INT ColumnCount
Definition: appview.h:218
HIMAGELIST m_hImageListView
Definition: appview.h:224
INT ItemCount
Definition: appview.h:216
BOOL AddColumn(INT Index, ATL::CStringW &Text, INT Width, INT Format)
Definition: appview.cpp:1168
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:222
#define IDS_APP_NAME
Definition: resource.h:137
#define IDS_APP_INST_VERSION
Definition: resource.h:138
INT CheckedItemCount
Definition: appview.h:217
VOID SetCheckboxesVisible(BOOL bIsVisible)
Definition: appview.cpp:1115

Referenced by CApplicationView::SetDisplayAppType().

◆ SetViewMode()

BOOL CAppsListView::SetViewMode ( DWORD  ViewMode)

Definition at line 1373 of file appview.cpp.

1374 {
1375  return SendMessage(LVM_SETVIEW, (WPARAM)ViewMode, 0) == 1;
1376 }
UINT_PTR WPARAM
Definition: windef.h:207
#define LVM_SETVIEW
Definition: commctrl.h:2842
#define SendMessage
Definition: winuser.h:5818

Referenced by CApplicationView::OnCommand().

Member Data Documentation

◆ ApplicationViewType

APPLICATION_VIEW_TYPE CAppsListView::ApplicationViewType = AppViewTypeEmpty
private

Definition at line 222 of file appview.h.

Referenced by AddAvailableApplication(), AddInstalledApplication(), and SetDisplayAppType().

◆ bHasCheckboxes

BOOL CAppsListView::bHasCheckboxes
private

Definition at line 214 of file appview.h.

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

◆ bIsAscending

BOOL CAppsListView::bIsAscending = TRUE
private

Definition at line 213 of file appview.h.

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

◆ CheckedItemCount

INT CAppsListView::CheckedItemCount = 0
private

Definition at line 217 of file appview.h.

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

◆ ColumnCount

INT CAppsListView::ColumnCount = 0
private

Definition at line 218 of file appview.h.

Referenced by SetDisplayAppType().

◆ ItemCount

INT CAppsListView::ItemCount = 0
private

◆ m_hImageListView

HIMAGELIST CAppsListView::m_hImageListView
private

◆ nLastHeaderID

INT CAppsListView::nLastHeaderID
private

Definition at line 220 of file appview.h.

Referenced by ColumnClick().


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