Author: davidmak
Date: 2006-11-26 15:19:25 -0500 (Sun, 26 Nov 2006)
New Revision: 68484
Added:
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/LayoutComboBox.cs
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog
trunk/monodevelop/Core/src/MonoDevelop.Ide/Makefile.am
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ViewCommands.cs
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.mdp
Log:
2006-11-26 David Makovsk?\195?\189 (Yakeen) <[EMAIL PROTECTED]>
* MonoDevelop.Ide.Gui/LayoutComboBox.cs: added
* MonoDevelop.Ide.Gui/Workbench.cs: defined LayoutChanged event and
firing
* MonoDevelop.Ide.Commands/ViewCommands.cs: added LayoutSelector to
ViewCommands enum
* MonoDevelop.Ide.addin.xml: new LayoutSelector action and added layout
toolbar
* MonoDevelop.Ide/Makefile.am:
* MonoDevelop.Ide/MonoDevelop.Ide.mdp: newly added file
Modified: trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog 2006-11-26
20:07:38 UTC (rev 68483)
+++ trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog 2006-11-26
20:19:25 UTC (rev 68484)
@@ -1,3 +1,12 @@
+2006-11-26 David Makovský (Yakeen) <[EMAIL PROTECTED]>
+
+ * MonoDevelop.Ide.Gui/LayoutComboBox.cs: added
+ * MonoDevelop.Ide.Gui/Workbench.cs: defined LayoutChanged event and
firing
+ * MonoDevelop.Ide.Commands/ViewCommands.cs: added LayoutSelector to
ViewCommands enum
+ * MonoDevelop.Ide.addin.xml: new LayoutSelector action and added layout
toolbar
+ * MonoDevelop.Ide/Makefile.am:
+ * MonoDevelop.Ide/MonoDevelop.Ide.mdp: newly added file
+
2006-11-22 David Makovský (Yakeen) <[EMAIL PROTECTED]>
* MonoDevelop.Ide.Gui.Dialogs/FileSelectorDialog.cs: remember last used
filter
Modified: trunk/monodevelop/Core/src/MonoDevelop.Ide/Makefile.am
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Ide/Makefile.am 2006-11-26
20:07:38 UTC (rev 68483)
+++ trunk/monodevelop/Core/src/MonoDevelop.Ide/Makefile.am 2006-11-26
20:19:25 UTC (rev 68484)
@@ -96,6 +96,7 @@
MonoDevelop.Ide.Gui/ViewCommandHandlers.cs \
MonoDevelop.Ide.Gui/ViewContentCollection.cs \
MonoDevelop.Ide.Gui/WorkbenchWindowCollection.cs \
+MonoDevelop.Ide.Gui/LayoutComboBox.cs \
MonoDevelop.Ide.Gui.BrowserDisplayBinding/BrowserDisplayBinding.cs \
MonoDevelop.Ide.Gui.BrowserDisplayBinding/HtmlViewPane.cs \
MonoDevelop.Ide.Gui.Content/IBookmarkBuffer.cs \
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ViewCommands.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ViewCommands.cs
2006-11-26 20:07:38 UTC (rev 68483)
+++
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ViewCommands.cs
2006-11-26 20:19:25 UTC (rev 68484)
@@ -34,6 +34,7 @@
ResetTreeDisplayOptions,
RefreshTree,
CollapseAllTreeNodes,
+ LayoutSelector,
}
internal class FullScreenHandler: CommandHandler
Added:
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/LayoutComboBox.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/LayoutComboBox.cs
2006-11-26 20:07:38 UTC (rev 68483)
+++
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/LayoutComboBox.cs
2006-11-26 20:19:25 UTC (rev 68484)
@@ -0,0 +1,79 @@
+//
+// LayoutComboBox.cs
+//
+// Author:
+// David Makovský <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 David Makovský
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using MonoDevelop.Ide;
+using Gtk;
+
+namespace MonoDevelop.Ide.Gui
+{
+ internal class LayoutComboBox : Alignment
+ {
+ ComboBox combo;
+ bool changingHere = false;
+
+ public LayoutComboBox ()
+ : base (0.5f, 0.5f, 1.0f, 0f)
+ {
+ LeftPadding = 3;
+ RightPadding = 3;
+ combo = Gtk.ComboBox.NewText ();
+ combo.Changed += new EventHandler (OnComboChanged);
+ Add (combo);
+ ShowAll ();
+
+ IdeApp.Workbench.LayoutChanged += (EventHandler)
Services.DispatchService.GuiDispatch (new EventHandler
(OnConfigurationsChanged));
+ }
+
+ void OnConfigurationsChanged (object sender, EventArgs e)
+ {
+ ((ListStore)combo.Model).Clear ();
+ int active = 0;
+ for (int i = 0; i < IdeApp.Workbench.Layouts.Length;
i++)
+ {
+ combo.AppendText (IdeApp.Workbench.Layouts[i]);
+ if (IdeApp.Workbench.Layouts[i] ==
IdeApp.Workbench.CurrentLayout)
+ active = i;
+ }
+ changingHere = true;
+ combo.Active = active;
+ combo.ShowAll ();
+ }
+
+ void OnComboChanged (object sender, EventArgs e)
+ {
+ if (! changingHere)
+ {
+ TreeIter iter;
+ if (combo.GetActiveIter (out iter))
+ IdeApp.Workbench.CurrentLayout =
(string)combo.Model.GetValue (iter, 0);
+ }
+ changingHere = false;
+ }
+ }
+}
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs
2006-11-26 20:07:38 UTC (rev 68483)
+++ trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs
2006-11-26 20:19:25 UTC (rev 68484)
@@ -56,6 +56,7 @@
IStatusBarService statusBarService;
public event EventHandler ActiveDocumentChanged;
+ public event EventHandler LayoutChanged;
internal void Initialize (IProgressMonitor monitor)
{
@@ -109,6 +110,11 @@
workbench.SetMemento
((IXmlConvertable)Runtime.Properties.GetProperty (workbenchMemento,
workbench.CreateMemento()));
RootWindow.Visible = true;
workbench.Context = WorkbenchContext.Edit;
+
+ // now we have an layout set notify it
+ if (LayoutChanged != null)
+ LayoutChanged (this, EventArgs.Empty);
+
workbench.RedrawAllComponents ();
RootWindow.Present ();
}
@@ -168,7 +174,11 @@
get { return workbench.WorkbenchLayout != null ?
workbench.WorkbenchLayout.CurrentLayout : ""; }
set {
if (value !=
workbench.WorkbenchLayout.CurrentLayout)
- workbench.WorkbenchLayout.CurrentLayout
= value;
+ {
+ workbench.WorkbenchLayout.CurrentLayout
= value;
+ if (LayoutChanged != null)
+ LayoutChanged (this,
EventArgs.Empty);
+ }
}
}
Modified: trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml
2006-11-26 20:07:38 UTC (rev 68483)
+++ trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.addin.xml
2006-11-26 20:19:25 UTC (rev 68484)
@@ -339,15 +339,24 @@
_label = "Layout List" />
<Command id = "MonoDevelop.Ide.Commands.ViewCommands.NewLayout"
defaultHandler =
"MonoDevelop.Ide.Commands.NewLayoutHandler"
- _label = "_New Layout..." />
+ _label = "_New Layout..."
+ icon = "gtk-add"
+ _description = "Create new layout" />
<Command id =
"MonoDevelop.Ide.Commands.ViewCommands.DeleteCurrentLayout"
defaultHandler =
"MonoDevelop.Ide.Commands.DeleteCurrentLayoutHandler"
- _label = "_Delete Current Layout" />
+ _label = "_Delete Current Layout"
+ icon = "gtk-remove"
+ _description = "Delete Current layout" />
+ <Command id =
"MonoDevelop.Ide.Commands.ViewCommands.LayoutSelector"
+ type = "custom"
+ widget = "MonoDevelop.Ide.Gui.LayoutComboBox"
+ _label = "Active Layout"
+ _description = "Switch Active Layout" />
<Command id = "MonoDevelop.Ide.Commands.ViewCommands.FullScreen"
defaultHandler =
"MonoDevelop.Ide.Commands.FullScreenHandler"
_label = "_Full Screen"
icon = "md-fullscreen"
- description = "Full Screen" />
+ _description = "Full Screen" />
<Command id = "MonoDevelop.Ide.Commands.ViewCommands.Open"
_label = "Open" />
<Command id =
"MonoDevelop.Ide.Commands.ViewCommands.TreeDisplayOptionList"
@@ -772,6 +781,12 @@
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.Run" />
<CommandItem id =
"MonoDevelop.Ide.Commands.ProjectCommands.Stop" />
</ItemSet>
+ <ItemSet id = "Layout" _label = "Layout">
+ <CommandItem id =
"MonoDevelop.Ide.Commands.ViewCommands.LayoutSelector" />
+ <CommandItem id =
"MonoDevelop.Ide.Commands.ViewCommands.NewLayout" />
+ <CommandItem id =
"MonoDevelop.Ide.Commands.ViewCommands.DeleteCurrentLayout" />
+ <CommandItem id =
"MonoDevelop.Ide.Commands.ViewCommands.FullScreen" />
+ </ItemSet>
</Extension>
<!-- Main Menu -->
Modified: trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.mdp
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.mdp
2006-11-26 20:07:38 UTC (rev 68483)
+++ trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.mdp
2006-11-26 20:19:25 UTC (rev 68484)
@@ -261,6 +261,7 @@
<File name="./MonoDevelop.Ide.Gui.Pads.ProjectPad/LinkedFilesFolder.cs"
subtype="Code" buildaction="Compile" />
<File
name="./MonoDevelop.Ide.Gui.Pads.ProjectPad/LinkedFilesFolderNodeBuilder.cs"
subtype="Code" buildaction="Compile" />
<File name="./icons/Icons.16x16.LinkOverlay.png" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="./MonoDevelop.Ide.Gui/LayoutComboBox.cs" subtype="Code"
buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Project" localcopy="True" refto="MonoDevelop.Core"
/>
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches