ReactOS  0.4.14-dev-583-g2a1ba2c
CAppRichEdit Class Reference
Inheritance diagram for CAppRichEdit:
Collaboration diagram for CAppRichEdit:

Public Member Functions

BOOL ShowAvailableAppInfo (CAvailableApplicationInfo *Info)
 
BOOL ShowInstalledAppInfo (PINSTALLED_INFO Info)
 
VOID SetWelcomeText ()
 
- Public Member Functions inherited from CUiWindow< CRichEdit >
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 ()
 
- Public Member Functions inherited from CRichEdit
 CRichEdit ()
 
VOID SetRangeFormatting (SIZE_T Start, SIZE_T End, DWORD dwEffects)
 
LONG GetTextLen ()
 
VOID InsertText (LPCWSTR lpszText, DWORD dwEffects)
 
VOID InsertText (const ATL::CStringW &szText, DWORD dwEffects)
 
VOID SetText (LPCWSTR lpszText, DWORD dwEffects)
 
VOID SetText (const ATL::CStringW &szText, DWORD dwEffects)
 
HWND Create (HWND hwndParent)
 
virtual VOID OnLink (ENLINK *Link)
 
 ~CRichEdit ()
 

Private Member Functions

VOID LoadAndInsertText (UINT uStringID, const ATL::CStringW &szText, DWORD StringFlags, DWORD TextFlags)
 
VOID LoadAndInsertText (UINT uStringID, DWORD StringFlags)
 
VOID InsertVersionInfo (CAvailableApplicationInfo *Info)
 
VOID InsertLicenseInfo (CAvailableApplicationInfo *Info)
 
VOID InsertLanguageInfo (CAvailableApplicationInfo *Info)
 

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 56 of file gui.cpp.

Member Function Documentation

◆ InsertLanguageInfo()

VOID CAppRichEdit::InsertLanguageInfo ( CAvailableApplicationInfo Info)
inlineprivate

Definition at line 134 of file gui.cpp.

135  {
136  if (!Info->HasLanguageInfo())
137  {
138  return;
139  }
140 
141  const INT nTranslations = Info->m_LanguageLCIDs.GetSize();
142  ATL::CStringW szLangInfo;
143  ATL::CStringW szLoadedTextAvailability;
144  ATL::CStringW szLoadedAInfoText;
145 
146  szLoadedAInfoText.LoadStringW(IDS_AINFO_LANGUAGES);
147 
148  if (Info->HasNativeLanguage())
149  {
150  szLoadedTextAvailability.LoadStringW(IDS_LANGUAGE_AVAILABLE_TRANSLATION);
151  if (nTranslations > 1)
152  {
154  buf.LoadStringW(IDS_LANGUAGE_MORE_PLACEHOLDER);
155  szLangInfo.Format(buf, nTranslations - 1);
156  }
157  else
158  {
159  szLangInfo.LoadStringW(IDS_LANGUAGE_SINGLE);
160  szLangInfo = L" (" + szLangInfo + L")";
161  }
162  }
163  else if (Info->HasEnglishLanguage())
164  {
165  szLoadedTextAvailability.LoadStringW(IDS_LANGUAGE_ENGLISH_TRANSLATION);
166  if (nTranslations > 1)
167  {
170  szLangInfo.Format(buf, nTranslations - 1);
171  }
172  else
173  {
174  szLangInfo.LoadStringW(IDS_LANGUAGE_SINGLE);
175  szLangInfo = L" (" + szLangInfo + L")";
176  }
177  }
178  else
179  {
180  szLoadedTextAvailability.LoadStringW(IDS_LANGUAGE_NO_TRANSLATION);
181  }
182 
183  InsertText(szLoadedAInfoText, CFE_BOLD);
184  InsertText(szLoadedTextAvailability, NULL);
185  InsertText(szLangInfo, CFE_ITALIC);
186  }
#define IDS_LANGUAGE_SINGLE
Definition: resource.h:201
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:668
int32_t INT
Definition: typedefs.h:56
struct TraceInfo Info
#define CFE_BOLD
Definition: richedit.h:406
smooth NULL
Definition: ftsmooth.c:416
#define IDS_AINFO_LANGUAGES
Definition: resource.h:158
#define IDS_LANGUAGE_AVAILABLE_TRANSLATION
Definition: resource.h:198
static const WCHAR L[]
Definition: oid.c:1250
#define CFE_ITALIC
Definition: richedit.h:407
VOID InsertText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:72
#define IDS_LANGUAGE_AVAILABLE_PLACEHOLDER
Definition: resource.h:203
#define IDS_LANGUAGE_MORE_PLACEHOLDER
Definition: resource.h:202
#define IDS_LANGUAGE_NO_TRANSLATION
Definition: resource.h:199
#define IDS_LANGUAGE_ENGLISH_TRANSLATION
Definition: resource.h:200

Referenced by ShowAvailableAppInfo().

◆ InsertLicenseInfo()

VOID CAppRichEdit::InsertLicenseInfo ( CAvailableApplicationInfo Info)
inlineprivate

Definition at line 111 of file gui.cpp.

112  {
113  ATL::CStringW szLicense;
114  switch (Info->m_LicenseType)
115  {
116  case LICENSE_OPENSOURCE:
117  szLicense.LoadStringW(IDS_LICENSE_OPENSOURCE);
118  break;
119  case LICENSE_FREEWARE:
120  szLicense.LoadStringW(IDS_LICENSE_FREEWARE);
121  break;
122  case LICENSE_TRIAL:
123  szLicense.LoadStringW(IDS_LICENSE_TRIAL);
124  break;
125  default:
127  return;
128  }
129 
130  szLicense += L" (" + Info->m_szLicense + L")";
132  }
#define IDS_AINFO_LICENSE
Definition: resource.h:155
struct TraceInfo Info
#define CFE_BOLD
Definition: richedit.h:406
static const WCHAR L[]
Definition: oid.c:1250
#define IDS_LICENSE_FREEWARE
Definition: resource.h:194
#define IDS_LICENSE_TRIAL
Definition: resource.h:195
VOID LoadAndInsertText(UINT uStringID, const ATL::CStringW &szText, DWORD StringFlags, DWORD TextFlags)
Definition: gui.cpp:60
#define IDS_LICENSE_OPENSOURCE
Definition: resource.h:193

Referenced by ShowAvailableAppInfo().

◆ InsertVersionInfo()

VOID CAppRichEdit::InsertVersionInfo ( CAvailableApplicationInfo Info)
inlineprivate

Definition at line 85 of file gui.cpp.

86  {
87  if (Info->IsInstalled())
88  {
89  if (Info->HasInstalledVersion())
90  {
91  if (Info->HasUpdate())
93  else
95 
96  LoadAndInsertText(IDS_AINFO_VERSION, Info->m_szInstalledVersion, CFE_BOLD, 0);
97  }
98  else
99  {
101  }
102  }
103  else
104  {
106  }
107 
109  }
#define IDS_AINFO_VERSION
Definition: resource.h:151
#define IDS_STATUS_INSTALLED
Definition: resource.h:183
#define IDS_AINFO_AVAILABLEVERSION
Definition: resource.h:157
struct TraceInfo Info
#define CFE_BOLD
Definition: richedit.h:406
#define IDS_STATUS_UPDATE_AVAILABLE
Definition: resource.h:186
#define IDS_STATUS_NOTINSTALLED
Definition: resource.h:184
#define CFE_ITALIC
Definition: richedit.h:407
VOID LoadAndInsertText(UINT uStringID, const ATL::CStringW &szText, DWORD StringFlags, DWORD TextFlags)
Definition: gui.cpp:60

Referenced by ShowAvailableAppInfo().

◆ LoadAndInsertText() [1/2]

VOID CAppRichEdit::LoadAndInsertText ( UINT  uStringID,
const ATL::CStringW szText,
DWORD  StringFlags,
DWORD  TextFlags 
)
inlineprivate

Definition at line 60 of file gui.cpp.

64  {
65  ATL::CStringW szLoadedText;
66  if (!szText.IsEmpty() && szLoadedText.LoadStringW(uStringID))
67  {
68  InsertText(szLoadedText, StringFlags);
69  InsertText(szText, TextFlags);
70  }
71  }
static const WCHAR szText[]
Definition: dialog.c:139
VOID InsertText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:72

Referenced by InsertLicenseInfo(), InsertVersionInfo(), and ShowAvailableAppInfo().

◆ LoadAndInsertText() [2/2]

VOID CAppRichEdit::LoadAndInsertText ( UINT  uStringID,
DWORD  StringFlags 
)
inlineprivate

Definition at line 73 of file gui.cpp.

75  {
76  ATL::CStringW szLoadedText;
77  if (szLoadedText.LoadStringW(uStringID))
78  {
79  InsertText(L"\n", 0);
80  InsertText(szLoadedText, StringFlags);
81  InsertText(L"\n", 0);
82  }
83  }
static const WCHAR L[]
Definition: oid.c:1250
VOID InsertText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:72

◆ SetWelcomeText()

VOID CAppRichEdit::SetWelcomeText ( )
inline

Definition at line 245 of file gui.cpp.

246  {
248 
249  szText.LoadStringW(IDS_WELCOME_TITLE);
251 
252  szText.LoadStringW(IDS_WELCOME_TEXT);
253  InsertText(szText, 0);
254 
255  szText.LoadStringW(IDS_WELCOME_URL);
257  }
#define IDS_WELCOME_TITLE
Definition: resource.h:92
#define IDS_WELCOME_TEXT
Definition: resource.h:93
#define CFE_BOLD
Definition: richedit.h:406
static const WCHAR szText[]
Definition: dialog.c:139
VOID InsertText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:72
#define CFM_LINK
Definition: richedit.h:337
#define IDS_WELCOME_URL
Definition: resource.h:94
VOID SetText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:84

Referenced by CMainWindow::UpdateApplicationsList().

◆ ShowAvailableAppInfo()

BOOL CAppRichEdit::ShowAvailableAppInfo ( CAvailableApplicationInfo Info)
inline

Definition at line 189 of file gui.cpp.

190  {
191  if (!Info) return FALSE;
192 
193  SetText(Info->m_szName, CFE_BOLD);
197 
202 
203  return TRUE;
204  }
#define TRUE
Definition: types.h:120
VOID InsertLicenseInfo(CAvailableApplicationInfo *Info)
Definition: gui.cpp:111
#define IDS_AINFO_URLSITE
Definition: resource.h:154
#define CFE_LINK
Definition: richedit.h:411
struct TraceInfo Info
#define CFE_BOLD
Definition: richedit.h:406
VOID InsertLanguageInfo(CAvailableApplicationInfo *Info)
Definition: gui.cpp:134
VOID InsertVersionInfo(CAvailableApplicationInfo *Info)
Definition: gui.cpp:85
#define IDS_AINFO_SIZE
Definition: resource.h:153
#define IDS_AINFO_URLDOWNLOAD
Definition: resource.h:156
VOID LoadAndInsertText(UINT uStringID, const ATL::CStringW &szText, DWORD StringFlags, DWORD TextFlags)
Definition: gui.cpp:60
#define IDS_AINFO_DESCRIPTION
Definition: resource.h:152
VOID SetText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:84

Referenced by CMainWindow::ShowAppInfo().

◆ ShowInstalledAppInfo()

BOOL CAppRichEdit::ShowInstalledAppInfo ( PINSTALLED_INFO  Info)
inline

Definition at line 206 of file gui.cpp.

207  {
209  ATL::CStringW szInfo;
210 
211  if (!Info || !Info->hSubKey)
212  return FALSE;
213 
214  Info->GetApplicationString(L"DisplayName", szText);
216  InsertText(L"\n", 0);
217 
218 #define GET_INFO(a, b, c, d) \
219  if (Info->GetApplicationString(a, szInfo)) \
220  { \
221  LoadAndInsertText(b, szInfo, c, d); \
222  }
223 
224  GET_INFO(L"DisplayVersion", IDS_INFO_VERSION, CFE_BOLD, 0);
225  GET_INFO(L"Publisher", IDS_INFO_PUBLISHER, CFE_BOLD, 0);
226  GET_INFO(L"RegOwner", IDS_INFO_REGOWNER, CFE_BOLD, 0);
227  GET_INFO(L"ProductID", IDS_INFO_PRODUCTID, CFE_BOLD, 0);
229  GET_INFO(L"HelpTelephone", IDS_INFO_HELPPHONE, CFE_BOLD, 0);
230  GET_INFO(L"Readme", IDS_INFO_README, CFE_BOLD, 0);
231  GET_INFO(L"Contact", IDS_INFO_CONTACT, CFE_BOLD, 0);
232  GET_INFO(L"URLUpdateInfo", IDS_INFO_UPDATEINFO, CFE_BOLD, CFM_LINK);
233  GET_INFO(L"URLInfoAbout", IDS_INFO_INFOABOUT, CFE_BOLD, CFM_LINK);
234  GET_INFO(L"Comments", IDS_INFO_COMMENTS, CFE_BOLD, 0);
235  GET_INFO(L"InstallDate", IDS_INFO_INSTALLDATE, CFE_BOLD, 0);
236  GET_INFO(L"InstallLocation", IDS_INFO_INSTLOCATION, CFE_BOLD, 0);
237  GET_INFO(L"InstallSource", IDS_INFO_INSTALLSRC, CFE_BOLD, 0);
238  GET_INFO(L"UninstallString", IDS_INFO_UNINSTALLSTR, CFE_BOLD, 0);
239  GET_INFO(L"InstallSource", IDS_INFO_INSTALLSRC, CFE_BOLD, 0);
240  GET_INFO(L"ModifyPath", IDS_INFO_MODIFYPATH, CFE_BOLD, 0);
241 
242  return TRUE;
243  }
#define IDS_INFO_INSTALLDATE
Definition: resource.h:148
#define IDS_INFO_PUBLISHER
Definition: resource.h:134
#define TRUE
Definition: types.h:120
#define IDS_INFO_INSTALLSRC
Definition: resource.h:145
#define IDS_INFO_README
Definition: resource.h:137
struct TraceInfo Info
#define CFE_BOLD
Definition: richedit.h:406
#define IDS_INFO_COMMENTS
Definition: resource.h:143
static const WCHAR szText[]
Definition: dialog.c:139
#define IDS_INFO_CONTACT
Definition: resource.h:140
#define IDS_INFO_VERSION
Definition: resource.h:132
static const WCHAR L[]
Definition: oid.c:1250
VOID InsertText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:72
#define CFM_LINK
Definition: richedit.h:337
#define IDS_INFO_UNINSTALLSTR
Definition: resource.h:146
#define IDS_INFO_UPDATEINFO
Definition: resource.h:141
#define IDS_INFO_PRODUCTID
Definition: resource.h:139
#define GET_INFO(a, b, c, d)
#define IDS_INFO_HELPPHONE
Definition: resource.h:136
#define IDS_INFO_MODIFYPATH
Definition: resource.h:147
#define IDS_INFO_INSTLOCATION
Definition: resource.h:144
#define IDS_INFO_HELPLINK
Definition: resource.h:135
#define IDS_INFO_REGOWNER
Definition: resource.h:138
VOID SetText(LPCWSTR lpszText, DWORD dwEffects)
Definition: crichedit.h:84
#define IDS_INFO_INFOABOUT
Definition: resource.h:142

Referenced by CMainWindow::ShowAppInfo().


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