changeset 1887:986de19221c9

fix tab bug
author pontscho
date Wed, 12 Sep 2001 18:53:42 +0000
parents a4e2aa412c75
children 1f1e98fbf3a7
files Gui/mplayer/gtk/fs.h Gui/mplayer/gtk/sb.h
diffstat 2 files changed, 6 insertions(+), 91 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/gtk/fs.h	Wed Sep 12 16:05:29 2001 +0000
+++ b/Gui/mplayer/gtk/fs.h	Wed Sep 12 18:53:42 2001 +0000
@@ -40,9 +40,6 @@
 GList       * fsList_items = NULL;
 GList       * fsTopList_items = NULL;
 
-GtkWidget   * fsItemList[6];
-int           fsItemListCounter = 0;
-
 void CheckDir( GtkWidget * list,unsigned char * directory )
 {
  struct stat     fs;
@@ -286,49 +283,18 @@
  if( bevent->type == GDK_2BUTTON_PRESS ) gtk_button_released( GTK_BUTTON( fsOk ) );
 }
 
-int fsShift = False;
-
 gboolean on_FileSelect_key_release_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data )
 {
  switch ( event->keyval )
   {
    case GDK_Escape:
-        if ( !fsShift ) gtk_button_released( GTK_BUTTON( fsCancel ) );
+        gtk_button_released( GTK_BUTTON( fsCancel ) );
         break;
    case GDK_Return:
-        if ( !fsShift ) gtk_button_released( GTK_BUTTON( fsOk ) );
+        gtk_button_released( GTK_BUTTON( fsOk ) );
         break;
    case GDK_BackSpace:
-        if ( !fsShift ) gtk_button_released( GTK_BUTTON( fsUp ) );
-        break;
-   case GDK_Tab:
-        if ( fsShift )
-         {
-          fsItemListCounter--;
-          if ( fsItemListCounter < 0 ) fsItemListCounter=5;
-         }
-         else
-          {
-           fsItemListCounter++;
-           if ( fsItemListCounter > 5 ) fsItemListCounter=0;
-          }
-        gtk_widget_grab_focus( fsItemList[fsItemListCounter] );
-        break;
-   case GDK_Shift_L:
-   case GDK_Shift_R:
-        fsShift=False;
-        break;
-  }
- return FALSE;
-}
-
-gboolean on_FileSelect_key_press_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data )
-{
- switch ( event->keyval )
-  {
-   case GDK_Shift_L:
-   case GDK_Shift_R:
-        fsShift=True;
+        gtk_button_released( GTK_BUTTON( fsUp ) );
         break;
   }
  return FALSE;
@@ -375,7 +341,6 @@
  gtk_widget_set_name( fsFileSelect,"fsFileSelect" );
  gtk_object_set_data( GTK_OBJECT( fsFileSelect ),"fsFileSelect",fsFileSelect );
  gtk_widget_set_usize( fsFileSelect,416,256 );
- GTK_WIDGET_SET_FLAGS( fsFileSelect,GTK_CAN_FOCUS );
  GTK_WIDGET_SET_FLAGS( fsFileSelect,GTK_CAN_DEFAULT );
  gtk_widget_set_events( fsFileSelect,GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK );
  gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect );
@@ -618,9 +583,6 @@
  gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"key_release_event",
                      GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),
                      NULL );
- gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"key_press_event",
-                     GTK_SIGNAL_FUNC( on_FileSelect_key_press_event ),
-                     NULL );
  gtk_signal_connect( GTK_OBJECT( combo_entry1 ),"changed",
                      GTK_SIGNAL_FUNC( fs_combo_entry1_changed ),
                      combo_entry1 );
@@ -649,13 +611,6 @@
 
  gtk_widget_grab_focus( fsFNameList );
 
- fsItemList[0]=fsFNameList;
- fsItemList[1]=combo_entry1;
- fsItemList[2]=fsOk;
- fsItemList[3]=fsCancel;
- fsItemList[4]=fsUp;
- fsItemList[5]=fsComboEntry2;
-
  return fsFileSelect;
 }
 
--- a/Gui/mplayer/gtk/sb.h	Wed Sep 12 16:05:29 2001 +0000
+++ b/Gui/mplayer/gtk/sb.h	Wed Sep 12 18:53:42 2001 +0000
@@ -16,9 +16,6 @@
 char      * sbMPlayerDirInHome=NULL;
 char      * sbMPlayerPrefixDir=NULL;
 
-GtkWidget * sbItemsList[3];
-int         sbItemsListCounter = 0;
-
 void HideSkinBrowser( void )
 {
  gtk_widget_hide( SkinBrowser );
@@ -86,42 +83,12 @@
  if( bevent->type == GDK_2BUTTON_PRESS ) HideSkinBrowser();
 }
 
-int sbShift = False;
-
 gboolean on_SkinBrowser_key_release_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data )
 {
  switch ( event->keyval )
   {
-   case GDK_Escape:
-        if ( !sbShift ) on_SkinBrowser_Cancel( NULL,0 );
-        break;
-   case GDK_Return:
-        if ( !sbShift ) HideSkinBrowser();
-        break;
-   case GDK_Tab:
-        if ( sbShift )
-         { if ( (--sbItemsListCounter) < 0 ) sbItemsListCounter=2; }
-         else
-          { if ( (++sbItemsListCounter) > 2 ) sbItemsListCounter=0; }
-        gtk_widget_grab_focus( sbItemsList[sbItemsListCounter] );
-        break;
-   case GDK_Shift_L:
-   case GDK_Shift_R:
-        sbShift=False;
-        break;
-  }
-// if ( ( event->keyval == GDK_Escape )|| ( event->keyval == GDK_Return ) ) HideSkinBrowser();
- return FALSE;
-}
-
-gboolean on_SkinBrowser_key_press_event( GtkWidget * widget,GdkEventKey * event,gpointer user_data )
-{
- switch ( event->keyval )
-  {
-   case GDK_Shift_L:
-   case GDK_Shift_R:
-        sbShift=True;
-        break;
+   case GDK_Escape: on_SkinBrowser_Cancel( NULL,0 ); break;
+   case GDK_Return: HideSkinBrowser(); break;
   }
  return FALSE;
 }
@@ -147,7 +114,7 @@
  gtk_object_set_data( GTK_OBJECT( SkinBrowser ),MSGTR_SkinBrowser,SkinBrowser );
  gtk_widget_set_usize( SkinBrowser,256,320 );
  gtk_container_set_border_width( GTK_CONTAINER( SkinBrowser ),1 );
- GTK_WIDGET_SET_FLAGS( SkinBrowser,GTK_CAN_FOCUS );
+// GTK_WIDGET_SET_FLAGS( SkinBrowser,GTK_CAN_FOCUS );
  GTK_WIDGET_SET_FLAGS( SkinBrowser,GTK_CAN_DEFAULT );
  gtk_widget_set_events( SkinBrowser,GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK | GDK_PROPERTY_CHANGE_MASK | GDK_VISIBILITY_NOTIFY_MASK );
  gtk_window_set_title( GTK_WINDOW( SkinBrowser ),MSGTR_SkinBrowser );
@@ -293,9 +260,6 @@
  gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"key_release_event",
                      GTK_SIGNAL_FUNC( on_SkinBrowser_key_release_event ),
                      NULL );
- gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"key_press_event",
-                     GTK_SIGNAL_FUNC( on_SkinBrowser_key_press_event ),
-                     NULL );
  gtk_signal_connect( GTK_OBJECT( SkinList ),"select_row",
                      GTK_SIGNAL_FUNC( on_SkinList_select_row ),
                      NULL );
@@ -313,10 +277,6 @@
 
  gtk_widget_grab_focus( SkinList );
 
- sbItemsList[0]=SkinList;
- sbItemsList[1]=sbOk;
- sbItemsList[2]=Cancel;
-
  return SkinBrowser;
 }