예제 #1
0
파일: display.c 프로젝트: cran/rggobi
USER_OBJECT_
RS_GGOBI(setDisplayOptions)(USER_OBJECT_ which, USER_OBJECT_ values)
{
  gint i;
  DisplayOptions *options;
  displayd *display = NULL;
  int apply = 0;

  g_return_val_if_fail(GET_LENGTH(values) == 8, NULL_USER_OBJECT);
  
  if(GET_LENGTH(which) == 0) {
     options = GGOBI(getDefaultDisplayOptions)();
  } else {
     display = toDisplay(which);
     g_return_val_if_fail(GGOBI_IS_DISPLAY(display), NULL_USER_OBJECT);
     options = &(display->options);
     g_return_val_if_fail(options != NULL, NULL_USER_OBJECT);
     apply = 1;
  }
  
  i = 0;
  options->points_show_p = LOGICAL_DATA(values)[i++];
  options->axes_show_p = LOGICAL_DATA(values)[i++];
  options->axes_label_p = LOGICAL_DATA(values)[i++];
  options->axes_values_p = LOGICAL_DATA(values)[i++];
  options->edges_undirected_show_p = LOGICAL_DATA(values)[i++];
  options->edges_arrowheads_show_p = LOGICAL_DATA(values)[i++];
  options->edges_directed_show_p = LOGICAL_DATA(values)[i++];
  options->whiskers_show_p = LOGICAL_DATA(values)[i++];
/* unused
  options->missings_show_p = LOGICAL_DATA(values)[i++];
  options->axes_center_p = LOGICAL_DATA(values)[i++];
  options->double_buffer_p = LOGICAL_DATA(values)[i++];
  options->link_p = LOGICAL_DATA(values)[i++];
*/

  if(apply) {
    set_display_options(display, display->ggobi);
  }

  return (NULL_USER_OBJECT);
}
예제 #2
0
파일: strmat.c 프로젝트: rafalcode/gusf
/**********************************************************************
 *  Function  util_menu()
 *                                                                    
 *  Parameter:                                                       
 *   
 *                                                              
 *  This function is the backbone of the interface.  All file input/ouput
 *  happens here.  This is also where the user can key in their own string
 *  if desired.  Here the user can view, delete and list the available 
 *  sequences.
 *  
 *                                                                   
 **********************************************************************/
void util_menu()  
{
  int num_seqs, num_lines;

  while (1) {
    num_seqs = get_num_sequences();

    num_lines = 14;
    printf("\n**   String Utilites Menu    **\n\n");
    printf("1)  Read formatted file\n");
    printf("2)  Read unformatted file\n");
    printf("3)  Create new sequence\n");
    if (num_seqs == 0)
      printf("4)  List sequences (currently available: None)\n");
    else
      printf("4)  List sequences (currently available: 1 - %d)\n", num_seqs);
    printf("5)  Print sequence\n");
    printf("6)  Save sequences\n");
    printf("7)  Delete sequences\n");
    printf("8)  Set output options\n");
    printf("0)  Exit\n");
    printf("\nEnter Selection: ");

    while ((choice = my_getline(stdin, &ch_len)) == NULL) ;
    switch (choice[0]) {
    case '0':
      return;

    case '1':
      fread_formatted();
      break;

    case '2':
      fread_unformatted();
      break;

    case '3':
      type_in_seq();
      break;

    case '4':
      list_sequences(num_lines);
      break;

    case '5':
      print_seq(num_lines);
      break;    

    case '6':
      fwrite_formatted();      
      break;

    case '7':
      delete_seq();
      break;

    case '8':
      set_display_options();
      break;

    default:
      printf("\nThat is not a choice.\n");
    }
  }
}