ReactOS  0.4.15-dev-1384-g878186b
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 1105 of file appview.cpp.

1106 {
1107  delete RichEdit;
1108  delete ScrnshotPrev;
1109 }
CAppScrnshotPreview * ScrnshotPrev
Definition: appview.h:187
CAppRichEdit * RichEdit
Definition: appview.h:186

Member Function Documentation

◆ Create()

HWND CAppInfoDisplay::Create ( HWND  hwndParent)

Definition at line 1047 of file appview.cpp.

1048 {
1049  RECT r = { 0,0,0,0 };
1050 
1052 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
_In_ BOOLEAN Create
Definition: pstypes.h:519
#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 1023 of file appview.cpp.

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

◆ OnCommand()

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

Definition at line 1083 of file appview.cpp.

1084 {
1085  WORD wCommand = LOWORD(wParam);
1086 
1087  switch (wCommand)
1088  {
1089  case ID_OPEN_LINK:
1090 
1091  ShellExecuteW(m_hWnd, L"open", pLink, NULL, NULL, SW_SHOWNOACTIVATE);
1092  HeapFree(GetProcessHeap(), 0, pLink);
1093  pLink = NULL;
1094  break;
1095 
1096  case ID_COPY_LINK:
1098  HeapFree(GetProcessHeap(), 0, pLink);
1099  pLink = NULL;
1100  break;
1101 
1102  }
1103 }
#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:50
#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 996 of file appview.cpp.

997 {
998  switch (Link->msg)
999  {
1000  case WM_LBUTTONUP:
1001  case WM_RBUTTONUP:
1002  {
1003  if (pLink) HeapFree(GetProcessHeap(), 0, pLink);
1004 
1006  (max(Link->chrg.cpMin, Link->chrg.cpMax) -
1007  min(Link->chrg.cpMin, Link->chrg.cpMax) + 1) * sizeof(WCHAR));
1008  if (!pLink)
1009  {
1010  /* TODO: Error message */
1011  return;
1012  }
1013 
1014  RichEdit->SendMessageW(EM_SETSEL, Link->chrg.cpMin, Link->chrg.cpMax);
1015  RichEdit->SendMessageW(EM_GETSELTEXT, 0, (LPARAM)pLink);
1016 
1017  ShowPopupMenuEx(m_hWnd, m_hWnd, IDR_LINKMENU, -1);
1018  }
1019  break;
1020  }
1021 }
#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:2000
#define WM_RBUTTONUP
Definition: winuser.h:1762
#define WM_LBUTTONUP
Definition: winuser.h:1759
#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:76
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 891 of file appview.cpp.

892 {
893  theResult = 0;
894  switch (message)
895  {
896  case WM_CREATE:
897  {
898  RichEdit = new CAppRichEdit();
899  RichEdit->Create(hwnd);
900 
903  break;
904  }
905  case WM_SIZE:
906  {
908  break;
909  }
911  {
912  ResizeChildren();
913  break;
914  }
915  case WM_COMMAND:
916  {
918  break;
919  }
920  case WM_NOTIFY:
921  {
922  NMHDR *NotifyHeader = (NMHDR *)lParam;
923  if (NotifyHeader->hwndFrom == RichEdit->m_hWnd)
924  {
925  switch (NotifyHeader->code)
926  {
927  case EN_LINK:
928  OnLink((ENLINK *)lParam);
929  break;
930  }
931  }
932  break;
933  }
934  }
935 
936  return FALSE;
937 }
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:760
WPARAM wParam
Definition: combotst.c:138
UINT code
Definition: winuser.h:3134
#define FALSE
Definition: types.h:117
VOID ResizeChildren()
Definition: appview.cpp:939
VOID OnLink(ENLINK *Link)
Definition: appview.cpp:996
#define WM_SIZE
Definition: winuser.h:1593
HWND Create(HWND hwndParent)
Definition: crichedit.h:95
#define WM_COMMAND
Definition: winuser.h:1722
HWND hwndFrom
Definition: winuser.h:3132
#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:1590
#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:1083

◆ ResizeChildren() [1/2]

VOID CAppInfoDisplay::ResizeChildren ( )
private

Definition at line 939 of file appview.cpp.

940 {
941  CRect rect;
943  ResizeChildren(rect.Width(), rect.Height());
944 }
& rect
Definition: startmenu.cpp:1413
VOID ResizeChildren()
Definition: appview.cpp:939
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 946 of file appview.cpp.

947 {
948  int ScrnshotWidth = ScrnshotPrev->GetRequestedWidth(Height);
949 
950  // make sure richedit always have room to display
951  ScrnshotWidth = min(ScrnshotWidth, Width - INFO_DISPLAY_PADDING - RICHEDIT_MIN_WIDTH);
952 
953  DWORD dwError = ERROR_SUCCESS;
954  HDWP hDwp = BeginDeferWindowPos(2);
955 
956  if (hDwp)
957  {
958  hDwp = ::DeferWindowPos(hDwp, ScrnshotPrev->m_hWnd, NULL,
959  0, 0, ScrnshotWidth, Height, 0);
960 
961  if (hDwp)
962  {
963  // hide the padding if scrnshot window width == 0
964  int RicheditPosX = ScrnshotWidth ? (ScrnshotWidth + INFO_DISPLAY_PADDING) : 0;
965 
966  hDwp = ::DeferWindowPos(hDwp, RichEdit->m_hWnd, NULL,
967  RicheditPosX, 0, Width - RicheditPosX, Height, 0);
968 
969  if (hDwp)
970  {
971  EndDeferWindowPos(hDwp);
972  }
973  else
974  {
975  dwError = GetLastError();
976  }
977  }
978  else
979  {
980  dwError = GetLastError();
981  }
982  }
983  else
984  {
985  dwError = GetLastError();
986  }
987 
988 
989 #if DBG
990  ATLASSERT(dwError == ERROR_SUCCESS);
991 #endif
992 
993  UpdateWindow();
994 }
HDWP WINAPI BeginDeferWindowPos(_In_ int)
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
CAppScrnshotPreview * ScrnshotPrev
Definition: appview.h:187
BOOL WINAPI UpdateWindow(_In_ HWND)
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
#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:858

◆ SetWelcomeText()

VOID CAppInfoDisplay::SetWelcomeText ( )

Definition at line 1076 of file appview.cpp.

1077 {
1079  ResizeChildren();
1081 }
CAppScrnshotPreview * ScrnshotPrev
Definition: appview.h:187
VOID SetWelcomeText()
Definition: appview.cpp:421
VOID ResizeChildren()
Definition: appview.cpp:939
CAppRichEdit * RichEdit
Definition: appview.h:186

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

◆ ShowAvailableAppInfo()

BOOL CAppInfoDisplay::ShowAvailableAppInfo ( CAvailableApplicationInfo Info)

Definition at line 1054 of file appview.cpp.

1055 {
1056  ATL::CStringW ScrnshotLocation;
1057  if (Info->RetrieveScrnshot(0, ScrnshotLocation))
1058  {
1059  ScrnshotPrev->DisplayImage(ScrnshotLocation);
1060  }
1061  else
1062  {
1064  }
1065  ResizeChildren();
1067 }
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:939
BOOL DisplayImage(LPCWSTR lpszLocation)
Definition: appview.cpp:798
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 1069 of file appview.cpp.

1070 {
1072  ResizeChildren();
1074 }
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:939
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: