/* * $Id$ * Copyright (C) 2011 gingko - http://gingko.homeip.net/ * * This file is part of Pouchin TV Mod, a free DVB-T viewer. * See http://www.pouchintv.fr/ for updates. * * Pouchin TV Mod is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Pouchin TV Mod is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #pragma once #define LZMA_HELP 1 #include #include "dlgutils.h" // ==================================================================================== #define SC_0 0 //!< Identifiant pour le template de surclassement /// Boîte de dialogue "Aide" class CHelpDialogBase : public CModelessDialogPatBase, public WinSubClass { struct HelpTEMPLATE { DLGTEMPLATEEX<0, 0, 4, 12> dlg; DLGITEMTEMPLATEEX<11, 0, 0> it1; DLGITEMTEMPLATEEX<1, 2, 0> it2; }; struct ResReader : #if LZMA_HELP public ByteVector #else public RawResource #endif { MemRng sMm; DWORD ESCallback(LPBYTE pbBuff, LONG cb, LONG *pcb); static DWORD CALLBACK ESCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) { return reinterpret_cast(dwCookie)->ESCallback(pbBuff, cb, pcb); } /// Extraction et décompression de la ressource d'aide bool Extraction(UINT idRessource); }; enum ItemsId { eIDC_HELPTEXT = 1000 }; static struct HelpTEMPLATE sDlgTmpl; tstring strDlgTitle; UINT idRtfResource; HINSTANCE hRichEdit; HWND hRtfCtl; DlgResizingHelper cResizingHelper; virtual LRESULT SubProc(WinSubClass & sc, UINT uMsg, WPARAM wParam, LPARAM lParam) { if (uMsg==EM_SETSEL) return 0; return sc.CallWindowProc(uMsg, wParam, lParam); } /// Traitement des messages de la boîte de dialogue virtual INT_PTR DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam); public: /// Constructeur : CHelpDialogBase(LPCTSTR pszTitle, UINT idRtfRes) : CModelessDialogPatBase(reinterpret_cast(&sDlgTmpl)), strDlgTitle(pszTitle), idRtfResource(idRtfRes), hRichEdit(LoadLibrary(_T("riched20.dll"))), hRtfCtl(NULL) { } ~CHelpDialogBase() { FreeLibrary(hRichEdit); } }; // ====================================================================================