14.13. Photon: Editing Queries - .change_int, .allow_entry_values

These two methods of the HistoryWindow class work together, calling the .set_sensitive methods to activate or deactivate the three specialized Interpolator options entry fields. The .change_int method uses the Gamma switch statement to detect which Interpolator options radio button was clicked, and calls the .allow_entry_values method with the appropriate arguments.

   /*--------------------------------------------------------------------
    * Method:      HistoryWindow.change_int
    * Returns:     t
    * Description: Responding to a click on a "Choose an Interpolator" radio
    *              button, this method calls the allow_entry_values() function
    *              on the active button.  
    *------------------------------------------------------------------*/
   method HistoryWindow.change_int(button, str)
   {
     
     if (button.switched_on())
       {
         .int_set.fn = str;
         switch (str)
           {
           case "NoInterpolator":
             .allow_entry_values(0, 0, 0);
           case "Periodic":
             .allow_entry_values(0, 1, 1);
           case "Relative":
             .allow_entry_values(1, 0, 0);
           case "FixedRelative":
             .allow_entry_values(1, 1, 0);
           }
       }
     /* To allow for a slow processor */
     usleep(10000);
   }
   
   /*--------------------------------------------------------------------
    * Method:      HistoryWindow.allow_entry_values
    * Returns:     t or nil
    * Description: Sets the three specialized parameter entry widgets sensitive
    *              or non-sensitive.  Called by HistoryWindow.change_int().
    *------------------------------------------------------------------*/
   method HistoryWindow.allow_entry_values(e1, e2, e3)
   {
     .XHistEnt.set_sensitive(e1);
     .IntEnt.set_sensitive(e2);
     .GapEnt.set_sensitive(e3);
   }