OSDN Git Service

Move splash screen image to About dialog and remove splash screen
authorsdottaka <sdottaka@users.sourceforge.net>
Sat, 27 Dec 2014 11:21:43 +0000 (20:21 +0900)
committersdottaka <sdottaka@users.sourceforge.net>
Sat, 27 Dec 2014 11:21:43 +0000 (20:21 +0900)
--HG--
branch : stable

16 files changed:
Src/AboutDlg.cpp
Src/AboutDlg.h
Src/MainFrm.cpp
Src/Merge.cpp
Src/Merge.h
Src/Merge.rc
Src/Merge.vcxproj
Src/Merge.vcxproj.filters
Src/OptionsDef.h
Src/OptionsInit.cpp
Src/PropGeneral.cpp
Src/PropGeneral.h
Src/Splash.cpp [deleted file]
Src/Splash.h [deleted file]
Src/res/splash.jpg
Src/resource.h

index 0ccb01c..8404837 100644 (file)
@@ -36,6 +36,8 @@ BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
        //{{AFX_MSG_MAP(CAboutDlg)
        //}}AFX_MSG_MAP
        ON_BN_CLICKED(IDC_OPEN_CONTRIBUTORS, OnBnClickedOpenContributors)
+       ON_WM_DRAWITEM()
+       ON_WM_CTLCOLOR()
 END_MESSAGE_MAP()
 
 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
@@ -56,24 +58,40 @@ void CAboutDlg::DoDataExchange(CDataExchange* pDX)
 /** 
  * @brief Read version info from resource to dialog.
  */
-BOOL CAboutDlg::OnInitDialog() 
+BOOL CAboutDlg::OnInitDialog()
 {
        theApp.TranslateDialog(m_hWnd);
        CDialog::OnInitDialog();
 
-       // Load application icon
-       HICON icon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
-       if (icon != NULL) {
-               CStatic * pIcon = (CStatic *) GetDlgItem(IDC_ABOUTBOX_ICON);
-               pIcon->SetIcon(icon);
-       }
+       m_image.Load(IDR_SPLASH);
+
+       CDC *pDC = GetDC();
+       int fontHeight = -MulDiv(10, pDC->GetDeviceCaps(LOGPIXELSY), 72);
+       m_font.CreateFont(fontHeight, 0, 0, 0, FW_MEDIUM, FALSE, FALSE,
+               0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
+               DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, _T("Tahoma"));
+       ReleaseDC(pDC);
+
+       String text = LoadResString(IDS_SPLASH_DEVELOPERS);
+       string_replace(text, _T(", "), _T("\n"));
+       CWnd *sta = GetDlgItem(IDC_STATIC);
+       sta->SetWindowTextW(text.c_str());
+       sta->SetFont(&m_font);
 
        CVersionInfo version(AfxGetResourceHandle());
        String sVersion = version.GetProductVersion();
        m_strVersion = LangFormatString1(IDS_VERSION_FMT, sVersion.c_str()).c_str();
+       if (m_strVersion.Find(_T(" - ")) != -1)
+       {
+               m_strVersion.Replace(_T(" - "), _T("\n"));
+               m_strVersion += _T(" ");
+       }
+       else
+       {
+               m_strVersion += _T("\n");
+       }
 
 #ifdef _UNICODE
-       m_strVersion += _T(" ");
        m_strVersion += theApp.LoadString(IDS_UNICODE).c_str();
 #endif
 
@@ -85,6 +103,7 @@ BOOL CAboutDlg::OnInitDialog()
        m_strVersion += _T(" ");
        m_strVersion += theApp.LoadString(IDS_WINX64).c_str();
 #endif
+       GetDlgItem(IDC_VERSION)->SetFont(&m_font);
 
        String sPrivateBuild = version.GetPrivateBuild();
        if (!sPrivateBuild.empty())
@@ -93,7 +112,10 @@ BOOL CAboutDlg::OnInitDialog()
                        sPrivateBuild.c_str()).c_str();
        }
 
-       String copyright = version.GetLegalCopyright();
+       String copyright = LoadResString(IDS_SPLASH_GPLTEXT);
+       copyright += _T("\n");
+       copyright += version.GetLegalCopyright();
+       copyright += _T(" All rights reserved.");
        m_ctlCompany.SetWindowText(copyright.c_str());
        m_ctlWWW.m_link = WinMergeURL;
 
@@ -103,6 +125,22 @@ BOOL CAboutDlg::OnInitDialog()
                      // EXCEPTION: OCX Property Pages should return FALSE
 }
 
+HBRUSH CAboutDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
+{
+       if (nCtlColor == CTLCOLOR_STATIC && pWnd != GetDlgItem(IDC_WWW))
+       {
+               pDC->SetBkMode(TRANSPARENT);
+               return (HBRUSH)GetStockObject(NULL_BRUSH);
+       }
+       return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
+}
+
+void CAboutDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
+{
+       CRect rc;
+       GetDlgItem(nIDCtl)->GetClientRect(&rc);
+       m_image.Render(CDC::FromHandle(lpDrawItemStruct->hDC), rc);
+}
 /**
  * @brief Show contributors list.
  * Opens Contributors.txt into notepad.
index b59ea37..a619f8f 100644 (file)
@@ -27,6 +27,7 @@
 #define _ABOUTDLG_H_
 
 #include "statlink.h"
+#include "Picture.h"
 #include "resource.h" // IDD_ABOUTBOX
 
 /** 
@@ -47,6 +48,8 @@ public:
        CStaticLink     m_ctlWWW;
        CString m_strVersion;
        CString m_strPrivateBuild;
+       CPicture m_image;
+       CFont m_font;
        //}}AFX_DATA
 
        // ClassWizard generated virtual function overrides
@@ -63,6 +66,8 @@ protected:
        DECLARE_MESSAGE_MAP()
 public:
        afx_msg void OnBnClickedOpenContributors();
+       afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
+       afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
 };
 
 #endif // _ABOUTDLG_H_
index 3471778..0529d7c 100644 (file)
@@ -50,7 +50,6 @@
 #include "ImgMergeFrm.h"
 #include "LineFiltersList.h"
 #include "ConflictFileParser.h"
-#include "Splash.h"
 #include "LineFiltersDlg.h"
 #include "paths.h"
 #include "Environment.h"
@@ -394,9 +393,6 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
        if (GetOptionsMgr()->GetBool(OPT_SHOW_STATUSBAR) == false)
                CMDIFrameWnd::ShowControlBar(&m_wndStatusBar, false, 0);
 
-       // CG: The following line was added by the Splash Screen component.
-       CSplashWnd::ShowSplashScreen(this);
-
        // Start handling status messages from CustomStatusCursors
        myStatusDisplay.SetFrame(this);
        CustomStatusCursor::SetStatusDisplay(&myStatusDisplay);
index 0fd3143..12b8ad3 100644 (file)
@@ -48,7 +48,6 @@
 #include "MergeDoc.h"
 #include "DirDoc.h"
 #include "DirView.h"
-#include "Splash.h"
 #include "PropBackups.h"
 #include "FileOrFolderSelect.h"
 #include "paths.h"
@@ -360,7 +359,6 @@ BOOL CMergeApp::InitInstance()
        }
 
        LoadStdProfileSettings(8);  // Load standard INI file options (including MRU)
-       BOOL bDisableSplash     = GetOptionsMgr()->GetBool(OPT_DISABLE_SPLASH);
 
        InitializeFileFilters();
 
@@ -410,8 +408,6 @@ BOOL CMergeApp::InitInstance()
 
        m_bMergingMode = GetOptionsMgr()->GetBool(OPT_MERGE_MODE);
 
-       CSplashWnd::EnableSplashScreen(!bDisableSplash && !bCommandLineInvoke);
-
        // Initialize i18n (multiple language) support
 
        m_pLangDlg->InitializeLanguage();
@@ -516,15 +512,6 @@ void CMergeApp::OnAppAbout()
 // CMergeApp commands
 
 
-BOOL CMergeApp::PreTranslateMessage(MSG* pMsg)
-{
-       // CG: The following lines were added by the Splash Screen component.
-       if (CSplashWnd::PreTranslateAppMessage(pMsg))
-               return TRUE;
-
-       return CWinApp::PreTranslateMessage(pMsg);
-}
-
 void CMergeApp::OnViewLanguage() 
 {
        if (m_pLangDlg->DoModal()==IDOK)
index c8cb61a..2dd250e 100644 (file)
@@ -166,7 +166,6 @@ protected:
        virtual BOOL OnIdle(LONG lCount);
        //}}AFX_VIRTUAL
 
-       virtual BOOL PreTranslateMessage(MSG* pMsg);
        void InitializeFileFilters();
        BOOL ParseArgsAndDoOpen(MergeCmdLineInfo& cmdInfo, CMainFrame* pMainFrame);
        void UpdateDefaultCodepage(int cpDefaultMode, int cpCustomCodepage);
index a902c37..7231a03 100644 (file)
@@ -829,22 +829,20 @@ END
 // Dialog
 //
 
-IDD_ABOUTBOX DIALOGEX 0, 0, 223, 124
+IDD_ABOUTBOX DIALOGEX 0, 0, 366, 235
 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
     WS_SYSMENU
 CAPTION "About WinMerge"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    ICON            IDR_MAINFRAME,IDC_ABOUTBOX_ICON,24,14,21,20
-    LTEXT           "WinMerge",IDC_STATIC,63,13,63,8,SS_NOPREFIX
-    LTEXT           "Version 1.0",IDC_VERSION,63,23,153,8,SS_NOPREFIX
-    LTEXT           "(Private Build)",IDC_PRIVATEBUILD,63,33,153,8
-    LTEXT           "All rights reserved.",IDC_STATIC,7,60,170,8
-    LTEXT           "Visit the WinMerge HomePage!",IDC_WWW,7,79,209,8
-    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,95,209,1
-    LTEXT           "[VERSION COPYRIGHT GOES HERE]",IDC_COMPANY,7,49,209,8
-    DEFPUSHBUTTON   "OK",IDOK,166,103,50,14
-    PUSHBUTTON      "Contributors",IDC_OPEN_CONTRIBUTORS,7,103,65,14
+    CONTROL         "",IDC_ABOUTBOX_ICON,"Static",SS_OWNERDRAW,0,0,366,215
+    LTEXT           "",IDC_STATIC,7,60,200,120
+    LTEXT           "Version 1.0",IDC_VERSION,240,153,133,20,SS_NOPREFIX
+    LTEXT           "(Private Build)",IDC_PRIVATEBUILD,240,173,133,8
+    LTEXT           "Visit the WinMerge HomePage!",IDC_WWW,80,220,207,10,SS_CENTER
+    LTEXT           "[VERSION COPYRIGHT GOES HERE]",IDC_COMPANY,7,175,350,40
+    DEFPUSHBUTTON   "OK",IDOK,295,218,65,14
+    PUSHBUTTON      "Contributors",IDC_OPEN_CONTRIBUTORS,7,218,65,14
 END
 
 IDD_OPEN DIALOGEX 0, 0, 460, 260
@@ -936,9 +934,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
     CONTROL         "Automatically &scroll to first difference",
                     IDC_SCROLL_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,
-                    7,220,10
-    CONTROL         "&Disable Splash Screen",IDC_DISABLE_SPLASH,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,7,17,220,10
+                    17,220,10
     CONTROL         "Cl&ose windows with ESC",IDC_ESC_CLOSES_WINDOW,"Button",
                     BS_AUTOCHECKBOX | WS_TABSTOP,7,27,220,10
     CONTROL         "&Automatically verify paths in Open-dialog",
index f12d539..a2292ec 100644 (file)
     </ClCompile>\r
     <ClCompile Include="SourceControl.cpp">\r
     </ClCompile>\r
-    <ClCompile Include="Splash.cpp">\r
-    </ClCompile>\r
     <ClCompile Include="Common\SplitterWndEx.cpp">\r
     </ClCompile>\r
     <ClCompile Include="ssapi.cpp">\r
     <ClInclude Include="Common\ShellFileOperations.h" />\r
     <ClInclude Include="Common\sizecbar.h" />\r
     <ClInclude Include="Common\SortHeaderCtrl.h" />\r
-    <ClInclude Include="Splash.h" />\r
     <ClInclude Include="Common\SplitterWndEx.h" />\r
     <ClInclude Include="ssapi.h" />\r
     <ClInclude Include="Common\StatLink.h" />\r
index 747817f..4be7196 100644 (file)
     <ClCompile Include="Common\DragDrop.cpp">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="Splash.cpp">\r
-      <Filter>MFCGui\Source Files</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="Common\ClipBoard.cpp">\r
       <Filter>Source Files</Filter>\r
     </ClCompile>\r
     <ClInclude Include="Common\SplitterWndEx.h">\r
       <Filter>MFCGui\Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="Splash.h">\r
-      <Filter>MFCGui\Header Files</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="Common\SortHeaderCtrl.h">\r
       <Filter>MFCGui\Header Files</Filter>\r
     </ClInclude>\r
index d396fdb..731d8fa 100644 (file)
@@ -31,7 +31,6 @@ const TCHAR OPT_TOOLBAR_SIZE[] = _T("Settings/ToolbarSize");
 const TCHAR OPT_RESIZE_PANES[] = _T("Settings/AutoResizePanes");
 
 const TCHAR OPT_SYNTAX_HIGHLIGHT[] = _T("Settings/HiliteSyntax");
-const TCHAR OPT_DISABLE_SPLASH[] = _T("Settings/DisableSplash");
 const TCHAR OPT_VIEW_WHITESPACE[] =  _T("Settings/ViewWhitespace");
 const TCHAR OPT_CONNECT_MOVED_BLOCKS[] = _T("Settings/ConnectMovedBlocks");
 const TCHAR OPT_SCROLL_TO_FIRST[] =  _T("Settings/ScrollToFirst");
index 6e95fe1..6366929 100644 (file)
@@ -69,7 +69,6 @@ void CMergeApp::OptionsInit()
        m_pOptions->InitOption(OPT_SYNTAX_HIGHLIGHT, true);
        m_pOptions->InitOption(OPT_WORDWRAP, false);
        m_pOptions->InitOption(OPT_VIEW_LINENUMBERS, false);
-       m_pOptions->InitOption(OPT_DISABLE_SPLASH, false);
        m_pOptions->InitOption(OPT_VIEW_WHITESPACE, false);
        m_pOptions->InitOption(OPT_CONNECT_MOVED_BLOCKS, 0);
        m_pOptions->InitOption(OPT_SCROLL_TO_FIRST, false);
index 70d34be..94cefb7 100644 (file)
@@ -46,7 +46,6 @@ static char THIS_FILE[] = __FILE__;
 PropGeneral::PropGeneral(COptionsMgr *optionsMgr) 
 : OptionsPanel(optionsMgr, PropGeneral::IDD)
 , m_bScroll(FALSE)
-, m_bDisableSplash(FALSE)
 , m_bSingleInstance(FALSE)
 , m_bVerifyPaths(FALSE)
 , m_bCloseWindowWithEsc(TRUE)
@@ -86,7 +85,6 @@ void PropGeneral::DoDataExchange(CDataExchange* pDX)
        CPropertyPage::DoDataExchange(pDX);
        //{{AFX_DATA_MAP(PropGeneral)
        DDX_Check(pDX, IDC_SCROLL_CHECK, m_bScroll);
-       DDX_Check(pDX, IDC_DISABLE_SPLASH, m_bDisableSplash);
        DDX_Check(pDX, IDC_SINGLE_INSTANCE, m_bSingleInstance);
        DDX_Check(pDX, IDC_VERIFY_OPEN_PATHS, m_bVerifyPaths);
        DDX_Check(pDX, IDC_ESC_CLOSES_WINDOW, m_bCloseWindowWithEsc);
@@ -113,7 +111,6 @@ END_MESSAGE_MAP()
 void PropGeneral::ReadOptions()
 {
        m_bScroll = GetOptionsMgr()->GetBool(OPT_SCROLL_TO_FIRST);
-       m_bDisableSplash = GetOptionsMgr()->GetBool(OPT_DISABLE_SPLASH);
        m_bSingleInstance = GetOptionsMgr()->GetBool(OPT_SINGLE_INSTANCE);
        m_bVerifyPaths = GetOptionsMgr()->GetBool(OPT_VERIFY_OPEN_PATHS);
        m_bCloseWindowWithEsc = GetOptionsMgr()->GetBool(OPT_CLOSE_WITH_ESC);
@@ -132,7 +129,6 @@ void PropGeneral::ReadOptions()
 void PropGeneral::WriteOptions()
 {
        GetOptionsMgr()->SaveOption(OPT_SCROLL_TO_FIRST, m_bScroll == TRUE);
-       GetOptionsMgr()->SaveOption(OPT_DISABLE_SPLASH, m_bDisableSplash == TRUE);
        GetOptionsMgr()->SaveOption(OPT_SINGLE_INSTANCE, m_bSingleInstance == TRUE);
        GetOptionsMgr()->SaveOption(OPT_VERIFY_OPEN_PATHS, m_bVerifyPaths == TRUE);
        GetOptionsMgr()->SaveOption(OPT_CLOSE_WITH_ESC, m_bCloseWindowWithEsc == TRUE);
index 58439ea..5c8c452 100644 (file)
@@ -31,7 +31,6 @@ public:
        //{{AFX_DATA(PropGeneral)
        enum { IDD = IDD_PROPPAGE_GENERAL };
        BOOL  m_bScroll;
-       BOOL  m_bDisableSplash;
        BOOL  m_bSingleInstance;
        BOOL  m_bVerifyPaths;
        BOOL  m_bCloseWindowWithEsc;
diff --git a/Src/Splash.cpp b/Src/Splash.cpp
deleted file mode 100644 (file)
index 63607b7..0000000
+++ /dev/null
@@ -1,304 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-//    WinMerge:  an interactive diff/merge utility
-//    Copyright (C) 1997-2000  Thingamahoochie Software
-//    Author: Dean Grimm
-//
-//    This program 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.
-//
-//    This program 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-//
-/////////////////////////////////////////////////////////////////////////////
-/** 
- * @file Src/Splash.cpp
- *
- * @brief Implementation of splashscreen class
- *
- */
-// ID line follows -- this is updated by SVN
-// $Id$
-
-#include "stdafx.h"
-#include "Splash.h"
-#include "UnicodeString.h"
-#include "Picture.h"
-#include "version.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char BASED_CODE THIS_FILE[] = __FILE__;
-#endif
-
-/** 
- * @brief Area for version text in splash image.
- * @note Translations may have language name after version number.
- */
-static const RECT VersionTextArea = { 346, 257, 547, 272 };
-/** @brief Font size for version text. */
-static const UINT VersionTextSize = 9;
-/** @brief Drawing style for version text. */
-static const UINT VersionTextStyle = DT_CENTER | DT_VCENTER;
-
-/** @brief Area for developers list. */
-static const RECT DevelopersArea = { 16, 87, 315, 272 };
-/** @brief Font size for developers list text. */
-static const UINT DevelopersTextSize = 10;
-/** @brief Drawing style for developers list text. */
-static const UINT DevelopersTextStyle = DT_NOPREFIX | DT_TOP;
-
-/** @brief Area for copyright text. */
-static const RECT CopyrightArea = { 10, 284, 539, 339 };
-/** @brief Font size for copyright text. */
-static const UINT CopyrightTextSize = 8;
-/** @brief Drawing style for copyright text. */
-static const UINT CopyrightTextStyle = DT_NOPREFIX | DT_TOP | DT_WORDBREAK;
-
-/** @brief Font used in splash screen texts. */
-static const TCHAR FontName[] = _T("Tahoma");
-
-/** @brief ID for the timer closing splash screen. */
-static const UINT_PTR SplashTimerID = 1;
-
-/////////////////////////////////////////////////////////////////////////////
-//   Splash Screen class
-
-BOOL CSplashWnd::c_bShowSplashWnd;
-CSplashWnd* CSplashWnd::c_pSplashWnd;
-
-/** 
- * @brief Default constructor.
- */
-CSplashWnd::CSplashWnd()
- : m_pPicture(NULL)
-{
-}
-
-/** 
- * @brief Default destructor.
- */
-CSplashWnd::~CSplashWnd()
-{
-       // Clear the static window pointer.
-       ASSERT(c_pSplashWnd == this);
-       c_pSplashWnd = NULL;
-}
-
-BEGIN_MESSAGE_MAP(CSplashWnd, CWnd)
-       //{{AFX_MSG_MAP(CSplashWnd)
-       ON_WM_CREATE()
-       ON_WM_PAINT()
-       ON_WM_TIMER()
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/** 
- * @brief Enables/disables splashscreen.
- */
-void CSplashWnd::EnableSplashScreen(BOOL bEnable /*= TRUE*/)
-{
-       c_bShowSplashWnd = bEnable;
-}
-
-/** 
- * @brief Shows splashscreen.
- */
-void CSplashWnd::ShowSplashScreen(CWnd* pParentWnd /*= NULL*/)
-{
-       if (!c_bShowSplashWnd || c_pSplashWnd != NULL)
-               return;
-
-       // Allocate a new splash screen, and create the window.
-       c_pSplashWnd = new CSplashWnd;
-       if (!c_pSplashWnd->Create(pParentWnd))
-               delete c_pSplashWnd;
-       else
-               c_pSplashWnd->UpdateWindow();
-}
-
-/** 
- * @brief Hide splashscreen after user presses any key.
- */
-BOOL CSplashWnd::PreTranslateAppMessage(MSG* pMsg)
-{
-       if (c_pSplashWnd == NULL)
-               return FALSE;
-
-       // If we get a keyboard or mouse message, hide the splash screen.
-       if (pMsg->message == WM_KEYDOWN ||
-           pMsg->message == WM_SYSKEYDOWN ||
-           pMsg->message == WM_LBUTTONDOWN ||
-           pMsg->message == WM_RBUTTONDOWN ||
-           pMsg->message == WM_MBUTTONDOWN ||
-           pMsg->message == WM_NCLBUTTONDOWN ||
-           pMsg->message == WM_NCRBUTTONDOWN ||
-           pMsg->message == WM_NCMBUTTONDOWN)
-       {
-               c_pSplashWnd->HideSplashScreen();
-               return TRUE;    // message handled here
-       }
-
-       return FALSE;   // message not handled
-}
-
-/** 
- * @brief Loads splashscreen image.
- * Loads splashscreen image from resource and creates window with same size.
- */
-BOOL CSplashWnd::Create(CWnd* pParentWnd /*= NULL*/)
-{
-       if (m_pPicture == NULL)
-               m_pPicture = new CPicture();
-
-       if (m_pPicture == NULL)
-               return FALSE;
-
-       if (!m_pPicture->Load(IDR_SPLASH))
-               return FALSE;
-
-       CSize imgSize = m_pPicture->GetImageSize();
-
-       return CreateEx(0,
-               AfxRegisterWndClass(0, AfxGetApp()->LoadStandardCursor(IDC_ARROW)),
-               NULL, WS_POPUP | WS_VISIBLE, 0, 0, imgSize.cx, imgSize.cy, pParentWnd->GetSafeHwnd(), NULL);
-}
-
-/** 
- * @brief Destroy the window and splash image then update the mainframe.
- */
-void CSplashWnd::HideSplashScreen()
-{
-       KillTimer(SplashTimerID);
-       m_pPicture->Free();
-       delete m_pPicture;
-       m_pPicture = NULL;
-       DestroyWindow();
-       AfxGetMainWnd()->UpdateWindow();
-}
-
-/** 
- * @brief Free the C++ class.
- */
-void CSplashWnd::PostNcDestroy()
-{
-       CWnd::PostNcDestroy();
-       delete this;
-}
-
-/** 
- * @brief Center splash screen and start timer for closing.
- */
-int CSplashWnd::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
-       if (CWnd::OnCreate(lpCreateStruct) == -1)
-               return -1;
-
-       // Center the window.
-       CenterWindow();
-
-       // Set a timer to destroy the splash screen.
-       SetTimer(SplashTimerID, 5000, NULL);
-
-       return 0;
-}
-
-/** 
- * @brief Paint splashscreen.
- * Draws image to window size (which is already set to image size).
- * Then adds texts over image.
- */
-void CSplashWnd::OnPaint()
-{
-       CPaintDC dc(this);
-       m_pPicture->Render(&dc);
-
-       CVersionInfo version(TRUE);
-       String s;
-       CFont versionFont;
-       CFont textFont;
-       CFont copyrightFont;
-       CFont *oldfont = NULL;
-
-       int fontHeight = -MulDiv(VersionTextSize, dc.GetDeviceCaps(LOGPIXELSY), 72);
-       BOOL fontSuccess = versionFont.CreateFont(fontHeight, 0, 0, 0, FW_BOLD, FALSE, FALSE,
-               0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
-               DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, FontName);
-       if (fontSuccess)
-               oldfont = dc.SelectObject(&versionFont);
-
-       CString sVersion = version.GetFixedProductVersion().c_str();
-       s = LangFormatString1(IDS_VERSION_FMT, sVersion);
-       dc.SetBkMode(TRANSPARENT);
-       
-       RECT area = VersionTextArea;
-       dc.DrawText(s.c_str(), &area, VersionTextStyle);
-
-       fontHeight = -MulDiv(DevelopersTextSize, dc.GetDeviceCaps(LOGPIXELSY), 72);
-       fontSuccess = textFont.CreateFont(fontHeight, 0, 0, 0, 0, FALSE, FALSE,
-               0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
-               DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, FontName);
-       if (fontSuccess)
-       {
-               // We already stored oldfont in previous font change
-               if (oldfont == NULL)
-                       oldfont = dc.SelectObject(&textFont);
-               else
-                       dc.SelectObject(&textFont);
-       }
-
-       String text = LoadResString(IDS_SPLASH_DEVELOPERS);
-
-       // avoid dereference of empty strings and the NULL termiated character
-       if (text.length() >= 0)
-       {
-               // Replace ", " with linefeed in developers list text to get
-               // developers listed a name per line in the about dialog
-               std::string::size_type pos = text.rfind(_T(", "));
-               while (pos != std::string::npos)
-               {
-                       text.replace(pos, 2, _T("\n"), 1);
-                       pos = text.rfind(_T(", "), pos - 1);
-               }
-       }
-
-       area = DevelopersArea;
-       dc.DrawText(text.c_str(), &area, DevelopersTextStyle);
-
-       fontHeight = -MulDiv(CopyrightTextSize, dc.GetDeviceCaps(LOGPIXELSY), 72);
-       fontSuccess = copyrightFont.CreateFont(fontHeight, 0, 0, 0, 0, FALSE, FALSE,
-               0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
-               DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, FontName);
-       if (fontSuccess)
-       {
-               // We already stored oldfont in previous font change
-               if (oldfont == NULL)
-                       oldfont = dc.SelectObject(&copyrightFont);
-               else
-                       dc.SelectObject(&copyrightFont);
-       }
-
-       text = LoadResString(IDS_SPLASH_GPLTEXT);
-       area = CopyrightArea;
-       dc.DrawText(text.c_str(), &area, CopyrightTextStyle);
-
-       if (oldfont != NULL)
-               dc.SelectObject(oldfont);
-}
-
-/** 
- * @brief Hide splashscreen after specified time.
- */
-void CSplashWnd::OnTimer(UINT_PTR nIDEvent)
-{
-       // Destroy the splash screen window.
-       HideSplashScreen();
-}
diff --git a/Src/Splash.h b/Src/Splash.h
deleted file mode 100644 (file)
index 4ae2fc1..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-//    WinMerge:  an interactive diff/merge utility
-//    Copyright (C) 1997  Dean P. Grimm
-//
-//    This program 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.
-//
-//    This program 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., 675 Mass Ave, Cambridge, MA 02139, USA.
-//
-/////////////////////////////////////////////////////////////////////////////
-/**
- * @file  Src/Splash.h
- *
- * @brief Declaration file for CSplashWnd
- *
- */
-// RCS ID line follows -- this is updated by CVS
-// $Id$
-
-#ifndef _SPLASH_SCRN_
-#define _SPLASH_SCRN_
-
-class CPicture;
-
-/**
- * @brief Splash screen class.
- * Loads image from resource and shows it as a splash screen
- * at program startup.
- */
-class CSplashWnd : public CWnd
-{
-// Construction
-protected:
-       CSplashWnd();
-
-// Attributes:
-private:
-       CPicture * m_pPicture; /**< Image loader/viewer for splash image */
-
-// Operations
-public:
-       static void EnableSplashScreen(BOOL bEnable = TRUE);
-       static void ShowSplashScreen(CWnd* pParentWnd = NULL);
-       static BOOL PreTranslateAppMessage(MSG* pMsg);
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(CSplashWnd)
-       //}}AFX_VIRTUAL
-
-// Implementation
-public:
-       ~CSplashWnd();
-       virtual void PostNcDestroy();
-
-protected:
-       BOOL Create(CWnd* pParentWnd = NULL);
-       void HideSplashScreen();
-       static BOOL c_bShowSplashWnd;
-       static CSplashWnd* c_pSplashWnd;
-
-// Generated message map functions
-protected:
-       //{{AFX_MSG(CSplashWnd)
-       afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
-       afx_msg void OnPaint();
-       afx_msg void OnTimer(UINT_PTR nIDEvent);
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-
-#endif
index 44aff50..2890838 100644 (file)
Binary files a/Src/res/splash.jpg and b/Src/res/splash.jpg differ
index 0246ba4..0822c92 100644 (file)
 #define IDC_HILITE_CHECK                1019
 #define IDC_IGNOREREGEXP                1020
 #define IDC_EDITPATTERN                 1021
-#define IDC_DISABLE_SPLASH              1023
 #define IDC_ALL_WHITE                   1024
 #define IDC_WHITE_CHANGE                1025
 #define IDC_WHITESPACE                  1026