ReactOS  0.4.15-dev-3299-gbe8e5fc
CApplicationView Class Reference

#include <appview.h>

Inheritance diagram for CApplicationView:
Collaboration diagram for CApplicationView:

Public Member Functions

 CApplicationView (CMainWindow *MainWindow)
 
 ~CApplicationView ()
 
HWND Create (HWND hwndParent)
 
void SetRedraw (BOOL bRedraw)
 
BOOL SetDisplayAppType (APPLICATION_VIEW_TYPE AppType)
 
BOOL AddInstalledApplication (CInstalledApplicationInfo *InstAppInfo, LPVOID param)
 
BOOL AddAvailableApplication (CAvailableApplicationInfo *AvlbAppInfo, BOOL InitCheckState, LPVOID param)
 
void CheckAll ()
 
PVOID GetFocusedItemData ()
 
int GetItemCount ()
 
VOID AppendTabOrderWindow (int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
 
BOOL ItemGetFocus (LPVOID CallbackParam)
 
BOOL ItemCheckStateChanged (BOOL bChecked, LPVOID CallbackParam)
 
- Public Member Functions inherited from CUiWindow< CWindowImpl< CApplicationView > >
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 ~CUiWindow ()
 
VOID GetWindowTextW (ATL::CStringW &szText)
 
- Public Member Functions inherited from CUiPrimitive
virtual ~CUiPrimitive ()
 

Static Public Member Functions

static ATL::CWndClassInfoGetWndClassInfo ()
 

Private Member Functions

BOOL ProcessWindowMessage (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
 
BOOL CreateToolbar ()
 
BOOL CreateSearchBar ()
 
BOOL CreateComboBox ()
 
BOOL CreateHSplitter ()
 
BOOL CreateListView ()
 
BOOL CreateAppInfoDisplay ()
 
VOID OnSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
 
VOID OnCommand (WPARAM wParam, LPARAM lParam)
 

Private Attributes

CUiPanelm_Panel = NULL
 
CMainToolbarm_Toolbar = NULL
 
CUiWindow< CComboBox > * m_ComboBox = NULL
 
CUiWindow< CSearchBar > * m_SearchBar = NULL
 
CAppsListViewm_ListView = NULL
 
CAppInfoDisplaym_AppsInfo = NULL
 
CUiSplitPanelm_HSplitter = NULL
 
CMainWindowm_MainWindow = NULL
 
APPLICATION_VIEW_TYPE ApplicationViewType = AppViewTypeEmpty
 

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

Constructor & Destructor Documentation

◆ CApplicationView()

CApplicationView::CApplicationView ( CMainWindow MainWindow)

Definition at line 1894 of file appview.cpp.

1895  : m_MainWindow(MainWindow)
1896 {
1897 }
CMainWindow * m_MainWindow
Definition: appview.h:347

◆ ~CApplicationView()

CApplicationView::~CApplicationView ( )

Definition at line 1899 of file appview.cpp.

1900 {
1901  delete m_Toolbar;
1902  delete m_SearchBar;
1903  delete m_ListView;
1904  delete m_AppsInfo;
1905  delete m_HSplitter;
1906 }
CUiWindow< CSearchBar > * m_SearchBar
Definition: appview.h:343
CAppsListView * m_ListView
Definition: appview.h:344
CUiSplitPanel * m_HSplitter
Definition: appview.h:346
CMainToolbar * m_Toolbar
Definition: appview.h:341
CAppInfoDisplay * m_AppsInfo
Definition: appview.h:345

Member Function Documentation

◆ AddAvailableApplication()

BOOL CApplicationView::AddAvailableApplication ( CAvailableApplicationInfo AvlbAppInfo,
BOOL  InitCheckState,
LPVOID  param 
)

Definition at line 2004 of file appview.cpp.

2005 {
2007  {
2008  return FALSE;
2009  }
2010  return m_ListView->AddAvailableApplication(AvlbAppInfo, InitCheckState, param);
2011 }
BOOL AddAvailableApplication(CAvailableApplicationInfo *AvlbAppInfo, BOOL InitCheckState, LPVOID CallbackParam)
Definition: appview.cpp:1432
#define FALSE
Definition: types.h:117
GLfloat param
Definition: glext.h:5796
CAppsListView * m_ListView
Definition: appview.h:344
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:348

Referenced by CMainWindow::EnumAvailableAppProc().

◆ AddInstalledApplication()

BOOL CApplicationView::AddInstalledApplication ( CInstalledApplicationInfo InstAppInfo,
LPVOID  param 
)

Definition at line 1995 of file appview.cpp.

1996 {
1998  {
1999  return FALSE;
2000  }
2001  return m_ListView->AddInstalledApplication(InstAppInfo, param);
2002 }
#define FALSE
Definition: types.h:117
GLfloat param
Definition: glext.h:5796
CAppsListView * m_ListView
Definition: appview.h:344
BOOL AddInstalledApplication(CInstalledApplicationInfo *InstAppInfo, LPVOID CallbackParam)
Definition: appview.cpp:1393
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:348

Referenced by CMainWindow::EnumInstalledAppProc().

◆ AppendTabOrderWindow()

VOID CApplicationView::AppendTabOrderWindow ( int  Direction,
ATL::CSimpleArray< HWND > &  TabOrderList 
)
virtual

Reimplemented from CUiWindow< CWindowImpl< CApplicationView > >.

Definition at line 2029 of file appview.cpp.

2030 {
2031  m_Toolbar->AppendTabOrderWindow(Direction, TabOrderList);
2032  m_ComboBox->AppendTabOrderWindow(Direction, TabOrderList);
2033  m_SearchBar->AppendTabOrderWindow(Direction, TabOrderList);
2034  m_ListView->AppendTabOrderWindow(Direction, TabOrderList);
2035  m_AppsInfo->AppendTabOrderWindow(Direction, TabOrderList);
2036 
2037  return;
2038 }
CUiWindow< CSearchBar > * m_SearchBar
Definition: appview.h:343
WDF_EXTERN_C_START typedef _In_ WDFDEVICE _In_ WDFCONTEXT _In_ WDF_DMA_DIRECTION Direction
virtual VOID AppendTabOrderWindow(int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
Definition: rosui.h:500
CAppsListView * m_ListView
Definition: appview.h:344
CMainToolbar * m_Toolbar
Definition: appview.h:341
CAppInfoDisplay * m_AppsInfo
Definition: appview.h:345
CUiWindow< CComboBox > * m_ComboBox
Definition: appview.h:342

Referenced by CMainWindow::HandleTabOrder().

◆ CheckAll()

void CApplicationView::CheckAll ( )

Definition at line 2013 of file appview.cpp.

2014 {
2015  m_ListView->CheckAll();
2016  return;
2017 }
CAppsListView * m_ListView
Definition: appview.h:344
VOID CheckAll()
Definition: appview.cpp:1298

Referenced by CMainWindow::OnCommand().

◆ Create()

HWND CApplicationView::Create ( HWND  hwndParent)

Definition at line 1932 of file appview.cpp.

1933 {
1934  RECT r = { 0,0,0,0 };
1935 
1937 
1939 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
_In_ BOOLEAN Create
Definition: pstypes.h:527
#define WS_CHILD
Definition: pedump.c:617
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define IDR_APPLICATIONMENU
Definition: resource.h:70
static HWND hwndParent
Definition: cryptui.c:300
static const WCHAR L[]
Definition: oid.c:1250
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
HINSTANCE hInst
Definition: dxdiag.c:13
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define WS_VISIBLE
Definition: pedump.c:620
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

Referenced by CMainWindow::CreateApplicationView().

◆ CreateAppInfoDisplay()

BOOL CApplicationView::CreateAppInfoDisplay ( )
private

Definition at line 1700 of file appview.cpp.

1701 {
1702  m_AppsInfo = new CAppInfoDisplay();
1706 
1707  return m_AppsInfo->Create(m_hWnd) != NULL;
1708 }
CUiCollection & Second()
Definition: rosui.h:568
INT Append(T *ptr)
Definition: rosui.h:79
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:242
CUiAlignment m_VerticalAlignment
Definition: rosui.h:243
HWND Create(HWND hwndParent)
Definition: appview.cpp:1050
CUiSplitPanel * m_HSplitter
Definition: appview.h:346
#define NULL
Definition: types.h:112
CAppInfoDisplay * m_AppsInfo
Definition: appview.h:345

Referenced by ProcessWindowMessage().

◆ CreateComboBox()

BOOL CApplicationView::CreateComboBox ( )
private

Definition at line 1665 of file appview.cpp.

1666 {
1670  m_ComboBox->m_Margin.top = 4;
1671 
1672  return m_ComboBox->Create(m_Toolbar->m_hWnd) != NULL;
1673 }
LONG top
Definition: windef.h:307
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:242
CUiAlignment m_VerticalAlignment
Definition: rosui.h:243
#define NULL
Definition: types.h:112
HWND Create(HWND hwndParent)
Definition: appview.cpp:215
CMainToolbar * m_Toolbar
Definition: appview.h:341
CUiMargin m_Margin
Definition: rosui.h:240
CUiWindow< CComboBox > * m_ComboBox
Definition: appview.h:342

Referenced by ProcessWindowMessage().

◆ CreateHSplitter()

BOOL CApplicationView::CreateHSplitter ( )
private

Definition at line 1675 of file appview.cpp.

1676 {
1677  m_HSplitter = new CUiSplitPanel();
1682  m_HSplitter->m_Pos = INT_MAX; //set INT_MAX to use lowest possible position (m_MinSecond)
1683  m_HSplitter->m_MinFirst = 10;
1684  m_HSplitter->m_MinSecond = 140;
1686 
1687  return m_HSplitter->Create(m_hWnd) != NULL;
1688 }
#define INT_MAX
Definition: limits.h:40
#define TRUE
Definition: types.h:120
INT m_MinFirst
Definition: rosui.h:544
INT Append(T *ptr)
Definition: rosui.h:79
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:242
INT m_MinSecond
Definition: rosui.h:545
HWND Create(HWND hwndParent)
Definition: rosui.h:803
BOOL m_DynamicFirst
Definition: rosui.h:543
BOOL m_Horizontal
Definition: rosui.h:542
CUiAlignment m_VerticalAlignment
Definition: rosui.h:243
INT m_Pos
Definition: rosui.h:541
CUiSplitPanel * m_HSplitter
Definition: appview.h:346
#define NULL
Definition: types.h:112
CUiCollection & Children()
Definition: rosui.h:359
CUiPanel * m_Panel
Definition: appview.h:340

Referenced by ProcessWindowMessage().

◆ CreateListView()

BOOL CApplicationView::CreateListView ( )
private

Definition at line 1690 of file appview.cpp.

1691 {
1692  m_ListView = new CAppsListView();
1696 
1697  return m_ListView->Create(m_hWnd) != NULL;
1698 }
INT Append(T *ptr)
Definition: rosui.h:79
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:242
CUiCollection & First()
Definition: rosui.h:567
CAppsListView * m_ListView
Definition: appview.h:344
CUiAlignment m_VerticalAlignment
Definition: rosui.h:243
HWND Create(HWND hwndParent)
Definition: appview.cpp:1261
CUiSplitPanel * m_HSplitter
Definition: appview.h:346
#define NULL
Definition: types.h:112

Referenced by ProcessWindowMessage().

◆ CreateSearchBar()

BOOL CApplicationView::CreateSearchBar ( )
private

Definition at line 1654 of file appview.cpp.

1655 {
1659  m_SearchBar->m_Margin.top = 4;
1661 
1662  return m_SearchBar->Create(m_Toolbar->m_hWnd) != NULL;
1663 }
CUiWindow< CSearchBar > * m_SearchBar
Definition: appview.h:343
LONG top
Definition: windef.h:307
LONG right
Definition: windef.h:308
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:242
#define TOOLBAR_PADDING
Definition: appview.h:38
HWND Create(HWND hwndParent)
Definition: appview.cpp:192
CUiAlignment m_VerticalAlignment
Definition: rosui.h:243
#define NULL
Definition: types.h:112
CMainToolbar * m_Toolbar
Definition: appview.h:341
CUiMargin m_Margin
Definition: rosui.h:240

Referenced by ProcessWindowMessage().

◆ CreateToolbar()

BOOL CApplicationView::CreateToolbar ( )
private

Definition at line 1644 of file appview.cpp.

1645 {
1646  m_Toolbar = new CMainToolbar();
1650 
1651  return m_Toolbar->Create(m_hWnd) != NULL;
1652 }
HWND Create(HWND hwndParent)
Definition: appview.cpp:107
INT Append(T *ptr)
Definition: rosui.h:79
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:242
CUiAlignment m_VerticalAlignment
Definition: rosui.h:243
#define NULL
Definition: types.h:112
CUiCollection & Children()
Definition: rosui.h:359
CMainToolbar * m_Toolbar
Definition: appview.h:341
CUiPanel * m_Panel
Definition: appview.h:340

Referenced by ProcessWindowMessage().

◆ GetFocusedItemData()

PVOID CApplicationView::GetFocusedItemData ( )

Definition at line 2019 of file appview.cpp.

2020 {
2021  return m_ListView->GetFocusedItemData();
2022 }
PVOID GetFocusedItemData()
Definition: appview.cpp:1315
CAppsListView * m_ListView
Definition: appview.h:344

Referenced by CMainWindow::OnCommand(), OnCommand(), CMainWindow::RemoveSelectedAppFromRegistry(), and CMainWindow::UninstallSelectedApp().

◆ GetItemCount()

int CApplicationView::GetItemCount ( )

Definition at line 2024 of file appview.cpp.

2025 {
2026  return m_ListView->GetItemCount();
2027 }
int GetItemCount()
Definition: rosctrls.h:121
CAppsListView * m_ListView
Definition: appview.h:344

Referenced by CMainWindow::UpdateStatusBarText().

◆ GetWndClassInfo()

ATL::CWndClassInfo & CApplicationView::GetWndClassInfo ( )
static

Definition at line 1908 of file appview.cpp.

1909 {
1910  DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
1911  static ATL::CWndClassInfo wc =
1912  {
1913  {
1914  sizeof(WNDCLASSEX),
1915  csStyle,
1916  StartWindowProc,
1917  0,
1918  0,
1919  NULL,
1920  NULL,
1921  NULL,
1922  (HBRUSH)(COLOR_BTNFACE + 1),
1923  NULL,
1924  L"RAppsApplicationView",
1925  NULL
1926  },
1927  NULL, NULL, IDC_ARROW, TRUE, 0, _T("")
1928  };
1929  return wc;
1930 }
#define TRUE
Definition: types.h:120
#define CS_HREDRAW
Definition: winuser.h:648
#define CS_VREDRAW
Definition: winuser.h:653
#define _T(x)
Definition: vfdio.h:22
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define COLOR_BTNFACE
Definition: winuser.h:918
#define NULL
Definition: types.h:112
#define IDC_ARROW
Definition: winuser.h:682
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5695

◆ ItemCheckStateChanged()

BOOL CApplicationView::ItemCheckStateChanged ( BOOL  bChecked,
LPVOID  CallbackParam 
)

Definition at line 2061 of file appview.cpp.

2062 {
2063  m_MainWindow->ItemCheckStateChanged(bChecked, CallbackParam);
2064  return TRUE;
2065 }
#define TRUE
Definition: types.h:120
CMainWindow * m_MainWindow
Definition: appview.h:347
BOOL ItemCheckStateChanged(BOOL bChecked, LPVOID CallbackParam)
Definition: gui.cpp:751

Referenced by ProcessWindowMessage().

◆ ItemGetFocus()

BOOL CApplicationView::ItemGetFocus ( LPVOID  CallbackParam)

Definition at line 2042 of file appview.cpp.

2043 {
2044  switch (ApplicationViewType)
2045  {
2047  return m_AppsInfo->ShowInstalledAppInfo((CInstalledApplicationInfo *)CallbackParam);
2048 
2050  return m_AppsInfo->ShowAvailableAppInfo((CAvailableApplicationInfo *)CallbackParam);
2051 
2052  case AppViewTypeEmpty:
2053  default:
2055  return FALSE;
2056  }
2057 }
#define FALSE
Definition: types.h:117
BOOL ShowInstalledAppInfo(CInstalledApplicationInfo *Info)
Definition: appview.cpp:1072
VOID SetWelcomeText()
Definition: appview.cpp:1079
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:348
BOOL ShowAvailableAppInfo(CAvailableApplicationInfo *Info)
Definition: appview.cpp:1057
CAppInfoDisplay * m_AppsInfo
Definition: appview.h:345

Referenced by ProcessWindowMessage().

◆ OnCommand()

VOID CApplicationView::OnCommand ( WPARAM  wParam,
LPARAM  lParam 
)
private

Definition at line 1776 of file appview.cpp.

1777 {
1778  if (lParam)
1779  {
1780  if ((HWND)lParam == m_SearchBar->GetWindow())
1781  {
1782  ATL::CStringW szBuf;
1783  switch (HIWORD(wParam))
1784  {
1785  case EN_SETFOCUS:
1786  {
1787  ATL::CStringW szWndText;
1788 
1789  szBuf.LoadStringW(IDS_SEARCH_TEXT);
1790  m_SearchBar->GetWindowTextW(szWndText);
1791  if (szBuf == szWndText)
1792  {
1793  m_SearchBar->SetWindowTextW(L"");
1794  }
1795  }
1796  break;
1797 
1798  case EN_KILLFOCUS:
1799  {
1800  m_SearchBar->GetWindowTextW(szBuf);
1801  if (szBuf.IsEmpty())
1802  {
1803  szBuf.LoadStringW(IDS_SEARCH_TEXT);
1804  m_SearchBar->SetWindowTextW(szBuf.GetString());
1805  }
1806  }
1807  break;
1808 
1809  case EN_CHANGE:
1810  {
1811  ATL::CStringW szWndText;
1812 
1813  szBuf.LoadStringW(IDS_SEARCH_TEXT);
1814  m_SearchBar->GetWindowTextW(szWndText);
1815  if (szBuf == szWndText)
1816  {
1817  szWndText = L"";
1818  m_MainWindow->SearchTextChanged(szWndText);
1819  }
1820  else
1821  {
1822  m_MainWindow->SearchTextChanged(szWndText);
1823  }
1824  }
1825  break;
1826  }
1827 
1828  return;
1829  }
1830  else if ((HWND)lParam == m_ComboBox->GetWindow())
1831  {
1832  int NotifyCode = HIWORD(wParam);
1833  switch (NotifyCode)
1834  {
1835  case CBN_SELCHANGE:
1836  int CurrSelection = m_ComboBox->SendMessageW(CB_GETCURSEL);
1837 
1838  int ViewModeList[] = { LV_VIEW_DETAILS, LV_VIEW_LIST, LV_VIEW_TILE };
1839  ATLASSERT(CurrSelection < (int)_countof(ViewModeList));
1840  if (!m_ListView->SetViewMode(ViewModeList[CurrSelection]))
1841  {
1842  MessageBoxW(L"View mode invalid or unimplemented");
1843  }
1844  break;
1845  }
1846 
1847  return;
1848  }
1849  else if ((HWND)lParam == m_Toolbar->GetWindow())
1850  {
1851  // the message is sent from Toolbar. fall down to continue process
1852  }
1853  else
1854  {
1855  return;
1856  }
1857  }
1858 
1859  // the LOWORD of wParam contains a Menu or Control ID
1860  WORD wCommand = LOWORD(wParam);
1861 
1862  switch (wCommand)
1863  {
1864  case ID_INSTALL:
1866  break;
1867 
1868  case ID_TOOLBAR_INSTALL:
1869  m_MainWindow->SendMessageW(WM_COMMAND, ID_INSTALL, 0);
1870  break;
1871 
1872  case ID_UNINSTALL:
1873  m_MainWindow->SendMessageW(WM_COMMAND, ID_UNINSTALL, 0);
1874  break;
1875 
1876  case ID_MODIFY:
1877  m_MainWindow->SendMessageW(WM_COMMAND, ID_MODIFY, 0);
1878  break;
1879 
1880  case ID_REGREMOVE:
1881  m_MainWindow->SendMessageW(WM_COMMAND, ID_REGREMOVE, 0);
1882  break;
1883 
1884  case ID_REFRESH:
1885  m_MainWindow->SendMessageW(WM_COMMAND, ID_REFRESH, 0);
1886  break;
1887 
1888  case ID_RESETDB:
1889  m_MainWindow->SendMessageW(WM_COMMAND, ID_RESETDB, 0);
1890  break;
1891  }
1892 }
#define ID_REFRESH
Definition: resource.h:16
_In_ ULONG NotifyCode
Definition: winddi.h:4265
CUiWindow< CSearchBar > * m_SearchBar
Definition: appview.h:343
#define ID_REGREMOVE
Definition: resource.h:83
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
BOOL SetViewMode(DWORD ViewMode)
Definition: appview.cpp:1388
#define ID_RESETDB
Definition: resource.h:84
#define IDS_SEARCH_TEXT
Definition: resource.h:91
#define ID_TOOLBAR_INSTALL
Definition: resource.h:87
#define ID_UNINSTALL
Definition: resource.h:75
#define CB_GETCURSEL
Definition: winuser.h:1926
WPARAM wParam
Definition: combotst.c:138
#define EN_KILLFOCUS
Definition: winuser.h:2008
#define EN_SETFOCUS
Definition: winuser.h:2010
BOOL InstallApplication(CAvailableApplicationInfo *Info)
Definition: gui.cpp:781
#define LV_VIEW_DETAILS
Definition: commctrl.h:2841
HWND GetWindow()
Definition: rosui.h:458
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
#define _countof(array)
Definition: sndvol32.h:68
PCXSTR GetString() const
Definition: atlsimpstr.h:361
unsigned short WORD
Definition: ntddk_ex.h:93
VOID GetWindowTextW(ATL::CStringW &szText)
Definition: rosui.h:514
CAppsListView * m_ListView
Definition: appview.h:344
static const WCHAR L[]
Definition: oid.c:1250
#define WM_COMMAND
Definition: winuser.h:1723
#define LV_VIEW_TILE
Definition: commctrl.h:2844
bool IsEmpty() const
Definition: atlsimpstr.h:379
#define ID_INSTALL
Definition: resource.h:74
CMainWindow * m_MainWindow
Definition: appview.h:347
#define CBN_SELCHANGE
Definition: winuser.h:1962
#define LV_VIEW_LIST
Definition: commctrl.h:2843
BOOL SearchTextChanged(ATL::CStringW &SearchText)
Definition: gui.cpp:812
#define HIWORD(l)
Definition: typedefs.h:247
CMainToolbar * m_Toolbar
Definition: appview.h:341
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define ID_MODIFY
Definition: resource.h:78
PVOID GetFocusedItemData()
Definition: appview.cpp:2019
CUiWindow< CComboBox > * m_ComboBox
Definition: appview.h:342
#define EN_CHANGE
Definition: winuser.h:2005

Referenced by ProcessWindowMessage().

◆ OnSize()

VOID CApplicationView::OnSize ( HWND  hwnd,
WPARAM  wParam,
LPARAM  lParam 
)
private

Definition at line 1716 of file appview.cpp.

1717 {
1718  if (wParam == SIZE_MINIMIZED)
1719  return;
1720 
1721  /* Size tool bar */
1722  m_Toolbar->AutoSize();
1723 
1724  /* Automatically hide captions */
1725  DWORD dToolbarTreshold = m_Toolbar->GetMaxButtonsWidth();
1726  DWORD dSearchbarMargin = (LOWORD(lParam) - m_SearchBar->m_Width - m_ComboBox->m_Width - TOOLBAR_PADDING * 2);
1727 
1728  if (dSearchbarMargin > dToolbarTreshold)
1729  {
1731  }
1732  else if (dSearchbarMargin < dToolbarTreshold)
1733  {
1735 
1736  }
1737 
1738  RECT r = { 0, 0, LOWORD(lParam), HIWORD(lParam) };
1739  HDWP hdwp = NULL;
1741 
1742  hdwp = BeginDeferWindowPos(count);
1743  if (hdwp)
1744  {
1745  hdwp = m_Panel->OnParentSize(r, hdwp);
1746  if (hdwp)
1747  {
1748  EndDeferWindowPos(hdwp);
1749  }
1750  }
1751 
1753  hdwp = BeginDeferWindowPos(count);
1754  if (hdwp)
1755  {
1756  hdwp = m_SearchBar->OnParentSize(r, hdwp);
1757  if (hdwp)
1758  {
1759  EndDeferWindowPos(hdwp);
1760  }
1761  }
1762 
1765  hdwp = BeginDeferWindowPos(count);
1766  if (hdwp)
1767  {
1768  hdwp = m_ComboBox->OnParentSize(r, hdwp);
1769  if (hdwp)
1770  {
1771  EndDeferWindowPos(hdwp);
1772  }
1773  }
1774 }
DWORD GetMaxButtonsWidth() const
Definition: appview.cpp:174
int m_Width
Definition: appview.h:328
HDWP WINAPI BeginDeferWindowPos(_In_ int)
CUiWindow< CSearchBar > * m_SearchBar
Definition: appview.h:343
VOID ShowButtonCaption()
Definition: appview.cpp:168
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
virtual DWORD_PTR CountSizableChildren()
Definition: rosui.h:476
GLuint GLuint GLsizei count
Definition: gl.h:1545
const INT m_Width
Definition: appview.h:303
LONG right
Definition: windef.h:308
int32_t INT
Definition: typedefs.h:58
WPARAM wParam
Definition: combotst.c:138
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
Definition: rosui.h:421
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
DWORD AutoSize()
Definition: rosctrls.h:378
#define TOOLBAR_PADDING
Definition: appview.h:38
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SIZE_MINIMIZED
Definition: winuser.h:2482
VOID HideButtonCaption()
Definition: appview.cpp:162
#define NULL
Definition: types.h:112
#define HIWORD(l)
Definition: typedefs.h:247
CMainToolbar * m_Toolbar
Definition: appview.h:341
CUiMargin m_Margin
Definition: rosui.h:240
virtual DWORD_PTR CountSizableChildren()
Definition: rosui.h:407
LPARAM lParam
Definition: combotst.c:139
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
Definition: rosui.h:481
#define LOWORD(l)
Definition: pedump.c:82
CUiWindow< CComboBox > * m_ComboBox
Definition: appview.h:342
CUiPanel * m_Panel
Definition: appview.h:340

Referenced by ProcessWindowMessage().

◆ ProcessWindowMessage()

BOOL CApplicationView::ProcessWindowMessage ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
LRESULT theResult,
DWORD  dwMapId 
)
private

Definition at line 1492 of file appview.cpp.

1493 {
1494  theResult = 0;
1495  switch (message)
1496  {
1497  case WM_CREATE:
1498  {
1499  BOOL bSuccess = TRUE;
1500  m_Panel = new CUiPanel();
1503 
1504  bSuccess &= CreateToolbar();
1506  bSuccess &= CreateComboBox();
1508  bSuccess &= CreateListView();
1510 
1511  m_Toolbar->AutoSize();
1512 
1513  RECT rTop;
1514 
1515  ::GetWindowRect(m_Toolbar->m_hWnd, &rTop);
1516  m_HSplitter->m_Margin.top = rTop.bottom - rTop.top;
1517  if (!bSuccess)
1518  {
1519  return -1; // creation failure
1520  }
1521  }
1522  break;
1523 
1524  case WM_NOTIFY:
1525  {
1526  LPNMHDR pNotifyHeader = (LPNMHDR)lParam;
1527  if (pNotifyHeader->hwndFrom == m_ListView->GetWindow())
1528  {
1529  switch (pNotifyHeader->code)
1530  {
1531  case LVN_ITEMCHANGED:
1532  {
1534 
1535  /* Check if this is a valid item
1536  * (technically, it can be also an unselect) */
1537  INT ItemIndex = pnic->iItem;
1538  if (ItemIndex == -1 ||
1539  ItemIndex >= ListView_GetItemCount(pnic->hdr.hwndFrom))
1540  {
1541  break;
1542  }
1543 
1544  /* Check if the focus has been moved to another item */
1545  if ((pnic->uChanged & LVIF_STATE) &&
1546  (pnic->uNewState & LVIS_FOCUSED) &&
1547  !(pnic->uOldState & LVIS_FOCUSED))
1548  {
1549  ItemGetFocus((LPVOID)pnic->lParam);
1550  }
1551 
1552  /* Check if the item is checked/unchecked */
1553  if (pnic->uChanged & LVIF_STATE)
1554  {
1555  int iOldState = STATEIMAGETOINDEX(pnic->uOldState);
1556  int iNewState = STATEIMAGETOINDEX(pnic->uNewState);
1557 
1558  if (iOldState == STATEIMAGE_UNCHECKED && iNewState == STATEIMAGE_CHECKED)
1559  {
1560  // this item is just checked
1563  }
1564  else if (iOldState == STATEIMAGE_CHECKED && iNewState == STATEIMAGE_UNCHECKED)
1565  {
1566  // this item is just unchecked
1569  }
1570  }
1571  }
1572  break;
1573 
1574  case LVN_COLUMNCLICK:
1575  {
1577 
1578  m_ListView->ColumnClick(pnmv);
1579  }
1580  break;
1581 
1582  case NM_DBLCLK:
1583  {
1585  if (Item->iItem != -1)
1586  {
1587  /* this won't do anything if the program is already installed */
1588 
1590  {
1592  }
1593  }
1594  }
1595  break;
1596 
1597  case NM_RCLICK:
1598  {
1599  if (((LPNMLISTVIEW)lParam)->iItem != -1)
1600  {
1601  ShowPopupMenuEx(m_hWnd, m_hWnd, 0, ID_INSTALL);
1602  }
1603  }
1604  break;
1605  }
1606  }
1607  else if (pNotifyHeader->hwndFrom == m_Toolbar->GetWindow())
1608  {
1609  switch (pNotifyHeader->code)
1610  {
1611  case TTN_GETDISPINFO:
1613  break;
1614  }
1615  }
1616  }
1617  break;
1618 
1619  case WM_SYSCOLORCHANGE:
1620  {
1621  /* Forward WM_SYSCOLORCHANGE to common controls */
1622  m_ListView->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
1624  m_Toolbar->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
1625  m_ComboBox->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
1626  }
1627  break;
1628 
1629  case WM_SIZE:
1630  {
1631  OnSize(hwnd, wParam, lParam);
1632  break;
1633  }
1634 
1635  case WM_COMMAND:
1636  {
1638  }
1639  break;
1640  }
1641  return FALSE;
1642 }
DWORD_PTR GetItemData(int i)
Definition: rosctrls.h:204
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1609
VOID OnGetDispInfo(LPTOOLTIPTEXT lpttt)
Definition: appview.cpp:71
Definition: tftpd.h:59
UINT uNewState
Definition: commctrl.h:3036
BOOL CreateComboBox()
Definition: appview.cpp:1665
#define TRUE
Definition: types.h:120
VOID ItemCheckStateNotify(int iItem, BOOL bCheck)
Definition: appview.cpp:1476
#define LVN_ITEMCHANGED
Definition: commctrl.h:3131
LONG top
Definition: windef.h:307
#define STATEIMAGE_UNCHECKED
Definition: appview.h:65
int32_t INT
Definition: typedefs.h:58
static BOOLEAN bSuccess
Definition: drive.cpp:432
DWORD WINAPI GetSysColor(_In_ int)
WPARAM wParam
Definition: combotst.c:138
struct tagNMHDR * LPNMHDR
VOID ColumnClick(LPNMLISTVIEW pnmv)
Definition: appview.cpp:1144
VOID OnCommand(WPARAM wParam, LPARAM lParam)
Definition: appview.cpp:1776
UINT code
Definition: winuser.h:3135
#define STATEIMAGETOINDEX(x)
Definition: appview.h:61
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL ItemGetFocus(LPVOID CallbackParam)
Definition: appview.cpp:2042
BOOL CreateHSplitter()
Definition: appview.cpp:1675
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:242
#define TTN_GETDISPINFO
Definition: commctrl.h:1878
UINT uOldState
Definition: commctrl.h:3037
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2307
DWORD AutoSize()
Definition: rosctrls.h:378
#define EM_SETBKGNDCOLOR
Definition: richedit.h:100
struct tagNMITEMACTIVATE * LPNMITEMACTIVATE
BOOL InstallApplication(CAvailableApplicationInfo *Info)
Definition: gui.cpp:781
BOOL ItemCheckStateChanged(BOOL bChecked, LPVOID CallbackParam)
Definition: appview.cpp:2061
#define LPTOOLTIPTEXT
Definition: commctrl.h:1890
HWND GetWindow()
Definition: rosui.h:458
#define WM_SIZE
Definition: winuser.h:1594
CAppsListView * m_ListView
Definition: appview.h:344
BOOL CreateToolbar()
Definition: appview.cpp:1644
#define STATEIMAGE_CHECKED
Definition: appview.h:66
#define COLOR_BTNFACE
Definition: winuser.h:918
VOID OnSize(HWND hwnd, WPARAM wParam, LPARAM lParam)
Definition: appview.cpp:1716
#define WM_COMMAND
Definition: winuser.h:1723
HWND hwndFrom
Definition: winuser.h:3133
CUiAlignment m_VerticalAlignment
Definition: rosui.h:243
BOOL CreateAppInfoDisplay()
Definition: appview.cpp:1700
#define NM_DBLCLK
Definition: commctrl.h:131
#define ID_INSTALL
Definition: resource.h:74
CMainWindow * m_MainWindow
Definition: appview.h:347
struct tagNMLISTVIEW * LPNMLISTVIEW
BOOL CreateSearchBar()
Definition: appview.cpp:1654
#define NM_RCLICK
Definition: commctrl.h:133
CUiSplitPanel * m_HSplitter
Definition: appview.h:346
BOOL CreateListView()
Definition: appview.cpp:1690
#define LVN_COLUMNCLICK
Definition: commctrl.h:3139
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:348
#define WM_CREATE
Definition: winuser.h:1591
LONG bottom
Definition: windef.h:309
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
VOID ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem)
Definition: misc.cpp:44
CMainToolbar * m_Toolbar
Definition: appview.h:341
LPARAM lParam
Definition: commctrl.h:3040
#define LVIF_STATE
Definition: commctrl.h:2312
CUiMargin m_Margin
Definition: rosui.h:240
LPARAM lParam
Definition: combotst.c:139
#define LVIS_FOCUSED
Definition: commctrl.h:2318
CUiWindow< CComboBox > * m_ComboBox
Definition: appview.h:342
#define WM_NOTIFY
Definition: richedit.h:61
CUiPanel * m_Panel
Definition: appview.h:340

◆ SetDisplayAppType()

BOOL CApplicationView::SetDisplayAppType ( APPLICATION_VIEW_TYPE  AppType)

Definition at line 1941 of file appview.cpp.

1942 {
1943  if (!m_ListView->SetDisplayAppType(AppType))
1944  {
1945  return FALSE;
1946  }
1947  ApplicationViewType = AppType;
1949 
1950  HMENU hMenu = ::GetMenu(m_hWnd);
1951  switch (AppType)
1952  {
1953  case AppViewTypeEmpty:
1954  default:
1959 
1960  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_REGREMOVE, TRUE);
1961  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_INSTALL, FALSE);
1962  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_UNINSTALL, TRUE);
1963  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_MODIFY, TRUE);
1964  break;
1965 
1971 
1972  // TODO: instead of disable these button, I would rather remove them.
1973  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_REGREMOVE, TRUE);
1974  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_INSTALL, FALSE);
1975  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_UNINSTALL, TRUE);
1976  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_MODIFY, TRUE);
1977  break;
1978 
1984 
1985  // TODO: instead of disable these button, I would rather remove them.
1986  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_REGREMOVE, FALSE);
1987  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_INSTALL, TRUE);
1988  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_UNINSTALL, FALSE);
1989  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_MODIFY, FALSE);
1990  break;
1991  }
1992  return TRUE;
1993 }
#define ID_REGREMOVE
Definition: resource.h:83
#define TRUE
Definition: types.h:120
#define ID_UNINSTALL
Definition: resource.h:75
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define FALSE
Definition: types.h:117
#define TB_ENABLEBUTTON
Definition: commctrl.h:1042
BOOL SetDisplayAppType(APPLICATION_VIEW_TYPE AppType)
Definition: appview.cpp:1325
#define MF_ENABLED
Definition: winuser.h:128
CAppsListView * m_ListView
Definition: appview.h:344
VOID SetWelcomeText()
Definition: appview.cpp:1079
#define ID_INSTALL
Definition: resource.h:74
APPLICATION_VIEW_TYPE ApplicationViewType
Definition: appview.h:348
CMainToolbar * m_Toolbar
Definition: appview.h:341
#define MF_GRAYED
Definition: winuser.h:129
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define ID_MODIFY
Definition: resource.h:78
CAppInfoDisplay * m_AppsInfo
Definition: appview.h:345

Referenced by CMainWindow::UpdateApplicationsList().

◆ SetRedraw()

void CApplicationView::SetRedraw ( BOOL  bRedraw)

Definition at line 1710 of file appview.cpp.

1711 {
1712  CWindow::SetRedraw(bRedraw);
1713  m_ListView->SetRedraw(bRedraw);
1714 }
void SetRedraw(BOOL redraw)
Definition: rosctrls.h:27
CAppsListView * m_ListView
Definition: appview.h:344

Referenced by CMainWindow::UpdateApplicationsList().

Member Data Documentation

◆ ApplicationViewType

APPLICATION_VIEW_TYPE CApplicationView::ApplicationViewType = AppViewTypeEmpty
private

◆ m_AppsInfo

CAppInfoDisplay* CApplicationView::m_AppsInfo = NULL
private

◆ m_ComboBox

CUiWindow<CComboBox>* CApplicationView::m_ComboBox = NULL
private

◆ m_HSplitter

CUiSplitPanel* CApplicationView::m_HSplitter = NULL
private

◆ m_ListView

◆ m_MainWindow

CMainWindow* CApplicationView::m_MainWindow = NULL
private

Definition at line 347 of file appview.h.

Referenced by ItemCheckStateChanged(), OnCommand(), and ProcessWindowMessage().

◆ m_Panel

CUiPanel* CApplicationView::m_Panel = NULL
private

Definition at line 340 of file appview.h.

Referenced by CreateHSplitter(), CreateToolbar(), OnSize(), and ProcessWindowMessage().

◆ m_SearchBar

CUiWindow<CSearchBar>* CApplicationView::m_SearchBar = NULL
private

◆ m_Toolbar


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