[Monodevelop-patches-list] r1597 - in trunk/MonoDevelop/src: AddIns/DisplayBindings/SourceEditor AddIns/DisplayBindings/SourceEditor/Gui AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels Libraries/MonoDevelop.Gui.Widgets Libraries/MonoDevelop.Gui.Widgets/DragNotebook Main/Base Main/Base/Gui/Workbench/Layouts
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Sun May 9 18:29:34 EDT 2004
Author: tberman
Date: 2004-05-09 18:29:34 -0400 (Sun, 09 May 2004)
New Revision: 1597
Added:
trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/DragNotebook/
trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/DragNotebook/DragNotebook.cs
Modified:
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/CodeTemplatePanel.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs
trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/ChangeLog
trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Makefile.am
trunk/MonoDevelop/src/Main/Base/ChangeLog
trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
Log:
bring current with cvs, and integrate Inigo's draggable notebook.
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog 2004-05-09 04:13:53 UTC (rev 1596)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog 2004-05-09 22:29:34 UTC (rev 1597)
@@ -1,3 +1,8 @@
+2004-05-09 Todd Berman <tberman at sevenl.net>
+
+ * Gui/SourceEditorView.cs: bring current with gtk-sharp cvs.
+ * Gui/OptionPanels/CodeTemplatePanel.cs: ^^
+
2004-04-30 Todd Berman <tberman at sevenl.net>
* CodeCompletion/CompletionWindow.cs: properly handle enter.
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/CodeTemplatePanel.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/CodeTemplatePanel.cs 2004-05-09 04:13:53 UTC (rev 1596)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/OptionPanels/CodeTemplatePanel.cs 2004-05-09 22:29:34 UTC (rev 1597)
@@ -317,7 +317,7 @@
foreach (CodeTemplateGroup templateGroup in templateGroups) {
- groupMenu.Append(Gtk.MenuItem.NewWithLabel(String.Join(";", templateGroup.ExtensionStrings)));
+ groupMenu.Append(new Gtk.MenuItem (String.Join(";", templateGroup.ExtensionStrings)));
}
groupMenu.ShowAll();
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs 2004-05-09 04:13:53 UTC (rev 1596)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs 2004-05-09 22:29:34 UTC (rev 1597)
@@ -89,8 +89,8 @@
buf.ToggleBookmark (line.Line);
} else if (e.Event.Button == 3) {
Gtk.Menu popup = new Gtk.Menu ();
- Gtk.CheckMenuItem bookmarkItem = Gtk.CheckMenuItem.NewWithLabel (GettextCatalog.GetString ("Bookmark"));
- Gtk.CheckMenuItem breakpointItem = Gtk.CheckMenuItem.NewWithLabel (GettextCatalog.GetString ("Breakpoint"));
+ Gtk.CheckMenuItem bookmarkItem = new Gtk.CheckMenuItem (GettextCatalog.GetString ("Bookmark"));
+ Gtk.CheckMenuItem breakpointItem = new Gtk.CheckMenuItem (GettextCatalog.GetString ("Breakpoint"));
bookmarkItem.Active = buf.IsBookmarked (line.Line);
breakpointItem.Active = buf.IsBreakpoint (line.Line);
Modified: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/ChangeLog 2004-05-09 04:13:53 UTC (rev 1596)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/ChangeLog 2004-05-09 22:29:34 UTC (rev 1597)
@@ -1,3 +1,9 @@
+2004-05-09 Todd Berman <tberman at sevenl.net>
+
+ * DragNotebook/DragNotebook.cs: notebook from Inigo Illan to add
+ dragable reorg of the notebook.
+ * Makefile.am: add DragNotebook.cs to build.
+
2004-04-13 John Luke <jluke at cfl.rr.com>
* Navbar/Navbar.cs: switch the address entry to Gnome.Entry
Added: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/DragNotebook/DragNotebook.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/DragNotebook/DragNotebook.cs 2004-05-09 04:13:53 UTC (rev 1596)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/DragNotebook/DragNotebook.cs 2004-05-09 22:29:34 UTC (rev 1597)
@@ -0,0 +1,180 @@
+// created on 03/19/2004 at 20:45
+
+using System;
+using Gtk;
+using GtkSharp;
+using Gdk;
+
+/*public class prueba
+{
+ public static void Main()
+ {
+ Application.Init ();
+ new Interfaz ();
+ Application.Run ();
+ }
+}*/
+namespace MonoDevelop.Gui.Widgets
+{
+ public class DragNotebook : Notebook {
+ protected bool draginprogress = false;
+ protected int srcpage;
+ protected double xstart;
+ protected double ystart;
+ protected Cursor cursor;
+
+ public DragNotebook ()
+ {
+ this.ButtonPressEvent += new ButtonPressEventHandler (ButtonPressCallback);
+ this.ButtonReleaseEvent += new ButtonReleaseEventHandler (ButtonReleaseCallback);
+ this.AddEvents ((Int32) (EventMask.AllEventsMask));
+ }
+
+ protected int FindTabAtNumPos (double absx, double absy)
+ {
+ PositionType tabpos;
+ int pagenum, xroot, yroot, maxx, maxy;
+ pagenum = 0;
+ Widget page, tab;
+
+ tabpos = this.TabPos;
+ if (this.NPages == 0) {
+ return -1;
+ }
+
+ page = this.GetNthPage (pagenum);
+
+ while (page != null) {
+ tab = this.GetTabLabel (page);
+
+ if (tab == null) {
+ return -1;
+ }
+
+ // if (!tab.Mapped)
+ // {
+ // pagenum++;
+ // continue;
+ // }
+
+ tab.ParentWindow.GetOrigin (out xroot, out yroot);
+
+ maxx = xroot + tab.Allocation.X + tab.Allocation.Width;
+ maxy = yroot + tab.Allocation.Y + tab.Allocation.Height;
+
+ if ((tabpos == PositionType.Top || tabpos == PositionType.Bottom) && absx <= maxx) {
+ return pagenum;
+ }
+ else if ((tabpos == PositionType.Right || tabpos == PositionType.Left) && absx <= maxy) {
+ return pagenum;
+ }
+
+ pagenum++;
+ page = this.GetNthPage (pagenum);
+ }
+
+ return -1;
+ }
+
+ protected void OnTabsReordered ()
+ {
+
+ }
+
+ [GLib.ConnectBefore]
+ protected void MotionNotifyCallback (object obj, MotionNotifyEventArgs args)
+ {
+ int curpage, pagenum;
+
+ if (!draginprogress) {
+ //if (Gtk.Drag.CheckThreshold (this, (Int32) xstart, (Int32) ystart, (Int32) args.Event.XRoot, (Int32) args.Event.YRoot))
+ //{
+ curpage = this.CurrentPage;
+ DragStart (curpage, args.Event.Time);
+ //}
+ //else
+ //{
+ // return;
+ //}
+ }
+
+ pagenum = FindTabAtNumPos (args.Event.XRoot, args.Event.YRoot);
+
+ MoveTab (pagenum);
+ }
+
+ protected void MoveTab (int destpagenum)
+ {
+ int curpagenum;
+ Widget curpage, tab;
+
+ curpagenum = this.CurrentPage;
+
+ if (destpagenum != curpagenum) {
+ curpage = this.GetNthPage (curpagenum);
+ tab = this.GetTabLabel (curpage);
+ this.ReorderChild (CurrentPageWidget, destpagenum);
+ }
+ }
+
+ protected void DragStart (int srcpage, uint time)
+ {
+ draginprogress = true;
+
+ this.srcpage = srcpage;
+
+ if (cursor == null) {
+ cursor = new Cursor (CursorType.Fleur);
+ }
+
+ Grab.Add (this);
+
+ if (!Pointer.IsGrabbed) {
+ Pointer.Grab (this.ParentWindow, false, EventMask.Button1MotionMask | EventMask.ButtonReleaseMask, null, cursor, time);
+ }
+ }
+
+ protected void DragStop ()
+ {
+ if (draginprogress) {
+ OnTabsReordered();
+ }
+
+ draginprogress = false;
+ srcpage = -1;
+ this.MotionNotifyEvent -= new MotionNotifyEventHandler (MotionNotifyCallback);
+ }
+
+ protected void ButtonReleaseCallback (object obj, ButtonReleaseEventArgs args)
+ {
+ if (Pointer.IsGrabbed) {
+ Pointer.Ungrab (args.Event.Time);
+ Gtk.Grab.Remove (this);
+ }
+
+ DragStop ();
+ }
+
+ [GLib.ConnectBefore]
+ protected void ButtonPressCallback (object obj, ButtonPressEventArgs args) {
+ int tabpos;
+
+ tabpos = FindTabAtNumPos (args.Event.XRoot, args.Event.YRoot);
+
+ if (draginprogress) {
+ return;
+ }
+ else {
+ srcpage = this.CurrentPage;
+ }
+
+ xstart = args.Event.XRoot;
+ ystart = args.Event.YRoot;
+
+ if (args.Event.Button == 1 && args.Event.Type == EventType.ButtonPress && tabpos >= 0) {
+ this.MotionNotifyEvent += new MotionNotifyEventHandler (MotionNotifyCallback);
+ }
+ }
+ }
+}
+
Modified: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Makefile.am
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Makefile.am 2004-05-09 04:13:53 UTC (rev 1596)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Makefile.am 2004-05-09 22:29:34 UTC (rev 1597)
@@ -22,8 +22,10 @@
./FolderDialog/FileEntry.cs \
./Navbar/Navbar.cs \
./TabLabel/TabLabel.cs \
-./GladeWidgetExtract/GladeWidgetExtract.cs
+./GladeWidgetExtract/GladeWidgetExtract.cs \
+./DragNotebook/DragNotebook.cs
+
build_sources = $(addprefix $(srcdir)/, $(FILES))
all: $(DLL)
Modified: trunk/MonoDevelop/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-05-09 04:13:53 UTC (rev 1596)
+++ trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-05-09 22:29:34 UTC (rev 1597)
@@ -1,3 +1,7 @@
+2004-05-09 Todd Berman <tberman at sevenl.net>
+
+ * Gui/Workbench/Layouts/SdiWorkspaceLayout.cs: use DragNotebook
+
2004-05-07 Todd Berman <tberman at sevenl.net>
* Gui/Pads/ClassScout/ClassScout.cs: adding a lock.
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs 2004-05-09 04:13:53 UTC (rev 1596)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs 2004-05-09 22:29:34 UTC (rev 1597)
@@ -45,7 +45,7 @@
VBox toolbarContainer;
Dock dock;
DockLayout dockLayout;
- Notebook tabControl;
+ DragNotebook tabControl;
EventHandler contextChangedHandler;
ArrayList _windows = new ArrayList ();
@@ -94,7 +94,7 @@
vbox.PackStart (dockBox, true, true, 0);
// Create the notebook for the various documents.
- tabControl = new Notebook ();
+ tabControl = new DragNotebook ();
tabControl.Scrollable = true;
tabControl.ShowTabs = false;
tabControl.SwitchPage += new SwitchPageHandler (ActiveMdiChanged);
More information about the Monodevelop-patches-list
mailing list