-/*
+/*
* PROJECT: ReactOS Applications Manager
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
* FILE: base/applications/rapps/gui.cpp
* COPYRIGHT: Copyright 2015 David Quintana (gigaherz@gmail.com)
* Copyright 2017 Alexander Shaposhnikov (sanchaez@reactos.org)
*/
-#include "defines.h"
+#include "rapps.h"
#include "rapps.h"
#include "rosui.h"
ATL::CStringW szLicense;
switch (Info->m_LicenseType)
{
- case LicenseType::LICENSE_OPENSOURCE:
+ case LICENSE_OPENSOURCE:
szLicense.LoadStringW(IDS_LICENSE_OPENSOURCE);
break;
- case LicenseType::LICENSE_FREEWARE:
+ case LICENSE_FREEWARE:
szLicense.LoadStringW(IDS_LICENSE_FREEWARE);
break;
- case LicenseType::LICENSE_TRIAL:
+ case LICENSE_TRIAL:
szLicense.LoadStringW(IDS_LICENSE_TRIAL);
break;
default:
public:
CAppsListView() :
- bAscending(TRUE),
bHasAllChecked(FALSE),
+ bAscending(TRUE),
bHasCheckboxes(FALSE)
{
}
class CSideTreeView :
public CUiWindow<CTreeView>
{
- HIMAGELIST hImageTreeView = ImageList_Create(TREEVIEW_ICON_SIZE, TREEVIEW_ICON_SIZE,
- GetSystemColorDepth() | ILC_MASK,
- 0, 1);
+ HIMAGELIST hImageTreeView;
public:
+ CSideTreeView() :
+ CUiWindow(),
+ hImageTreeView(ImageList_Create(TREEVIEW_ICON_SIZE, TREEVIEW_ICON_SIZE,
+ GetSystemColorDepth() | ILC_MASK,
+ 0, 1))
+ {
+ }
+
HTREEITEM AddItem(HTREEITEM hParent, ATL::CStringW &Text, INT Image, INT SelectedImage, LPARAM lParam)
{
return CUiWindow<CTreeView>::AddItem(hParent, const_cast<LPWSTR>(Text.GetString()), Image, SelectedImage, lParam);
~CSideTreeView()
{
DestroyImageList();
- CUiWindow<CTreeView>::~CUiWindow();
}
};
UpdateApplicationsList(-1);
}
- }
+ }
break;
case ID_UNINSTALL:
}
}
- static BOOL SearchPatternMatch(PCWSTR szHaystack, PCWSTR szNeedle)
+ static BOOL SearchPatternMatch(LPCWSTR szHaystack, LPCWSTR szNeedle)
{
if (!*szNeedle)
return TRUE;
HIMAGELIST hImageListView = ListView_GetImageList(hListView, LVSIL_SMALL);
- if (!SearchPatternMatch(Info->m_szName, szSearchPattern) &&
- !SearchPatternMatch(Info->m_szDesc, szSearchPattern))
+ if (!SearchPatternMatch(Info->m_szName.GetString(), szSearchPattern) &&
+ !SearchPatternMatch(Info->m_szDesc.GetString(), szSearchPattern))
{
return TRUE;
}
/* Load icon from file */
ATL::CStringW szIconPath;
- szIconPath.Format(L"%lsicons\\%ls.ico", szFolderPath, Info->m_szName);
+ szIconPath.Format(L"%lsicons\\%ls.ico", szFolderPath, Info->m_szName.GetString());
hIcon = (HICON) LoadImageW(NULL,
szIconPath.GetString(),
IMAGE_ICON,
Index = ImageList_AddIcon(hImageListView, hIcon);
DestroyIcon(hIcon);
- Index = ListViewAddItem(Info->m_Category, Index, Info->m_szName, (LPARAM) Info);
+ Index = ListViewAddItem(Info->m_Category, Index, Info->m_szName.GetString(), (LPARAM) Info);
ListView_SetImageList(hListView, hImageListView, LVSIL_SMALL);
ListView_SetItemText(hListView, Index, 1, const_cast<LPWSTR>(Info->m_szVersion.GetString()));
{
EnumType = SelectedEnumType;
}
-
+
//if previous one was INSTALLED purge the list
//TODO: make the Installed category a separate class to avoid doing this
if (bWasInInstalled)