comparison kdiff3/src/kreplacements/ShellContextMenu.cpp @ 70:5bbfe4784324

KDiff3 0.9.89 for Qt4
author joachim99
date Tue, 18 Apr 2006 20:19:57 +0000
parents 8febbfb1148c
children
comparison
equal deleted inserted replaced
69:8febbfb1148c 70:5bbfe4784324
7 #include <malloc.h> 7 #include <malloc.h>
8 #include <qstring.h> 8 #include <qstring.h>
9 #include <qstringlist.h> 9 #include <qstringlist.h>
10 #include <qwidget.h> 10 #include <qwidget.h>
11 #include <qdir.h> 11 #include <qdir.h>
12 #include <qpopupmenu.h> 12 #include <QMenu>
13 #include "ShellContextMenu.h" 13 #include "ShellContextMenu.h"
14 14
15 #ifdef _DEBUG 15 #ifdef _DEBUG
16 #undef THIS_FILE 16 #undef THIS_FILE
17 static char THIS_FILE[]=__FILE__; 17 static char THIS_FILE[]=__FILE__;
24 24
25 #define MIN_ID 100 25 #define MIN_ID 100
26 #define MAX_ID 10000 26 #define MAX_ID 10000
27 27
28 28
29 void showShellContextMenu( const QString& itemPath, QPoint pt, QWidget* pParentWidget, QPopupMenu* pMenu ) 29 void showShellContextMenu( const QString& itemPath, QPoint pt, QWidget* pParentWidget, QMenu* pMenu )
30 { 30 {
31 CShellContextMenu scm; 31 CShellContextMenu scm;
32 scm.SetObjects(QDir::convertSeparators(itemPath)); 32 scm.SetObjects(QDir::convertSeparators(itemPath));
33 int id = scm.ShowContextMenu (pParentWidget, pt, pMenu); 33 int id = scm.ShowContextMenu (pParentWidget, pt, pMenu);
34 if (id>=1) 34 if (id>=1)
125 // call original WndProc of window to prevent undefined bevhaviour of window 125 // call original WndProc of window to prevent undefined bevhaviour of window
126 return ::CallWindowProc ((WNDPROC) GetProp ( hWnd, TEXT ("OldWndProc")), hWnd, message, wParam, lParam); 126 return ::CallWindowProc ((WNDPROC) GetProp ( hWnd, TEXT ("OldWndProc")), hWnd, message, wParam, lParam);
127 } 127 }
128 128
129 129
130 UINT CShellContextMenu::ShowContextMenu(QWidget * pParentWidget, QPoint pt, QPopupMenu* pMenu ) 130 UINT CShellContextMenu::ShowContextMenu(QWidget * pParentWidget, QPoint pt, QMenu* pMenu )
131 { 131 {
132 HWND hWnd = pParentWidget->winId(); 132 HWND hWnd = pParentWidget->winId();
133 int iMenuType = 0; // to know which version of IContextMenu is supported 133 int iMenuType = 0; // to know which version of IContextMenu is supported
134 LPCONTEXTMENU pContextMenu; // common pointer to IContextMenu and higher version interface 134 LPCONTEXTMENU pContextMenu; // common pointer to IContextMenu and higher version interface
135 135