OSDN Git Service

Add SCI Edit to GitBlameView
authorFrank Li <lznuaa@gmail.com>
Sat, 10 Jan 2009 15:36:05 +0000 (23:36 +0800)
committerFrank Li <lznuaa@gmail.com>
Sat, 10 Jan 2009 15:36:05 +0000 (23:36 +0800)
src/TortoiseGit.sln
src/TortoiseGitBlame/TortoiseGitBlame.vcproj
src/TortoiseGitBlame/TortoiseGitBlameView.cpp
src/TortoiseGitBlame/TortoiseGitBlameView.h
src/TortoiseProc/TortoiseProc.vcproj

index ac0d900..5506657 100644 (file)
@@ -45,6 +45,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TortoiseGitBlame", "Tortois
                {A2C38606-3D96-4A2C-B5C5-22CEAC523B37} = {A2C38606-3D96-4A2C-B5C5-22CEAC523B37}\r
                {13BC1836-2726-45C4-9249-5BA2BBBF8328} = {13BC1836-2726-45C4-9249-5BA2BBBF8328}\r
                {A5498556-CE09-4095-8335-08FC8370552D} = {A5498556-CE09-4095-8335-08FC8370552D}\r
+               {12E5B4AE-D7EF-4A57-A22D-6F9F9D8CE1FB} = {12E5B4AE-D7EF-4A57-A22D-6F9F9D8CE1FB}\r
                {7CA5B1EB-8CC9-40A6-96D8-83649C1A870B} = {7CA5B1EB-8CC9-40A6-96D8-83649C1A870B}\r
        EndProjectSection\r
 EndProject\r
index e14f5e5..768e873 100644 (file)
@@ -45,7 +45,7 @@
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               AdditionalIncludeDirectories="..\..\ext\scintilla\include;..\Utils"\r
+                               AdditionalIncludeDirectories="..\Git;..\TortoiseProc;..\..\ext\scintilla\include;..\Utils;..\Utils\MiscUI;..\..\ext\hunspell"\r
                                PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG"\r
                                MinimalRebuild="true"\r
                                BasicRuntimeChecks="3"\r
@@ -68,7 +68,9 @@
                        />\r
                        <Tool\r
                                Name="VCLinkerTool"\r
+                               AdditionalDependencies="Crypt32.lib gdiplus.lib shfolder.lib shell32.lib comctl32.lib ws2_32.lib rpcrt4.lib shlwapi.lib wininet.lib version.lib"\r
                                LinkIncremental="2"\r
+                               IgnoreDefaultLibraryNames="LIBCMTD"\r
                                GenerateDebugInformation="true"\r
                                SubSystem="2"\r
                                TargetMachine="1"\r
                                Name="VCCLCompilerTool"\r
                                Optimization="2"\r
                                EnableIntrinsicFunctions="true"\r
-                               AdditionalIncludeDirectories="..\..\ext\scintilla\include;..\Utils"\r
+                               AdditionalIncludeDirectories="..\Git;..\TortoiseProc;..\..\ext\scintilla\include;..\Utils;..\Utils\MiscUI;..\..\ext\hunspell"\r
                                PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG"\r
                                MinimalRebuild="false"\r
                                RuntimeLibrary="2"\r
                        />\r
                        <Tool\r
                                Name="VCLinkerTool"\r
+                               AdditionalDependencies="Crypt32.lib gdiplus.lib shfolder.lib shell32.lib comctl32.lib ws2_32.lib rpcrt4.lib shlwapi.lib wininet.lib version.lib"\r
                                LinkIncremental="1"\r
                                GenerateDebugInformation="true"\r
                                SubSystem="2"\r
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\Utils\MiscUI\SciEdit.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\Utils\MiscUI\SciEdit.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath=".\stdafx.cpp"\r
                                >\r
                                <FileConfiguration\r
index fcfc14a..e79f41b 100644 (file)
@@ -39,6 +39,8 @@ BEGIN_MESSAGE_MAP(CTortoiseGitBlameView, CView)
        ON_COMMAND(ID_FILE_PRINT, &CView::OnFilePrint)\r
        ON_COMMAND(ID_FILE_PRINT_DIRECT, &CView::OnFilePrint)\r
        ON_COMMAND(ID_FILE_PRINT_PREVIEW, &CTortoiseGitBlameView::OnFilePrintPreview)\r
+       ON_WM_CREATE()\r
+       ON_WM_SIZE()\r
 END_MESSAGE_MAP()\r
 \r
 // CTortoiseGitBlameView construction/destruction\r
@@ -55,7 +57,7 @@ CTortoiseGitBlameView::CTortoiseGitBlameView()
 \r
        m_font = 0;\r
        m_italicfont = 0;\r
-       m_blamewidth = 0;\r
+       m_blamewidth = 100;\r
        m_revwidth = 0;\r
        m_datewidth = 0;\r
        m_authorwidth = 0;\r
@@ -91,7 +93,35 @@ CTortoiseGitBlameView::~CTortoiseGitBlameView()
 }\r
 \r
 \r
+int CTortoiseGitBlameView::OnCreate(LPCREATESTRUCT lpcs)\r
+{\r
 \r
+       CRect rect,rect1;\r
+       this->GetWindowRect(&rect1);\r
+       rect.left=m_blamewidth;\r
+       rect.right=rect.Width();\r
+       rect.top=0;\r
+       rect.bottom=rect.Height();\r
+       BOOL b=m_TextView.Create(_T("Scintilla"),_T("source"),0,rect,this,0,0);\r
+       m_TextView.Init(0);\r
+       m_TextView.ShowWindow( SW_SHOW);\r
+       //m_TextView.InsertText(_T("Abdadfasdf"));\r
+        \r
+       return CView::OnCreate(lpcs);\r
+}\r
+\r
+void CTortoiseGitBlameView::OnSize(UINT nType,int cx, int cy)\r
+{\r
+\r
+       CRect rect;\r
+       rect.left=m_blamewidth;\r
+       rect.right=cx;\r
+       rect.top=0;\r
+       rect.bottom=cy;\r
+\r
+       m_TextView.MoveWindow(&rect);\r
+\r
+}\r
 BOOL CTortoiseGitBlameView::PreCreateWindow(CREATESTRUCT& cs)\r
 {\r
        // TODO: Modify the Window class or styles here by modifying\r
index a3944da..1e07abe 100644 (file)
@@ -8,6 +8,7 @@
 #include "Scintilla.h"\r
 #include "SciLexer.h"\r
 #include "registry.h"\r
+#include "SciEdit.h"\r
 \r
 \r
 const COLORREF black = RGB(0,0,0);\r
@@ -71,9 +72,15 @@ protected:
        afx_msg void OnFilePrintPreview();\r
        afx_msg void OnRButtonUp(UINT nFlags, CPoint point);\r
        afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);\r
+       afx_msg int OnCreate(LPCREATESTRUCT lpcs);\r
+       afx_msg void OnSize(UINT nType, int cx, int cy);\r
+\r
        DECLARE_MESSAGE_MAP()\r
 \r
 public:\r
+\r
+       CSciEdit                        m_TextView;\r
+\r
        HINSTANCE hInstance;\r
        HINSTANCE hResource;\r
        HWND currentDialog;\r
index aad8a5a..128b60b 100644 (file)
                                        RelativePath=".\AppUtils.cpp"\r
                                        >\r
                                </File>\r
-                               <File\r
-                                       RelativePath=".\Colors.cpp"\r
-                                       >\r
-                               </File>\r
                        </Filter>\r
                        <Filter\r
                                Name="UI"\r
                                >\r
                                <File\r
+                                       RelativePath=".\Colors.cpp"\r
+                                       >\r
+                               </File>\r
+                               <File\r
                                        RelativePath="..\Utils\MiscUI\SciEdit.cpp"\r
                                        >\r
                                </File>\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\explorer.ico"\r
+                               RelativePath="..\Resources\explorer.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\explorer.ico"\r
+                               RelativePath=".\explorer.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\newfolder.ico"\r
+                               RelativePath="..\Resources\newfolder.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\newfolder.ico"\r
+                               RelativePath=".\newfolder.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\open.ico"\r
+                               RelativePath="..\Resources\open.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\open.ico"\r
+                               RelativePath=".\open.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\save.ico"\r
+                               RelativePath="..\Resources\save.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\save.ico"\r
+                               RelativePath=".\save.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\saveas.ico"\r
+                               RelativePath="..\Resources\saveas.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\saveas.ico"\r
+                               RelativePath=".\saveas.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\up.ico"\r
+                               RelativePath="..\Resources\up.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\up.ico"\r
+                               RelativePath=".\up.ico"\r
                                >\r
                        </File>\r
                        <File\r