Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r17 - branches/SOPTIM/src/tsvnWizard.pas

delphiaddinfortortoisesvn
Discussion topic

Back to topic list

svn commit: r17 - branches/SOPTIM/src/tsvnWizard.pas

Author otto_noll
Full name Otto Noll
Date 2008-12-15 08:58:38 PST
Message Author: otto_noll
Date: 2008-12-15 08:58:37-0800
New Revision: 17

Modified:
   branches/SOPTIM/src/​tsvnWizard.pas

Log:
Create Tortoise menu in editor's pop up menu

Modified: branches/SOPTIM/src/​tsvnWizard.pas
Url: http://delphiaddinfo​rtortoisesvn.tigris.​org/source/browse/de​lphiaddinfortortoise​svn/branches/SOPTIM/​src/tsvnWizard.pas?v​iew=diff&pathrev​=17&r1=16&r2​=17
====================​====================​====================​==================
--- branches/SOPTIM/src/​tsvnWizard.pas (original)
+++ branches/SOPTIM/src/​tsvnWizard.pas 2008-12-15 08:58:37-0800
@@ -5,7 +5,7 @@
 interface
 
 uses ToolsAPI, SysUtils, Windows, Dialogs, Menus, Registry, ShellApi,
- Classes, Controls, Graphics, ImgList, ExtCtrls, ActnList;
+ Classes, Controls, Graphics, ImgList, ExtCtrls, ActnList,Forms;
 
 const
     SVN_PROJECT_EXPLORER = 0;
@@ -37,6 +37,7 @@
     procedure CreateMenu;
     procedure UpdateAction( sender: TObject );
     procedure ExecuteAction( sender: TObject );
+ procedure CreatePopupMenu;
 public
     constructor Create;
     destructor Destroy; override;
@@ -105,7 +106,8 @@
 end;
 
 constructor TTortoiseSVN.Create;
-var reg: TRegistry;
+var
+ reg: TRegistry;
 begin
     Reg := TRegistry.Create;
     try
@@ -123,7 +125,6 @@
     timer.interval:= 200;
     timer.OnTimer:= tick;
     timer.enabled:= true;
-
 end;
 
 procedure TTortoiseSVN.Tick( sender: TObject );
@@ -131,6 +132,7 @@
 begin
     if BorlandIDEServices.Q​ueryInterface( INTAServices, intf ) = s_OK then begin
         self.createMenu;
+ self.CreatePopupMenu;
         timer.free;
         timer:= nil;
     end;
@@ -220,11 +222,34 @@
 
         tsvnMenu.add( item );
     end;
-
     mainMenu:= (BorlandIDEServices as INTAServices).MainMenu;
     mainMenu.Items.Insert( mainMenu.Items.Count-1, tsvnMenu );
 end;
 
+procedure TTortoiseSVN.CreatePopupMenu;
+var
+ I: Integer;
+ PMenu: TPopupMenu;
+ MItem,Diff: TMenuItem;
+begin
+ for I := 0 to Screen.FormCount - 1 do
+ begin
+ if Screen.Forms[I].ClassName = 'TEditWindow' then
+ begin
+ PMenu := TPopupMenu(Screen.Fo​rms[I].FindComponent​('EditorLocalMenu'))​;
+ if PMenu <> nil then
+ begin
+ MItem := TMenuItem.Create(PMenu);
+ MItem.Caption := 'TortoiseSVN';
+ MItem.Visible := True;
+ PMenu.Items.Add(MItem);
+ end;
+ end;
+ end;
+end;
+
+
+
 destructor TTortoiseSVN.Destroy;
 begin
     if tsvnMenu <> nil then begin
@@ -414,8 +439,6 @@
 begin
 end;
 
-
-
 {$IFNDEF DLL_MODE}
 
 procedure Register;

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r17 - branches/SOPTIM/src/tsvnWizard.pas otto_noll Otto Noll 2008-12-15 08:58:38 PST
Messages per page: