[xiph-cvs] r6519 - trunk/postfish

xiphmont at xiph.org xiphmont at xiph.org
Fri Apr 16 20:10:41 PDT 2004



Author: xiphmont
Date: 2004-04-16 23:10:40 -0400 (Fri, 16 Apr 2004)
New Revision: 6519

Modified:
   trunk/postfish/subpanel.c
   trunk/postfish/subpanel.h
   trunk/postfish/version.h
Log:
Implement subpanel active button rotation for files with >9 channel

<p><p>Modified: trunk/postfish/subpanel.c
===================================================================
--- trunk/postfish/subpanel.c	2004-04-16 23:44:06 UTC (rev 6518)
+++ trunk/postfish/subpanel.c	2004-04-17 03:10:40 UTC (rev 6519)
@@ -104,17 +104,45 @@
                                GdkEvent *event,
                                gpointer in){
 
+  subpanel_generic *p=in;
+  GdkEventKey *kevent=(GdkEventKey *)event;
+  
   /* if this is a shortcutless panel, check first for a numeral
      keypress; the intent of this mechanism is to handle focus
      rotation on the activation buttons on a panel handling > 10
      channels with multiple activation buttons. */
+    
+  int keych=kevent->keyval-GDK_0,active;
+  if(keych==0)
+    keych=9;
+  else 
+    keych--;
+  
+  if(keych>=0 && keych<=9){
+    if(input_ch>9){
+      int actualch=keych+p->rotation[keych]*10;
 
+      if(actualch<p->active_button_start)return TRUE;
+      if(actualch>=p->active_button_start+p->active_button_count)return TRUE;
 
+      gtk_widget_grab_focus(p->subpanel_activebutton[actualch-p->active_button_start]);
 
-  subpanel_generic *p=in;
-  GdkEvent copy=*(GdkEvent *)event;
-  copy.any.window=p->mainpanel->toplevel->window;
-  gtk_main_do_event((GdkEvent *)(&copy));
+      p->rotation[keych]++;
+      if(keych+p->rotation[keych]*10+p->active_button_start>=input_ch)p->rotation[keych]=0;
+
+    }else{
+      if(keych<p->active_button_start)return TRUE;
+      if(keych>=p->active_button_start+p->active_button_count)return TRUE;
+
+      active=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(p->subpanel_activebutton[keych-p->active_button_start]));
+      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(p->subpanel_activebutton[keych-p->active_button_start]),!active);
+
+    }
+  }else{
+    GdkEvent copy=*(GdkEvent *)event;
+    copy.any.window=p->mainpanel->toplevel->window;
+    gtk_main_do_event((GdkEvent *)(&copy));
+  }
   return TRUE;
 }
 
@@ -165,7 +193,7 @@
   
   gtk_box_pack_start(GTK_BOX(toplabel),toplabelwb,0,0,5);
   for(i=num-1;i>=0;i--)
-    gtk_box_pack_end(GTK_BOX(toplabel),toplabelab[i],0,0,5);
+    gtk_box_pack_end(GTK_BOX(toplabel),toplabelab[i],0,0,1);
 
   gtk_widget_set_name(toplabelwb,"panelbutton");
   gtk_widget_set_name(toplabelbox,"panelbox");

Modified: trunk/postfish/subpanel.h
===================================================================
--- trunk/postfish/subpanel.h	2004-04-16 23:44:06 UTC (rev 6518)
+++ trunk/postfish/subpanel.h	2004-04-17 03:10:40 UTC (rev 6519)
@@ -33,6 +33,7 @@
 
   int active_button_count; /* silliness around the rotating non-alt-shortcut */
   int active_button_start; /* silliness around the rotating non-alt-shortcut */
+  int rotation[10];
 
   sig_atomic_t *mappedvar;
 

Modified: trunk/postfish/version.h
===================================================================
--- trunk/postfish/version.h	2004-04-16 23:44:06 UTC (rev 6518)
+++ trunk/postfish/version.h	2004-04-17 03:10:40 UTC (rev 6519)
@@ -1,2 +1,2 @@
 #define VERSION "$Id$ "
-/* DO NOT EDIT: Automated versioning hack [Fri Apr 16 19:43:08 EDT 2004] */
+/* DO NOT EDIT: Automated versioning hack [Fri Apr 16 23:09:46 EDT 2004] */

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list