// MultiLangRibbonView.cpp // // (c)1998-2025 Codejock Software, All Rights Reserved. // // THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE // RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN // CONSENT OF CODEJOCK SOFTWARE. // // THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED // IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO // YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A // SINGLE COMPUTER. // // CONTACT INFORMATION: // support@codejock.com // http://www.codejock.com // ///////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "MultiLangRibbon.h" #include "MultiLangRibbonDoc.h" #include "CntrItem.h" #include "MultiLangRibbonView.h" #include "WorkspaceView.h" #ifdef _DEBUG # define new DEBUG_NEW # undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CMultiLangRibbonView IMPLEMENT_DYNCREATE(CMultiLangRibbonView, CScrollRichEditViewEx) BEGIN_MESSAGE_MAP(CMultiLangRibbonView, CScrollRichEditViewEx) //{{AFX_MSG_MAP(CMultiLangRibbonView) // NOTE - the ClassWizard will add and remove mapping macros here. // DO NOT EDIT what you see in these blocks of generated code! ON_WM_DESTROY() //}}AFX_MSG_MAP // Standard printing commands ON_COMMAND(ID_FILE_PRINT, CScrollRichEditViewEx::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_DIRECT, CScrollRichEditViewEx::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_PREVIEW, CScrollRichEditViewEx::OnFilePrintPreview) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CMultiLangRibbonView construction/destruction CMultiLangRibbonView::CMultiLangRibbonView() { // TODO: add construction code here } CMultiLangRibbonView::~CMultiLangRibbonView() { } BOOL CMultiLangRibbonView::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs cs.dwExStyle &= ~WS_EX_CLIENTEDGE; return CScrollRichEditViewEx::PreCreateWindow(cs); } void CMultiLangRibbonView::OnInitialUpdate() { CScrollRichEditViewEx::OnInitialUpdate(); // Set the printing margins (720 twips = 1/2 inch). SetMargins(CRect(720, 720, 720, 720)); static BOOL bLoadOnce = FALSE; if (!bLoadOnce && GetDocument()->GetPathName().IsEmpty()) { bLoadOnce = TRUE; HINSTANCE hInstance = AfxGetInstanceHandle(); LPCTSTR lpszResourceName = _T("FEEDBACK.RTF"); LPCTSTR lpszResourceType = _T("RTF"); HRSRC hRsrc = ::FindResource(hInstance, lpszResourceName, lpszResourceType); if (hRsrc == NULL) return; HGLOBAL hGlobal = LoadResource(hInstance, hRsrc); if (hGlobal == NULL) return; LPCSTR pData = (LPCSTR)LockResource(hGlobal); if (pData == NULL) return; DWORD dwSize = (DWORD)SizeofResource(hInstance, hRsrc); if (dwSize == 0) return; CMemFile memRTF((BYTE*)pData, dwSize, 0); CArchive ar(&memRTF, CArchive::load | CArchive::bNoFlushOnDelete | CArchive::bNoByteSwap); Serialize(ar); GetDocument()->SetModifiedFlag(FALSE); } } ///////////////////////////////////////////////////////////////////////////// // CMultiLangRibbonView printing BOOL CMultiLangRibbonView::OnPreparePrinting(CPrintInfo* pInfo) { // default preparation return DoPreparePrinting(pInfo); } void CMultiLangRibbonView::OnDestroy() { // Deactivate the item on destruction; this is important // when a splitter view is being used. CScrollRichEditViewEx::OnDestroy(); } ///////////////////////////////////////////////////////////////////////////// // CMultiLangRibbonView diagnostics #ifdef _DEBUG void CMultiLangRibbonView::AssertValid() const { CScrollRichEditViewEx::AssertValid(); } void CMultiLangRibbonView::Dump(CDumpContext& dc) const { CScrollRichEditViewEx::Dump(dc); } CMultiLangRibbonDoc* CMultiLangRibbonView::GetDocument() // non-debug version is inline { _ASSERTE(m_pDocument->IsKindOf(RUNTIME_CLASS(CMultiLangRibbonDoc))); return (CMultiLangRibbonDoc*)m_pDocument; } #endif //_DEBUG CRect CMultiLangRibbonView::GetParentViewRect() { return ((CWorkspaceView*)GetParent())->GetViewRect(CXTPClientRect(GetParent())); } CScrollBar* CMultiLangRibbonView::GetParentScrollbar(int nBar) const { if (nBar != SB_VERT) return NULL; if (!AfxGetMainWnd()) return NULL; return &((CWorkspaceView*)GetParent())->m_wndScrollBar[nBar]; } COLORREF CMultiLangRibbonView::GetFrameColor() { return GetXtremeColor(COLOR_ACTIVEBORDER); } ///////////////////////////////////////////////////////////////////////////// // CMultiLangRibbonView message handlers