2 // TortoiseGitBlame.cpp : Defines the class behaviors for the application.
6 #include "afxwinappex.h"
7 #include "TortoiseGitBlame.h"
10 #include "TortoiseGitBlameDoc.h"
11 #include "TortoiseGitBlameView.h"
12 #include "CmdLineParser.h"
19 // CTortoiseGitBlameApp
21 BEGIN_MESSAGE_MAP(CTortoiseGitBlameApp
, CWinAppEx
)
22 ON_COMMAND(ID_APP_ABOUT
, &CTortoiseGitBlameApp::OnAppAbout
)
23 // Standard file based document commands
24 ON_COMMAND(ID_FILE_NEW
, &CWinAppEx::OnFileNew
)
25 ON_COMMAND(ID_FILE_OPEN
, &CWinAppEx::OnFileOpen
)
26 // Standard print setup command
27 ON_COMMAND(ID_FILE_PRINT_SETUP
, &CWinAppEx::OnFilePrintSetup
)
31 // CTortoiseGitBlameApp construction
33 CTortoiseGitBlameApp::CTortoiseGitBlameApp()
38 m_bHiColorIcons
= TRUE
;
40 // TODO: add construction code here,
41 // Place all significant initialization in InitInstance
44 // The one and only CTortoiseGitBlameApp object
46 CTortoiseGitBlameApp theApp
;
49 // CTortoiseGitBlameApp initialization
51 BOOL
CTortoiseGitBlameApp::InitInstance()
53 // InitCommonControlsEx() is required on Windows XP if an application
54 // manifest specifies use of ComCtl32.dll version 6 or later to enable
55 // visual styles. Otherwise, any window creation will fail.
56 INITCOMMONCONTROLSEX InitCtrls
;
57 InitCtrls
.dwSize
= sizeof(InitCtrls
);
58 // Set this to include all the common control classes you want to use
59 // in your application.
60 InitCtrls
.dwICC
= ICC_WIN95_CLASSES
;
61 InitCommonControlsEx(&InitCtrls
);
63 CWinAppEx::InitInstance();
65 // Initialize OLE libraries
68 AfxMessageBox(IDP_OLE_INIT_FAILED
);
71 AfxEnableControlContainer();
72 // Standard initialization
73 // If you are not using these features and wish to reduce the size
74 // of your final executable, you should remove from the following
75 // the specific initialization routines you do not need
76 // Change the registry key under which our settings are stored
77 // TODO: You should modify this string to be something appropriate
78 // such as the name of your company or organization
79 SetRegistryKey(_T("Local AppWizard-Generated Applications"));
80 LoadStdProfileSettings(4); // Load standard INI file options (including MRU)
82 InitContextMenuManager();
84 InitKeyboardManager();
87 CMFCToolTipInfo ttParams
;
88 ttParams
.m_bVislManagerTheme
= TRUE
;
89 theApp
.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL
,
90 RUNTIME_CLASS(CMFCToolTipCtrl
), &ttParams
);
92 // Register the application's document templates. Document templates
93 // serve as the connection between documents, frame windows and views
94 CSingleDocTemplate
* pDocTemplate
;
95 pDocTemplate
= new CSingleDocTemplate(
96 IDR_TORTOISE_GIT_BLAME_MAINFRAME
,
97 RUNTIME_CLASS(CTortoiseGitBlameDoc
),
98 RUNTIME_CLASS(CMainFrame
), // main SDI frame window
99 RUNTIME_CLASS(CTortoiseGitBlameView
));
102 AddDocTemplate(pDocTemplate
);
106 // Parse command line for standard shell commands, DDE, file open
107 CCommandLineInfo cmdInfo
;
108 ParseCommandLine(cmdInfo
);
110 // Dispatch commands specified on the command line. Will return FALSE if
111 // app was launched with /RegServer, /Register, /Unregserver or /Unregister.
112 if (!ProcessShellCommand(cmdInfo
))
115 // The one and only window has been initialized, so show and update it
116 m_pMainWnd
->ShowWindow(SW_SHOW
);
117 m_pMainWnd
->UpdateWindow();
118 // call DragAcceptFiles only if there's a suffix
119 // In an SDI app, this should occur after ProcessShellCommand
125 // CAboutDlg dialog used for App About
127 class CAboutDlg
: public CDialog
133 enum { IDD
= IDD_ABOUTBOX
};
136 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
140 DECLARE_MESSAGE_MAP()
143 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD
)
147 void CAboutDlg::DoDataExchange(CDataExchange
* pDX
)
149 CDialog::DoDataExchange(pDX
);
152 BEGIN_MESSAGE_MAP(CAboutDlg
, CDialog
)
155 // App command to run the dialog
156 void CTortoiseGitBlameApp::OnAppAbout()
162 // CTortoiseGitBlameApp customization load/save methods
164 void CTortoiseGitBlameApp::PreLoadState()
168 bNameValid
= strName
.LoadString(IDS_EDIT_MENU
);
170 GetContextMenuManager()->AddMenu(strName
, IDR_POPUP_EDIT
);
173 void CTortoiseGitBlameApp::LoadCustomState()
177 void CTortoiseGitBlameApp::SaveCustomState()
181 // CTortoiseGitBlameApp message handlers