ReactOS  0.4.15-dev-3302-ga37d9a4
CAppInfoDisplay Class Reference

#include <appview.h>

Inheritance diagram for CAppInfoDisplay:
Collaboration diagram for CAppInfoDisplay:

Public Member Functions

HWND Create (HWND hwndParent)
 
BOOL ShowAvailableAppInfo (CAvailableApplicationInfo *Info)
 
BOOL ShowInstalledAppInfo (CInstalledApplicationInfo *Info)
 
VOID SetWelcomeText ()
 
VOID OnCommand (WPARAM wParam, LPARAM lParam)
 
 ~CAppInfoDisplay ()
 
- Public Member Functions inherited from CUiWindow< CWindowImpl< CAppInfoDisplay > >
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 ()
 

Static Public Member Functions

static ATL::CWndClassInfoGetWndClassInfo ()
 

Public Attributes

CAppRichEditRichEdit = NULL
 
CAppScrnshotPreviewScrnshotPrev = NULL
 
- Public Attributes inherited from CUiBox
CUiMargin m_Margin
 
CUiAlignment m_HorizontalAlignment
 
CUiAlignment m_VerticalAlignment
 

Private Member Functions

BOOL ProcessWindowMessage (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
 
VOID ResizeChildren ()
 
VOID ResizeChildren (int Width, int Height)
 
VOID OnLink (ENLINK *Link)
 

Private Attributes

LPWSTR pLink = NULL
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ ~CAppInfoDisplay()

CAppInfoDisplay::~CAppInfoDisplay ( )

Definition at line 1108 of file appview.cpp.

1109 {
1110  delete RichEdit;
1111  delete ScrnshotPrev;
1112 }
CAppScrnshotPreview * ScrnshotPrev
Definition: appview.h:187
CAppRichEdit * RichEdit
Definition: appview.h:186

Member Function Documentation

◆ Create()

HWND CAppInfoDisplay::Create ( HWND  hwndParent)

Definition at line 1050 of file appview.cpp.

1051 {
1052  RECT r = { 0,0,0,0 };
1053 
1055 }
#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
static HWND hwndParent
Definition: cryptui.c:300
static const WCHAR L[]
Definition: oid.c:1250
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by CApplicationView::CreateAppInfoDisplay().

◆ GetWndClassInfo()

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

Definition at line 1026 of file appview.cpp.

1027 {
1028  DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
1029  static ATL::CWndClassInfo wc =
1030  {
1031  {
1032  sizeof(WNDCLASSEX),
1033  csStyle,
1034  StartWindowProc,
1035  0,
1036  0,
1037  NULL,
1038  NULL,
1039  NULL,
1040  (HBRUSH)(COLOR_BTNFACE + 1),
1041  NULL,
1042  L"RAppsAppInfo",
1043  NULL
1044  },
1045  NULL, NULL, IDC_ARROW, TRUE, 0, _T("")
1046  };
1047  return wc;
1048 }
#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

◆ OnCommand()

VOID CAppInfoDisplay::OnCommand ( WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1086 of file appview.cpp.

1087 {
1088  WORD wCommand = LOWORD(wParam);
1089 
1090  switch (wCommand)
1091  {
1092  case ID_OPEN_LINK:
1093 
1094  ShellExecuteW(m_hWnd, L"open", pLink, NULL, NULL, SW_SHOWNOACTIVATE);
1095  HeapFree(GetProcessHeap(), 0, pLink);
1096  pLink = NULL;
1097  break;
1098 
1099  case ID_COPY_LINK:
1101  HeapFree(GetProcessHeap(), 0, pLink);
1102  pLink = NULL;
1103  break;
1104 
1105  }
1106 }
#define SW_SHOWNOACTIVATE
Definition: winuser.h:768
WPARAM wParam
Definition: combotst.c:138
LPWSTR pLink
Definition: appview.h:173
#define GetProcessHeap()
Definition: compat.h:595
unsigned short WORD
Definition: ntddk_ex.h:93
#define ID_COPY_LINK
Definition: resource.h:80
static const WCHAR L[]
Definition: oid.c:1250
VOID CopyTextToClipboard(LPCWSTR lpszText)
Definition: misc.cpp:18
#define NULL
Definition: types.h:112
#define ID_OPEN_LINK
Definition: resource.h:79
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2274
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by ProcessWindowMessage().

◆ OnLink()

VOID CAppInfoDisplay::OnLink ( ENLINK Link)
private

Definition at line 999 of file appview.cpp.

1000 {
1001  switch (Link->msg)
1002  {
1003  case WM_LBUTTONUP:
1004  case WM_RBUTTONUP:
1005  {
1006  if (pLink) HeapFree(GetProcessHeap(), 0, pLink);
1007 
1009  (max(Link->chrg.cpMin, Link->chrg.cpMax) -
1010  min(Link->chrg.cpMin, Link->chrg.cpMax) + 1) * sizeof(WCHAR));
1011  if (!pLink)
1012  {
1013  /* TODO: Error message */
1014  return;
1015  }
1016 
1017  RichEdit->SendMessageW(EM_SETSEL, Link->chrg.cpMin, Link->chrg.cpMax);
1018  RichEdit->SendMessageW(EM_GETSELTEXT, 0, (LPARAM)pLink);
1019 
1020  ShowPopupMenuEx(m_hWnd, m_hWnd, IDR_LINKMENU, -1);
1021  }
1022  break;
1023  }
1024 }
#define max(a, b)
Definition: svc.c:63
static int Link(const char **args)
Definition: vfdcmd.c:2414
LONG_PTR LPARAM
Definition: windef.h:208
LPWSTR pLink
Definition: appview.h:173
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define EM_SETSEL
Definition: winuser.h:2001
#define WM_RBUTTONUP
Definition: winuser.h:1763
#define WM_LBUTTONUP
Definition: winuser.h:1760
#define min(a, b)
Definition: monoChain.cc:55
#define IDR_LINKMENU
Definition: resource.h:69
CAppRichEdit * RichEdit
Definition: appview.h:186
VOID ShowPopupMenuEx(HWND hwnd, HWND hwndOwner, UINT MenuID, UINT DefaultItem)
Definition: misc.cpp:44
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define EM_GETSELTEXT
Definition: richedit.h:95
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by ProcessWindowMessage().

◆ ProcessWindowMessage()

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

Definition at line 893 of file appview.cpp.

894 {
895  theResult = 0;
896  switch (message)
897  {
898  case WM_CREATE:
899  {
900  RichEdit = new CAppRichEdit();
901  RichEdit->Create(hwnd);
902 
905  break;
906  }
907  case WM_SIZE:
908  {
910  break;
911  }
913  {
914  ResizeChildren();
915  break;
916  }
917  case WM_COMMAND:
918  {
920  break;
921  }
922  case WM_NOTIFY:
923  {
924  NMHDR *NotifyHeader = (NMHDR *)lParam;
925  if (NotifyHeader->hwndFrom == RichEdit->m_hWnd)
926  {
927  switch (NotifyHeader->code)
928  {
929  case EN_LINK:
930  OnLink((ENLINK *)lParam);
931  break;
932  }
933  }
934  break;
935  }
936  }
937 
938  return FALSE;
939 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: tftpd.h:59
CAppScrnshotPreview * ScrnshotPrev
Definition: appview.h:187
#define GET_X_LPARAM(lp)
Definition: windowsx.h:274
HWND Create(HWND hParent)
Definition: appview.cpp:762
WPARAM wParam
Definition: combotst.c:138
UINT code
Definition: winuser.h:3135
#define FALSE
Definition: types.h:117
VOID ResizeChildren()
Definition: appview.cpp:941
VOID OnLink(ENLINK *Link)
Definition: appview.cpp:999
#define WM_SIZE
Definition: winuser.h:1594
HWND Create(HWND hwndParent)
Definition: crichedit.h:95
#define WM_COMMAND
Definition: winuser.h:1723
HWND hwndFrom
Definition: winuser.h:3133
#define EN_LINK
Definition: richedit.h:202
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:275
CAppRichEdit * RichEdit
Definition: appview.h:186
#define WM_CREATE
Definition: winuser.h:1591
#define WM_RAPPS_RESIZE_CHILDREN
Definition: appview.h:42
LPARAM lParam
Definition: combotst.c:139
#define WM_NOTIFY
Definition: richedit.h:61
VOID OnCommand(WPARAM wParam, LPARAM lParam)
Definition: appview.cpp:1086

◆ ResizeChildren() [1/2]

VOID CAppInfoDisplay::ResizeChildren ( )
private

Definition at line 941 of file appview.cpp.

942 {
943  CRect rect;
945  ResizeChildren(rect.Width(), rect.Height());
946 }
& rect
Definition: startmenu.cpp:1413
VOID ResizeChildren()
Definition: appview.cpp:941
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

Referenced by ProcessWindowMessage(), SetWelcomeText(), ShowAvailableAppInfo(), and ShowInstalledAppInfo().

◆ ResizeChildren() [2/2]

VOID CAppInfoDisplay::ResizeChildren ( int  Width,
int  Height 
)
private

Definition at line 948 of file appview.cpp.

949 {
950  int ScrnshotWidth = ScrnshotPrev->GetRequestedWidth(Height);
951 
952  // make sure richedit always have room to display
953  ScrnshotWidth = min(ScrnshotWidth, Width - INFO_DISPLAY_PADDING - RICHEDIT_MIN_WIDTH);
954 
955  DWORD dwError = ERROR_SUCCESS;
956  HDWP hDwp = BeginDeferWindowPos(2);
957 
958  if (hDwp)
959  {
960  hDwp = ::DeferWindowPos(hDwp, ScrnshotPrev->m_hWnd, NULL,
961  0, 0, ScrnshotWidth, Height, 0);
962 
963  if (hDwp)
964  {
965  // hide the padding if scrnshot window width == 0
966  int RicheditPosX = ScrnshotWidth ? (ScrnshotWidth + INFO_DISPLAY_PADDING) : 0;
967 
968  hDwp = ::DeferWindowPos(hDwp, RichEdit->m_hWnd, NULL,
969  RicheditPosX, 0, Width - RicheditPosX, Height, 0);
970 
971  if (hDwp)
972  {
973  EndDeferWindowPos(hDwp);
974  }
975  else
976  {
977  dwError = GetLastError();
978  }
979  }
980  else
981  {
982  dwError = GetLastError();
983  }
984  }
985  else
986  {
987  dwError = GetLastError();
988  }
989 
990 
991 #if DBG
992  ATLASSERT(dwError == ERROR_SUCCESS);
993 #endif
994  UNREFERENCED_PARAMETER(dwError);
995 
996  UpdateWindow();
997 }
HDWP WINAPI BeginDeferWindowPos(_In_ int)
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
CAppScrnshotPreview * ScrnshotPrev
Definition: appview.h:187
BOOL WINAPI UpdateWindow(_In_ HWND)
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define RICHEDIT_MIN_WIDTH
Definition: appview.h:35
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
#define INFO_DISPLAY_PADDING
Definition: appview.h:32
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND m_hWnd
Definition: atlwin.h:268
#define min(a, b)
Definition: monoChain.cc:55
#define NULL
Definition: types.h:112
CAppRichEdit * RichEdit
Definition: appview.h:186
int GetRequestedWidth(int Height)
Definition: appview.cpp:860

◆ SetWelcomeText()

VOID CAppInfoDisplay::SetWelcomeText ( )

Definition at line 1079 of file appview.cpp.

1080 {
1082  ResizeChildren();
1084 }
CAppScrnshotPreview * ScrnshotPrev
Definition: appview.h:187
VOID SetWelcomeText()
Definition: appview.cpp:423
VOID ResizeChildren()
Definition: appview.cpp:941
CAppRichEdit * RichEdit
Definition: appview.h:186

Referenced by CApplicationView::ItemGetFocus(), and CApplicationView::SetDisplayAppType().

◆ ShowAvailableAppInfo()

BOOL CAppInfoDisplay::ShowAvailableAppInfo ( CAvailableApplicationInfo Info)

Definition at line 1057 of file appview.cpp.

1058 {
1059  ATL::CStringW ScrnshotLocation;
1060  if (Info->RetrieveScrnshot(0, ScrnshotLocation))
1061  {
1062  ScrnshotPrev->DisplayImage(ScrnshotLocation);
1063  }
1064  else
1065  {
1067  }
1068  ResizeChildren();
1070 }
CAppScrnshotPreview * ScrnshotPrev
Definition: appview.h:187
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
VOID ResizeChildren()
Definition: appview.cpp:941
BOOL DisplayImage(LPCWSTR lpszLocation)
Definition: appview.cpp:800
BOOL ShowAvailableAppInfo(CAvailableApplicationInfo *Info)
Definition: appview.cpp:368
CAppRichEdit * RichEdit
Definition: appview.h:186

Referenced by CApplicationView::ItemGetFocus().

◆ ShowInstalledAppInfo()

BOOL CAppInfoDisplay::ShowInstalledAppInfo ( CInstalledApplicationInfo Info)

Definition at line 1072 of file appview.cpp.

1073 {
1075  ResizeChildren();
1077 }
BOOL ShowInstalledAppInfo(CInstalledApplicationInfo *Info)
Definition: appview.cpp:394
CAppScrnshotPreview * ScrnshotPrev
Definition: appview.h:187
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
VOID ResizeChildren()
Definition: appview.cpp:941
CAppRichEdit * RichEdit
Definition: appview.h:186

Referenced by CApplicationView::ItemGetFocus().

Member Data Documentation

◆ pLink

LPWSTR CAppInfoDisplay::pLink = NULL
private

Definition at line 173 of file appview.h.

Referenced by OnCommand(), and OnLink().

◆ RichEdit

◆ ScrnshotPrev


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