From 46f232a1885f8769acedc4eebbc823bef89a7e5d Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sun, 18 Dec 2005 17:20:37 +0000 Subject: [PATCH] Use IntPtr instead of int in SendMessage P/Invoke declaration. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@913 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- AddIns/ICSharpCode.SharpDevelop.addin | 4 -- .../Project/Src/Gui/Ime.cs | 24 ++++++------ .../Project/ICSharpCode.SharpDevelop.csproj | 4 -- .../Base/Project/Resources/ViewGPLDialog.xfrm | 33 ---------------- .../Base/Project/Src/Commands/HelpCommands.cs | 11 ------ .../Project/Src/Gui/Dialogs/ViewGPLDialog.cs | 39 ------------------- .../CompilerMessageView.cs | 4 +- .../Src/Gui/TreeGrid/DynamicListItem.cs | 6 +-- 8 files changed, 17 insertions(+), 108 deletions(-) delete mode 100644 src/Main/Base/Project/Resources/ViewGPLDialog.xfrm delete mode 100644 src/Main/Base/Project/Src/Gui/Dialogs/ViewGPLDialog.cs diff --git a/AddIns/ICSharpCode.SharpDevelop.addin b/AddIns/ICSharpCode.SharpDevelop.addin index 0c4ae814f2..69de599668 100644 --- a/AddIns/ICSharpCode.SharpDevelop.addin +++ b/AddIns/ICSharpCode.SharpDevelop.addin @@ -1396,10 +1396,6 @@ class = "ICSharpCode.SharpDevelop.Commands.ViewTipOfTheDay" /> - diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/Ime.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/Ime.cs index 42a02566d0..a2c0c4d166 100644 --- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/Ime.cs +++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/Ime.cs @@ -58,9 +58,9 @@ namespace ICSharpCode.TextEditor private static extern IntPtr ImmGetDefaultIMEWnd(IntPtr hWnd); [ DllImport("user32.dll") ] - private static extern int SendMessage(IntPtr hWnd, int msg, int wParam, COMPOSITIONFORM lParam); + private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, COMPOSITIONFORM lParam); [ DllImport("user32.dll") ] - private static extern int SendMessage(IntPtr hWnd, int msg, int wParam, [In, MarshalAs(UnmanagedType.LPStruct)] LOGFONT lParam); + private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, [In, MarshalAs(UnmanagedType.LPStruct)] LOGFONT lParam); [ StructLayout(LayoutKind.Sequential) ] private class COMPOSITIONFORM @@ -123,11 +123,11 @@ namespace ICSharpCode.TextEditor } SendMessage( - hIMEWnd, - WM_IME_CONTROL, - IMC_SETCOMPOSITIONFONT, - lf - ); + hIMEWnd, + WM_IME_CONTROL, + new IntPtr(IMC_SETCOMPOSITIONFONT), + lf + ); } public void SetIMEWindowLocation(int x, int y) @@ -143,11 +143,11 @@ namespace ICSharpCode.TextEditor lParam.rcArea = new RECT(); SendMessage( - hIMEWnd, - WM_IME_CONTROL, - IMC_SETCOMPOSITIONWINDOW, - lParam - ); + hIMEWnd, + WM_IME_CONTROL, + new IntPtr(IMC_SETCOMPOSITIONWINDOW), + lParam + ); } } } diff --git a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj index d397ef4f0d..56bf0b68c2 100644 --- a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj +++ b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj @@ -207,9 +207,6 @@ Form - - Form - Form @@ -485,7 +482,6 @@ - diff --git a/src/Main/Base/Project/Resources/ViewGPLDialog.xfrm b/src/Main/Base/Project/Resources/ViewGPLDialog.xfrm deleted file mode 100644 index 8e46e79af3..0000000000 --- a/src/Main/Base/Project/Resources/ViewGPLDialog.xfrm +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Main/Base/Project/Src/Commands/HelpCommands.cs b/src/Main/Base/Project/Src/Commands/HelpCommands.cs index 16f4df3c26..39e562c3db 100644 --- a/src/Main/Base/Project/Src/Commands/HelpCommands.cs +++ b/src/Main/Base/Project/Src/Commands/HelpCommands.cs @@ -35,17 +35,6 @@ namespace ICSharpCode.SharpDevelop.Commands } } - public class ViewGPL : AbstractMenuCommand - { - public override void Run() - { - using (ViewGPLDialog totdd = new ViewGPLDialog()) { - totdd.Owner = (Form)WorkbenchSingleton.Workbench; - totdd.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm); - } - } - } - public class LinkCommand : AbstractMenuCommand { string site; diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/ViewGPLDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/ViewGPLDialog.cs deleted file mode 100644 index 40369ada31..0000000000 --- a/src/Main/Base/Project/Src/Gui/Dialogs/ViewGPLDialog.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// 2002-2005 AlphaSierraPapa -// GNU General Public License -// -// $Revision$ -// - -using System; -using System.IO; -using System.Drawing; -using System.ComponentModel; -using System.Windows.Forms; -using System.Resources; - -using ICSharpCode.Core; -using ICSharpCode.SharpDevelop.Gui.XmlForms; - -namespace ICSharpCode.SharpDevelop.Gui -{ - public class ViewGPLDialog : BaseSharpDevelopForm - { - public ViewGPLDialog() - { - SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.ViewGPLDialog.xfrm")); - LoadGPL(); - } - - void LoadGPL() - { - string filename = FileUtility.ApplicationRootPath + - Path.DirectorySeparatorChar + "doc" + - Path.DirectorySeparatorChar + "license.txt"; - if (FileUtility.TestFileExists(filename)) { - RichTextBox licenseRichTextBox = (RichTextBox)ControlDictionary["licenseRichTextBox"]; - licenseRichTextBox.LoadFile(filename, RichTextBoxStreamType.PlainText); - } - } - } -} diff --git a/src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs b/src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs index ded8a7f83e..898d119f81 100644 --- a/src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs +++ b/src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs @@ -204,11 +204,11 @@ namespace ICSharpCode.SharpDevelop.Gui [System.Security.SuppressUnmanagedCodeSecurityAttribute] [System.Runtime.InteropServices.DllImport("user32.dll")] - static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, IntPtr lParam); + static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); void SetUpdate(bool update) { - SendMessage(textEditorControl.Handle, WM_SETREDRAW, update ? 1 : 0, IntPtr.Zero); + SendMessage(textEditorControl.Handle, WM_SETREDRAW, update ? new IntPtr(1) : IntPtr.Zero, IntPtr.Zero); } void AppendTextCombined(MessageViewCategory category) diff --git a/src/Main/Base/Project/Src/Gui/TreeGrid/DynamicListItem.cs b/src/Main/Base/Project/Src/Gui/TreeGrid/DynamicListItem.cs index 0ef509934c..7900d1a4f3 100644 --- a/src/Main/Base/Project/Src/Gui/TreeGrid/DynamicListItem.cs +++ b/src/Main/Base/Project/Src/Gui/TreeGrid/DynamicListItem.cs @@ -316,7 +316,7 @@ namespace ICSharpCode.SharpDevelop.Gui.TreeGrid public event EventHandler BeginLabelEdit; public event EventHandler FinishLabelEdit; - public event EventHandler CancelledLabelEdit; + public event EventHandler CanceledLabelEdit; void HandleLabelEditClick(DynamicList list) { @@ -332,8 +332,8 @@ namespace ICSharpCode.SharpDevelop.Gui.TreeGrid if (e2.KeyData == Keys.Enter || e2.KeyData == Keys.Escape) { e2.Handled = true; if (e2.KeyData == Keys.Escape) { - if (CancelledLabelEdit != null) - CancelledLabelEdit(this, new DynamicListEventArgs(list)); + if (CanceledLabelEdit != null) + CanceledLabelEdit(this, new DynamicListEventArgs(list)); escape = true; } this.Control = null;