[longomatch] Enable use of arrows for frame seeking and framerate changes



commit 1bc53641f371a55abb190461d51af5054c66b5c9
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Mon Apr 5 18:31:58 2010 +0200

    Enable use of arrows for frame seeking and framerate changes
    
    Don't allow any widget to take the focus and override key press events
    on tree widgets. Arrow keys are now only used for frame seeking and
    frame rate adjustement

 CesarPlayer/Gui/PlayerBin.cs                       |    7 +++++++
 CesarPlayer/gtk-gui/LongoMatch.Gui.CapturerBin.cs  |    3 ---
 CesarPlayer/gtk-gui/LongoMatch.Gui.PlayerBin.cs    |    7 -------
 CesarPlayer/gtk-gui/gui.stetic                     |   10 ----------
 LongoMatch/Common/Constants.cs                     |    8 ++++----
 LongoMatch/Gui/Component/ButtonsWidget.cs          |    3 +++
 LongoMatch/Gui/MainWindow.cs                       |    5 ++---
 LongoMatch/Gui/TreeView/PlayersTreeView.cs         |    6 +++++-
 LongoMatch/Gui/TreeView/PlaysTreeView.cs           |    5 +++++
 LongoMatch/Gui/TreeView/TagsTreeView.cs            |    7 ++++++-
 .../LongoMatch.Gui.Component.ButtonsWidget.cs      |    2 --
 .../LongoMatch.Gui.Component.TimeLineWidget.cs     |    2 --
 LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs    |    2 +-
 LongoMatch/gtk-gui/gui.stetic                      |    5 -----
 14 files changed, 33 insertions(+), 39 deletions(-)
---
diff --git a/CesarPlayer/Gui/PlayerBin.cs b/CesarPlayer/Gui/PlayerBin.cs
index 903eeb2..15a7f03 100644
--- a/CesarPlayer/Gui/PlayerBin.cs
+++ b/CesarPlayer/Gui/PlayerBin.cs
@@ -73,6 +73,13 @@ namespace LongoMatch.Gui
 			UnSensitive();
 			timescale.Adjustment.PageIncrement = 0.01;
 			timescale.Adjustment.StepIncrement = 0.0001;
+			playbutton.CanFocus = false;
+			prevbutton.CanFocus = false;
+			nextbutton.CanFocus = false;
+			volumebutton.CanFocus = false;
+			timescale.CanFocus = false;
+			vscale1.CanFocus = false;	
+			drawbutton.CanFocus = false;
 		}
 		
 #endregion
diff --git a/CesarPlayer/gtk-gui/LongoMatch.Gui.CapturerBin.cs b/CesarPlayer/gtk-gui/LongoMatch.Gui.CapturerBin.cs
index a043a1f..9c4498a 100644
--- a/CesarPlayer/gtk-gui/LongoMatch.Gui.CapturerBin.cs
+++ b/CesarPlayer/gtk-gui/LongoMatch.Gui.CapturerBin.cs
@@ -64,7 +64,6 @@ namespace LongoMatch.Gui {
             // Container child buttonsbox.Gtk.Box+BoxChild
             this.recbutton = new Gtk.Button();
             this.recbutton.TooltipMarkup = "Start or continue capture";
-            this.recbutton.CanFocus = true;
             this.recbutton.Name = "recbutton";
             this.recbutton.UseUnderline = true;
             // Container child recbutton.Gtk.Container+ContainerChild
@@ -89,7 +88,6 @@ namespace LongoMatch.Gui {
             // Container child buttonsbox.Gtk.Box+BoxChild
             this.pausebutton = new Gtk.Button();
             this.pausebutton.TooltipMarkup = "Pause capture";
-            this.pausebutton.CanFocus = true;
             this.pausebutton.Name = "pausebutton";
             this.pausebutton.UseUnderline = true;
             // Container child pausebutton.Gtk.Container+ContainerChild
@@ -114,7 +112,6 @@ namespace LongoMatch.Gui {
             // Container child buttonsbox.Gtk.Box+BoxChild
             this.stopbutton = new Gtk.Button();
             this.stopbutton.TooltipMarkup = "Stop and close capture";
-            this.stopbutton.CanFocus = true;
             this.stopbutton.Name = "stopbutton";
             this.stopbutton.UseUnderline = true;
             // Container child stopbutton.Gtk.Container+ContainerChild
diff --git a/CesarPlayer/gtk-gui/LongoMatch.Gui.PlayerBin.cs b/CesarPlayer/gtk-gui/LongoMatch.Gui.PlayerBin.cs
index dc020ca..8d06899 100644
--- a/CesarPlayer/gtk-gui/LongoMatch.Gui.PlayerBin.cs
+++ b/CesarPlayer/gtk-gui/LongoMatch.Gui.PlayerBin.cs
@@ -77,7 +77,6 @@ namespace LongoMatch.Gui {
             this.buttonsbox.Homogeneous = true;
             // Container child buttonsbox.Gtk.Box+BoxChild
             this.closebutton = new Gtk.Button();
-            this.closebutton.CanFocus = true;
             this.closebutton.Name = "closebutton";
             this.closebutton.UseUnderline = true;
             // Container child closebutton.Gtk.Container+ContainerChild
@@ -101,7 +100,6 @@ namespace LongoMatch.Gui {
             w10.Fill = false;
             // Container child buttonsbox.Gtk.Box+BoxChild
             this.drawbutton = new Gtk.Button();
-            this.drawbutton.CanFocus = true;
             this.drawbutton.Name = "drawbutton";
             this.drawbutton.UseUnderline = true;
             // Container child drawbutton.Gtk.Container+ContainerChild
@@ -125,7 +123,6 @@ namespace LongoMatch.Gui {
             w19.Fill = false;
             // Container child buttonsbox.Gtk.Box+BoxChild
             this.playbutton = new Gtk.Button();
-            this.playbutton.CanFocus = true;
             this.playbutton.Name = "playbutton";
             this.playbutton.UseUnderline = true;
             this.playbutton.Relief = ((Gtk.ReliefStyle)(2));
@@ -150,7 +147,6 @@ namespace LongoMatch.Gui {
             w28.Fill = false;
             // Container child buttonsbox.Gtk.Box+BoxChild
             this.pausebutton = new Gtk.Button();
-            this.pausebutton.CanFocus = true;
             this.pausebutton.Name = "pausebutton";
             this.pausebutton.UseUnderline = true;
             this.pausebutton.Relief = ((Gtk.ReliefStyle)(2));
@@ -175,7 +171,6 @@ namespace LongoMatch.Gui {
             w37.Fill = false;
             // Container child buttonsbox.Gtk.Box+BoxChild
             this.prevbutton = new Gtk.Button();
-            this.prevbutton.CanFocus = true;
             this.prevbutton.Name = "prevbutton";
             this.prevbutton.UseUnderline = true;
             this.prevbutton.Relief = ((Gtk.ReliefStyle)(2));
@@ -201,7 +196,6 @@ namespace LongoMatch.Gui {
             // Container child buttonsbox.Gtk.Box+BoxChild
             this.nextbutton = new Gtk.Button();
             this.nextbutton.Sensitive = false;
-            this.nextbutton.CanFocus = true;
             this.nextbutton.Name = "nextbutton";
             this.nextbutton.UseUnderline = true;
             this.nextbutton.Relief = ((Gtk.ReliefStyle)(2));
@@ -261,7 +255,6 @@ namespace LongoMatch.Gui {
             w59.Expand = false;
             // Container child controlsbox.Gtk.Box+BoxChild
             this.volumebutton = new Gtk.Button();
-            this.volumebutton.CanFocus = true;
             this.volumebutton.Name = "volumebutton";
             this.volumebutton.UseUnderline = true;
             this.volumebutton.Relief = ((Gtk.ReliefStyle)(2));
diff --git a/CesarPlayer/gtk-gui/gui.stetic b/CesarPlayer/gtk-gui/gui.stetic
index f020f65..1421d4b 100644
--- a/CesarPlayer/gtk-gui/gui.stetic
+++ b/CesarPlayer/gtk-gui/gui.stetic
@@ -108,7 +108,6 @@
                       <widget class="Gtk.Button" id="closebutton">
                         <property name="MemberName" />
                         <property name="Visible">False</property>
-                        <property name="CanFocus">True</property>
                         <property name="Type">TextAndIcon</property>
                         <property name="Icon">stock:gtk-close Dnd</property>
                         <property name="Label" translatable="yes" />
@@ -125,7 +124,6 @@
                     <child>
                       <widget class="Gtk.Button" id="drawbutton">
                         <property name="MemberName" />
-                        <property name="CanFocus">True</property>
                         <property name="Type">TextAndIcon</property>
                         <property name="Icon">stock:gtk-select-color Menu</property>
                         <property name="Label" translatable="yes" />
@@ -142,7 +140,6 @@
                     <child>
                       <widget class="Gtk.Button" id="playbutton">
                         <property name="MemberName" />
-                        <property name="CanFocus">True</property>
                         <property name="Type">TextAndIcon</property>
                         <property name="Icon">stock:gtk-media-play Button</property>
                         <property name="Label" translatable="yes" />
@@ -160,7 +157,6 @@
                     <child>
                       <widget class="Gtk.Button" id="pausebutton">
                         <property name="MemberName" />
-                        <property name="CanFocus">True</property>
                         <property name="Type">TextAndIcon</property>
                         <property name="Icon">stock:gtk-media-pause Button</property>
                         <property name="Label" translatable="yes" />
@@ -179,7 +175,6 @@
                       <widget class="Gtk.Button" id="prevbutton">
                         <property name="MemberName" />
                         <property name="Visible">False</property>
-                        <property name="CanFocus">True</property>
                         <property name="Type">TextAndIcon</property>
                         <property name="Icon">stock:gtk-media-previous Button</property>
                         <property name="Label" translatable="yes" />
@@ -199,7 +194,6 @@
                         <property name="MemberName" />
                         <property name="Visible">False</property>
                         <property name="Sensitive">False</property>
-                        <property name="CanFocus">True</property>
                         <property name="Type">TextAndIcon</property>
                         <property name="Icon">stock:gtk-media-next Button</property>
                         <property name="Label" translatable="yes" />
@@ -266,7 +260,6 @@
                 <child>
                   <widget class="Gtk.Button" id="volumebutton">
                     <property name="MemberName" />
-                    <property name="CanFocus">True</property>
                     <property name="Type">TextAndIcon</property>
                     <property name="Icon">stock:stock_volume Button</property>
                     <property name="Label" translatable="yes" />
@@ -374,7 +367,6 @@
                   <widget class="Gtk.Button" id="recbutton">
                     <property name="MemberName" />
                     <property name="Tooltip" translatable="yes">Start or continue capture</property>
-                    <property name="CanFocus">True</property>
                     <property name="Type">TextAndIcon</property>
                     <property name="Icon">stock:gtk-media-record Dialog</property>
                     <property name="Label" translatable="yes" />
@@ -393,7 +385,6 @@
                     <property name="MemberName" />
                     <property name="Visible">False</property>
                     <property name="Tooltip" translatable="yes">Pause capture</property>
-                    <property name="CanFocus">True</property>
                     <property name="Type">TextAndIcon</property>
                     <property name="Icon">stock:gtk-media-pause Dialog</property>
                     <property name="Label" translatable="yes" />
@@ -412,7 +403,6 @@
                     <property name="MemberName" />
                     <property name="Visible">False</property>
                     <property name="Tooltip" translatable="yes">Stop and close capture</property>
-                    <property name="CanFocus">True</property>
                     <property name="Type">TextAndIcon</property>
                     <property name="Icon">stock:gtk-media-stop Dialog</property>
                     <property name="Label" translatable="yes" />
diff --git a/LongoMatch/Common/Constants.cs b/LongoMatch/Common/Constants.cs
index b55217f..0c625bb 100644
--- a/LongoMatch/Common/Constants.cs
+++ b/LongoMatch/Common/Constants.cs
@@ -57,17 +57,17 @@ Petr Kovar (cs)";
 		
 		public const string WEBSITE = "http://www.longomatch.ylatuya.es";;
 		
-		public const Key PREV_FRAME = Gdk.Key.z;
+		public const Key PREV_FRAME = Gdk.Key.Left;
 
-		public const Key NEXT_FRAME = Gdk.Key.x;
+		public const Key NEXT_FRAME = Gdk.Key.Right;
 		
 		public const Key STEP_BACKWARD = Gdk.Key.a;
 		
 		public const Key STEP_FORWARD = Gdk.Key.s;		
 		
-		public const Key FRAMERATE_UP = Gdk.Key.n;
+		public const Key FRAMERATE_UP = Gdk.Key.Up;
 		
-		public const Key FRAMERATE_DOWN = Gdk.Key.m;
+		public const Key FRAMERATE_DOWN = Gdk.Key.Down;
 		
 		public const Key TOGGLE_PLAY = Gdk.Key.space;		
 	}
diff --git a/LongoMatch/Gui/Component/ButtonsWidget.cs b/LongoMatch/Gui/Component/ButtonsWidget.cs
index a12c5f5..57682e3 100644
--- a/LongoMatch/Gui/Component/ButtonsWidget.cs
+++ b/LongoMatch/Gui/Component/ButtonsWidget.cs
@@ -83,10 +83,13 @@ namespace LongoMatch.Gui.Component
 					l.Markup = sections.GetName(i);
 					l.Justify = Justification.Center;
 					l.Ellipsize = Pango.EllipsizeMode.Middle;
+					l.CanFocus = false;
 
 					b.Add(l);
 					b.Name = i.ToString();
 					b.Clicked += new EventHandler(OnButtonClicked);
+					b.CanFocus = false;
+					
 					l.Show();
 					b.Show();
 
diff --git a/LongoMatch/Gui/MainWindow.cs b/LongoMatch/Gui/MainWindow.cs
index 3962aa9..d3d23cc 100644
--- a/LongoMatch/Gui/MainWindow.cs
+++ b/LongoMatch/Gui/MainWindow.cs
@@ -531,13 +531,12 @@ namespace LongoMatch.Gui
 			drawingtoolbox1.Visible = DrawingToolAction.Active;
 			drawingtoolbox1.DrawingVisibility = DrawingToolAction.Active;
 		}
-
+	
 		protected override bool OnDeleteEvent (Gdk.Event evnt)
 		{
 			CloseAndQuit();	
 			return true;
 		}
-
-		#endregion			}
+		#endregion			
 	}
 }
\ No newline at end of file
diff --git a/LongoMatch/Gui/TreeView/PlayersTreeView.cs b/LongoMatch/Gui/TreeView/PlayersTreeView.cs
index a022f51..5274258 100644
--- a/LongoMatch/Gui/TreeView/PlayersTreeView.cs
+++ b/LongoMatch/Gui/TreeView/PlayersTreeView.cs
@@ -53,7 +53,6 @@ namespace LongoMatch.Gui.Component
 
 
 		public PlayersTreeView() {
-
 			team = Team.LOCAL;
 			this.RowActivated += new RowActivatedHandler(OnTreeviewRowActivated);
 
@@ -235,5 +234,10 @@ namespace LongoMatch.Gui.Component
 			    && !projectIsLive)
 				this.TimeNodeSelected(item as MediaTimeNode);
 		}
+		
+		protected override bool OnKeyPressEvent (Gdk.EventKey evnt)
+		{
+			return false;
+		}
 	}
 }
diff --git a/LongoMatch/Gui/TreeView/PlaysTreeView.cs b/LongoMatch/Gui/TreeView/PlaysTreeView.cs
index af85773..2a606bc 100644
--- a/LongoMatch/Gui/TreeView/PlaysTreeView.cs
+++ b/LongoMatch/Gui/TreeView/PlaysTreeView.cs
@@ -91,6 +91,7 @@ namespace LongoMatch.Gui.Component
 			nameColumn.SetCellDataFunc(nameCell, new Gtk.TreeCellDataFunc(RenderName));
 
 			this.AppendColumn(nameColumn);
+			
 		}
 		
 		new public TreeStore Model{
@@ -536,5 +537,9 @@ namespace LongoMatch.Gui.Component
 				PlayersTagged((MediaTimeNode)GetValueFromPath(Selection.GetSelectedRows()[0]), Team.VISITOR);
 		}
 		
+		protected override bool OnKeyPressEvent (Gdk.EventKey evnt)
+		{
+			return false;
+		}		
 	}
 }
diff --git a/LongoMatch/Gui/TreeView/TagsTreeView.cs b/LongoMatch/Gui/TreeView/TagsTreeView.cs
index 3e1a28a..baea269 100644
--- a/LongoMatch/Gui/TreeView/TagsTreeView.cs
+++ b/LongoMatch/Gui/TreeView/TagsTreeView.cs
@@ -232,7 +232,12 @@ namespace LongoMatch.Gui.Component
 		protected void OnSnapshot(object obj, EventArgs args) {
 			if (SnapshotSeriesEvent != null)
 				SnapshotSeriesEvent(GetValueFromPath(Selection.GetSelectedRows()[0]));
-		}			
+		}	
+		
+		protected override bool OnKeyPressEvent (Gdk.EventKey evnt)
+		{
+			return false;
+		}
 	}
 }
 
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.Component.ButtonsWidget.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.Component.ButtonsWidget.cs
index 466e799..28bd5b7 100644
--- a/LongoMatch/gtk-gui/LongoMatch.Gui.Component.ButtonsWidget.cs
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.Component.ButtonsWidget.cs
@@ -32,7 +32,6 @@ namespace LongoMatch.Gui.Component {
             this.vbox1.Spacing = 6;
             // Container child vbox1.Gtk.Box+BoxChild
             this.cancelbutton = new Gtk.Button();
-            this.cancelbutton.CanFocus = true;
             this.cancelbutton.Name = "cancelbutton";
             this.cancelbutton.UseUnderline = true;
             this.cancelbutton.Label = Mono.Unix.Catalog.GetString("Cancel");
@@ -43,7 +42,6 @@ namespace LongoMatch.Gui.Component {
             w1.Fill = false;
             // Container child vbox1.Gtk.Box+BoxChild
             this.starttagbutton = new Gtk.Button();
-            this.starttagbutton.CanFocus = true;
             this.starttagbutton.Name = "starttagbutton";
             this.starttagbutton.UseUnderline = true;
             this.starttagbutton.Label = Mono.Unix.Catalog.GetString("Tag new play");
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.Component.TimeLineWidget.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.Component.TimeLineWidget.cs
index 88fb3a1..690d83a 100644
--- a/LongoMatch/gtk-gui/LongoMatch.Gui.Component.TimeLineWidget.cs
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.Component.TimeLineWidget.cs
@@ -40,7 +40,6 @@ namespace LongoMatch.Gui.Component {
             this.vbox3.Spacing = 6;
             // Container child vbox3.Gtk.Box+BoxChild
             this.fitbutton = new Gtk.Button();
-            this.fitbutton.CanFocus = true;
             this.fitbutton.Name = "fitbutton";
             this.fitbutton.UseUnderline = true;
             // Container child fitbutton.Gtk.Container+ContainerChild
@@ -64,7 +63,6 @@ namespace LongoMatch.Gui.Component {
             w9.Fill = false;
             // Container child vbox3.Gtk.Box+BoxChild
             this.vscale1 = new Gtk.VScale(null);
-            this.vscale1.CanFocus = true;
             this.vscale1.Name = "vscale1";
             this.vscale1.UpdatePolicy = ((Gtk.UpdateType)(1));
             this.vscale1.Inverted = true;
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
index ac24646..6d24a6c 100644
--- a/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.MainWindow.cs
@@ -193,7 +193,7 @@ namespace LongoMatch.Gui {
             this.ImportProjectAction.ShortLabel = Mono.Unix.Catalog.GetString("_Import Project");
             w1.Add(this.ImportProjectAction, "<Control>i");
             this.FreeCaptureModeAction = new Gtk.RadioAction("FreeCaptureModeAction", Mono.Unix.Catalog.GetString("Free Capture Mode"), null, null, 0);
-            this.FreeCaptureModeAction.Group = this.CaptureModeAction.Group;
+            this.FreeCaptureModeAction.Group = this.AnalyzeModeAction.Group;
             this.FreeCaptureModeAction.Sensitive = false;
             this.FreeCaptureModeAction.ShortLabel = Mono.Unix.Catalog.GetString("Free Capture Mode");
             w1.Add(this.FreeCaptureModeAction, null);
diff --git a/LongoMatch/gtk-gui/gui.stetic b/LongoMatch/gtk-gui/gui.stetic
index 7000a67..ffa4a9c 100644
--- a/LongoMatch/gtk-gui/gui.stetic
+++ b/LongoMatch/gtk-gui/gui.stetic
@@ -819,7 +819,6 @@
           <widget class="Gtk.Button" id="cancelbutton">
             <property name="MemberName" />
             <property name="Visible">False</property>
-            <property name="CanFocus">True</property>
             <property name="Type">TextOnly</property>
             <property name="Label" translatable="yes">Cancel</property>
             <property name="UseUnderline">True</property>
@@ -836,7 +835,6 @@
           <widget class="Gtk.Button" id="starttagbutton">
             <property name="MemberName" />
             <property name="Visible">False</property>
-            <property name="CanFocus">True</property>
             <property name="Type">TextOnly</property>
             <property name="Label" translatable="yes">Tag new play</property>
             <property name="UseUnderline">True</property>
@@ -2644,7 +2642,6 @@ new one.</property>
             <child>
               <widget class="Gtk.Button" id="fitbutton">
                 <property name="MemberName" />
-                <property name="CanFocus">True</property>
                 <property name="Type">TextAndIcon</property>
                 <property name="Icon">stock:gtk-zoom-fit Button</property>
                 <property name="Label" translatable="yes" />
@@ -2661,7 +2658,6 @@ new one.</property>
             <child>
               <widget class="Gtk.VScale" id="vscale1">
                 <property name="MemberName" />
-                <property name="CanFocus">True</property>
                 <property name="UpdatePolicy">Discontinuous</property>
                 <property name="Inverted">True</property>
                 <property name="Lower">1</property>
@@ -4335,7 +4331,6 @@ Hotkeys with a single key are also allowed with Ctrl+key.</property>
                 <property name="MemberName" />
                 <property name="CanFocus">True</property>
                 <property name="Label" translatable="yes" />
-                <property name="Active">True</property>
                 <property name="DrawIndicator">False</property>
                 <property name="HasLabel">False</property>
                 <property name="UseUnderline">True</property>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]