[Monodevelop-patches-list] r887 - trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Commands
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Fri Feb 13 20:01:06 EST 2004
Author: jluke
Date: 2004-02-13 20:01:06 -0500 (Fri, 13 Feb 2004)
New Revision: 887
Modified:
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Commands/ToolCommands.cs
Log:
set TransientFor, hide/dispose right, remove leading FF
still broken, and should be in Gui/Dialogs not Commands
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Commands/ToolCommands.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Commands/ToolCommands.cs 2004-02-14 00:33:32 UTC (rev 886)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Commands/ToolCommands.cs 2004-02-14 01:01:06 UTC (rev 887)
@@ -7,21 +7,11 @@
using System;
using System.IO;
-using System.Threading;
-using System.Drawing;
-using System.Drawing.Printing;
-using System.Collections;
-using System.ComponentModel;
-using System.Diagnostics;
using System.Text;
-using System.Xml;
-using System.Xml.Xsl;
using ICSharpCode.Core.AddIns;
-
using ICSharpCode.Core.Properties;
using ICSharpCode.Core.AddIns.Codons;
-
using ICSharpCode.SharpDevelop.Gui.Dialogs;
using ICSharpCode.TextEditor;
using ICSharpCode.SharpDevelop.Gui;
@@ -36,10 +26,11 @@
{
public class ColorDialog : ColorSelectionDialog
{
- public ColorDialog () : base ("DON'T use this dialog it DOESN'T work correctly")
+ public ColorDialog () : base ("WARNING BROKEN: Insert a color")
{
this.ColorSelection.HasPalette = true;
this.ColorSelection.HasOpacityControl = false;
+ this.TransientFor = (Window) WorkbenchSingleton.Workbench;
}
public string ColorStr ()
@@ -50,7 +41,7 @@
// debug line
// Console.WriteLine("r {0}, b {1}, g{2}", color.red, color.green, color.blue );
char[] hexchars = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
- s.Append ("#FF");
+ s.Append ("#");
foreach (ushort val in vals) {
/* Convert to a range of 0-255, then lookup the
* digit for each half-byte */
@@ -77,12 +68,14 @@
//FIXME:
// - The return sting value is not the same choosen in the Dialog
// - Return color name (not color value) if it IsKnownColor but it's still not implemented for System.Drawing.Color
- using (ColorDialog dialog = new ColorDialog ()) {
- if (dialog.Run () != (int) ResponseType.Ok)
- return;
-
+ ColorDialog dialog = new ColorDialog ();
+ if (dialog.Run () == (int) ResponseType.Ok)
+ {
w.InsertAtCursor (dialog.ColorStr ());
}
+
+ dialog.Hide ();
+ dialog.Dispose ();
}
}
More information about the Monodevelop-patches-list
mailing list